In the below code if I read image using imread
the image is displaying differently and if the source is camera it is showing normal colored image. And below is the code.
Can some one explain bit in detail with some good link if possible?
int main () {
cv :: Mat_<unsigned char> src;
cv :: VideoCapture cap(0);
while ( 1 ) {
cap >> src;
// src = cv :: imread ( "C:\\Users\\hubuser10\\Desktop\\1.jpg" );
imshow ( "test image", src );
cv :: waitKey(1);
}
}
Result from imread:
Camera image:
Both VideoCapture
and imread
without additional parameter returns 3-channels BGR frames. Use cv::Mat_<cv::Vec3b>
type.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.