1 | initial version |
imread(f_name, 1);
will (force)load a 3 channel img. so you can't access that by
temp.at<cv::Vec4b>(y,x); // that would need 4 channels, right ?
try :
imread(f_name, -1);
instead ( i.e don't force it into 3 channels )
2 | No.2 Revision |
imread(f_name, 1);
will (force)load a 3 channel img. so you can't access that by
temp.at<cv::Vec4b>(y,x); // that would need 4 channels, right ?
try :
imread(f_name, -1);
instead ( i.e don't force it into 3 channels )
and, ofc, make sure, that the image you're reading actually has 4 channels. unless it prints
4 chanel
on your console, your code will crash.
3 | No.3 Revision |
imread(f_name, 1);
will (force)load a 3 channel img. so you can't access that by
temp.at<cv::Vec4b>(y,x); // that would need 4 channels, right ?
try :
imread(f_name, -1);
instead ( i.e don't force it into 3 channels )
and, ofc, make sure, that the image you're reading actually has 4 channels. unless it prints
4 chanel
chanels in image
on your console, your code will crash.