我在Matrix src中有300*200的图像.我正在对图像进行以下操作.
for(int i=0;i<src.rows;i++){
for(int j=0;j<src.cols;j++){
line( src, Point(i,j),Point(i,j), Scalar( 255, 0, 0 ), 1,8 );
}
]
imshow("A",src);
waitKey(0);
Run Code Online (Sandbox Code Playgroud)
我期待它以白色覆盖整个图像,但图像的下半部分仍然是空的.如果我这样做的话
for(int i=0;i<src.rows;i++){
for(int j=0;j<src.cols;j++){
src.at<uchar>(i,j)=255;
}
]
imshow("A",src);
waitKey(0);
Run Code Online (Sandbox Code Playgroud)
整个图像覆盖白色.所以,这意味着src.at(i,j)使用(i,j)作为(行,列),但Point(x,y)使用(x,y)作为(列,行)
opencv ×1