Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

cvLoadImage cvSaveImage in Linux

tchaikovsky
Beginner
667 Views

Hi!

I'm trying to implement a simple code to my program in linux, but having a strange behavior with opencv work. actuially i do almost nothing, but even it don't work.

IplImage* img =0;

img = cvLoadImage(filename,1);

if (img == 0 ) return -1;

cvSaveImage(filename2,img);

So, after work of this code, the new image is created, but its contend seem to be taken from wrong place. i mean image is absolutely chaotic. this code works fine in windows, but why not in linux:(. can someone give me an advice, or simply show how to do it? thank you!

Sorry,i forgot to say, that problem is with jpeg files. so perhaps i need to install something more to work with jpeg? i've seen the jpeg examples, but it seem all low-level encode routines are written. should it be so complecated to load jpeg from opencv?

0 Kudos
4 Replies
Vladimir_Dudnik
Employee
667 Views

Did you try to build any of OpenCV samples to see if it work for you?

Vladimir

0 Kudos
tchaikovsky
Beginner
667 Views

yes, but it gives an error,

(the function is not implemented

rebuid library Windows, GTK+ 2.x or Carbon support), in function cvNamedWindow

as samples use it, i can't test properly.

0 Kudos
Vladimir_Dudnik
Employee
667 Views

strange. Did you use the latest version of OpenCV (1.0)?

Vladimir

0 Kudos
cyberhansraj
Beginner
667 Views
hi

I presume you compiled the library source on your linux platform. The problem is that when you configured using ./configure, the development lib for gtk2.0 wasn't detected(if it actually existed in your system). so when you ran the make command, it compiled the library without any UI support. You need to have not only gtk runtime on your system, but also gtk development lib to be able to successfully compile opencv with ui support.
as of now, you should remove the current installation of opencv from your system; rebuild your opencv lib after installing gtk dev lib in the correct path; and reinstall the compiled opencv lib.
Hope this works.
0 Kudos
Reply