ropencv 0.0.30 → 0.0.35

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
  SHA256:
3
- metadata.gz: '064970d324ab983db62a99907d87e7dd39d7112e091c8da867b08017587e328a'
4
- data.tar.gz: 9efdc1cfb2e78434ddd18d183870abeb708c2171676242e2349b719eb473123a
3
+ metadata.gz: 517c1a1959590086a988d260c740237060aaabba70b6ec0613dcf06bd8696698
4
+ data.tar.gz: 00fe3546915868ee913b92b36f406d67eee89f8256c3fc3c872ba07a1aaacb3a
5
5
  SHA512:
6
- metadata.gz: e3750392f32e511fec00517ab5277e9b80c541203060d3d68c8612e67db8a441dabad54fee76e3d7b8163dda087437bc5265652736f66f03f3001a722ff73753
7
- data.tar.gz: 3ae3875b0fda02d386424e2966ae9ab9040c44d459e2d9e301c92a2b8c8ffef32214ea92fa06c5fe2f91a410a6ff536226c9a8c9983114101abca4a310d99afb
6
+ metadata.gz: 1fea1adc6931eae8ba8673b570098f74cf8669892a4c94e259d0c6c172827b97a1e0e35c57edcfd76ae1dbe69402aaed8e88ec91ed665609c354b04d14750551
7
+ data.tar.gz: ac25f63d6f7baefda1c8dc8a73d604dc6e2ad2a83a9f15b50c269c6435e6ddb6b11d2403129c49c18cb05fc66a8230485068767c10397964d9d289bc1a59c4ed
data/ext/helper.rb CHANGED
@@ -92,26 +92,15 @@ class Vec < Rbind::RClass
92
92
  end
93
93
 
94
94
  # find opencv version and headers needed to be parsed by rbind
95
- def find_opencv
96
- # find opencv4 header path
97
-
98
- pkg = nil
99
- paths = nil
100
- ["opencv4","opencv"].each do |p|
101
- out = IO.popen("pkg-config --cflags-only-I #{p}")
102
- paths = out.read.split("-I").delete_if(&:empty?).map do |i|
103
- i.gsub("\n","").gsub(" ","")
104
- end
105
- if !paths.empty?
106
- pkg = p
107
- break
108
- end
95
+ def find_opencv(hint)
96
+ hint =~ /\[(.*)\]\[v(.*)\(\)\]/
97
+ paths = [$1]
98
+ opencv_version = $2
99
+ if !opencv_version || !paths
100
+ raise "hint #{hint} is not encoding opencv loaction and version. It must have the format [PATH][vMAJOR.MINRO.REVISION()]"
109
101
  end
110
- raise "Cannot find OpenCV" if paths.empty?
102
+ paths << File.join(paths.first,"include")
111
103
 
112
- #check opencv version
113
- out = IO.popen("pkg-config --modversion #{pkg}")
114
- opencv_version = out.read.chomp;
115
104
  opencv_version =~ /(\d+).(\d+).(\d+)/
116
105
  major = $1.to_i; minor = $2.to_i; revision = $3.to_i
117
106
 
@@ -141,28 +130,22 @@ def find_opencv
141
130
  "opencv2/stitching/detail/seam_finders.hpp", "opencv2/stitching/detail/timelapsers.hpp", "opencv2/videostab/motion_core.hpp",
142
131
  "opencv2/viz/types.hpp", "opencv2/viz/widgets.hpp"]
143
132
  elsif major == 4
144
- ["opencv2/core.hpp", "opencv2/core/base.hpp", "opencv2/core/mat.hpp", "opencv2/core/ocl.hpp",
133
+ headers = ["opencv2/core.hpp", "opencv2/core/base.hpp", "opencv2/core/mat.hpp", "opencv2/core/ocl.hpp",
145
134
  "opencv2/core/opengl.hpp", "opencv2/core/optim.hpp", "opencv2/core/persistence.hpp", "opencv2/core/types.hpp",
146
135
  "opencv2/core/utility.hpp", "opencv2/imgproc.hpp", "opencv2/imgcodecs.hpp", "opencv2/videoio.hpp",
147
136
  "opencv2/highgui.hpp", "opencv2/video/background_segm.hpp", "opencv2/video/tracking.hpp", "opencv2/flann/miniflann.hpp",
148
137
  "opencv2/ml.hpp", "opencv2/features2d.hpp", "opencv2/calib3d.hpp", "opencv2/objdetect.hpp", "opencv2/photo.hpp",
149
- "opencv2/shape/hist_cost.hpp", "opencv2/shape/shape_distance.hpp", "opencv2/shape/shape_transformer.hpp", "opencv2/stitching.hpp",
138
+ "opencv2/shape/shape_distance.hpp", "opencv2/shape/shape_transformer.hpp", "opencv2/stitching.hpp",
150
139
  "opencv2/stitching/detail/blenders.hpp", "opencv2/stitching/detail/exposure_compensate.hpp", "opencv2/stitching/detail/motion_estimators.hpp",
151
140
  "opencv2/stitching/detail/seam_finders.hpp", "opencv2/stitching/detail/timelapsers.hpp", "opencv2/videostab/motion_core.hpp",
152
141
  "opencv2/viz/types.hpp", "opencv2/viz/widgets.hpp"]
142
+ headers.map do |h|
143
+ File.join("opencv4",h)
144
+ end
153
145
  else
154
146
  raise "OpenCV version #{opencv_version} is currently not supported"
155
147
  end
156
148
 
157
- temp = paths.clone
158
- temp.each do |path|
159
- if path =~ /(.*)opencv$/
160
- paths << $1
161
- elsif path =~ /(.*)opencv2$/
162
- paths << $1
163
- end
164
- end
165
-
166
149
  # check that all headers are available
167
150
  headers = headers.map do |i|
168
151
  path = paths.find do |p|
data/ext/rbind.rb CHANGED
@@ -3,7 +3,8 @@ require 'pp'
3
3
  require 'yaml'
4
4
 
5
5
  require File.join(File.dirname(__FILE__),'helper.rb')
6
- major,minor,revision,opencv_headers = find_opencv
6
+
7
+ major,minor,revision,opencv_headers = find_opencv(ARGV[0])
7
8
  opencv_version = "#{major}.#{minor}.#{revision}"
8
9
  Rbind.log.warn "found opencv #{opencv_version}"
9
10
 
@@ -48,6 +49,10 @@ elsif major >= 4
48
49
  rbind.cv.detail.add_type(Rbind::RClass.new("ImageFeatures"))
49
50
  rbind.cv.detail.add_type(Rbind::RClass.new("CameraParams"))
50
51
  rbind.cv.detail.add_type(Rbind::RClass.new("MatchesInfo"))
52
+ if(minor > 5)
53
+ rbind.cv.add_type(Rbind::RClass.new("HistogramCostExtractor"))
54
+ rbind.cv.add_type(Rbind::RClass.new("ShapeTransformer"))
55
+ end
51
56
  else
52
57
  rbind.pkg_config << "opencv"
53
58
  rbind.add_std_vector
@@ -136,6 +141,10 @@ elsif major >= 4
136
141
  # is removed on opencv master
137
142
  # mark none polymorphic class
138
143
  rbind.ml.DTrees.Params.polymorphic = false if(rbind.ml.DTrees.type?("Params"))
144
+
145
+ if minor > 5
146
+ rbind.cv.createShapeContextDistanceExtractor.ignore = true
147
+ end
139
148
  end
140
149
 
141
150
  # add some more vector types
@@ -148,6 +157,7 @@ rbind.parser.type("std::vector<uint64_t>")
148
157
  rbind.parser.type("std::vector<int8_t>")
149
158
  rbind.parser.type("std::vector<int64_t>")
150
159
  rbind.parser.type("std::vector<Scalar>")
160
+ rbind.parser.type("std::vector<Range>")
151
161
  rbind.parser.type("std::vector<std::vector<Point2d> >")
152
162
 
153
163
  # add some extra documentation
@@ -5,11 +5,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
5
5
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
6
6
 
7
7
  include(FindPkgConfig)
8
- pkg_check_modules(OPENCV REQUIRED opencv)
9
- add_definitions(${OPENCV_CFLAGS})
8
+ find_package(OpenCV REQUIRED)
10
9
  include_directories(${OPENCV_INCLUDE_DIRS})
11
- link_directories(${OPENCV_LIBRARY_DIRS})
12
-
13
10
 
14
11
  # use, i.e. don't skip the full RPATH for the build tree
15
12
  SET(CMAKE_SKIP_BUILD_RPATH FALSE)
@@ -42,10 +39,9 @@ SET(RBIND_SRC
42
39
  "${CMAKE_CURRENT_SOURCE_DIR}/conversions.cc")
43
40
 
44
41
  add_custom_command(OUTPUT ${RBIND_SRC}
45
- COMMAND ruby "${CMAKE_CURRENT_SOURCE_DIR}/../rbind.rb")
46
-
42
+ COMMAND ruby "${CMAKE_CURRENT_SOURCE_DIR}/../rbind.rb" ARGS "\"${FIND_PACKAGE_MESSAGE_DETAILS_OpenCV}\"")
47
43
  ADD_LIBRARY(rbind_opencv SHARED ${RBIND_SRC})
48
- TARGET_LINK_LIBRARIES(rbind_opencv ${OPENCV_LIBS} ${OPENCV_LDFLAGS_OTHER} ${OPENCV_LIBRARIES})
44
+ TARGET_LINK_LIBRARIES(rbind_opencv ${OpenCV_LIBS})
49
45
 
50
46
  set(ROOT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/../..)
51
47
  install(TARGETS rbind_opencv LIBRARY DESTINATION ${ROOT_FOLDER}/lib/ropencv)
data/ropencv.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ropencv'
3
- s.version = '0.0.30'
4
- s.date = '2019-06-06'
3
+ s.version = '0.0.35'
4
+ s.date = '2021-02-14'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Alexander Duda']
7
7
  s.email = ['Alexander.Duda@me.com']
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.require_path = 'lib'
13
13
  s.required_rubygems_version = ">= 1.3.6"
14
14
  s.add_runtime_dependency "rbind", ">= 0.0.30"
15
- s.add_runtime_dependency "ffi", "~> 1.9.0"
15
+ s.add_runtime_dependency "ffi", ">= 1.9.0"
16
16
  s.add_development_dependency 'minitest', '~> 5.5'
17
17
  s.extensions = ['ext/extconf.rb']
18
18
  s.license = 'BSD'
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.30
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Duda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-06 00:00:00.000000000 Z
11
+ date: 2021-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbind
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: ffi
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.9.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.9.0
41
41
  - !ruby/object:Gem::Dependency
@@ -117,7 +117,7 @@ homepage: http://www.ropencv.aduda.eu
117
117
  licenses:
118
118
  - BSD
119
119
  metadata: {}
120
- post_install_message:
120
+ post_install_message:
121
121
  rdoc_options: []
122
122
  require_paths:
123
123
  - lib
@@ -132,9 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: 1.3.6
134
134
  requirements: []
135
- rubyforge_project:
136
- rubygems_version: 2.7.3
137
- signing_key:
135
+ rubygems_version: 3.0.3
136
+ signing_key:
138
137
  specification_version: 4
139
138
  summary: Ruby bindings for opencv 2.4.4 and higher
140
139
  test_files: []