对于.at<uchar>(j, i) 和.at<uchar>(Point(j, i)) 的区别
转载致谢:https://blog.csdn.net/qq_37764129/article/details/82144406
-
srcImage.at<uchar>(j, i) //表示的是 j 行 i 列 的这个像素
-
srcImage.at<uchar>(Point(j, i)) //表示的是 坐标(j,i)的像素
为了我下面的图方便说明 j 换成 x , i 换成 y 。也就是说:
-
srcImage.at<uchar>(x, y) //表示的是 x 行 y 列 的这个像素
-
srcImage.at<uchar>(Point(x, y)) //表示的是 坐标(x,y)的像素
可能就会有人不明白了,有什么区别呢??
先上一幅图
问图中红点的坐标是? (2,1) 还是 (1,2)?
答案是(2,1)!
为什么? 看清了 我问的是坐标!!
那么(2,1) 和 (1,2)究竟有什么不同?
(2,1)表示的是红点的坐标,就是红点的 x 坐标是 2, y 坐标是 1。
(1,2)表示的是红点的行和列,就是红点的行是1,列是2,也就是红点在第 1 行,第 2 列。
这下子我相信大家都明白这两者的区别了吧
-
srcImage.at<uchar>(j, i)
-
srcImage.at<uchar>(Point(j, i))
_________________________________________________________________________________________________________________________________________________
每一个不曾起舞的日子,都是对生命的辜负。
But it is the same with man as with the tree. The more he seeks to rise into the height and light, the more vigorously do his roots struggle earthward, downward, into the dark, the deep - into evil.
其实人跟树是一样的,越是向往高处的阳光,它的根就越要伸向黑暗的地底。----尼采
每一个不曾起舞的日子,都是对生命的辜负。
But it is the same with man as with the tree. The more he seeks to rise into the height and light, the more vigorously do his roots struggle earthward, downward, into the dark, the deep - into evil.
其实人跟树是一样的,越是向往高处的阳光,它的根就越要伸向黑暗的地底。----尼采