ropencv 0.0.20 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d80992cd488fc9da556eafc91ec379f008232224
4
- data.tar.gz: 560a506ffc0a3f10e3738fb951cebea84ddc175b
3
+ metadata.gz: ddadd3f34d029333f0b75d6daf43c9530d9eb3ce
4
+ data.tar.gz: 64055d27486efc056af1a403885ab76985351df1
5
5
  SHA512:
6
- metadata.gz: 63b6394bb116af88eb33061789eac7bf13510b1f9ba22d24b8a147eb76c7fae5b24c2dae1a6586910d0a7fd6dae1259a31ce9e22a768f916c413cc8e7c96e152
7
- data.tar.gz: d9eec5dfc196d4f77dc106c21c1de14bdbd49022889bf0b23ab62d8c2ce90eb6b4ac9c97d1bf0070fba5431ed67852276ab2aa8a6caa8e7e8fb5d8e36d549692
6
+ metadata.gz: 3f9bd2767f57f0181b02b361ebf134efdb3bddc641f8bfacdcd83c9fc93a7f3d199cda1a4ef8f419e1d370145834b541957e2a91860fb2445635c23ef2190232
7
+ data.tar.gz: b07b8f0000084df1c053521ec527c4992419f4cb04011d197cf6062cf21aca22427cf7c50230f73a0774ffbc0031afe3928d20c4aba8c178d5dfa3945c5d2e9b
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,21 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ropencv (0.0.20)
5
+ ffi (~> 1.9.0)
6
+ rbind (>= 0.0.27)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ffi (1.9.8)
12
+ minitest (5.5.1)
13
+ rbind (0.0.27)
14
+ ffi (>= 1.9.0)
15
+
16
+ PLATFORMS
17
+ ruby
18
+
19
+ DEPENDENCIES
20
+ minitest (~> 5.5)
21
+ ropencv!
@@ -3,6 +3,7 @@ const cv.CV_LKFLOW_PYR_B_READY 2
3
3
  const cv.CV_LKFLOW_INITIAL_GUESSES 4
4
4
  const cv.CV_LKFLOW_GET_MIN_EIGENVALS 8
5
5
  const cv.INT_MAX 2147483647
6
+ const cv.DBL_MAX 1.7976931348623157e+308
6
7
  const cv.CV_8U 0
7
8
  const cv.CV_8S 1
8
9
  const cv.CV_16U 2
@@ -8,7 +8,6 @@ add_definitions(${OPENCV_CFLAGS})
8
8
  include_directories(${OPENCV_INCLUDE_DIRS})
9
9
  link_directories(${OPENCV_LIBRARY_DIRS})
10
10
 
11
-
12
11
  SET(RBIND_SRC
13
12
  "${CMAKE_CURRENT_SOURCE_DIR}/types.cc"
14
13
  "${CMAKE_CURRENT_SOURCE_DIR}/operations.cc"
@@ -18,7 +17,7 @@ add_custom_command(OUTPUT ${RBIND_SRC}
18
17
  COMMAND ruby "${CMAKE_CURRENT_SOURCE_DIR}/../rbind.rb")
19
18
 
20
19
  ADD_LIBRARY(rbind_opencv SHARED ${RBIND_SRC})
21
- TARGET_LINK_LIBRARIES(rbind_opencv ${OPENCV_LIBS} ${OPENCV_LDFLAGS_OTHER} )
20
+ TARGET_LINK_LIBRARIES(rbind_opencv ${OPENCV_LIBS} ${OPENCV_LDFLAGS_OTHER} ${OPENCV_LIBRARIES})
22
21
 
23
22
  set(ROOT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/../..)
24
23
  install(TARGETS rbind_opencv LIBRARY DESTINATION ${ROOT_FOLDER}/lib/ropencv)
@@ -7,6 +7,6 @@
7
7
  <url>http://</url>
8
8
  <logo>http://</logo>
9
9
 
10
- <depend package="opencv" />
10
+ <depend package="external/opencv" />
11
11
  <depend package="tools/rbind" />
12
12
  </package>
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ropencv'
3
- s.version = '0.0.20'
4
- s.date = '2015-03-13'
3
+ s.version = '0.0.21'
4
+ s.date = '2015-04-14'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Alexander Duda']
7
7
  s.email = ['Alexander.Duda@dfki.de']
@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.required_rubygems_version = ">= 1.3.6"
14
14
  s.add_runtime_dependency "rbind", ">= 0.0.27"
15
15
  s.add_runtime_dependency "ffi", "~> 1.9.0"
16
+ s.add_development_dependency 'minitest', '~> 5.5'
16
17
  s.extensions = ['ext/extconf.rb']
17
18
  s.license = 'BSD'
18
19
  end
@@ -1,6 +1,9 @@
1
- require './test_mat'
2
- require './test_vec'
3
- require './test_vector'
4
- require './test_scalar'
5
- require './test_opencv'
6
- require './test_triangulate_points'
1
+ require File.expand_path('../test_helper.rb', __FILE__)
2
+
3
+ require 'test_mat'
4
+ require 'test_vec'
5
+ require 'test_vector'
6
+ require 'test_scalar'
7
+ require 'test_opencv'
8
+ require 'test_triangulate_points'
9
+ require 'test_recognizer'
@@ -0,0 +1,11 @@
1
+ GEM_ROOT = File.join(File.dirname(__FILE__), '..')
2
+
3
+ $:.unshift(File.join(GEM_ROOT, 'lib'))
4
+ $:.unshift(File.join(GEM_ROOT, 'test'))
5
+
6
+ require 'minitest/spec'
7
+ require 'ropencv'
8
+ require 'pp'
9
+
10
+ include OpenCV
11
+ MiniTest.autorun
@@ -1,9 +1,5 @@
1
- require 'minitest/spec'
2
- require 'ropencv'
3
- require 'pp'
4
- include OpenCV
1
+ require File.expand_path('../test_helper.rb', __FILE__)
5
2
 
6
- MiniTest::Unit.autorun
7
3
  describe Cv::Mat do
8
4
  before do
9
5
  end
@@ -1,9 +1,5 @@
1
- require 'minitest/spec'
2
- require 'ropencv'
3
- require 'pp'
4
- include OpenCV
1
+ require File.expand_path('../test_helper.rb', __FILE__)
5
2
 
6
- MiniTest::Unit.autorun
7
3
  describe OpenCV::Cv do
8
4
  before do
9
5
  end
@@ -0,0 +1,39 @@
1
+ require File.expand_path('../test_helper.rb', __FILE__)
2
+
3
+ # opencv FaceRecognizer is optional and part of opencv_contrib
4
+ if defined? OpenCV::Cv::FaceRecognizer
5
+ describe 'cv::createlbph_face_recognizer' do
6
+ describe 'initialization' do
7
+ it 'creates a recognizer instance' do
8
+ recognizer = cv::createlbph_face_recognizer
9
+ assert_kind_of OpenCV::Cv::Ptr::Cv_FaceRecognizer, recognizer
10
+ end
11
+ end
12
+
13
+ describe 'prediction' do
14
+ before do
15
+ @recognizer = cv::createlbph_face_recognizer
16
+ @images_path = File.join(GEM_ROOT, 'examples', 'data')
17
+ @images = Std::Vector.new(cv::Mat)
18
+ @labels = [0, 1]
19
+
20
+ [ 'sample.jpg', 'jolie.jpeg' ].each do |filename|
21
+ @images << cv::imread(File.join(@images_path, filename), cv::IMREAD_GRAYSCALE)
22
+ end
23
+ end
24
+
25
+ it 'can be trained against given labels and images' do
26
+ @recognizer.train(@images, @labels)
27
+
28
+ image = cv::imread(File.join(@images_path, 'jolie.jpeg'), cv::IMREAD_GRAYSCALE)
29
+ label = FFI::MemoryPointer.new(:int, 16)
30
+ conf = FFI::MemoryPointer.new(:float, 32)
31
+
32
+ @recognizer.predict(image, label, conf)
33
+
34
+ assert_operator label.read_int, :>=, 0
35
+ refute conf.read_float.nan?
36
+ end
37
+ end
38
+ end
39
+ end
@@ -1,9 +1,5 @@
1
- require 'minitest/spec'
2
- require 'ropencv'
3
- require 'pp'
4
- include OpenCV
1
+ require File.expand_path('../test_helper.rb', __FILE__)
5
2
 
6
- MiniTest::Unit.autorun
7
3
  describe Cv::Scalar do
8
4
  describe "initialize" do
9
5
  it "can be created from 4 values" do
@@ -1,10 +1,5 @@
1
- require 'minitest/spec'
2
- require 'ropencv'
3
- require 'pp'
4
- include OpenCV
1
+ require File.expand_path('../test_helper.rb', __FILE__)
5
2
 
6
-
7
- MiniTest::Unit.autorun
8
3
  describe Cv do
9
4
  describe "triangulate_points" do
10
5
  it "must triangulate the given points" do
@@ -1,9 +1,4 @@
1
- require 'minitest/spec'
2
- require 'ropencv'
3
- require 'pp'
4
- include OpenCV
5
-
6
- MiniTest::Unit.autorun
1
+ require File.expand_path('../test_helper.rb', __FILE__)
7
2
 
8
3
  describe Cv::Vec2d do
9
4
  describe "initialize" do
@@ -1,9 +1,5 @@
1
- require 'minitest/spec'
2
- require 'ropencv'
3
- require 'pp'
4
- include OpenCV
1
+ require File.expand_path('../test_helper.rb', __FILE__)
5
2
 
6
- MiniTest::Unit.autorun
7
3
  describe Std::Vector::Cv_Point do
8
4
  describe "initialize" do
9
5
  it "can be created without arguments" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ropencv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Duda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbind
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.9.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '5.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '5.5'
41
55
  description: ROpenCV is a ffi ruby binding for the Open Source Computer Vision Library
42
56
  OpenCV 2.4.4 and higher
43
57
  email:
@@ -50,6 +64,8 @@ files:
50
64
  - .gitignore
51
65
  - .yardopts
52
66
  - CMakeLists.txt
67
+ - Gemfile
68
+ - Gemfile.lock
53
69
  - License.txt
54
70
  - README.md
55
71
  - examples/data/haarcascade_frontalface_alt.xml.gz
@@ -85,8 +101,10 @@ files:
85
101
  - manifest.xml
86
102
  - ropencv.gemspec
87
103
  - test/suite.rb
104
+ - test/test_helper.rb
88
105
  - test/test_mat.rb
89
106
  - test/test_opencv.rb
107
+ - test/test_recognizer.rb
90
108
  - test/test_scalar.rb
91
109
  - test/test_triangulate_points.rb
92
110
  - test/test_vec.rb
@@ -117,3 +135,4 @@ signing_key:
117
135
  specification_version: 4
118
136
  summary: Ruby bindings for opencv 2.4.4 and higher
119
137
  test_files: []
138
+ has_rdoc: