imread()用法|| root权限
1.ushort用法?
USHORT is a macro which is not part of the official C++ language (it's probably defined or typedef'ed somewhere). unsigned short is an official type defined by the C++ language as an integer that can at least hold numbers between 0 and 65535.
Use unsigned short and your code will be portable - don't use USHORT unless you company's coding standard requires it
USHORT是一个宏,它不是官方C ++语言的一部分(它可能是在某处定义或定义的)。 unsigned short是一种由C ++语言定义的正式类型,它是一个整数,它至少可以包含0到65535之间的数字。
使用无符号的short,你的代码将是可移植的 - 除非你公司的编码标准要求,否则不要使用USHORT
2. imread()
imread
Loads an image from a file.
- C++:
Matimread(const string& filename, int flags=1 )
- Python:
cv2.imread(filename[, flags]) → retval
- C:
IplImage*cvLoadImage(const char* filename, int iscolor=CV_LOAD_IMAGE_COLOR )
- C:
CvMat*cvLoadImageM(const char* filename, int iscolor=CV_LOAD_IMAGE_COLOR )
- Python:
cv.LoadImage(filename, iscolor=CV_LOAD_IMAGE_COLOR) → None
- Python:
cv.LoadImageM(filename, iscolor=CV_LOAD_IMAGE_COLOR) → None -
Parameters: - filename – Name of file to be loaded.
- flags –
Flags specifying the color type of a loaded image:
- CV_LOAD_IMAGE_ANYDEPTH - If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.
- CV_LOAD_IMAGE_COLOR - If set, always convert image to the color one
- CV_LOAD_IMAGE_GRAYSCALE - If set, always convert image to the grayscale one
- >0 Return a 3-channel color image.
-
Note
In the current implementation the alpha channel, if any, is stripped from the output image. Use negative value if you need the alpha channel.
- =0 Return a grayscale image.
- <0 Return the loaded image as is (with alpha channel).
指定加载图像的颜色类型的标志:
CV_LOAD_IMAGE_ANYDEPTH - 如果设置,则当输入具有相应深度时返回16位/ 32位图像,否则将其转换为8位。
CV_LOAD_IMAGE_COLOR - 如果设置,则始终将图像转换为颜色
CV_LOAD_IMAGE_GRAYSCALE - 如果设置,则始终将图像转换为灰度图像> 0返回一个3通道彩色图像。
注意
在当前实现中,alpha通道(如果有的话)从输出图像中剥离。如果您需要Alpha通道,请使用负值。
= 0返回灰度图像。
<0按原样返回加载的图像(带有Alpha通道)
The function imread loads an image from the specified file and returns it. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty matrix ( Mat::data==NULL ). Currently, the following file formats are supported:
- Windows bitmaps -
*.bmp, *.dib(always supported)- JPEG files -
*.jpeg, *.jpg, *.jpe(see the Notes section)- JPEG 2000 files -
*.jp2(see the Notes section)- Portable Network Graphics -
*.png(see the Notes section)- Portable image format -
*.pbm, *.pgm, *.ppm(always supported)- Sun rasters -
*.sr, *.ras(always supported)- TIFF files -
*.tiff, *.tif(see the Notes section)
Note
- The function determines the type of an image by the content, not by the file extension.
- On Microsoft Windows* OS and MacOSX*, the codecs shipped with an OpenCV image (libjpeg, libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs, and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware that currently these native image loaders give images with different pixel values because of the color management embedded into MacOSX.
- On Linux*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for codecs supplied with an OS image. Install the relevant packages (do not forget the development files, for example, “libjpeg-dev”, in Debian* and Ubuntu*) to get the codec support or turn on the
OPENCV_BUILD_3RDPARTY_LIBSflag in CMake. - 该功能根据内容而不是文件扩展名来确定图像的类型。
在Microsoft Windows * OS和MacOSX *上,缺省情况下使用OpenCV映像(libjpeg,libpng,libtiff和libjasper)附带的编解码器。所以,OpenCV总是可以读取JPEG,PNG和TIFF。在MacOSX上,还可以选择使用本机MacOSX图像阅读器。但要注意,由于嵌入到MacOSX中的颜色管理,当前这些原生图像加载器会为图像提供不同的像素值。
在Linux *,BSD风格和其他类Unix开源操作系统上,OpenCV查找随操作系统映像提供的编解码器。安装相关软件包(不要忘记Debian *和Ubuntu *中的开发文件,例如“libjpeg-dev”)以获得编解码器支持或打开CMake中的OPENCV_BUILD_3RDPARTY_LIBS标志。
Note
In the case of color images, the decoded images will have the channels stored in B G R order.
在彩色图像的情况下,解码图像将以B G R顺序存储信道。
3. 最后执行main二进制文件时,提示权限不够。
louis@louis-lib:~/slam$ cd bin
louis@louis-lib:~/slam/bin$ ./main //执行main用“./main”格式
bash: ./main: 权限不够
louis@louis-lib:~/slam/bin$
打开超级终端,输入指令
louis@louis-lib:~$ sudo gedit /etc/passwd
sudo gedit /etc/passwd ,
回车;找到我们用户名所在的那一行,将里面的当前用户的ID值进行修改。譬如我的当前用户是crystal。则找到了
louis:x:1000:1000:louis,,,:/home/louis:/bin/bash 将两个1000改成0即可。即最后改完的结果为:
louis:x:0:0:louis,,,:/home/louis:/bin/bash 最后将Ubuntu系统进行注销,然后在登陆的用户名里输入 你自己的用户名和密码,这样登陆上来就是root权限了。这是因为root的ID值为0。重新登陆之后打开超级终端发现我们的用户权限已经为root了。
握草!!!我的用户没了,只留下guest用户,解决方案如链接http://13473996167.iteye.com/blog/2263734。
最后还是重装了。。。
imread()用法|| root权限的更多相关文章
- android中获取root权限的方法以及原理(转)
一. 概述 本文介绍了android中获取root权限的方法以及原理,让大家对android 玩家中常说的“越狱”有一个更深层次的认识. 二. Root 的介绍 1. Root 的目的 可以让我们拥有 ...
- Android 上SuperUser获取ROOT权限原理解析
Android 上SuperUser获取ROOT权限原理解析 一. 概述 本文介绍了android中获取root权限的方法以及原理,让大家对android 玩家中常说的“越狱”有一个更深层次的认识. ...
- [Android Pro] android root权限破解分析
许 多机友新购来的Android机器没有破解过Root权限,无法使用一些需要高权限的软件,以及进行一些高权限的操作,其实破解手机Root权限是比较简 单及安全的,破解Root权限的原理就是在手机的/s ...
- Android权限说明 system权限 root权限
原文链接:http://blog.csdn.net/rockwupj/article/details/8618655 Android权限说明 Android系统是运行在Linux内核上的,Androi ...
- Ubuntu 13.10上用户怎样获得root权限,用户怎样获得永久root权限,假设配置root登录
一.用户怎样获得root权限: 1. 进入terminal 2. 输入sudo passwd root 并设置password,提示要你输入两次password.自己设定password,一定要 ...
- Atitit godaddy 文件权限 root权限设置
Atitit godaddy 文件权限 root权限设置 1. ubuntu需要先登录,再su切换到root1 2. sudo 授权许可使用的su,也是受限制的su1 3. ubuntu默认吗roo ...
- php利用root权限执行shell脚本
vi /etc/sudoers , 为apache用户赋予root权限,并且不需要密码,还有一步重要的修改(我被困扰的就是这个地方) root ALL=(ALL) ALL apache ALL= ...
- linux下如何添加一个用户并且让用户获得root权限
1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 #passwd tommy //修改密码 Changing pass ...
- Android应用请求获取Root权限
应用获取Root权限的原理:让应用的代码执行目录获取最高权限.在Linux中通过chmod 777 [代码执行目录] /** * 应用程序运行命令获取 Root权限,设备必须已破解(获得ROOT权限) ...
随机推荐
- ckeditor 捕获键代码
<!--<script type="text/javascript"> var ctrlKey = false; var shiftKey = false; if ...
- Python爬虫-百度模拟登录(一)
千呼万唤屎出来呀,百度模拟登录终于要呈现在大家眼前了,最近比较忙,晚上又得早点休息,这篇文章写了好几天才完成.这个成功以后,我打算试试百度网盘的其他接口实现.看看能不能把服务器文件上传到网盘,好歹也有 ...
- C++扬帆远航——6(三色球)
/* * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名:sanseqiu.cpp * 作者:常轩 * 完成日期:2016 ...
- python爬虫-scrapy日志
1.scrapy日志介绍 Scrapy的日志系统是实现了对python内置的日志的封装 scrapy也使用python日志级别分类 logging.CRITICAL logging.ERROE log ...
- 在idea下遇到的问题汇总(间接性更新)
在idea下遇到的问题汇总(间接性更新) tomcat下的jsp代码问题: 在idea的环境下,遇到jsp代码.符号失效,首先需要考虑到jar包没有引入,情况如图: 这种情况是因为jar包没有导入进去 ...
- Docker实战之Kafka集群
1. 概述 Apache Kafka 是一个快速.可扩展的.高吞吐.可容错的分布式发布订阅消息系统.其具有高吞吐量.内置分区.支持数据副本和容错的特性,适合在大规模消息处理场景中使用. 笔者之前在物联 ...
- 7-45 jmu-python-涨工资 (10 分)
输入一组工资数据,写入列表.对于小于5000的工资,涨1.5倍.并输出涨后的工资数据. 输入格式: 数据之间空格隔开 输出格式: 涨工资后的数据,空格隔开.尾部 不带空格. 输入样例: 3000 40 ...
- springmvc 的@ResponseBody 如何使用JSONP?
JSONP解释 在解释JSONP之前,我们需要了解下”同源策略“这个概念,这对理解跨域有帮助.基于安全的原因,浏览器是存在同源策略机制的,同源策略阻止从一个源加载的文档或脚本获取或设置另一个源加载额文 ...
- 17-Java-文件上传报错(commons-fileupload包和commons-io包不支持JDK版本:UnsupportedClassVersionError: org/apache/commons/io/IOUtils : Unsupported major.minor version 52.0)
文件上传报错(commons-fileupload包和commons-io包不支持JDK版本) 这个bug可把我弄惨了!!!我代码是想通过写个文件上传,我写的文件上传需要用到commons-fileu ...
- 2020年ubuntu sever1804 安装和配置
最后一次折腾linux服务器,应该是13的我的VPS.因为转行后,没有及时关注vps续费的问题,结果过期,所有的数据丢失了 当时觉得,反正都不做了,丢了就丢了吧,可现在想起来,实在是太后悔了. 今天, ...