D-Alex / ropencv

ffi ruby wrapper for opencv
Other
67 stars 14 forks source link

Pixel by pixel processing #9

Closed nicholasjhenry closed 10 years ago

nicholasjhenry commented 10 years ago

What is the most efficient method for pixel by pixel processing/manipulation using ropencv? With the C++ interface this could be done use ptr function on Mat or an cv::Mat_<cv::Vec3b>::iterator. Thank you for you help.

D-Alex commented 10 years ago

The most efficient way would be to directly access the mat.data field via ffi and do the offset by yourself.

Usually, I write all algorithm in c++ and use rbind to generate ruby bindings which are compatible to ropencv (an example can be found here https://gitorious.org/rock-image-processing/frame_helper branch rbind). The only problem here is that rbind is still not finished and a bit cumbersome.

nicholasjhenry commented 10 years ago

I apologize for my late response! Thank you for that info -- very helpful.