文章和代码以及样例图片等相干资源,曾经归档至【Github仓库:digital-image-processing-matlab】或者公众号【AIShareLab】回复 数字图像处理 也可获取。

98.roifill

性能:在图像的任意区域中进行平滑插补。
语法:

J = roifill(I,c,r) J = roifill(I)J = roifill(I,BW) [J,BW] = roifill(...) J = roifill(x,y,I,xi,yi)[x,y,J,BW,xi,yi] = roifill(...)

举例

I = imread('eight.tif');c = [222 272 300 270 221 194];r = [21 21 75 121 121 75];J = roifill(I,c,r); imshow(I)figure, imshow(J)

相干命令:
roifilt2, roipoly

99.roifilt2

性能:过滤敏感区域。
语法:

J = roifilt2(h,I,BW)J = roifilt2(I,BW,fun)J = roifilt2(I,BW,fun,P1,P2,...)

举例

h = fspecial('unsharp'); J = roifilt2(h,I,BW); imshow(J)

相干命令:
filter2, roipoly

100.roipoly

性能:抉择一个敏感的多边形区域。
语法:

BW = roipoly(I,c,r)BW = roipoly(I)BW = roipoly(x,y,I,xi,yi) [BW,xi,yi] = roipoly(...)[x,y,BW,xi,yi] = roipoly(...)

举例

I = imread('eight.tif');c = [222 272 300 270 221 194];r = [21 21 75 121 121 75];BW = roipoly(I,c,r); imshow(I)figure, imshow(BW)

相干命令:
roifilt2, roicolor, roifill

101.std2

性能:计算矩阵元素的规范偏移。
语法:

b = std2(A) 

相干命令: corr2, mean2

102.subimage

性能:在一幅图中显示多个图像。
语法:

subimage(X,map) subimage(I) subimage(BW) subimage(RGB) subimage(x,y,...)h = subimage(...)

举例

load trees[X2,map2] = imread('forest.tif'); subplot(1,2,1), subimage(X,map) subplot(1,2,2), subimage(X2,map2)

103.truesize

性能:调整图像显示尺寸。
语法:

truesize(fig,[mrows mcols]) truesize(fig)

相干命令:
imshow, iptsetpref, iptgetpref

104.uint8

性能:转换数据为8 位无符号整型。
语法:

B = uint8(A)

举例

a = [1 3 5];b = uint8(a);whosName Size Bytes Class a 1x3 24 doublearrayb 1x3 3 uint8 array

相干命令:
double, im2double, im2uint8

105.uint16

性能:转换数据为16 位无符号整型。
语法:

I = uint16(X)

举例

a = [1 3 5];b = uint16(a); whosName Size Bytes Class a 1x3 24 double array b 1x3 6 uint16 array 

相干命令:
double, datatypes, uint8, uint32, int8, int16, int32.

106.warp

性能:将图像显示到纹理映射外表。
语法:

warp(X,map) warp(I,n) warp(BW) warp(RGB) warp(z,...)warp(x,y,z,...) h = warp(...) 

举例

[x,y,z] = cylinder;I = imread('testpat1.tif'); warp(x,y,z,I);

相干命令:
imshow

107.wiener2

性能:进行二维适应性去噪过滤解决。
语法:

J = wiener2(I,[m n],noise) [J,noise] = wiener2(I,[m n]) 

举例

I = imread('saturn.tif');J = imnoise(I,'gaussian',0,0.005); K = wiener2(J,[5 5]);imshow(J)figure, imshow(K)

相干命令:
filter2, medfilt2

108.zoom

性能:缩放图像。
语法:

zoom on zoom off zoom out zoom reset zoom zoom xon zoom yonzoom(factor) zoom(fig,option)

相干命令:
imcrop

参考文献:

[1] Rafael C. Gonzalez, Richard E. Woods, and Steven L. Eddins. 2003. Digital Image Processing Using MATLAB. Prentice-Hall, Inc., USA.

[2] [阮秋琦. 数字图像处理(MATLAB版)[M]. 北京:电子工业出版社, 2014.](https://github.com/timerring/digital-image-processing-matlab/blob/main/reference/Digital_Image_Processing_(MATLAB_version).pdf)

[3] [冈萨雷斯. 数字图像处理(第三版)[M]. 北京:电子工业出版社, 2011.](https://github.com/timerring/digital-image-processing-matlab/blob/main/reference/Digital_Image_Processing_(Third_Edition).pdf)