Camera + UDP receiver.. Which functionalities to use?
-
Camera transfers part by part of JPEG file (2k or 4k of datagrams). Datagrams are received by UDP receiver (QUDPsocket) in an indefinite loop. By reading the start and end sequence I could extract and complete whole jpeg file of around 100Kbytes. (receiving and adding datagrams together). Then, probably by designing connect structure to signal GraphicsView when whole JPEG file is ready for further processing.
-
The problem is where to store such big array from received datagrams. Maybe QbytesArray could be used? A then how to put those pixels in QImage structure prepared for GraphicsView… Pixmap? Signals and slots are to be used for communication between objects.
-
The processing speed is a big issue. Is somehow possible to process one by one parts of Jpeg, before putting on GraphicsView as a whole ?
-
-
@Tamis2018 You could store the Jpeg data in a file and load it in QImage when it is ready: http://doc.qt.io/qt-5/qimage.html#QImage-8
You can construct a QImage using http://doc.qt.io/qt-5/qimage.html#fromData-1 -
Hi,
What kind of camera is it ?
On what OS are you running this ?
What are the image specifications ?
-
Unless it's a top secret product under NDA, can you give more details about that device ?
-
@SGaist
I do not know myself. The one who knows, he does not have time for me. What I was thinking about is two things:- That QbytesArrays are big about 1000000 bytes.... I am going to put this as signal which will notify system that whole jpeg has arrived and signal will have argument QByteArraywhile coresponding slot will take the array as an argument and from there use Qimage to draw image. Image should be redrawn no less 3 times in second.
- I am thinking about to use Qconcurent to separate indefinite UDP loop and Image drawing. I do not know whether that is neccessary for that?
-
Rather than Qt Concurrent you should rather use the Mandelbrot Example as a base for generating the QImage from your data.