Ask Your Question
0

Cannot display .bmp image captured by GigE camera in Visual Studio

asked 2017-02-07 06:09:42 -0600

jok23 gravatar image

Hello everyone!

I succesfully configured GigE camera Manta, OpenCV and Visual Studio, soo I am able to capture the image and save it to disk.

Image that is saved to disk is ''image.bmp'' , other informations about the image are:

size: 2048 x 1088, ,bith depth : 8 ,element Type: bmp

If I want now to display this image using code:

Mat img = cv::imread("image.bmp");
cv::namedWindow("img", CV_WINDOW_AUTOSIZE);
cv::imshow("img", img);

I only get black window with no image on!! What I am doing wrong? Should I use other parameters when reading image from disk? Is there possible that it has to do something with image depth?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-02-07 06:27:00 -0600

LBerger gravatar image

updated 2017-02-07 06:27:43 -0600

check image size :

cout<<img.size();

and don't forget after imshow()

waitKey(0);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-02-07 06:09:42 -0600

Seen: 241 times

Last updated: Feb 07 '17