ropencv icon indicating copy to clipboard operation
ropencv copied to clipboard

trackbar not wrapped?

Open nurettin opened this issue 8 years ago • 2 comments

Hi, this is a great tool for teaching. Thanks for that.

I am unable to find a way to access the gui trackbar, is there a function for that? If not, how can I implement it ?

nurettin avatar Apr 03 '16 18:04 nurettin

I am encountering the same issue: in gems/ropencv-0.0.21/lib/ropencv/ropencv_types.rb I can see get_trackbar_pos and set_trackbar_pos but not createTrackbar. An issue with rbind filtering it based upon callback type ?

From the documentation it seems that none of this pointer are required, so in the end if it wasn't filtered, it could perhaps still be useful using get_trackbar_pos to get the value.

Is there any easy way to not filter it ?

yduf avatar Mar 25 '17 18:03 yduf

A workaround, to access the createTrasckbar function, by calling it trhough ffi;

require 'ffi'
module OpenCV
  extend FFI::Library
  ffi_lib 'libopencv_highgui.so'
  attach_function :cvCreateTrackbar, :cvCreateTrackbar,[ :string, :string, :pointer, :int, :pointer ], :int
end

Then it can be used as described above:

cv::namedWindow("LLines", 1);
cvCreateTrackbar( "trackbarname", "LLines", valuep = nil, count = 200, onChange=nil)
value = cv::getTrackbarPos( "trackbarname", "LLines")

yduf avatar Mar 25 '17 20:03 yduf