Ask Your Question
0

How to write compile.sh file for facerec_fisherfaces?

asked 2016-04-27 09:49:49 -0600

Mohammed Eliass gravatar image

On Ubuntu 14.4 with OpenCV 3.1.0 : I'm trying to compile and run this file http://docs.opencv.org/3.0-last-rst/_...

but I don't know what to write in the compile.sh file to make it executable

I found this compile.sh but it doesn't work :

LIBS="-lopencv_imgproc -lopencv_highgui -lopencv_core -lopencv_objdetect -lopencv_contrib"
g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L/usr/lib -L/usr/local/lib -fpic -Wall -c "untitled.cpp" $LIBS

g++ -shared -I/usr/local/include/opencv -I/usr/local/include/opencv2 -o libuntitled.so untitled.o -L/usr/local/lib $LIBS

g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -o untitled untitled.o -L/usr/local/lib $LIBS

exit 0
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-04-27 10:03:26 -0600

berak gravatar image

updated 2016-04-27 10:06:42 -0600

  • you'll need to rebuild opencv with opencv_contrib (please see readme there for build instructions)
  • please see 3.1 docs , not the old 3.0 ones
  • LIBS="-lopencv_imgproc -lopencv_imgcodecs -lopencv_highgui -lopencv_core -lopencv_objdetect -lopencv_face"
  • the old 2.4 samples won't run as-is, please have a look at the current samples
edit flag offensive delete link more

Comments

thanks a lot @berak ...... , but I'm confused how to rebuild opencv with this extra modules

Mohammed Eliass gravatar imageMohammed Eliass ( 2016-04-27 10:17:42 -0600 )edit

what exactly you don't understand there ?

berak gravatar imageberak ( 2016-04-27 10:25:19 -0600 )edit

cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules opencv_source_directory after typing this in the terminal , absolutely after changing the directory to opencv/build what's the whole command ... I don't understand what to do to make this execute .... could you please explain this line , the first

Mohammed Eliass gravatar imageMohammed Eliass ( 2016-04-27 10:34:27 -0600 )edit

where did you download the opencv_contrib repo to ?

berak gravatar imageberak ( 2016-04-27 10:40:23 -0600 )edit

to the build directory /home/mohammed/opencv-3.1.0/build

Mohammed Eliass gravatar imageMohammed Eliass ( 2016-04-27 10:43:32 -0600 )edit

after changing the permissions to both build/modules and opencv_contrib/modules with sudo chmod 777 modules there 's an error bash: /modules: Permission denied

Mohammed Eliass gravatar imageMohammed Eliass ( 2016-04-27 10:47:25 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-04-27 09:49:49 -0600

Seen: 201 times

Last updated: Apr 27 '16