matlab生成视差图函数disparity参数选择对生成的视差图效果有很大的影响,这里将matlab帮助中的参数进行列举,方便之后修改查验。

'Method' — Disparity estimation algorithm
'SemiGlobal' (default) | 'BlockMatching'


模式可选择BM和SGBM;

'DisparityRange' — Range of disparity
[0 64] (default) | two-element vector

视差图范围,默认是[0 64]

该值的设置取决于两相机的间距和物距综合影响,大基线距和近处测量时应增大视差范围,但范围差值要求可以被16整除。

'BlockSize' — Square block size
15 (default) | odd integer

 

窗口大小,范围是5~255,需要为奇数

'ContrastThreshold' — Contrast threshold range
0.5 (default) | scalar value

置信度区间,(0,1]

'UniquenessThreshold' — Minimum value of uniqueness
15 (default) | non-negative integer

视差唯一性百分比,视差窗口范围内最低代价是次低代价的(1 + uniquenessRatio/100)倍时,最低代价对应的视差值才是该像素点的视差,否则该像素点的视差为 0 。

当一个像素的唯一性值较低时,计算出的视差不太可靠。

'DistanceThreshold' — Maximum distance for left-to-right image checking
[] (disabled) (default) | non-negative integer

左右图像的最大阈值

matlab帮助中是这么写的,也就是当设置这个值时就能直接实现左右一致性检验了?目前还不清楚实现出来的效果怎么样

The distance threshold specifies the maximum distance between a point inI1 and the same point found from I2. The function finds the distance and marks the pixel in the following way:

Let p1 be a point in image I1.
Step 1: The function searches for point p1's best match in image I2 (left-to-right check) and finds point p2.
Step 2: The function searches for p2's best match in image I1 (right-to-left check) and finds point p3.
If the search returns a distance between p1 and p3 greater thanDistanceThreshold, the function marks the disparity for the point p1 as unreliable.

'TextureThreshold' — Minimum texture threshold
0.0002 (default) | scalar value

最小纹理阈值,This parameter applies only when you set Method to'BlockMatching'.

程序如下:

clear;
% close all;
 I1 = imread('E:left\l1.png');
%   I1 = imresize(I1, 0.2);
 I2 = imread('E:\right\r1.png');
%   I2 = imresize(I2, 0.2);
% figure,  imshow(I1);
 
% figure
% imshow(stereoAnaglyph(I1,I2));
% title('Red-cyan composite view of the stereo images');

disparityRange = [0 128];
disparityMap = disparity(rgb2gray(I1),rgb2gray(I2),'BlockSize',...
    15,'DisparityRange',disparityRange);

%disparityMap = disparity(rgb2gray(I1),rgb2gray(I2));

figure
imshow(disparityMap,disparityRange);
%imshow(disparityMap);
title('Disparity Map');
colormap jet
colorbar

matlab disparity函数相关推荐

  1. matlab matlabpool,Matlab matlabpool函数undefined

    我尝试使用matlab并行计算功能. 我先输入"版本"来检查,如果我已经安装了并行计算工具箱,它确实Matlab matlabpool函数undefined >> ve ...

  2. MATLAB常用函数, 常见问题

    MATLAB常用函数 1.常用取整函数 round(x):四舍五入函数 floor(x) : 向下取整, 即 floor(1.2)=1,  floor(1.8) = 1 ceil(x) : 向上取整, ...

  3. matlab doc函数,matlab常用函数.doc

    matlab常用函数.doc MatLab 常用函数 1. 特殊变量与常数 ans 计算结果的变量名 computer 确定运行的计算机 eps 浮点相对精度 Inf 无穷大 I 虚数单位 name ...

  4. matlab中imresize函数的用法,为何 MATLAB imresize 函数和 OpenCV resize 函数结果不同

    为何 MATLAB imresize 函数和 OpenCV resize 函数结果不同?今年 4 月,我在依照 MATLAB 代码自己写一个卷积神经网络 C++ 实现的过程中,就发现了这个问题,不过那 ...

  5. matlab 数学库,matlab数学函数库

    (n) 求 n 的阶乘 如何用 matlab 配方 没有发现 matlab 有这一命令,不过我们可以调用 maple 的命令,调用方法如下: 首先加载 maple 中的 student 函数库,加载. ...

  6. matlab freqz函数使用

    Matlab freqz函数使用 (2012-10-22 13:42:03) 转载▼ 标签: 杂谈 freqz函数计算线性系统的频率响应,包括幅频响应和相频响应,基本输入为线性系统的AMMA模型系数向 ...

  7. Matlab参考函数

    附录1 常用命令 附录1.1 管理用命令 函数名 功能描述 函数名 功能描述 addpath 增加一条搜索路径 rmpath 删除一条搜索路径 demo 运行Matlab演示程序 type 列出.M文 ...

  8. matlab rbf函数_基于径向基函数(RBF)的无网格伪谱法与程序实现(2)——微分矩阵...

    参考资料 Gregory E. Fasshauer. Meshfree Approximation Methods with MATLAB. P.387 P401 数值实现 Matlab 2019a ...

  9. Matlab自定义函数的几种方法

    Matlab自定义函数的几种方法_czw-CSDN博客_matlab自定义函数 Matlab 定义函数的几种方法_海底小星星的博客-CSDN博客_matlab定义函数

最新文章

  1. docker一:mac入门安装
  2. python基本数据类型及操作
  3. Python 的电子邮件编程
  4. 看看这些被同事喷的 JS 代码风格你写过多少
  5. MySQL 之视图、 触发器、事务、存储过程、内置函数、流程控制、索引(一)
  6. 航海学校高级课程任务讲义--海事课程
  7. 有限元ansys/lsdyna学习笔记-01
  8. 【MySQL】MySQL 8 新特性
  9. linux 查看所有端口号_linux系统:ss命令
  10. 微服务内部方法调用方式
  11. 程序员正在抛弃 Facebook
  12. 微信小程序手机号快速填写及会员卡开卡组件开放
  13. 给Java程序猿们推荐一些值得一看的好书
  14. 微信小程序关于map地图
  15. 力扣动态规划全题型解析【基础、背包、股票、编辑距离、回文】
  16. KB kb KB大小写
  17. ArcEngine编辑模块——批量删除要素
  18. 图标显示方框问题的一种原因
  19. java编程好学么_零基础小白学Java编程好学吗
  20. HDU 5914 - Triangle

热门文章

  1. 夯实Java基础系列15:Java注解简介和最佳实践
  2. 三十八、SAP设置默认语言
  3. ios新设备(包括iphone6和iphone6 plus)的开发用分辨率和像素
  4. 有了这些工具,可以助我工作效率起飞,强烈建议收藏!!
  5. 远程登录Linux服务器
  6. 西西弗斯--生命的意义--人为什么活着
  7. python数字转中文大写_python3 数字转人民币大写
  8. 系统之家win7 32位64位iso极速旗舰版 v12.1
  9. Mono for Android 实现高效的导航
  10. Linux学习进阶路线