I need to use the getRectSubPix function in my code as part of a process of cropping an rotating a section of my image. This works fine normally with 3 channel images, but as soon as I try to use it with a BGRA or a RGBA mat image it crashes saying to me
OpenCV Error: Unsupported format or combination of formats () in cvGetRectSubPix, file /home/biotracking/Downloads/OpenCV-2.4.2/modules/imgproc/src/samplers.cpp, line 550
my code is basically like this
cv::cvtColor(polymask, polymask, CV_BGR2BGRA);
getRectSubPix(polymask, cv::Size(sqrt(biggestdistancesquared)*2,sqrt(biggestdistancesquared)*2), src_center, polymask);
If this function truly didn't work for Mats with alpha channels that seems crazy. Anybody know?