Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to use imshow when png is loaded in memory

My program receives PNG buffers from TCP connection. I have an unsigned character pointer to the PNG file. I want to show the PNG image with imshow as they are received (i.e. sort of a video stream of PNG images).

So far I am not able to achieve this since imshow wants a cv::mat and I don't know how to convert from uchar * (png raw file data) to cv::mat.

Thank you.