Last active
February 25, 2016 23:20
-
-
Save matsadler/bca0e39ca0b1365b0bc1 to your computer and use it in GitHub Desktop.
ruby-opencv Invalid sequence error bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "opencv" | |
image = OpenCV::CvMat.new(100, 100, OpenCV::CV_8U, 1).fill(0) | |
image[50,50] = OpenCV::CvColor::White | |
def foo(image) | |
image.find_contours | |
end | |
100_000.times do |i| | |
object = [] | |
foo(image).first | |
end | |
# also encounters the same error, but takes longer | |
def foo(image) | |
image.find_contours | |
end | |
2_000_000.times {|i| foo(image).first} | |
# also encounters the same error | |
1_000_000.times do |i| | |
contours = image.find_contours | |
current = contours | |
current = current.h_next while current | |
contours.first | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "ruby-opencv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
ruby-opencv (0.0.14) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
ruby-opencv | |
BUNDLED WITH | |
1.10.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bug.rb:12:in `first': Invalid sequence error. (TypeError) | |
from bug.rb:12:in `block in <main>' | |
from bug.rb:10:in `times' | |
from bug.rb:10:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment