AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Qimage one review3/29/2024 ![]() ![]() (Right) the messed-up result from the cv::Mat matImageROIīy exploring other issues regarding conversion between cv::Mat and QImage, it seems the stride becomes "non-standard" in some particular ROI sizes. (Middle) the expected result from the QImage and the QRect (which roughly corresponds to the green rectangle drawn by hand). The screenshot below illustrates the issue. Unsigned char* dataBuffer = imageROI.bits() Ĭv::Mat tempImage(cv::Size(imageROI.width(), imageROI.height()), CV_8UC1, dataBuffer, cv::Mat::AUTO_STEP) Ĭv::namedWindow( "openCV imshow() from a cv::Mat image", cv::WINDOW_AUTOSIZE ) Ĭv::imshow( "openCV imshow() from a cv::Mat image", tempImage) QImage imageInit(matImage.data, ls, matImage.rows, QImage::Format_Grayscale8) It is of type CV_8U and has a square size of 2048x2048 In what follows, my full-size image is the cv::Mat matImage. Surprisingly, everything work fine whenever the width and the height of the cv::Rect or the QRect are equal. ![]() The problem is symmetric, i.e, I cannot properly get the ROI by using a cv::Rect in a cv::Mat and creating a QImage out of the Mat. I cannot properly convert and/or display an ROI using a QRect in a QImage and create a cv::Mat image out of the QImage. ![]()
0 Comments
Read More
Leave a Reply. |