Ask Your Question
0

jpeg library OpenCV not built

asked 2017-09-10 01:50:04 -0600

infoclogged gravatar image

My purpose is to build OpenCV with 3rd party jpeg support. By passing -D BUILD_JPEG=ON to cmake, I can see the object files being compiled. I wanted to copy the built jpeg library to the /usr/local/, but I dont see any library for libjpeg. I just see the object files. Do I need to put the object files in the library myself?

What is the signifigance of WITH_JPEG and BUILD_JPEG configuration variables in cmake?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-09-10 02:33:17 -0600

LBerger gravatar image

updated 2017-09-10 06:56:09 -0600

WITH_JPEG means imread will able to read jpeg files using opencv jpeg lib or external jpeg lib.

BUILD_JPEG means opencv jpeg source files will be compile in opencv

in cmakecache.txt you can find

//Build libjpeg from source ----> use source in third party folder

BUILD_JPEG:BOOL=ON

//Include JPEG support ----> opencv can open jpeg file

WITH_JPEG:BOOL=ON

If you want to read jpeg with internal source files -DBUILD_JPEG:BOOL=ON -DWITH_JPEG:BOOL=ON and don't forget to delete CMakeCache.txt

edit flag offensive delete link more

Comments

so, if WITH_JPEG is OFF, then no jpeg files can be read, although a libjpeg package is installed in the system through apt-get?

infoclogged gravatar imageinfoclogged ( 2017-09-10 03:13:33 -0600 )edit

I'm not a linux user but I think yes (if you delete CMakeCache.txt). I think sometimes you can use WITH_JPEG off if you have a specific jpeg lib and you can link your program with

LBerger gravatar imageLBerger ( 2017-09-10 06:59:18 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-09-10 01:50:04 -0600

Seen: 3,103 times

Last updated: Sep 10 '17