ruby-opencv 0.0.8.pre-mswin32 → 0.0.9.pre2-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/DEVELOPERS_NOTE.md +137 -0
  3. data/Gemfile +1 -1
  4. data/License.txt +30 -30
  5. data/Manifest.txt +7 -5
  6. data/README.md +98 -0
  7. data/Rakefile +63 -5
  8. data/config.yml +7 -0
  9. data/examples/alpha_blend.rb +21 -21
  10. data/examples/find_obj.rb +169 -169
  11. data/examples/match_kdtree.rb +88 -88
  12. data/ext/opencv/cvcapture.cpp +19 -12
  13. data/ext/opencv/cvutils.cpp +192 -194
  14. data/ext/opencv/cvutils.h +30 -29
  15. data/{extconf.rb → ext/opencv/extconf.rb} +12 -4
  16. data/lib/opencv.rb +12 -3
  17. data/lib/opencv/psyched_yaml.rb +22 -22
  18. data/lib/opencv/version.rb +1 -1
  19. data/ruby-opencv.gemspec +44 -43
  20. data/test/helper.rb +1 -1
  21. data/test/runner.rb +30 -30
  22. data/test/test_curve.rb +1 -1
  23. data/test/test_cvavgcomp.rb +24 -24
  24. data/test/test_cvbox2d.rb +76 -76
  25. data/test/test_cvcapture.rb +183 -183
  26. data/test/test_cvchain.rb +108 -108
  27. data/test/test_cvcircle32f.rb +41 -41
  28. data/test/test_cvconnectedcomp.rb +61 -61
  29. data/test/test_cvcontour.rb +150 -150
  30. data/test/test_cvcontourtree.rb +43 -43
  31. data/test/test_cverror.rb +1 -1
  32. data/test/test_cvfeaturetree.rb +65 -65
  33. data/test/test_cvfont.rb +58 -58
  34. data/test/test_cvhaarclassifiercascade.rb +63 -63
  35. data/test/test_cvhistogram.rb +1 -1
  36. data/test/test_cvhumoments.rb +83 -83
  37. data/test/test_cvline.rb +50 -50
  38. data/test/test_cvmat.rb +1 -1
  39. data/test/test_cvmat_drawing.rb +1 -1
  40. data/test/test_cvmat_dxt.rb +1 -1
  41. data/test/test_cvmat_imageprocessing.rb +1 -1
  42. data/test/test_cvmat_matching.rb +1 -1
  43. data/test/test_cvmoments.rb +180 -180
  44. data/test/test_cvpoint.rb +75 -75
  45. data/test/test_cvpoint2d32f.rb +75 -75
  46. data/test/test_cvpoint3d32f.rb +93 -93
  47. data/test/test_cvrect.rb +144 -144
  48. data/test/test_cvscalar.rb +113 -113
  49. data/test/test_cvseq.rb +295 -295
  50. data/test/test_cvsize.rb +75 -75
  51. data/test/test_cvsize2d32f.rb +75 -75
  52. data/test/test_cvslice.rb +31 -31
  53. data/test/test_cvsurfparams.rb +57 -57
  54. data/test/test_cvsurfpoint.rb +66 -66
  55. data/test/test_cvtermcriteria.rb +56 -56
  56. data/test/test_cvtwopoints.rb +40 -40
  57. data/test/test_cvvideowriter.rb +58 -58
  58. data/test/test_iplconvkernel.rb +54 -54
  59. data/test/test_iplimage.rb +1 -1
  60. data/test/test_mouseevent.rb +17 -17
  61. data/test/test_opencv.rb +1 -1
  62. data/test/test_pointset.rb +1 -1
  63. data/test/test_preliminary.rb +130 -130
  64. data/test/test_trackbar.rb +47 -47
  65. data/test/test_window.rb +115 -115
  66. metadata +28 -56
  67. data/README.rdoc +0 -149
  68. data/ext/opencv/lib/opencv.rb +0 -3
  69. data/ext/opencv/lib/opencv/psyched_yaml.rb +0 -22
  70. data/ext/opencv/lib/opencv/version.rb +0 -3
@@ -5,14 +5,17 @@ def cv_version_suffix(incdir)
5
5
  major, minor, subminor = nil, nil, nil
6
6
  open("#{incdir}/opencv2/core/version.hpp", 'r') { |f|
7
7
  f.read.lines.each { |line|
8
- major = $1.to_s if line =~ /\A#define\s+CV_MAJOR_VERSION\s+(\d+)\s*\Z/
9
- minor = $1.to_s if line =~ /\A#define\s+CV_MINOR_VERSION\s+(\d+)\s*\Z/
10
- subminor = $1.to_s if line =~ /\A#define\s+CV_SUBMINOR_VERSION\s+(\d+)\s*\Z/
8
+ major = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_EPOCH|CV_MAJOR_VERSION)\s+(\d+)\s*\Z/
9
+ minor = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_MAJOR|CV_MINOR_VERSION)\s+(\d+)\s*\Z/
10
+ subminor = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_MINOR|CV_SUBMINOR_VERSION)\s+(\d+)\s*\Z/
11
11
  }
12
12
  }
13
13
  major + minor + subminor
14
14
  end
15
15
 
16
+ # Quick fix for 2.0.0
17
+ # @libdir_basename is set to nil and dir_config() sets invalid libdir '${opencv-dir}/' when --with-opencv-dir option passed.
18
+ @libdir_basename ||= 'lib'
16
19
  incdir, libdir = dir_config("opencv", "/usr/local/include", "/usr/local/lib")
17
20
  dir_config("libxml2", "/usr/include", "/usr/lib")
18
21
 
@@ -67,9 +70,14 @@ opencv_headers.each {|header|
67
70
  }
68
71
  have_header("stdarg.h")
69
72
 
73
+ if $warnflags
74
+ $warnflags.slice!('-Wdeclaration-after-statement')
75
+ $warnflags.slice!('-Wimplicit-function-declaration')
76
+ end
77
+
70
78
  # Quick fix for 1.8.7
71
79
  $CFLAGS << " -I#{File.dirname(__FILE__)}/ext/opencv"
72
80
 
73
81
  # Create Makefile
74
- create_makefile("opencv", "./ext/opencv")
82
+ create_makefile('opencv')
75
83
 
data/lib/opencv.rb CHANGED
@@ -1,3 +1,12 @@
1
- require (File.dirname(__FILE__) + '/opencv/version')
2
- require 'opencv.so'
3
-
1
+ require (File.dirname(__FILE__) + '/opencv/version')
2
+
3
+ if RUBY_PLATFORM =~ /mingw|mswin/
4
+ major, minor, subminor = RUBY_VERSION.split('.')
5
+ begin
6
+ require "#{major}.#{minor}/opencv.so"
7
+ rescue LoadError
8
+ require 'opencv.so'
9
+ end
10
+ else
11
+ require 'opencv.so'
12
+ end
@@ -1,22 +1,22 @@
1
- # -*- mode: ruby; coding: utf-8-unix -*-
2
- # Psych loader for avoiding loading problem
3
- # (borrowed from Bundler 1.1.rc.7 https://github.com/carlhuda/bundler/blob/v1.1.rc.7/lib/bundler/psyched_yaml.rb )
4
- #
5
- # See: https://github.com/ruby-opencv/ruby-opencv/pull/6
6
-
7
- # Psych could be a gem
8
- begin
9
- gem 'psych'
10
- rescue Gem::LoadError
11
- end if defined?(Gem)
12
-
13
- # Psych could be a stdlib
14
- begin
15
- # it's too late if Syck is already loaded
16
- require 'psych' unless defined?(Syck)
17
- rescue LoadError
18
- end
19
-
20
- # Psych might NOT EXIST AT ALL
21
- require 'yaml'
22
-
1
+ # -*- mode: ruby; coding: utf-8 -*-
2
+ # Psych loader for avoiding loading problem
3
+ # (borrowed from Bundler 1.1.rc.7 https://github.com/carlhuda/bundler/blob/v1.1.rc.7/lib/bundler/psyched_yaml.rb )
4
+ #
5
+ # See: https://github.com/ruby-opencv/ruby-opencv/pull/6
6
+
7
+ # Psych could be a gem
8
+ begin
9
+ gem 'psych'
10
+ rescue Gem::LoadError
11
+ end if defined?(Gem)
12
+
13
+ # Psych could be a stdlib
14
+ begin
15
+ # it's too late if Syck is already loaded
16
+ require 'psych' unless defined?(Syck)
17
+ rescue LoadError
18
+ end
19
+
20
+ # Psych might NOT EXIST AT ALL
21
+ require 'yaml'
22
+
@@ -1,3 +1,3 @@
1
1
  module OpenCV
2
- VERSION = '0.0.8.pre'
2
+ VERSION = '0.0.9.pre2'
3
3
  end
data/ruby-opencv.gemspec CHANGED
@@ -1,43 +1,44 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = "ruby-opencv"
5
- s.version = "0.0.8.pre.20130127091400"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["lsxi", "ser1zw", "pcting"]
9
- s.date = "2013-01-27"
10
- s.description = "OpenCV wrapper for Ruby"
11
- s.email = ["masakazu.yonekura@gmail.com", "azariahsawtikes@gmail.com", "pcting@gmail.com"]
12
- s.extensions = ["extconf.rb"]
13
- s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "README.rdoc", "examples/matching_to_many_images/train/trainImages.txt"]
14
- s.files = [".gitignore", "Gemfile", "History.txt", "License.txt", "Manifest.txt", "README.rdoc", "Rakefile", "examples/alpha_blend.rb", "examples/box.png", "examples/box_in_scene.png", "examples/contours/bitmap-contours-with-labels.png", "examples/contours/bitmap-contours.png", "examples/contours/bounding-box-detect-canny.rb", "examples/contours/contour_retrieval_modes.rb", "examples/contours/rotated-boxes.jpg", "examples/convexhull.rb", "examples/face_detect.rb", "examples/find_obj.rb", "examples/houghcircle.rb", "examples/inpaint.png", "examples/inpaint.rb", "examples/lenna-rotated.jpg", "examples/lenna.jpg", "examples/match_kdtree.rb", "examples/matching_to_many_images.rb", "examples/matching_to_many_images/query.png", "examples/matching_to_many_images/train/1.png", "examples/matching_to_many_images/train/2.png", "examples/matching_to_many_images/train/3.png", "examples/matching_to_many_images/train/trainImages.txt", "examples/paint.rb", "examples/snake.rb", "examples/stuff.jpg", "examples/tiffany.jpg", "ext/opencv/curve.cpp", "ext/opencv/curve.h", "ext/opencv/cvavgcomp.cpp", "ext/opencv/cvavgcomp.h", "ext/opencv/cvbox2d.cpp", "ext/opencv/cvbox2d.h", "ext/opencv/cvcapture.cpp", "ext/opencv/cvcapture.h", "ext/opencv/cvchain.cpp", "ext/opencv/cvchain.h", "ext/opencv/cvcircle32f.cpp", "ext/opencv/cvcircle32f.h", "ext/opencv/cvcondensation.cpp", "ext/opencv/cvcondensation.h", "ext/opencv/cvconnectedcomp.cpp", "ext/opencv/cvconnectedcomp.h", "ext/opencv/cvcontour.cpp", "ext/opencv/cvcontour.h", "ext/opencv/cvcontourtree.cpp", "ext/opencv/cvcontourtree.h", "ext/opencv/cvconvexitydefect.cpp", "ext/opencv/cvconvexitydefect.h", "ext/opencv/cverror.cpp", "ext/opencv/cverror.h", "ext/opencv/cvfeaturetree.cpp", "ext/opencv/cvfeaturetree.h", "ext/opencv/cvfont.cpp", "ext/opencv/cvfont.h", "ext/opencv/cvhaarclassifiercascade.cpp", "ext/opencv/cvhaarclassifiercascade.h", "ext/opencv/cvhistogram.cpp", "ext/opencv/cvhistogram.h", "ext/opencv/cvhumoments.cpp", "ext/opencv/cvhumoments.h", "ext/opencv/cvline.cpp", "ext/opencv/cvline.h", "ext/opencv/cvmat.cpp", "ext/opencv/cvmat.h", "ext/opencv/cvmatnd.cpp", "ext/opencv/cvmatnd.h", "ext/opencv/cvmemstorage.cpp", "ext/opencv/cvmemstorage.h", "ext/opencv/cvmoments.cpp", "ext/opencv/cvmoments.h", "ext/opencv/cvpoint.cpp", "ext/opencv/cvpoint.h", "ext/opencv/cvpoint2d32f.cpp", "ext/opencv/cvpoint2d32f.h", "ext/opencv/cvpoint3d32f.cpp", "ext/opencv/cvpoint3d32f.h", "ext/opencv/cvrect.cpp", "ext/opencv/cvrect.h", "ext/opencv/cvscalar.cpp", "ext/opencv/cvscalar.h", "ext/opencv/cvseq.cpp", "ext/opencv/cvseq.h", "ext/opencv/cvsize.cpp", "ext/opencv/cvsize.h", "ext/opencv/cvsize2d32f.cpp", "ext/opencv/cvsize2d32f.h", "ext/opencv/cvslice.cpp", "ext/opencv/cvslice.h", "ext/opencv/cvsparsemat.cpp", "ext/opencv/cvsparsemat.h", "ext/opencv/cvsurfparams.cpp", "ext/opencv/cvsurfparams.h", "ext/opencv/cvsurfpoint.cpp", "ext/opencv/cvsurfpoint.h", "ext/opencv/cvtermcriteria.cpp", "ext/opencv/cvtermcriteria.h", "ext/opencv/cvtwopoints.cpp", "ext/opencv/cvtwopoints.h", "ext/opencv/cvutils.cpp", "ext/opencv/cvutils.h", "ext/opencv/cvvideowriter.cpp", "ext/opencv/cvvideowriter.h", "ext/opencv/gui.cpp", "ext/opencv/gui.h", "ext/opencv/iplconvkernel.cpp", "ext/opencv/iplconvkernel.h", "ext/opencv/iplimage.cpp", "ext/opencv/iplimage.h", "ext/opencv/lib/opencv.rb", "ext/opencv/lib/opencv/psyched_yaml.rb", "ext/opencv/lib/opencv/version.rb", "ext/opencv/mouseevent.cpp", "ext/opencv/mouseevent.h", "ext/opencv/opencv.cpp", "ext/opencv/opencv.h", "ext/opencv/pointset.cpp", "ext/opencv/pointset.h", "ext/opencv/trackbar.cpp", "ext/opencv/trackbar.h", "ext/opencv/window.cpp", "ext/opencv/window.h", "extconf.rb", "images/CvMat_sobel.png", "images/CvMat_sub_rect.png", "images/CvSeq_relationmap.png", "images/face_detect_from_lena.jpg", "ruby-opencv.gemspec", "test/helper.rb", "test/runner.rb", "test/samples/airplane.jpg", "test/samples/baboon.jpg", "test/samples/baboon200.jpg", "test/samples/baboon200_rotated.jpg", "test/samples/blank0.jpg", "test/samples/blank1.jpg", "test/samples/blank2.jpg", "test/samples/blank3.jpg", "test/samples/blank4.jpg", "test/samples/blank5.jpg", "test/samples/blank6.jpg", "test/samples/blank7.jpg", "test/samples/blank8.jpg", "test/samples/blank9.jpg", "test/samples/cat.jpg", "test/samples/chessboard.jpg", "test/samples/contours.jpg", "test/samples/fruits.jpg", "test/samples/haarcascade_frontalface_alt.xml.gz", "test/samples/inpaint-mask.bmp", "test/samples/lena-256x256.jpg", "test/samples/lena-32x32.jpg", "test/samples/lena-eyes.jpg", "test/samples/lena-inpaint.jpg", "test/samples/lena.jpg", "test/samples/lines.jpg", "test/samples/messy0.jpg", "test/samples/messy1.jpg", "test/samples/movie_sample.avi", "test/samples/one_way_train_0000.jpg", "test/samples/one_way_train_0001.jpg", "test/samples/partially_blank0.jpg", "test/samples/partially_blank1.jpg", "test/samples/smooth0.jpg", "test/samples/smooth1.jpg", "test/samples/smooth2.jpg", "test/samples/smooth3.jpg", "test/samples/smooth4.jpg", "test/samples/smooth5.jpg", "test/samples/smooth6.jpg", "test/samples/str-cv-rotated.jpg", "test/samples/str-cv.jpg", "test/samples/str-ov.jpg", "test/samples/stuff.jpg", "test/test_curve.rb", "test/test_cvavgcomp.rb", "test/test_cvbox2d.rb", "test/test_cvcapture.rb", "test/test_cvchain.rb", "test/test_cvcircle32f.rb", "test/test_cvconnectedcomp.rb", "test/test_cvcontour.rb", "test/test_cvcontourtree.rb", "test/test_cverror.rb", "test/test_cvfeaturetree.rb", "test/test_cvfont.rb", "test/test_cvhaarclassifiercascade.rb", "test/test_cvhistogram.rb", "test/test_cvhumoments.rb", "test/test_cvline.rb", "test/test_cvmat.rb", "test/test_cvmat_drawing.rb", "test/test_cvmat_dxt.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvmat_matching.rb", "test/test_cvmoments.rb", "test/test_cvpoint.rb", "test/test_cvpoint2d32f.rb", "test/test_cvpoint3d32f.rb", "test/test_cvrect.rb", "test/test_cvscalar.rb", "test/test_cvseq.rb", "test/test_cvsize.rb", "test/test_cvsize2d32f.rb", "test/test_cvslice.rb", "test/test_cvsurfparams.rb", "test/test_cvsurfpoint.rb", "test/test_cvtermcriteria.rb", "test/test_cvtwopoints.rb", "test/test_cvvideowriter.rb", "test/test_iplconvkernel.rb", "test/test_iplimage.rb", "test/test_mouseevent.rb", "test/test_opencv.rb", "test/test_pointset.rb", "test/test_preliminary.rb", "test/test_trackbar.rb", "test/test_window.rb"]
15
- s.homepage = "https://github.com/ruby-opencv/ruby-opencv/"
16
- s.rdoc_options = ["--main", "README.rdoc"]
17
- s.require_paths = ["lib"]
18
- s.rubyforge_project = "ruby-opencv"
19
- s.rubygems_version = "1.8.23"
20
- s.summary = "OpenCV wrapper for Ruby"
21
- s.test_files = ["test/test_curve.rb", "test/test_cvavgcomp.rb", "test/test_cvbox2d.rb", "test/test_cvcapture.rb", "test/test_cvchain.rb", "test/test_cvcircle32f.rb", "test/test_cvconnectedcomp.rb", "test/test_cvcontour.rb", "test/test_cvcontourtree.rb", "test/test_cverror.rb", "test/test_cvfeaturetree.rb", "test/test_cvfont.rb", "test/test_cvhaarclassifiercascade.rb", "test/test_cvhistogram.rb", "test/test_cvhumoments.rb", "test/test_cvline.rb", "test/test_cvmat.rb", "test/test_cvmat_drawing.rb", "test/test_cvmat_dxt.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvmat_matching.rb", "test/test_cvmoments.rb", "test/test_cvpoint.rb", "test/test_cvpoint2d32f.rb", "test/test_cvpoint3d32f.rb", "test/test_cvrect.rb", "test/test_cvscalar.rb", "test/test_cvseq.rb", "test/test_cvsize.rb", "test/test_cvsize2d32f.rb", "test/test_cvslice.rb", "test/test_cvsurfparams.rb", "test/test_cvsurfpoint.rb", "test/test_cvtermcriteria.rb", "test/test_cvtwopoints.rb", "test/test_cvvideowriter.rb", "test/test_iplconvkernel.rb", "test/test_iplimage.rb", "test/test_mouseevent.rb", "test/test_opencv.rb", "test/test_pointset.rb", "test/test_preliminary.rb", "test/test_trackbar.rb", "test/test_window.rb"]
22
-
23
- if s.respond_to? :specification_version then
24
- s.specification_version = 3
25
-
26
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
27
- s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
28
- s.add_development_dependency(%q<rake-compiler>, [">= 0"])
29
- s.add_development_dependency(%q<hoe-gemspec>, [">= 0"])
30
- s.add_development_dependency(%q<hoe>, ["~> 3.5"])
31
- else
32
- s.add_dependency(%q<rdoc>, ["~> 3.10"])
33
- s.add_dependency(%q<rake-compiler>, [">= 0"])
34
- s.add_dependency(%q<hoe-gemspec>, [">= 0"])
35
- s.add_dependency(%q<hoe>, ["~> 3.5"])
36
- end
37
- else
38
- s.add_dependency(%q<rdoc>, ["~> 3.10"])
39
- s.add_dependency(%q<rake-compiler>, [">= 0"])
40
- s.add_dependency(%q<hoe-gemspec>, [">= 0"])
41
- s.add_dependency(%q<hoe>, ["~> 3.5"])
42
- end
43
- end
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "ruby-opencv"
5
+ s.version = "0.0.9.pre2.20130505044041"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["lsxi", "ser1zw", "pcting"]
9
+ s.date = "2013-05-04"
10
+ 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."
11
+ s.email = ["masakazu.yonekura@gmail.com", "azariahsawtikes@gmail.com", "pcting@gmail.com"]
12
+ s.extensions = ["ext/opencv/extconf.rb"]
13
+ s.extra_rdoc_files = ["DEVELOPERS_NOTE.md", "History.txt", "License.txt", "Manifest.txt", "README.md", "examples/matching_to_many_images/train/trainImages.txt"]
14
+ s.files = [".gitignore", "DEVELOPERS_NOTE.md", "Gemfile", "History.txt", "License.txt", "Manifest.txt", "README.md", "Rakefile", "config.yml", "examples/alpha_blend.rb", "examples/box.png", "examples/box_in_scene.png", "examples/contours/bitmap-contours-with-labels.png", "examples/contours/bitmap-contours.png", "examples/contours/bounding-box-detect-canny.rb", "examples/contours/contour_retrieval_modes.rb", "examples/contours/rotated-boxes.jpg", "examples/convexhull.rb", "examples/face_detect.rb", "examples/find_obj.rb", "examples/houghcircle.rb", "examples/inpaint.png", "examples/inpaint.rb", "examples/lenna-rotated.jpg", "examples/lenna.jpg", "examples/match_kdtree.rb", "examples/matching_to_many_images.rb", "examples/matching_to_many_images/query.png", "examples/matching_to_many_images/train/1.png", "examples/matching_to_many_images/train/2.png", "examples/matching_to_many_images/train/3.png", "examples/matching_to_many_images/train/trainImages.txt", "examples/paint.rb", "examples/snake.rb", "examples/stuff.jpg", "examples/tiffany.jpg", "ext/opencv/curve.cpp", "ext/opencv/curve.h", "ext/opencv/cvavgcomp.cpp", "ext/opencv/cvavgcomp.h", "ext/opencv/cvbox2d.cpp", "ext/opencv/cvbox2d.h", "ext/opencv/cvcapture.cpp", "ext/opencv/cvcapture.h", "ext/opencv/cvchain.cpp", "ext/opencv/cvchain.h", "ext/opencv/cvcircle32f.cpp", "ext/opencv/cvcircle32f.h", "ext/opencv/cvcondensation.cpp", "ext/opencv/cvcondensation.h", "ext/opencv/cvconnectedcomp.cpp", "ext/opencv/cvconnectedcomp.h", "ext/opencv/cvcontour.cpp", "ext/opencv/cvcontour.h", "ext/opencv/cvcontourtree.cpp", "ext/opencv/cvcontourtree.h", "ext/opencv/cvconvexitydefect.cpp", "ext/opencv/cvconvexitydefect.h", "ext/opencv/cverror.cpp", "ext/opencv/cverror.h", "ext/opencv/cvfeaturetree.cpp", "ext/opencv/cvfeaturetree.h", "ext/opencv/cvfont.cpp", "ext/opencv/cvfont.h", "ext/opencv/cvhaarclassifiercascade.cpp", "ext/opencv/cvhaarclassifiercascade.h", "ext/opencv/cvhistogram.cpp", "ext/opencv/cvhistogram.h", "ext/opencv/cvhumoments.cpp", "ext/opencv/cvhumoments.h", "ext/opencv/cvline.cpp", "ext/opencv/cvline.h", "ext/opencv/cvmat.cpp", "ext/opencv/cvmat.h", "ext/opencv/cvmatnd.cpp", "ext/opencv/cvmatnd.h", "ext/opencv/cvmemstorage.cpp", "ext/opencv/cvmemstorage.h", "ext/opencv/cvmoments.cpp", "ext/opencv/cvmoments.h", "ext/opencv/cvpoint.cpp", "ext/opencv/cvpoint.h", "ext/opencv/cvpoint2d32f.cpp", "ext/opencv/cvpoint2d32f.h", "ext/opencv/cvpoint3d32f.cpp", "ext/opencv/cvpoint3d32f.h", "ext/opencv/cvrect.cpp", "ext/opencv/cvrect.h", "ext/opencv/cvscalar.cpp", "ext/opencv/cvscalar.h", "ext/opencv/cvseq.cpp", "ext/opencv/cvseq.h", "ext/opencv/cvsize.cpp", "ext/opencv/cvsize.h", "ext/opencv/cvsize2d32f.cpp", "ext/opencv/cvsize2d32f.h", "ext/opencv/cvslice.cpp", "ext/opencv/cvslice.h", "ext/opencv/cvsparsemat.cpp", "ext/opencv/cvsparsemat.h", "ext/opencv/cvsurfparams.cpp", "ext/opencv/cvsurfparams.h", "ext/opencv/cvsurfpoint.cpp", "ext/opencv/cvsurfpoint.h", "ext/opencv/cvtermcriteria.cpp", "ext/opencv/cvtermcriteria.h", "ext/opencv/cvtwopoints.cpp", "ext/opencv/cvtwopoints.h", "ext/opencv/cvutils.cpp", "ext/opencv/cvutils.h", "ext/opencv/cvvideowriter.cpp", "ext/opencv/cvvideowriter.h", "ext/opencv/extconf.rb", "ext/opencv/gui.cpp", "ext/opencv/gui.h", "ext/opencv/iplconvkernel.cpp", "ext/opencv/iplconvkernel.h", "ext/opencv/iplimage.cpp", "ext/opencv/iplimage.h", "ext/opencv/mouseevent.cpp", "ext/opencv/mouseevent.h", "ext/opencv/opencv.cpp", "ext/opencv/opencv.h", "ext/opencv/pointset.cpp", "ext/opencv/pointset.h", "ext/opencv/trackbar.cpp", "ext/opencv/trackbar.h", "ext/opencv/window.cpp", "ext/opencv/window.h", "images/CvMat_sobel.png", "images/CvMat_sub_rect.png", "images/CvSeq_relationmap.png", "images/face_detect_from_lena.jpg", "lib/opencv.rb", "lib/opencv/psyched_yaml.rb", "lib/opencv/version.rb", "ruby-opencv.gemspec", "test/helper.rb", "test/runner.rb", "test/samples/airplane.jpg", "test/samples/baboon.jpg", "test/samples/baboon200.jpg", "test/samples/baboon200_rotated.jpg", "test/samples/blank0.jpg", "test/samples/blank1.jpg", "test/samples/blank2.jpg", "test/samples/blank3.jpg", "test/samples/blank4.jpg", "test/samples/blank5.jpg", "test/samples/blank6.jpg", "test/samples/blank7.jpg", "test/samples/blank8.jpg", "test/samples/blank9.jpg", "test/samples/cat.jpg", "test/samples/chessboard.jpg", "test/samples/contours.jpg", "test/samples/fruits.jpg", "test/samples/haarcascade_frontalface_alt.xml.gz", "test/samples/inpaint-mask.bmp", "test/samples/lena-256x256.jpg", "test/samples/lena-32x32.jpg", "test/samples/lena-eyes.jpg", "test/samples/lena-inpaint.jpg", "test/samples/lena.jpg", "test/samples/lines.jpg", "test/samples/messy0.jpg", "test/samples/messy1.jpg", "test/samples/movie_sample.avi", "test/samples/one_way_train_0000.jpg", "test/samples/one_way_train_0001.jpg", "test/samples/partially_blank0.jpg", "test/samples/partially_blank1.jpg", "test/samples/smooth0.jpg", "test/samples/smooth1.jpg", "test/samples/smooth2.jpg", "test/samples/smooth3.jpg", "test/samples/smooth4.jpg", "test/samples/smooth5.jpg", "test/samples/smooth6.jpg", "test/samples/str-cv-rotated.jpg", "test/samples/str-cv.jpg", "test/samples/str-ov.jpg", "test/samples/stuff.jpg", "test/test_curve.rb", "test/test_cvavgcomp.rb", "test/test_cvbox2d.rb", "test/test_cvcapture.rb", "test/test_cvchain.rb", "test/test_cvcircle32f.rb", "test/test_cvconnectedcomp.rb", "test/test_cvcontour.rb", "test/test_cvcontourtree.rb", "test/test_cverror.rb", "test/test_cvfeaturetree.rb", "test/test_cvfont.rb", "test/test_cvhaarclassifiercascade.rb", "test/test_cvhistogram.rb", "test/test_cvhumoments.rb", "test/test_cvline.rb", "test/test_cvmat.rb", "test/test_cvmat_drawing.rb", "test/test_cvmat_dxt.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvmat_matching.rb", "test/test_cvmoments.rb", "test/test_cvpoint.rb", "test/test_cvpoint2d32f.rb", "test/test_cvpoint3d32f.rb", "test/test_cvrect.rb", "test/test_cvscalar.rb", "test/test_cvseq.rb", "test/test_cvsize.rb", "test/test_cvsize2d32f.rb", "test/test_cvslice.rb", "test/test_cvsurfparams.rb", "test/test_cvsurfpoint.rb", "test/test_cvtermcriteria.rb", "test/test_cvtwopoints.rb", "test/test_cvvideowriter.rb", "test/test_iplconvkernel.rb", "test/test_iplimage.rb", "test/test_mouseevent.rb", "test/test_opencv.rb", "test/test_pointset.rb", "test/test_preliminary.rb", "test/test_trackbar.rb", "test/test_window.rb"]
15
+ s.homepage = "https://github.com/ruby-opencv/ruby-opencv/"
16
+ s.licenses = ["The BSD License"]
17
+ s.rdoc_options = ["--main", "README.md"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = "ruby-opencv"
20
+ s.rubygems_version = "2.0.3"
21
+ s.summary = "OpenCV wrapper for Ruby"
22
+ s.test_files = ["test/test_cvhistogram.rb", "test/test_cvconnectedcomp.rb", "test/test_mouseevent.rb", "test/test_opencv.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvmat.rb", "test/test_cvfeaturetree.rb", "test/test_iplconvkernel.rb", "test/test_cvchain.rb", "test/test_cvmat_drawing.rb", "test/test_cvpoint.rb", "test/test_trackbar.rb", "test/test_cvsize2d32f.rb", "test/test_cvsurfparams.rb", "test/test_cvscalar.rb", "test/test_cverror.rb", "test/test_cvhumoments.rb", "test/test_iplimage.rb", "test/test_cvslice.rb", "test/test_cvtwopoints.rb", "test/test_cvfont.rb", "test/test_cvseq.rb", "test/test_cvcontour.rb", "test/test_curve.rb", "test/test_cvsize.rb", "test/test_window.rb", "test/test_cvbox2d.rb", "test/test_cvpoint2d32f.rb", "test/test_cvcapture.rb", "test/test_pointset.rb", "test/test_cvcontourtree.rb", "test/test_cvavgcomp.rb", "test/test_cvsurfpoint.rb", "test/test_cvrect.rb", "test/test_cvline.rb", "test/test_cvvideowriter.rb", "test/test_cvpoint3d32f.rb", "test/test_cvmat_matching.rb", "test/test_cvcircle32f.rb", "test/test_preliminary.rb", "test/test_cvmat_dxt.rb", "test/test_cvmoments.rb", "test/test_cvtermcriteria.rb", "test/test_cvhaarclassifiercascade.rb"]
23
+
24
+ if s.respond_to? :specification_version then
25
+ s.specification_version = 4
26
+
27
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
+ s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
29
+ s.add_development_dependency(%q<rake-compiler>, [">= 0"])
30
+ s.add_development_dependency(%q<hoe-gemspec>, [">= 0"])
31
+ s.add_development_dependency(%q<hoe>, ["~> 3.6"])
32
+ else
33
+ s.add_dependency(%q<rdoc>, ["~> 4.0"])
34
+ s.add_dependency(%q<rake-compiler>, [">= 0"])
35
+ s.add_dependency(%q<hoe-gemspec>, [">= 0"])
36
+ s.add_dependency(%q<hoe>, ["~> 3.6"])
37
+ end
38
+ else
39
+ s.add_dependency(%q<rdoc>, ["~> 4.0"])
40
+ s.add_dependency(%q<rake-compiler>, [">= 0"])
41
+ s.add_dependency(%q<hoe-gemspec>, [">= 0"])
42
+ s.add_dependency(%q<hoe>, ["~> 3.6"])
43
+ end
44
+ end
data/test/helper.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # -*- mode: ruby; coding: utf-8-unix -*-
2
+ # -*- mode: ruby; coding: utf-8 -*-
3
3
  require 'test/unit'
4
4
  require 'digest/md5'
5
5
  require 'opencv'
data/test/runner.rb CHANGED
@@ -1,30 +1,30 @@
1
- #!/usr/bin/env ruby
2
- # -*- mode: ruby; coding: utf-8-unix -*-
3
- require 'test/unit'
4
-
5
- src_testdir = File.dirname(File.expand_path(__FILE__))
6
- if Test::Unit.methods.include? :setup_argv
7
- srcdir = File.dirname(src_testdir)
8
- Test::Unit.setup_argv {|files|
9
- if files.empty?
10
- [src_testdir]
11
- else
12
- files.map {|f|
13
- if File.exist? "#{src_testdir}/#{f}"
14
- "#{src_testdir}/#{f}"
15
- elsif File.exist? "#{srcdir}/#{f}"
16
- "#{srcdir}/#{f}"
17
- elsif File.exist? f
18
- f
19
- else
20
- raise ArgumentError, "not found: #{f}"
21
- end
22
- }
23
- end
24
- }
25
- elsif Test::Unit.constants.map {|c| c.to_sym }.include? :AutoRunner
26
- Test::Unit::AutoRunner.run(true, src_testdir)
27
- else
28
- raise 'Test runner not found'
29
- end
30
-
1
+ #!/usr/bin/env ruby
2
+ # -*- mode: ruby; coding: utf-8 -*-
3
+ require 'test/unit'
4
+
5
+ src_testdir = File.dirname(File.expand_path(__FILE__))
6
+ if Test::Unit.methods.include? :setup_argv
7
+ srcdir = File.dirname(src_testdir)
8
+ Test::Unit.setup_argv {|files|
9
+ if files.empty?
10
+ [src_testdir]
11
+ else
12
+ files.map {|f|
13
+ if File.exist? "#{src_testdir}/#{f}"
14
+ "#{src_testdir}/#{f}"
15
+ elsif File.exist? "#{srcdir}/#{f}"
16
+ "#{srcdir}/#{f}"
17
+ elsif File.exist? f
18
+ f
19
+ else
20
+ raise ArgumentError, "not found: #{f}"
21
+ end
22
+ }
23
+ end
24
+ }
25
+ elsif Test::Unit.constants.map {|c| c.to_sym }.include? :AutoRunner
26
+ Test::Unit::AutoRunner.run(true, src_testdir)
27
+ else
28
+ raise 'Test runner not found'
29
+ end
30
+
data/test/test_curve.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # -*- mode: ruby; coding: utf-8-unix -*-
2
+ # -*- mode: ruby; coding: utf-8 -*-
3
3
  require 'test/unit'
4
4
  require 'opencv'
5
5
  require File.expand_path(File.dirname(__FILE__)) + '/helper'
@@ -1,24 +1,24 @@
1
- #!/usr/bin/env ruby
2
- # -*- mode: ruby; coding: utf-8-unix -*-
3
- require 'test/unit'
4
- require 'opencv'
5
- require File.expand_path(File.dirname(__FILE__)) + '/helper'
6
-
7
- include OpenCV
8
-
9
- # Tests for OpenCV::CvAvgComp
10
- class TestCvAvgComp < OpenCVTestCase
11
- def setup
12
- @avgcomp = CvAvgComp.new
13
- end
14
-
15
- def test_initialize
16
- assert_equal(CvAvgComp, @avgcomp.class)
17
- assert(@avgcomp.is_a? CvRect)
18
- end
19
-
20
- def test_neighbors
21
- assert_equal(Fixnum, @avgcomp.neighbors.class)
22
- end
23
- end
24
-
1
+ #!/usr/bin/env ruby
2
+ # -*- mode: ruby; coding: utf-8 -*-
3
+ require 'test/unit'
4
+ require 'opencv'
5
+ require File.expand_path(File.dirname(__FILE__)) + '/helper'
6
+
7
+ include OpenCV
8
+
9
+ # Tests for OpenCV::CvAvgComp
10
+ class TestCvAvgComp < OpenCVTestCase
11
+ def setup
12
+ @avgcomp = CvAvgComp.new
13
+ end
14
+
15
+ def test_initialize
16
+ assert_equal(CvAvgComp, @avgcomp.class)
17
+ assert(@avgcomp.is_a? CvRect)
18
+ end
19
+
20
+ def test_neighbors
21
+ assert_equal(Fixnum, @avgcomp.neighbors.class)
22
+ end
23
+ end
24
+
data/test/test_cvbox2d.rb CHANGED
@@ -1,76 +1,76 @@
1
- #!/usr/bin/env ruby
2
- # -*- mode: ruby; coding: utf-8-unix -*-
3
- require 'test/unit'
4
- require 'opencv'
5
- require File.expand_path(File.dirname(__FILE__)) + '/helper'
6
-
7
- include OpenCV
8
-
9
- # Tests for OpenCV::CvBox2D
10
- class TestCvBox2D < OpenCVTestCase
11
- class MyPoint; end
12
- def test_initialize
13
- box = CvBox2D.new
14
- assert_in_delta(0, box.center.x, 0.001)
15
- assert_in_delta(0, box.center.y, 0.001)
16
- assert_in_delta(0, box.size.width, 0.001)
17
- assert_in_delta(0, box.size.height, 0.001)
18
- assert_in_delta(0, box.angle, 0.001)
19
-
20
- box = CvBox2D.new(CvPoint2D32f.new(1.1, 2.2), CvSize2D32f.new(3.3, 4.4), 5.5)
21
- assert_in_delta(1.1, box.center.x, 0.001)
22
- assert_in_delta(2.2, box.center.y, 0.001)
23
- assert_in_delta(3.3, box.size.width, 0.001)
24
- assert_in_delta(4.4, box.size.height, 0.001)
25
- assert_in_delta(5.5, box.angle, 0.001)
26
- end
27
-
28
- def test_center
29
- box = CvBox2D.new
30
- box.center = CvPoint2D32f.new(1.1, 2.2)
31
- assert_in_delta(1.1, box.center.x, 0.001)
32
- assert_in_delta(2.2, box.center.y, 0.001)
33
-
34
- box.center.x = 3.3
35
- box.center.y = 4.4
36
- assert_in_delta(3.3, box.center.x, 0.001)
37
- assert_in_delta(4.4, box.center.y, 0.001)
38
- end
39
-
40
- def test_size
41
- box = CvBox2D.new
42
- box.size = CvSize2D32f.new(1.1, 2.2)
43
- assert_in_delta(1.1, box.size.width, 0.001)
44
- assert_in_delta(2.2, box.size.height, 0.001)
45
-
46
- box.size.width = 3.3
47
- box.size.height = 4.4
48
- assert_in_delta(3.3, box.size.width, 0.001)
49
- assert_in_delta(4.4, box.size.height, 0.001)
50
- end
51
-
52
- def test_angle
53
- box = CvBox2D.new
54
- box.angle = 1.1
55
- assert_in_delta(1.1, box.angle, 0.001)
56
- end
57
-
58
- def test_points
59
- box = CvBox2D.new
60
- box.center = CvPoint2D32f.new(10, 20)
61
- box.size = CvSize2D32f.new(5, 7)
62
- pt = box.points
63
-
64
- assert_equal(4, pt.size)
65
- assert_in_delta(7.5, pt[0].x, 0.001)
66
- assert_in_delta(23.5, pt[0].y, 0.001)
67
- assert_in_delta(7.5, pt[1].x, 0.001)
68
- assert_in_delta(16.5, pt[1].y, 0.001)
69
- assert_in_delta(12.5, pt[2].x, 0.001)
70
- assert_in_delta(16.5, pt[2].y, 0.001)
71
- assert_in_delta(12.5, pt[3].x, 0.001)
72
- assert_in_delta(23.5, pt[3].y, 0.001)
73
- end
74
- end
75
-
76
-
1
+ #!/usr/bin/env ruby
2
+ # -*- mode: ruby; coding: utf-8 -*-
3
+ require 'test/unit'
4
+ require 'opencv'
5
+ require File.expand_path(File.dirname(__FILE__)) + '/helper'
6
+
7
+ include OpenCV
8
+
9
+ # Tests for OpenCV::CvBox2D
10
+ class TestCvBox2D < OpenCVTestCase
11
+ class MyPoint; end
12
+ def test_initialize
13
+ box = CvBox2D.new
14
+ assert_in_delta(0, box.center.x, 0.001)
15
+ assert_in_delta(0, box.center.y, 0.001)
16
+ assert_in_delta(0, box.size.width, 0.001)
17
+ assert_in_delta(0, box.size.height, 0.001)
18
+ assert_in_delta(0, box.angle, 0.001)
19
+
20
+ box = CvBox2D.new(CvPoint2D32f.new(1.1, 2.2), CvSize2D32f.new(3.3, 4.4), 5.5)
21
+ assert_in_delta(1.1, box.center.x, 0.001)
22
+ assert_in_delta(2.2, box.center.y, 0.001)
23
+ assert_in_delta(3.3, box.size.width, 0.001)
24
+ assert_in_delta(4.4, box.size.height, 0.001)
25
+ assert_in_delta(5.5, box.angle, 0.001)
26
+ end
27
+
28
+ def test_center
29
+ box = CvBox2D.new
30
+ box.center = CvPoint2D32f.new(1.1, 2.2)
31
+ assert_in_delta(1.1, box.center.x, 0.001)
32
+ assert_in_delta(2.2, box.center.y, 0.001)
33
+
34
+ box.center.x = 3.3
35
+ box.center.y = 4.4
36
+ assert_in_delta(3.3, box.center.x, 0.001)
37
+ assert_in_delta(4.4, box.center.y, 0.001)
38
+ end
39
+
40
+ def test_size
41
+ box = CvBox2D.new
42
+ box.size = CvSize2D32f.new(1.1, 2.2)
43
+ assert_in_delta(1.1, box.size.width, 0.001)
44
+ assert_in_delta(2.2, box.size.height, 0.001)
45
+
46
+ box.size.width = 3.3
47
+ box.size.height = 4.4
48
+ assert_in_delta(3.3, box.size.width, 0.001)
49
+ assert_in_delta(4.4, box.size.height, 0.001)
50
+ end
51
+
52
+ def test_angle
53
+ box = CvBox2D.new
54
+ box.angle = 1.1
55
+ assert_in_delta(1.1, box.angle, 0.001)
56
+ end
57
+
58
+ def test_points
59
+ box = CvBox2D.new
60
+ box.center = CvPoint2D32f.new(10, 20)
61
+ box.size = CvSize2D32f.new(5, 7)
62
+ pt = box.points
63
+
64
+ assert_equal(4, pt.size)
65
+ assert_in_delta(7.5, pt[0].x, 0.001)
66
+ assert_in_delta(23.5, pt[0].y, 0.001)
67
+ assert_in_delta(7.5, pt[1].x, 0.001)
68
+ assert_in_delta(16.5, pt[1].y, 0.001)
69
+ assert_in_delta(12.5, pt[2].x, 0.001)
70
+ assert_in_delta(16.5, pt[2].y, 0.001)
71
+ assert_in_delta(12.5, pt[3].x, 0.001)
72
+ assert_in_delta(23.5, pt[3].y, 0.001)
73
+ end
74
+ end
75
+
76
+