PS3EYEDriver
PS3EYEDriver copied to clipboard
debayer filter fails for vertically flipped images
// horz, vert
_cam->setFlip(false, false);

// horz, vert
_cam->setFlip(false, true);

The filter works correctly for horizontally flipped images.
This is likely because the pattern looks different upside-down.
G R G R G R
B G B G B G
G R G R G R
B G B G B G
@rovarma Thanks for your work on this! I'm updating https://github.com/bakercp/ofxPS3EyeGrabber/
Just a small followup for reference. Since opencv is a default included addon for openFrameworks I'm just using cv::demosaicing to do my conversions as it is hardware optimized, etc. For pixels with no vertical flip I use
if (_pixelFormat == OF_PIXELS_GRAY)
{
code = vFlip ? cv::COLOR_BayerRG2GRAY : cv::COLOR_BayerGB2GRAY;
}
else
{
The difference is just RG vs GB (the default debayering function in this library is hard-coded to GB). After choosing the right conversion type, I pass my pixels like this:
cv::demosaicing(ofxCv::toCv(_rawCameraPixels),
ofxCv::toCv(_pixels),
code);