Ask Your Question
0

the Mat problem

asked 2013-04-25 07:45:51 -0600

Derek gravatar image

updated 2013-04-25 08:24:45 -0600

Hi OpenCV team,

I have added the OpenCV(V 2.4.5) in the eclipse and the program compiles normally. When eclipse executes the following line the program pointer of eclipse enters the constructor of Mat class.

(Mat m = new Mat());

and then eclipse shows the message of Source not found and enters InvocationTargetException.class,after leaving the constructor of Mat class.

Do I miss some parameter to be set?

Please help me, thank you.

edit retag flag offensive close merge delete

Comments

1

Did you have an error or what?

Daniil Osokin gravatar imageDaniil Osokin ( 2013-04-26 03:25:30 -0600 )edit

no, there is any error after compiling. if there was an error, the eclipse would not enter the debug mode and the simulator of the phone.

Derek gravatar imageDerek ( 2013-04-26 07:53:07 -0600 )edit
1

Then what exactly are you asking from us? You have no error and your code does exactly nothing? You got me confused :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-26 08:12:16 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-04-26 22:26:11 -0600

wuling gravatar image

HI, I think you should check the source Mat is empty or not. for example:

Mat a=imread(image_path) // if image is loades, the a is not empty

of course , if you use

Mat m = new Mat()  // where m is empty.
edit flag offensive delete link more

Comments

I have tried to use the method that you said. when I use Mat m=new Mat(image_path) instead of Mat m=new Mat(), the eclipse doesn't show the message of Source not found. Mat m = new Mat() is a legal line, but why can not work normally?

Derek gravatar imageDerek ( 2013-04-27 09:49:01 -0600 )edit

I think you don't read opencv doucument.in fact, Mat format don't new constructor.for for example Mat image(200, 200, CV_8UC3, Scalar(0)); //you just give initial value.where image size:200x200 format 3 channels 8 bits & all value are zero. so i think you have better to read the opencv example or ref:http://docs.opencv.org/2.4.4/modules/core/doc/basic_structures.html#mat

wuling gravatar imagewuling ( 2013-04-27 11:09:07 -0600 )edit

thank you for your opinion. I will study it.

Derek gravatar imageDerek ( 2013-04-29 11:37:44 -0600 )edit

Question Tools

Stats

Asked: 2013-04-25 07:45:51 -0600

Seen: 254 times

Last updated: Apr 26 '13