I had to create a system that can process images in realtime. I have implemented in C++ a pixel format conversion system that can also do some simple transformation (currently: rotation & mirroring).
Input/output format of the system are frame in a the following formats:
- RGB (24, 32)
- YUYV420, YUYV 422
- JPEG
- Raw greyscale
For instance, one operation can be:
- YUYV422 -> rotation 90 -> flip Horiz -> RGB24
- Greyscale -> rotation 270 -> flip Vert -> YUYV420
The goal of the system is to offer best performance for rotation/mirroring and pixel format conversion. My current implementation rely on OpenCV, but I suffer from performance issues when processing data above 2k resolutions.
The current implementation uses cv::Mat and cv::transpose/cv::flip/cv::cvtColor, and I optimized the system to remove transitionnal buffers and copy as much as possible.
Not very happy to reinvent the wheel, I know that using swscale and some filters from FFMpeg, it is possible to achieve the same result. My question are:
The FFMpeg system is rather generic, do you think I might suffer from footprint/performance caveat with this solution?
Format conversion seems somewhat ooptimized in OpenCV, but I have no idea about FFMpeg implementation... (note: I'm on x86_64 intel platform with SSE)
Do you know any library than can handle this kind of simple transformation for real time?
Thank you