QCamera capture 8bit gray scale and convert to rgb
-
Thanks for your prompt reply.
I can't change the resolution at which the sensor is capturing. It is a special sensor and I can't configure for lower resolution.
I have a test app that does the scaling by doing just that copy/scale (copying only the needed pixels to destination image buffer). The problem is that this is very slow process. It takes 0.6 seconds per frame. This doesn't work for my application this is the reason I was wondering if the scale and image conversion could be done by gpu. I can copy the frame from the camera to a buffer in memory but then I need to somehow hand over the buffer to the gpu and do the scaling/conversion there. -
So something like creating a texture from the image and then process it ?
-
Something like QOpenGLTexture ?
-
Before going further, what will you be using to display the image ? QtWidgets ? QtQuick ?
-
Then, IIRC, your image is already a texture or something similar if you are using QtQuick with the VideoOutput element.
-
I found this article: http://blog.qt.io/blog/2015/03/20/introducing-video-filters-in-qt-multimedia/
on video filters. I will give this a try.
I have another question though since I need to differentiate between preview and capture formats.
The sensor generates 8 bit gray for preview and then I need to switch to 16bit gray for capture.
How can this be done by the camera. I don't see an api to specify capture mode or preview mode. I could be wrong though. -
Does your camera provide an API for that ?