引言:特征提取是缺陷检测和分类器的重要基础,由于网络资料匮乏,这个系列的贴子勇哥会长期更新,以充实其内容。
moments_gray_plane(Regions, Image : : : MRow, MCol, Alpha, Beta, Mean)
函数计算一个平面的灰度值矩和灰度值的参数。
公式为:
F为平面,
m11,m20,m02为区域缩放矩。
因此 Alpha 表示沿直线轴方向的梯度(“向下”),Beta 表示沿列轴方向的梯度(“向右”)。
原图
处理后
注意红色矩形处为参考平面的位置。
read_image (Image, 'mreut') gen_rectangle1 (Rectangle, 50, 340, 180, 464) moments_gray_plane (Rectangle, Image, MRow, MCol, Alpha, Beta, Mean) get_image_size (Image, Width, Height) gen_image_gray_ramp (ImagePlane, Alpha, Beta, Mean, MRow, MCol, Width, Height) sub_image (ImagePlane, Image, ImageSub, 1, 128)
---------------------
作者:hackpig
来源:www.skcircle.com
版权声明:本文为博主原创文章,转载请附上博文链接!
本文出自勇哥的网站《少有人走的路》wwww.skcircle.com,转载请注明出处!讨论可扫码加群:


