mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
Merge branch 'develop'
This commit is contained in:
commit
2517b4aac5
6 changed files with 44 additions and 46 deletions
|
@ -1,3 +1,3 @@
|
|||
--load yard_extension.rb
|
||||
--load ./yard_extension.rb
|
||||
ext/opencv/*.cpp
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
An OpenCV wrapper for Ruby.
|
||||
|
||||
* Web site: <https://github.com/ruby-opencv/ruby-opencv>
|
||||
* Ruby 1.9.3, 2.0.0, 2.1.0 and OpenCV 2.4.8 are supported.
|
||||
* Ruby 1.9.3, 2.0.0, 2.1.x and OpenCV 2.4.8 are supported.
|
||||
|
||||
## Requirement
|
||||
|
||||
|
@ -24,10 +24,10 @@ Note: **/path/to/opencvdir** is the directory where you installed OpenCV.
|
|||
|
||||
|
||||
### Windows
|
||||
You can use pre-build binary for Windows (mswin32, mingw32).
|
||||
You can use pre-build binary for Windows (mswin32).
|
||||
|
||||
1. Install [OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/)
|
||||
2. Set path to OpenCV libraries. When you installed OpenCV to **C:\opencv**, add **C:\opencv\build\x86\vc10\bin (for mswin32)** or **C:\opencv\build\x86\mingw\bin (for mingw32)** to the systems path.
|
||||
2. Set path to OpenCV libraries. When you installed OpenCV to **C:\opencv**, add **C:\opencv\build\x86\vc10\bin** to the systems path.
|
||||
3. Install ruby-opencv
|
||||
|
||||
```
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
CC = RbConfig::CONFIG['CC']
|
||||
if CC =~ /clang/
|
||||
RbConfig::MAKEFILE_CONFIG['try_header'] = :try_cpp
|
||||
RbConfig::CONFIG['CPP'] = "#{CC} -E"
|
||||
elsif RbConfig::CONFIG['arch'] =~ /mswin32/
|
||||
RbConfig::MAKEFILE_CONFIG['try_header'] = :try_cpp
|
||||
RbConfig::CONFIG['CPP'] = "#{CC} /P"
|
||||
end
|
||||
|
||||
require "mkmf"
|
||||
|
||||
def cv_version_suffix(incdir)
|
||||
|
@ -23,51 +33,35 @@ opencv_headers = ["opencv2/core/core_c.h", "opencv2/core/core.hpp", "opencv2/img
|
|||
"opencv2/imgproc/imgproc.hpp", "opencv2/video/tracking.hpp", "opencv2/features2d/features2d.hpp",
|
||||
"opencv2/flann/flann.hpp", "opencv2/calib3d/calib3d.hpp", "opencv2/objdetect/objdetect.hpp",
|
||||
"opencv2/legacy/compat.hpp", "opencv2/legacy/legacy.hpp", "opencv2/highgui/highgui_c.h",
|
||||
"opencv2/highgui/highgui.hpp", "opencv2/photo/photo.hpp", "opencv2/nonfree/nonfree.hpp"]
|
||||
"opencv2/highgui/highgui.hpp", "opencv2/photo/photo.hpp"]
|
||||
opencv_headers_opt = ["opencv2/nonfree/nonfree.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_photo", "opencv_nonfree"]
|
||||
|
||||
"opencv_flann", "opencv_highgui", "opencv_imgproc", "opencv_legacy",
|
||||
"opencv_ml", "opencv_objdetect", "opencv_video", "opencv_photo"]
|
||||
opencv_libraries_opt = ["opencv_gpu", "opencv_nonfree"]
|
||||
|
||||
puts ">> Check the required libraries..."
|
||||
case CONFIG["arch"]
|
||||
when /mswin32/
|
||||
if $mswin or $mingw
|
||||
suffix = cv_version_suffix(incdir)
|
||||
opencv_libraries.map! { |lib| lib + suffix }
|
||||
opencv_libraries_opt.map! { |lib| lib + suffix }
|
||||
have_library("msvcrt")
|
||||
opencv_libraries.each {|lib|
|
||||
raise "#{lib}.lib not found." unless have_library(lib)
|
||||
}
|
||||
if $mswin
|
||||
$CFLAGS << ' /EHsc'
|
||||
when /mingw32/
|
||||
suffix = cv_version_suffix(incdir)
|
||||
opencv_libraries.map! {|lib| lib + suffix }
|
||||
have_library("msvcrt")
|
||||
opencv_libraries.each {|lib|
|
||||
raise "lib#{lib} not found." unless have_library(lib)
|
||||
}
|
||||
CONFIG['CXXFLAGS'] << ' /EHsc'
|
||||
end
|
||||
else
|
||||
opencv_libraries.each {|lib|
|
||||
raise "lib#{lib} not found." unless have_library(lib)
|
||||
}
|
||||
have_library("stdc++")
|
||||
end
|
||||
|
||||
opencv_libraries.each { |lib| raise "#{lib} not found." unless have_library(lib) }
|
||||
opencv_libraries_opt.each { |lib| warn "#{lib} not found." unless have_library(lib) }
|
||||
|
||||
# Check the required headers
|
||||
puts ">> Check the required headers..."
|
||||
opencv_headers.each {|header|
|
||||
unless have_header(header)
|
||||
if CONFIG["arch"] =~ /mswin32/ and File.exists? "#{incdir}/#{header}"
|
||||
# In mswin32, have_header('opencv2/nonfree/nonfree.hpp') fails because of a syntax problem.
|
||||
warn "warning: #{header} found but `have_header` failed."
|
||||
$defs << "-DHAVE_#{header.tr_cpp}"
|
||||
else
|
||||
raise "#{header} not found."
|
||||
end
|
||||
end
|
||||
}
|
||||
opencv_headers.each { |header| raise "#{header} not found." unless have_header(header) }
|
||||
opencv_headers_opt.each { |header| warn "#{header} not found." unless have_header(header) }
|
||||
have_header("stdarg.h")
|
||||
|
||||
if $warnflags
|
||||
|
|
|
@ -771,6 +771,8 @@ extern "C" {
|
|||
*/
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV2_NONFREE_NONFREE_HPP
|
||||
cv::initModule_nonfree();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ extern "C" {
|
|||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/video/background_segm.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
#include "opencv2/flann/flann.hpp"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
|
@ -79,6 +78,10 @@ extern "C" {
|
|||
#include "opencv2/ml/ml.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV2_NONFREE_NONFREE_HPP
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
#endif
|
||||
|
||||
// Ruby/OpenCV headers
|
||||
#include "cvutils.h"
|
||||
#include "cverror.h"
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# stub: ruby-opencv 0.0.12.20140119050230 ruby lib
|
||||
# stub: ruby-opencv 0.0.12.20140330174646 ruby lib
|
||||
# stub: ext/opencv/extconf.rb
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "ruby-opencv"
|
||||
s.version = "0.0.12.20140119050230"
|
||||
s.version = "0.0.12.20140330174646"
|
||||
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.require_paths = ["lib"]
|
||||
s.authors = ["lsxi", "ser1zw", "pcting"]
|
||||
s.date = "2014-01-18"
|
||||
s.date = "2014-03-30"
|
||||
s.description = "ruby-opencv is a wrapper of OpenCV for Ruby. It helps you to write computer vision programs (e.g. detecting faces from pictures) with Ruby."
|
||||
s.email = ["masakazu.yonekura@gmail.com", "azariahsawtikes@gmail.com", "pcting@gmail.com"]
|
||||
s.extensions = ["ext/opencv/extconf.rb"]
|
||||
|
@ -18,8 +18,7 @@ Gem::Specification.new do |s|
|
|||
s.homepage = "https://github.com/ruby-opencv/ruby-opencv/"
|
||||
s.licenses = ["The BSD License"]
|
||||
s.rdoc_options = ["--main", "README.md"]
|
||||
s.rubyforge_project = "ruby-opencv"
|
||||
s.rubygems_version = "2.2.1"
|
||||
s.rubygems_version = "2.2.2"
|
||||
s.summary = "OpenCV wrapper for Ruby"
|
||||
s.test_files = ["test/test_cvcontour.rb", "test/test_eigenfaces.rb", "test/test_cvmoments.rb", "test/test_cvseq.rb", "test/test_cvcontourtree.rb", "test/test_cvbox2d.rb", "test/test_iplimage.rb", "test/test_cvvideowriter.rb", "test/test_cvline.rb", "test/test_cvhumoments.rb", "test/test_cvfont.rb", "test/test_cvconnectedcomp.rb", "test/test_cvhistogram.rb", "test/test_trackbar.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvhaarclassifiercascade.rb", "test/test_cvcircle32f.rb", "test/test_cvcapture.rb", "test/test_cvmat_dxt.rb", "test/test_cvrect.rb", "test/test_iplconvkernel.rb", "test/test_cvsurfpoint.rb", "test/test_cvavgcomp.rb", "test/test_cvscalar.rb", "test/test_pointset.rb", "test/test_curve.rb", "test/test_cvtermcriteria.rb", "test/test_cvtwopoints.rb", "test/test_cvsurfparams.rb", "test/test_cvpoint2d32f.rb", "test/test_cvpoint3d32f.rb", "test/test_cvfeaturetree.rb", "test/test_mouseevent.rb", "test/test_cvchain.rb", "test/test_cvmat.rb", "test/test_fisherfaces.rb", "test/test_cverror.rb", "test/test_cvpoint.rb", "test/test_cvsize2d32f.rb", "test/test_preliminary.rb", "test/test_cvmat_drawing.rb", "test/test_lbph.rb", "test/test_cvsize.rb", "test/test_window.rb", "test/test_cvslice.rb", "test/test_opencv.rb"]
|
||||
|
||||
|
@ -30,17 +29,17 @@ Gem::Specification.new do |s|
|
|||
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
|
||||
s.add_development_dependency(%q<rake-compiler>, ["~> 0"])
|
||||
s.add_development_dependency(%q<hoe-gemspec>, ["~> 0"])
|
||||
s.add_development_dependency(%q<hoe>, ["~> 3.8"])
|
||||
s.add_development_dependency(%q<hoe>, ["~> 3.10"])
|
||||
else
|
||||
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
||||
s.add_dependency(%q<rake-compiler>, ["~> 0"])
|
||||
s.add_dependency(%q<hoe-gemspec>, ["~> 0"])
|
||||
s.add_dependency(%q<hoe>, ["~> 3.8"])
|
||||
s.add_dependency(%q<hoe>, ["~> 3.10"])
|
||||
end
|
||||
else
|
||||
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
||||
s.add_dependency(%q<rake-compiler>, ["~> 0"])
|
||||
s.add_dependency(%q<hoe-gemspec>, ["~> 0"])
|
||||
s.add_dependency(%q<hoe>, ["~> 3.8"])
|
||||
s.add_dependency(%q<hoe>, ["~> 3.10"])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue