spillai / numpy-opencv-converter

OpenCV <=> NumPy Converter using Boost::Python
BSD 2-Clause "Simplified" License
131 stars 52 forks source link

bug when ndims == 3? #1

Closed brodyh closed 8 years ago

brodyh commented 9 years ago

Hi Sudeep,

Is it safe to uncomment the code here for conversions from 3 dimensional numpy arrays? I needed it for converting RGB images to cv::Mat.

Thanks!

spillai commented 9 years ago

Yes, it's safe. Just make sure the size() is consistent with rows/cols. I recall it wasn't when I had it uncommented earlier. I'll try to fix it over the weekend, but meanwhile just uncomment and check the values of mat.size() and mat.rows/mat.cols before you access them.

sromberg commented 9 years ago

Do you a have a newer version that supports matrices with 3 channels such as color images?