cv::Mat to QImage conversion

后端 未结 3 1011
说谎
说谎 2021-02-10 08:01

I\'ve found very similiar topic: how to convert an opencv cv::Mat to qimage , but it does not solve my problem.

I have function converting cv::Mat to QImage



        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-10 08:41

    The problem is that both the cv::Mat and QImage data isn't necessarily contiguous. New data rows in opencv start on a 32bit boundary (not sure about QImage - I think it's system dependant) so you can't copy a memeory block unless your rows happen to be exact multiples of 4bytes

    See How to output this 24 bit image in Qt

提交回复
热议问题