qt - How can I convert a QImage of format RGB32 to OpenCV::mat? -
i have qimage of format rgb32 when this:
cv::mat depthmat(depthimg.height(),depthimg.width(),cv_8uc3,(uchar*)depthimg.bits(),depthimg.bytesperline());
i image of left. supposed image on right.
okay! figured out! rgb32 has 8 bits of r, 8 bits of g, 8 bits of b , 8 bits of alpha. it's rgba. so, can use this:
cv::mat depthmat(depthimg.height(),depthimg.width(),cv_8uc4,(uchar*)depthimg.bits(),depthimg.bytesperline());
Comments
Post a Comment