Ask Your Question
0

why image not loaded

asked 2014-08-29 11:08:16 -0500

fedor gravatar image

I load it by cvLoadImage and chek pointer after that. If it's NULL, image not loaded. But I need to know why ( bad format, file or path not found, e.g. ). How can I do this ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-08-29 16:33:45 -0500

FLY gravatar image

updated 2014-08-29 16:36:04 -0500

Kindly next time don't forget to update the error with question.

cvLoadImage is C interface in OpenCv that is old interface better to go for C++ interface , you need to study some basics of OpenCv

Follow these Books

Book1

Book2

Better to use C++ interface of opencv , use imread for image load rather than cvLoadImage

Example

Mat image = imread ("image path");
imshow ("myimage" , image);
edit flag offensive delete link more

Comments

Thanks for answer !

I have no error, at the wrong load (check NULL pointer after cvLoadImage ) I know, that something went not so and print "ERROR", but I don't know why. I need to know why image not loaded.

Use IplImage because further I use cvCvtColor and cvCvtPixToPlane which don't work with mat... ou, try to do with mat.data and it works)

However, the question in other :) How to understand the reason for which the photo wasn't loaded?

fedor gravatar imagefedor ( 2014-08-30 00:05:09 -0500 )edit

kindly post your code

FLY gravatar imageFLY ( 2014-08-30 03:57:02 -0500 )edit

You not so understood me :(( I write the program for processing of a large number of a photo, at the wrong loading to the log is written "ERROR" , but it is necessary that there was also a cause of error, like "ERROR : WRONG PATH" or "ERROR : BAD FORMAT ". Can I do this using OpenCV ?

fedor gravatar imagefedor ( 2014-09-01 07:22:07 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-08-29 11:08:16 -0500

Seen: 165 times

Last updated: Aug 29 '14