Hi!
I’m receiving grayscale pixel data from a thermal sensor over the serial port. It is transferred into a byte array and I now want to transform it into an image via image.image() to combine it with the onboard camera module. The problem is that I always get the “TypeError: ‘arg’ argument required”. Do I miss something?
And as a follow up. Is there a way to display an img in the IDE that isn’t the onboard camera snapshot? Like the image I created from external sensor data?
Hi!
As another follow up. As described, I’m using my rt1062 cam with an external thermal sensor. The problem I’m now facing is that the conversion of the serial data to an image is a bigger bottleneck than I anticipated and is somewhere around 3 fps for the conversion alone.
What would be the most efficient way of converting for maximizing frame rates?
My current approach looks like the following: 1. if uart.any():
num_bytes = uart.readinto(buffer)
2. convert pixel data to grayscale and to a bytearray
First, how fast are you receiving serial data? Second, how much data is there? If you’re trying to convert a 320x320 14-bit image to 8-bits grayscale or something using Python then this will be very slow.
If it’s an 8x8 thermal image then it would be fast.
Sr. I forgot to add them
Serial runs at 2 000 000.
At the moment, the pixel data over serial are values in deciKelvin with 4 digits per pixel.
Overall it’s an image with 2400 pixels.
For the conversion to grayscale I take the temperature range of interest and simply map the data to values between 0 and 255.