ropencv 0.0.22 → 0.0.34

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
- SHA1:
3
- metadata.gz: d6203505aa5f31b21ee520787dd576ea0180121f
4
- data.tar.gz: ffd25c6e69b0a2454859b08f7c325dd598e56eb5
2
+ SHA256:
3
+ metadata.gz: 663872452e7ff2563896ccf1c3ae0d215d646f8f4175c26c0e5d1ac101be3f7e
4
+ data.tar.gz: a6deabc2ae5c6a0f47174e9d3cb577a446f5d9b0d7cc7181f5f47b92b5787f68
5
5
  SHA512:
6
- metadata.gz: f54f387cf82bc8e34bbbfdb37d91903947397340dbe5ac1008ab143e81a08f4be14e8d9bd46ae49d77a5c45b51836f5bbba3266650e95f972e8a8d14f63a6e08
7
- data.tar.gz: 85318f33655792d822309aaf4805b42e86bd5e3aafb3decb0645be8eb44172f480f70ec7303f8a2aa6b9a126255eeec294a33d18c14ace5f4f6f034b809e0529
6
+ metadata.gz: f147a1682fdf6ec36504ab2a98b273933ed58ba98c9f2690b1087d4dd153f6938b2e60a8e4c1b43c122c6054430b6dd2240015ccf9ed6764e91651f98a453ede
7
+ data.tar.gz: a1d115dd6ef68373dfff24e5461d11ba2cda39a512d2f17f15173ed230cf6a3b589eb4bbdf9df681b180ab74c8fafed6b0df962c88aac757bcc3194005f5aa23
data/ext/helper.rb CHANGED
@@ -92,17 +92,16 @@ 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 opencv header path
97
- out = IO.popen("pkg-config --cflags-only-I opencv")
98
- paths = out.read.split("-I").delete_if(&:empty?).map do |i|
99
- i.gsub("\n","").gsub(" ","")
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()]"
100
101
  end
101
- raise "Cannot find OpenCV" if paths.empty?
102
+ paths << File.join(paths.first,"include")
102
103
 
103
- #check opencv version
104
- out = IO.popen("pkg-config --modversion opencv")
105
- out.read.chomp =~ /(\d+).(\d+).(\d+)/
104
+ opencv_version =~ /(\d+).(\d+).(\d+)/
106
105
  major = $1.to_i; minor = $2.to_i; revision = $3.to_i
107
106
 
108
107
  ##add opencv headers
@@ -130,19 +129,23 @@ def find_opencv
130
129
  "opencv2/stitching/detail/blenders.hpp", "opencv2/stitching/detail/exposure_compensate.hpp", "opencv2/stitching/detail/motion_estimators.hpp",
131
130
  "opencv2/stitching/detail/seam_finders.hpp", "opencv2/stitching/detail/timelapsers.hpp", "opencv2/videostab/motion_core.hpp",
132
131
  "opencv2/viz/types.hpp", "opencv2/viz/widgets.hpp"]
132
+ elsif major == 4
133
+ headers = ["opencv2/core.hpp", "opencv2/core/base.hpp", "opencv2/core/mat.hpp", "opencv2/core/ocl.hpp",
134
+ "opencv2/core/opengl.hpp", "opencv2/core/optim.hpp", "opencv2/core/persistence.hpp", "opencv2/core/types.hpp",
135
+ "opencv2/core/utility.hpp", "opencv2/imgproc.hpp", "opencv2/imgcodecs.hpp", "opencv2/videoio.hpp",
136
+ "opencv2/highgui.hpp", "opencv2/video/background_segm.hpp", "opencv2/video/tracking.hpp", "opencv2/flann/miniflann.hpp",
137
+ "opencv2/ml.hpp", "opencv2/features2d.hpp", "opencv2/calib3d.hpp", "opencv2/objdetect.hpp", "opencv2/photo.hpp",
138
+ "opencv2/shape/shape_distance.hpp", "opencv2/shape/shape_transformer.hpp", "opencv2/stitching.hpp",
139
+ "opencv2/stitching/detail/blenders.hpp", "opencv2/stitching/detail/exposure_compensate.hpp", "opencv2/stitching/detail/motion_estimators.hpp",
140
+ "opencv2/stitching/detail/seam_finders.hpp", "opencv2/stitching/detail/timelapsers.hpp", "opencv2/videostab/motion_core.hpp",
141
+ "opencv2/viz/types.hpp", "opencv2/viz/widgets.hpp"]
142
+ headers.map do |h|
143
+ File.join("opencv4",h)
144
+ end
133
145
  else
134
146
  raise "OpenCV version #{opencv_version} is currently not supported"
135
147
  end
136
148
 
137
- temp = paths.clone
138
- temp.each do |path|
139
- if path =~ /(.*)opencv$/
140
- paths << $1
141
- elsif path =~ /(.*)opencv2$/
142
- paths << $1
143
- end
144
- end
145
-
146
149
  # check that all headers are available
147
150
  headers = headers.map do |i|
148
151
  path = paths.find do |p|
data/ext/opencv.txt CHANGED
@@ -11,6 +11,7 @@ const cv.CV_16S 3
11
11
  const cv.CV_32S 4
12
12
  const cv.CV_32F 5
13
13
  const cv.CV_64F 6
14
+ const cv.CV_16F 7
14
15
  const cv.CV_8UC1 (1-1)*8 + CV_8U
15
16
  const cv.CV_8UC2 (2-1)*8 + CV_8U
16
17
  const cv.CV_8UC3 (3-1)*8 + CV_8U
@@ -74,26 +75,6 @@ cv.Range.operator+ Range
74
75
  int delta
75
76
  cv.Range.operator- Range
76
77
  int delta
77
- class cv.String
78
- cv.String.String
79
- cv.String.String
80
- c_string str
81
- size_t length
82
- cv.String.String
83
- String other
84
- cv.String.size size_t
85
- cv.String.length size_t
86
- cv.String.operator[] char
87
- size_t idx
88
- cv.String.c_str const_c_string
89
- cv.String.begin char =str_begin
90
- cv.String.end char =str_end
91
- cv.String.empty bool
92
- cv.String.clear void
93
- cv.String.compare int
94
- String str
95
- cv.String.swap void
96
- String str /IO
97
78
  class cv.Scalar
98
79
  double* val
99
80
  cv.Scalar.Scalar
@@ -497,13 +478,6 @@ cv.Mat.ptr uchar*
497
478
  int i2
498
479
  cv.Mat.operator () Mat =block
499
480
  Rect rect
500
- const cv.Mat.MAGIC_VAL 0x42FF0000
501
- const cv.Mat.AUTO_STEP 0
502
- const cv.Mat.CONTINUOUS_FLAG CV_MAT_CONT_FLAG
503
- const cv.Mat.SUBMATRIX_FLAG CV_SUBMAT_FLAG
504
- const cv.Mat.MAGIC_MASK 0xFFFF0000
505
- const cv.Mat.TYPE_MASK 0x00000FFF
506
- const cv.Mat.DEPTH_MASK 7
507
481
  class cv.RNG
508
482
  uint64 state
509
483
  cv.RNG.RNG
@@ -673,10 +647,120 @@ cv.FileNode.operator>> void =read_vector_string
673
647
  cv.FileNode.begin FileNodeIterator
674
648
  cv.FileNode.end FileNodeIterator
675
649
  cv.FileNodeIterator.operator++ FileNodeIterator
676
- cv.FileNodeIterator.operator-- FileNodeIterator
677
650
  cv.FileNodeIterator.operator* FileNode =to_node
678
651
  cv.FileNodeIterator.operator== bool
679
652
  FileNodeIterator other
680
653
  cv.FileNodeIterator.operator!= bool
681
654
  FileNodeIterator other
682
-
655
+ class cv.UMat
656
+ int flags
657
+ int rows
658
+ int cols
659
+ size_t step
660
+ cv.UMat.UMat
661
+ cv.UMat.UMat
662
+ UMat m
663
+ cv.UMat.UMat
664
+ vector_Point vec
665
+ bool copy false
666
+ cv.UMat.UMat
667
+ vector_Point2f vec
668
+ bool copy false
669
+ cv.UMat.UMat
670
+ vector_Point2d vec
671
+ bool copy false
672
+ cv.UMat.UMat
673
+ vector_Point3f vec
674
+ bool copy false
675
+ cv.UMat.UMat
676
+ vector_Point3d vec
677
+ bool copy false
678
+ cv.UMat.row UMat
679
+ int y
680
+ cv.UMat.col UMat
681
+ int c
682
+ cv.UMat.rowRange UMat
683
+ int startrow
684
+ int endrow
685
+ cv.UMat.rowRange UMat
686
+ Range r
687
+ cv.UMat.colRange UMat
688
+ int startcol
689
+ int endcol
690
+ cv.UMat.colRange UMat
691
+ Range r
692
+ cv.UMat.diag UMat
693
+ int d 0
694
+ cv.UMat.clone UMat
695
+ cv.UMat.copyTo void
696
+ UMat m /O
697
+ cv.UMat.copyTo void
698
+ UMat m /O
699
+ UMat mask /IO
700
+ cv.UMat.convertTo void
701
+ UMat m /O
702
+ int rtype
703
+ double alpha 1
704
+ double beta 0
705
+ cv.UMat.assignTo void
706
+ UMat m /O
707
+ int type -1
708
+ cv.UMat.reshape UMat
709
+ int cn
710
+ int rows 0
711
+ cv.UMat.t UMat
712
+ cv.UMat.inv UMat
713
+ int method DECOMP_LU
714
+ cv.UMat.mul UMat
715
+ UMat m
716
+ double scale 1
717
+ cv.UMat.dot double
718
+ UMat m
719
+ cv.UMat.diag UMat /S
720
+ UMat d
721
+ cv.UMat.zeros UMat /S
722
+ int rows
723
+ int cols
724
+ int type
725
+ cv.UMat.zeros UMat /S
726
+ Size size
727
+ int type
728
+ cv.UMat.ones UMat /S
729
+ int rows
730
+ int cols
731
+ int type
732
+ cv.UMat.ones UMat /S
733
+ Size size
734
+ int type
735
+ cv.UMat.eye UMat /S
736
+ int rows
737
+ int cols
738
+ int type
739
+ cv.UMat.eye UMat /S
740
+ Size size
741
+ int type
742
+ cv.UMat.create void
743
+ int rows
744
+ int cols
745
+ int type
746
+ cv.UMat.create void
747
+ Size size
748
+ int type
749
+ cv.UMat.isContinuous bool
750
+ cv.UMat.isSubmatrix bool
751
+ cv.UMat.elemSize size_t
752
+ cv.UMat.elemSize1 size_t
753
+ cv.UMat.size Size
754
+ cv.UMat.type int
755
+ cv.UMat.depth int
756
+ cv.UMat.channels int
757
+ cv.UMat.step1 size_t
758
+ int i 0
759
+ cv.UMat.empty bool
760
+ cv.UMat.total size_t
761
+ cv.UMat.checkVector int
762
+ int elemChannels
763
+ int depth -1
764
+ bool requireContinuous true
765
+ cv.UMat.operator () UMat =block
766
+ Rect rect
@@ -1,14 +1,3 @@
1
- cv.drawMatches void
2
- Mat img1
3
- vector_KeyPoint keypoints1
4
- Mat img2
5
- vector_KeyPoint keypoints2
6
- vector_DMatch matches1to2
7
- Mat outImg /O
8
- Scalar matchColor Scalar::all(-1)
9
- Scalar singlePointColor Scalar::all(-1)
10
- vector_char matchesMask std::vector<char>()
11
- int flags DrawMatchesFlags::DEFAULT
12
1
  cv.morphologyDefaultBorderValue Scalar
13
2
  cv.polyfit void
14
3
  Mat srcx
@@ -0,0 +1,19 @@
1
+ class cv.String
2
+ cv.String.String
3
+ cv.String.String
4
+ c_string str
5
+ size_t length
6
+ cv.String.String
7
+ String other
8
+ cv.String.size size_t
9
+ cv.String.length size_t
10
+ cv.String.operator[] char
11
+ size_t idx
12
+ cv.String.c_str const_c_string
13
+ cv.String.empty bool
14
+ cv.String.clear void
15
+ cv.String.compare int
16
+ String str
17
+ cv.String.swap void
18
+ String str /IO
19
+
@@ -0,0 +1,30 @@
1
+ cv.UMat.getMat Mat
2
+ AccessFlag flags
3
+ cv.UMat.UMat
4
+ Size size
5
+ int type
6
+ UMatUsageFlags usageFlags USAGE_DEFAULT
7
+ cv.UMat.UMat
8
+ int rows
9
+ int cols
10
+ int type
11
+ UMatUsageFlags usageFlags USAGE_DEFAULT
12
+ cv.UMat.UMat
13
+ int rows
14
+ int cols
15
+ int type
16
+ Scalar scalar
17
+ UMatUsageFlags usageFlags USAGE_DEFAULT
18
+ cv.UMat.UMat
19
+ Size size
20
+ int type
21
+ Scalar scalar
22
+ UMatUsageFlags usageFlags USAGE_DEFAULT
23
+ cv.UMat.UMat
24
+ UMat m
25
+ Range row_range
26
+ Range col_range Range::all()
27
+ cv.UMat.UMat
28
+ UMat m
29
+ Rect roi
30
+
@@ -46,3 +46,7 @@ const cv.CV_WND_PROP_ASPECT_RATIO 2
46
46
  const cv.CV_WND_PROP_OPENGL 3
47
47
  const cv.InputArray.KINDSHIFT 16
48
48
  const cv.DBL_EPSILON Float::EPSILON
49
+ const cv.CV_CALIB_CB_ADAPTIVE_THRESH 1
50
+ const cv.CV_CALIB_CB_NORMALIZE_IMAGE 2
51
+ const cv.CV_CALIB_CB_FILTER_QUADS 4
52
+ const cv.CV_CALIB_CB_FAST_CHECK 8
data/ext/rbind.rb CHANGED
@@ -3,12 +3,12 @@ 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
 
10
11
  rbind = Rbind::Rbind.new("OpenCV")
11
- rbind.pkg_config << "opencv"
12
12
  rbind.includes = opencv_headers
13
13
 
14
14
  # add Vec types
@@ -21,18 +21,40 @@ end
21
21
 
22
22
  # add some templates and alias
23
23
  rbind.parser.type_alias["const_c_string"] = rbind.c_string.to_const
24
- if major >= 3
24
+ if major >= 3 && major < 4
25
+ rbind.pkg_config << "opencv"
25
26
  rbind.add_std_types
27
+ rbind.cv.add_type(Rbind::RClass.new("String"))
28
+ rbind.cv.type_alias["string"] = rbind.cv.String
26
29
  rbind.parser.add_type OpenCVPtr2.new
27
30
  rbind.cv.add_type(Rbind::RClass.new("ShapeTransformer"))
28
31
  rbind.cv.add_type(Rbind::RClass.new("Feature2D"))
32
+ rbind.cv.add_type(Rbind::RClass.new("KeyPoint"))
33
+ rbind.cv.add_type(Rbind::RClass.new("DMatch"))
29
34
  rbind.cv.type_alias["FeatureDetector"] = rbind.cv.Feature2D
30
35
  rbind.cv.type_alias["DescriptorExtractor"] = rbind.cv.Feature2D
31
- # add missing enum values
32
- rbind.cv.add_type(Rbind::RClass.new("Stitcher"))
33
- rbind.cv.Stitcher.add_type(Rbind::REnum.new("Status"))
34
- rbind.cv.Stitcher.Status.values = {:OK => 0, :ERR_NEED_MORE_IMGS => 1,:ERR_HOMOGRAPHY_EST_FAIL => 2,:ERR_CAMERA_PARAMS_ADJUST_FAIL => 3}
36
+ elsif major >= 4
37
+ rbind.pkg_config << "opencv4"
38
+ rbind.add_std_types
39
+ rbind.cv.type_alias["string"] = rbind.std.string
40
+ rbind.cv.type_alias["String"] = rbind.std.string
41
+ rbind.parser.add_type OpenCVPtr2.new
42
+ rbind.cv.add_type(Rbind::RClass.new("Feature2D"))
43
+ rbind.cv.add_type(Rbind::RClass.new("KeyPoint"))
44
+ rbind.cv.add_type(Rbind::RClass.new("DMatch"))
45
+ rbind.cv.type_alias["FeatureDetector"] = rbind.cv.Feature2D
46
+ rbind.cv.type_alias["DescriptorExtractor"] = rbind.cv.Feature2D
47
+ rbind.cv.add_namespace("detail")
48
+ rbind.cv.detail.add_type(Rbind::RClass.new("GraphCutSeamFinderBase"))
49
+ rbind.cv.detail.add_type(Rbind::RClass.new("ImageFeatures"))
50
+ rbind.cv.detail.add_type(Rbind::RClass.new("CameraParams"))
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
35
56
  else
57
+ rbind.pkg_config << "opencv"
36
58
  rbind.add_std_vector
37
59
  rbind.parser.add_type OpenCVPtr.new
38
60
  end
@@ -42,11 +64,10 @@ rbind.use_namespace rbind.std
42
64
  rbind.parse File.join(File.dirname(__FILE__),"pre_opencv244.txt")
43
65
  rbind.parse File.join(File.dirname(__FILE__),"opencv.txt")
44
66
  rbind.use_namespace rbind.cv
45
- rbind.cv.type_alias["string"] = rbind.cv.String
46
67
  rbind.parse_headers
47
68
  rbind.parse File.join(File.dirname(__FILE__),"post_opencv244.txt")
48
- rbind.cv.String.begin.return_type = rbind.cv.String.begin.return_type.to_const.to_ptr
49
- rbind.cv.String.end.return_type = rbind.cv.String.end.return_type.to_const.to_ptr
69
+ #rbind.cv.String.begin.return_type = rbind.cv.String.begin.return_type.to_const.to_ptr
70
+ #rbind.cv.String.end.return_type = rbind.cv.String.end.return_type.to_const.to_ptr
50
71
 
51
72
  # post parsing + patching wrong signatures
52
73
  if major == 2 && minor == 4 && revision>= 9
@@ -71,19 +92,48 @@ if major == 2 && minor == 4 && revision>= 9
71
92
  rbind.cv.BRISK.operation("BRISK")[1].parameter(0).remove_const!
72
93
  rbind.cv.BRISK.operation("BRISK")[1].parameter(1).remove_const!
73
94
  rbind.cv.putText.parameter(0).remove_const!
74
- elsif major >= 3
95
+ elsif major == 3
75
96
  rbind.parse File.join(File.dirname(__FILE__),"post_opencv249.txt")
76
97
  rbind.parse File.join(File.dirname(__FILE__),"post_opencv300.txt")
98
+ rbind.parse File.join(File.dirname(__FILE__),"post_opencv300a.txt")
77
99
  rbind.parse File.join(File.dirname(__FILE__),"post_opencv310.txt") if minor >= 1
78
100
 
79
- rbind.cv.randShuffle.parameter(2).remove_const!
80
- rbind.cv.AlignExposures.process.parameter(1).remove_const!
101
+ # rbind.cv.randShuffle.parameter(2).remove_const!
102
+ # rbind.cv.AlignExposures.process.parameter(1).remove_const!
103
+ rbind.cv.AlignMTB.process[0].parameter(1).remove_const!
104
+ rbind.cv.AlignMTB.process[1].parameter(1).remove_const!
105
+ rbind.CvDTreeNode.ignore = true
106
+ rbind.CvSlice.ignore = true
107
+ rbind.CvTermCriteria.ignore = true
108
+ rbind.cv.polyfit.ignore = true
109
+
110
+ # is removed on opencv master
111
+ rbind.ml.StatModel.getParams.ignore = true if(rbind.ml.StatModel.operation?('getParams'))
112
+
113
+ # is removed on opencv master
114
+ # mark none polymorphic class
115
+ rbind.ml.DTrees.Params.polymorphic = false if(rbind.ml.DTrees.type?("Params"))
116
+ elsif major >= 4
117
+ rbind.parse File.join(File.dirname(__FILE__),"post_opencv249.txt")
118
+ rbind.parse File.join(File.dirname(__FILE__),"post_opencv300.txt")
119
+ rbind.parse File.join(File.dirname(__FILE__),"post_opencv400.txt")
120
+
81
121
  rbind.cv.AlignMTB.process[0].parameter(1).remove_const!
82
122
  rbind.cv.AlignMTB.process[1].parameter(1).remove_const!
83
123
  rbind.CvDTreeNode.ignore = true
84
124
  rbind.CvSlice.ignore = true
85
125
  rbind.CvTermCriteria.ignore = true
86
126
  rbind.cv.polyfit.ignore = true
127
+ rbind.cv.FlannBasedMatcher.write[0].ignore = true
128
+ rbind.cv.FlannBasedMatcher.write[1].ignore = true
129
+ rbind.cv.FlannBasedMatcher.read[0].ignore = true
130
+ # issues with UMat
131
+ rbind.detail.NoExposureCompensator.feed.ignore = true
132
+ rbind.detail.GainCompensator.feed.ignore = true
133
+ rbind.detail.BlocksGainCompensator.feed.ignore = true
134
+
135
+ # issues with enum using full namespace name
136
+ rbind.cv.HOGDescriptor.ignore = true
87
137
 
88
138
  # is removed on opencv master
89
139
  rbind.ml.StatModel.getParams.ignore = true if(rbind.ml.StatModel.operation?('getParams'))
@@ -91,6 +141,10 @@ elsif major >= 3
91
141
  # is removed on opencv master
92
142
  # mark none polymorphic class
93
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
94
148
  end
95
149
 
96
150
  # add some more vector types
@@ -103,6 +157,7 @@ rbind.parser.type("std::vector<uint64_t>")
103
157
  rbind.parser.type("std::vector<int8_t>")
104
158
  rbind.parser.type("std::vector<int64_t>")
105
159
  rbind.parser.type("std::vector<Scalar>")
160
+ rbind.parser.type("std::vector<Range>")
106
161
  rbind.parser.type("std::vector<std::vector<Point2d> >")
107
162
 
108
163
  # add some extra documentation
@@ -2,12 +2,11 @@ cmake_minimum_required(VERSION 2.6)
2
2
  PROJECT(rbind_opencv CXX)
3
3
 
4
4
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
5
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
6
+
5
7
  include(FindPkgConfig)
6
- pkg_check_modules(OPENCV REQUIRED opencv)
7
- add_definitions(${OPENCV_CFLAGS})
8
+ find_package(OpenCV REQUIRED)
8
9
  include_directories(${OPENCV_INCLUDE_DIRS})
9
- link_directories(${OPENCV_LIBRARY_DIRS})
10
-
11
10
 
12
11
  # use, i.e. don't skip the full RPATH for the build tree
13
12
  SET(CMAKE_SKIP_BUILD_RPATH FALSE)
@@ -40,10 +39,9 @@ SET(RBIND_SRC
40
39
  "${CMAKE_CURRENT_SOURCE_DIR}/conversions.cc")
41
40
 
42
41
  add_custom_command(OUTPUT ${RBIND_SRC}
43
- COMMAND ruby "${CMAKE_CURRENT_SOURCE_DIR}/../rbind.rb")
44
-
42
+ COMMAND ruby "${CMAKE_CURRENT_SOURCE_DIR}/../rbind.rb" ARGS "\"${FIND_PACKAGE_MESSAGE_DETAILS_OpenCV}\"")
45
43
  ADD_LIBRARY(rbind_opencv SHARED ${RBIND_SRC})
46
- TARGET_LINK_LIBRARIES(rbind_opencv ${OPENCV_LIBS} ${OPENCV_LDFLAGS_OTHER} ${OPENCV_LIBRARIES})
44
+ TARGET_LINK_LIBRARIES(rbind_opencv ${OpenCV_LIBS})
47
45
 
48
46
  set(ROOT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/../..)
49
47
  install(TARGETS rbind_opencv LIBRARY DESTINATION ${ROOT_FOLDER}/lib/ropencv)
@@ -82,9 +82,7 @@ module OpenCV
82
82
  end
83
83
  end
84
84
  def to_s
85
- s = size()
86
- return "" if s == 0
87
- str_begin.read_string_length(s)
85
+ c_str
88
86
  end
89
87
  end
90
88
 
@@ -208,7 +206,7 @@ module OpenCV
208
206
  end
209
207
 
210
208
  def <<(val)
211
- if val.is_a?(Fixnum)
209
+ if val.is_a?(1.class)
212
210
  write_int(val)
213
211
  elsif val.is_a?(Float)
214
212
  write_double(val)
@@ -396,7 +394,7 @@ module OpenCV
396
394
  [obj.size,1,obj.first]
397
395
  end
398
396
  end
399
- setter,step,type = if e.is_a? Fixnum
397
+ setter,step,type = if e.is_a? 1.class
400
398
  [:put_array_of_int32,4*w,CV_32SC1]
401
399
  elsif e.is_a? Float
402
400
  [:put_array_of_float64,8*w,CV_64FC1]
@@ -463,7 +461,7 @@ module OpenCV
463
461
  case other
464
462
  when Float
465
463
  [other,to_f]
466
- when Fixnum
464
+ when 1.class
467
465
  [other,to_i]
468
466
  else
469
467
  raise TypeError, "#{self.class} can't be coerced into #{other.class}"
@@ -539,7 +537,7 @@ module OpenCV
539
537
  def -(val)
540
538
  if val.is_a? Float
541
539
  Rbind::cv_mat_operator_minus__2( self, val)
542
- elsif val.is_a? Fixnum
540
+ elsif val.is_a? 1.class
543
541
  Rbind::cv_mat_operator_minus__3( self, val)
544
542
  else
545
543
  Rbind::cv_mat_operator_minus( self, val)
@@ -549,7 +547,7 @@ module OpenCV
549
547
  def +(val)
550
548
  if val.is_a? Float
551
549
  Rbind::cv_mat_operator_plus__2( self, val)
552
- elsif val.is_a? Fixnum
550
+ elsif val.is_a? 1.class
553
551
  Rbind::cv_mat_operator_plus__3( self, val)
554
552
  else
555
553
  Rbind::cv_mat_operator_plus( self, val)
@@ -559,7 +557,7 @@ module OpenCV
559
557
  def /(val)
560
558
  if val.is_a? Float
561
559
  Rbind::cv_mat_operator_div__2( self, val)
562
- elsif val.is_a? Fixnum
560
+ elsif val.is_a? 1.class
563
561
  Rbind::cv_mat_operator_div__3( self, val)
564
562
  else
565
563
  Rbind::cv_mat_operator_div( self, val)
@@ -569,7 +567,7 @@ module OpenCV
569
567
  def *(val)
570
568
  if val.is_a? Float
571
569
  Rbind::cv_mat_operator_mult__2( self, val)
572
- elsif val.is_a? Fixnum
570
+ elsif val.is_a? 1.class
573
571
  Rbind::cv_mat_operator_mult__3( self, val)
574
572
  else
575
573
  Rbind::cv_mat_operator_mult( self, val)
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.22'
4
- s.date = '2018-07-10'
3
+ s.version = '0.0.34'
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']
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
  s.files = `git ls-files`.split("\n") + ["lib/ropencv/ropencv_types.rb","lib/ropencv/ropencv_ruby.rb"]
12
12
  s.require_path = 'lib'
13
13
  s.required_rubygems_version = ">= 1.3.6"
14
- s.add_runtime_dependency "rbind", ">= 0.0.28"
15
- s.add_runtime_dependency "ffi", "~> 1.9.0"
14
+ s.add_runtime_dependency "rbind", ">= 0.0.30"
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.22
4
+ version: 0.0.34
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: 2018-07-10 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
@@ -16,26 +16,26 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.28
19
+ version: 0.0.30
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.28
26
+ version: 0.0.30
27
27
  - !ruby/object:Gem::Dependency
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
@@ -92,7 +92,9 @@ files:
92
92
  - ext/post_opencv244.txt
93
93
  - ext/post_opencv249.txt
94
94
  - ext/post_opencv300.txt
95
+ - ext/post_opencv300a.txt
95
96
  - ext/post_opencv310.txt
97
+ - ext/post_opencv400.txt
96
98
  - ext/pre_opencv244.txt
97
99
  - ext/rbind.rb
98
100
  - ext/src/CMakeLists.txt
@@ -115,7 +117,7 @@ homepage: http://www.ropencv.aduda.eu
115
117
  licenses:
116
118
  - BSD
117
119
  metadata: {}
118
- post_install_message:
120
+ post_install_message:
119
121
  rdoc_options: []
120
122
  require_paths:
121
123
  - lib
@@ -130,9 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
132
  - !ruby/object:Gem::Version
131
133
  version: 1.3.6
132
134
  requirements: []
133
- rubyforge_project:
134
- rubygems_version: 2.5.2.3
135
- signing_key:
135
+ rubygems_version: 3.0.3
136
+ signing_key:
136
137
  specification_version: 4
137
138
  summary: Ruby bindings for opencv 2.4.4 and higher
138
139
  test_files: []