I’m writing a code that uses openCV, here is my Question the frame in openCV is in RGB color space, but I need it in YCbCr format, so I used I wrote this small code :
void PixelError::conversiontoYcbcr(cv::Mat rgbFrame){
cv::cvtColor(rgbFrame,frameycbcr, CV_RGB2YCrCb,0);
cv::Vec3f pixel = frameycbcr.at<cv::Vec3f>(row,col);
}
this was the example to get R and G adn B value but since I convert the frame I was hopping to get my values too, but I got an error in row and col and I don’t know which channel of the vector pixel represents my Y or Cb or CR values.
thanks in advance for your help
If your input RGB image is using 8 bits per channel, the result of cvtColor will also be of the type CV_8UC3. So you have to get your pixel with as a cv::Vec3b like so: