mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
OpenCV 2.2 fixes
This commit is contained in:
parent
21ce3fb026
commit
cce894071f
3 changed files with 36 additions and 12 deletions
|
@ -19,6 +19,7 @@ OpenCV Ruby Wrapper
|
|||
== FEATURES/PROBLEMS:
|
||||
|
||||
* First release rubygems, Some OpenCV functions wrapped.
|
||||
* Mouse interaction often causes segfaults on my Ubuntu 10.10 (Ruby 1.9.2).
|
||||
|
||||
== DEPENDENCIES:
|
||||
|
||||
|
@ -79,7 +80,7 @@ subfolder called data.
|
|||
|
||||
== REQUIREMENTS:
|
||||
|
||||
* OpenCV 2.0 or 2.1
|
||||
* OpenCV 2.2
|
||||
http://opencv.willowgarage.com/wiki/
|
||||
* ffcall (optional)
|
||||
http://www.haible.de/bruno/packages-ffcall.html
|
||||
|
|
|
@ -15,14 +15,24 @@ require "mkmf"
|
|||
# extconf.rb --with-opencv-lib=/path/to/opencv/lib
|
||||
# extconf.rb --with-opencv-include=/path/to/opencv/include
|
||||
|
||||
dir_config("opencv", "/usr/local/include/opencv", "/usr/local/lib")
|
||||
dir_config("opencv", "/usr/local/include/opencv2", "/usr/local/lib")
|
||||
if CONFIG["arch"].include?("darwin")
|
||||
dir_config("ffcall", "/opt/local/include", "/opt/local/lib")
|
||||
dir_config("ffcall", "/opt/local/include", "/opt/local/lib")
|
||||
else
|
||||
dir_config("ffcall", "/usr/local/include", "/usr/local/lib")
|
||||
dir_config("ffcall", "/usr/local/include", "/usr/local/lib")
|
||||
end
|
||||
dir_config("libxml2", "/usr/include", "/usr/lib")
|
||||
|
||||
opencv_headers = ["core/core_c.h", "core/core.hpp", "imgproc/imgproc_c.h",
|
||||
"imgproc/imgproc.hpp", "video/tracking.hpp", "features2d/features2d.hpp",
|
||||
"flann/flann.hpp", "calib3d/calib3d.hpp", "objdetect/objdetect.hpp",
|
||||
"legacy/compat.hpp", "legacy/legacy.hpp", "highgui/highgui_c.h",
|
||||
"highgui/highgui.hpp"]
|
||||
|
||||
opencv_libraries = ["opencv_calib3d", "opencv_contrib", "opencv_core", "opencv_features2d",
|
||||
"opencv_flann", "opencv_gpu", "opencv_highgui", "opencv_imgproc",
|
||||
"opencv_legacy", "opencv_ml", "opencv_objdetect", "opencv_video"]
|
||||
|
||||
opencv_libraries = ["cxcore", "cv", "highgui"]
|
||||
|
||||
puts ">> check require libraries..."
|
||||
case CONFIG["arch"]
|
||||
|
@ -41,7 +51,7 @@ end
|
|||
|
||||
# check require headers
|
||||
puts ">> check require headers..."
|
||||
opencv_libraries.map{|lib| "#{lib}.h"}.each{|header|
|
||||
opencv_headers.each{|header|
|
||||
raise "#{header} not found." unless have_header(header)
|
||||
}
|
||||
#have_header("ml.h")
|
||||
|
|
25
ext/opencv.h
25
ext/opencv.h
|
@ -58,13 +58,26 @@ extern "C"{
|
|||
#include <assert.h>
|
||||
|
||||
// OpenCV headers
|
||||
#include <cxcore.h>
|
||||
#include <cvaux.h>
|
||||
#include <cv.h>
|
||||
#include <highgui.h>
|
||||
#include <cxmisc.h>
|
||||
#include "opencv2/core/core_c.h"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/video/background_segm.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/flann/flann.hpp"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
#include "opencv2/legacy/compat.hpp"
|
||||
#include "opencv2/legacy/legacy.hpp"
|
||||
#include "opencv2/legacy/blobtrack.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/highgui/highgui_c.h"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core/internal.hpp"
|
||||
|
||||
#ifdef HAVE_ML_H
|
||||
#include <ml.h>
|
||||
#include "opencv2/ml/ml.hpp"
|
||||
#endif
|
||||
|
||||
// Ruby/OpenCV headers
|
||||
|
|
Loading…
Add table
Reference in a new issue