Drawing functions: Support antialiasing for CV_8UC4 (Feature #4300)
Description
Hi.
I'm working on porting highgui to Wayland. (http://wayland.freedesktop.org/)
Github pfpacket/opencv-wayland: https://github.com/pfpacket/opencv-wayland
It is rebased on commit 6a5f413f27cb4955e63277f13c055f88a90e633b "Merge tag '3.0.0-rc1'"
Yes, it works and basic functionalities are mostly implemented.
(I will not send a pull request to merge into the mainline though)
And now I am optimizing the performance.
The problem is the antialiasing of CV_8UC4 images.
Why do we need CV_8UC4 images?
Because the formats which any Wayland Compositors must support are XRGB8888 and ARGB8888.
The wayland documentation says, "All renderers should support argb8888 and xrgb8888 but any other formats are optional and may not be supported by the particular renderer in use."
(http://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_shm)
Currently, I create a image with CV_8UC3 and then, with CV_AA, I use drawing functions such as cv::line(), cv::putText() to draw widgets. e.g. titlebars, trackbars, image viewers.
Later write the image to the buffer, converting to XRGB8888.
This conversion takes very long time according to callgrind.
To improve performance, I want to use a cv::Mat with no conversions using the constructor:
Mat::Mat(Size size, int type, void* data, size_t step=AUTO_STEP)ΒΆ.
If a image is CV_8UC3, antialiasing works and no problems here.
But if a image is CV_8UC4, antialiasing doesn't work and the drawn widgets aren't beautiful.
Attached is a screenshot of a simple painter using my OpenCV wayland backend running on Weston.
Please support antialiasing for CV_8UC4.
Thank you.
History
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4975