Fastest method to convert IplImage IPL_DEPTH_32S to QImage Format_RGB32

前端 未结 3 657
失恋的感觉
失恋的感觉 2021-01-28 08:27

What is the fastest method to convert IplImage IPL_DEPTH_32S to QImage Format_RGB32?

I need to catch pictures from cam and show it on form with frequency 30 frames in se

3条回答
  •  旧巷少年郎
    2021-01-28 08:59

    IPL_DEPTH_32S is greyscale with a 32bit pixel - normally used for depth data rather than an actual 'image', if you are packign a colour image into check what the pixel ordering is.

    QImage::Format_ARGB32_Premultiplied is the fastest QImage format because its what the graphics card uses - note that the data order is actually BGRA and the A channel must be at least as large as the pixel, ie 255 if you don't want to use alpha.

    There is a RGB2BGRA and BGR2RGBA in cv::cvtColor()

提交回复
热议问题