一起做orb-slam(2)
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。
最后还是重装了。。。
一起做orb-slam(2)的更多相关文章
- 一起做RGB-D SLAM 第二季 (一)
小萝卜:师兄!过年啦!是不是很无聊啊!普通人的生活就是赚钱花钱,实在是很没意思啊! 师兄:是啊…… 小萝卜:他们都不懂搞科研和码代码的乐趣呀! 师兄:可不是嘛…… 小萝卜:所以今年过年,我们再做一个S ...
- 一起做RGB-D SLAM(7) (完结篇)
第七讲 添加回环检测 2016.11 更新 把原文的SIFT替换成了ORB,这样你可以在没有nonfree模块下使用本程序了. 回环检测的阈值作出了相应的调整. 请以现在的github上源码为准. 简 ...
- 一起做RGB-D SLAM (3)
第三讲 特征提取与配准 2016.11 更新 把原文的SIFT替换成了ORB,这样你可以在没有nonfree模块下使用本程序了. OpenCV可以使用 apt-get install libopenc ...
- 一起做RGB-D SLAM (4)
第四讲 点云拼接 广告:“一起做”系列的代码网址:https://github.com/gaoxiang12/rgbd-slam-tutorial-gx 当博客更新时代码也会随着更新. SLAM技术交 ...
- 一起做RGB-D SLAM调试
最近在学习高博的一起做RGB-D SLAM第一版本,其中调试出现了挺多问题,百度查找许多资料, 最后调通所有程序,记录以下运行环境. 高博一起做RGB-D SLAM系列主页: http://www.c ...
- 一起做RGB-D SLAM 第二季 (二)
本节目标 我们要实现一个基本的文件IO,用于读取TUM数据集中的图像.顺带的,还要做一个参数文件的读取. 设计参数文件读取的类:ParameterReader 首先,我们来做一个参数读取的类.该类读取 ...
- 一起做RGB-D SLAM (6)
第六讲 图优化工具g2o的入门 2016.11 更新 把原文的SIFT替换成了ORB,这样你可以在没有nonfree模块下使用本程序了. OpenCV可以使用 apt-get install libo ...
- 一起做RGB-D SLAM (5)
第五讲 Visual Odometry (视觉里程计) 2016.11 更新 把原文的SIFT替换成了ORB,这样你可以在没有nonfree模块下使用本程序了. 去掉了cv::cv2Eigen函数,因 ...
- 一起做RGB-D SLAM (1)
前言 2016.11 更新 增加了对16.04的支持. 整理了过时的代码. SLAM,即Simultaneous Localization and Mapping,中文译作同时定位与地图创建,是近几十 ...
- 一起做RGB-D SLAM (2)
第二讲 从图像到点云 本讲中,我们将带领读者,编写一个将图像转换为点云的程序.该程序是后期处理地图的基础.最简单的点云地图即是把不同位置的点云进行拼接得到的. 当我们使用RGB-D相机时,会从相机里读 ...
随机推荐
- wipefs进程
wipefs进程是啥,占用了百分之90多的cpu wipefs进程是啥,占用了百分之90多的cpu,把这个进程干掉了,过了一天又自动启动了,很多朋友应该遇到过类似的问题. wipefs是linux自带 ...
- ASP.NET Core MVC 2.1 顶级参数验证
本文讨论ASP.NET Core 2.1中与ASP.NET Core MVC / Web API控制器中的模型绑定相关的功能.虽说这是一个功能,但从我的角度来看,它更像是一个错误修复! 请注意,我使用 ...
- Spark ML源码分析之四 树
之前我们讲过,在Spark ML中所有的机器学习模型都是以参数作为划分的,树相关的参数定义在treeParams.scala这个文件中,这里构建一个关于树的体系结构.首先,以Decis ...
- eclipse配置svn方法
一.在Eclipse里下载Subclipse插件 方法一:从Eclipse Marketplace里面下载 具体操作:打开Eclipse --> Help --> Eclipse Mark ...
- PTA常见错误
1.最常犯的错误. 格式错误 在PTA程序检测中,输入输出要严格按照题目要求.输出的格式要完全按照题目要求来,该空格地方空格,该换行要换行.否则,就算你运行结果是对的,PTA还是提示你格式错误 比如下 ...
- C语言的第一次博客作业
题目1:7-3 温度转换 1.代码 int fahr, celsius; fahr=150; celsius=5*(fahr-32)/9; printf("fahr = %d, celsiu ...
- B-dya6
1.昨天的困难,今天解决的进度,以及明天要做的事情 昨天的困难:在导入导出方面遇到了困难,导出的文件不能直接导入. 今天解决的进度:完成了登录页面的背景设计,并再次测试了整个系统的功能. 明天要做的事 ...
- C语言——第一次作业(2)
1.写程序证明p++等价于(p)++还是等价于*(p++)? #include <stdio.h> int main() { int *p,a=5; p = &a; printf( ...
- Codechef March Challenge 2014——The Street
The Street Problem Code: STREETTA https://www.codechef.com/problems/STREETTA Submit Tweet All submis ...
- [Android]上传到多个Maven仓库的Gradle插件RapidMavenPushPlugin
博客搬迁至https://blog.wangjiegulu.com RSS订阅:https://blog.wangjiegulu.com/feed.xml RapidMavenPushPlugin 用 ...