Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. cv::Mat raw(640, 480, CV_8UC1, frame->buffer.data()); i'm unshure about bayer images, but CV_8UC1 would mean, that your input image has 1 channel only(gray). try CV_8UC3 (3 uchar channels) i think, you truncated it
  2. it's rows, cols there, not width height. (yes, happy here to confuse it evey 2nd time, too)
    so : cv::Mat raw(480,640, CV_8UC3, frame->buffer.data());
  3. BONUS: NO, that constructor only copies the pointer and sets up rows/cols and such, no deep copy, so careful with that!!. but you're safe here, since the following cvtColor() WILL alloc new space for the result image
  1. cv::Mat raw(640, 480, CV_8UC1, frame->buffer.data()); i'm unshure about bayer images, but CV_8UC1 would mean, that your input image has 1 channel only(gray). try CV_8UC3 (3 uchar channels) i think, you truncated it
  2. it's rows, cols there, not width height. (yes, happy here to confuse it evey 2nd time, too)
    so : cv::Mat raw(480,640, CV_8UC3, frame->buffer.data());
  3. BONUS: NO, that constructor only copies the pointer and sets up rows/cols and such, no deep copy, so careful with that!!. but you're safe here, since the following cvtColor() WILL alloc new space for the result imageimage. in other situations, when you're using such a constructor with a 'borrowed' pointer you'd want to clone() it