I am trying to print an image using OpenCV defining a 400x400 Mat:
plot2 = cv::Mat(400,400, CV_8U, 255);
But when I try to print the dots, something strange happens. The y coordinate only prints up to the first 100 values. That is, if I print a dot (50 100), it does not print it in the 100 / 400th part of the columns, but in the end. One way or another, 400 columns turned into 100.
For example, at startup:
for (int j = 0; j < 95; ++j){
plot2.at<int>(20, j) = 0;
}
cv::imshow("segunda pared", plot2);
Shows this (the underlined part is the part corresponding to the code above):

A line that goes to 95 almost occupies all 400 points, when it should occupy only the 95/400th screen.
What am I doing wrong?
source
share