Compress image to send between Notecards

I recently attended a Zoom call where I was told that there was a project by the team that used compression to implement image transfer between Notecards.

Could I get a link to that project.

What I would like to do is run image classification/detection on a Nicla Vision and then send a preview image with the inference info (bounding box, identification, confidence) via JSON from the Notecard to Notehub.

This would not be for continuous streaming. There would some logic to determine what to send.

I would like to use Notehub to be able to forward the image with notifications.

Hi Ralph,

Nice to meet you, and welcome back to the forum. You can find the project, named portal, on GitHub. Specifically, look at the code in send_to_notehub for compressing, encoding, and sending the image to the Notecard.

Try to keep the final encoded image data small. I try to keep it under 4k because if you get much bigger than that you’re going to quickly run into issues. I can’t give you an exact size limit, but just keep the images as small as possible especially if your device won’t be seeing consistent cell coverage and will be forced to queue up a few images while waiting to see good signal. See the TODO section of the on GitHub too.

I just did a small cleanup of the code for you but I don’t have a raspberry pi to test it on today. Thus, I apologize for any small syntax errors, but it should be 90% correct; it was run not too long ago.

Thanks, and keep the interesting questions coming,


1 Like

Hi Carl

Thanks a lot for the project links. I’m currently on a trip, but I’ll be back next week and hopefully will get a chance to try running your setup after Thanksgiving.

I took a look at the send_to_notehub function that you referenced and that’s very helpful. I’ll have to admit that I haven’t used the webp format before. I’ll see if I can replicate what you did using Raspberry Pi’s first.

For my specific project I’ll need to see if I can do the same on the Arduino Nicla Vision. Only issue that I anticipate is finding a webp encoder that I can run on it. I know that I can run Micropython, but not sure if the Pillow library has the same capability as regular Python. Otherwise, I think I see encoders that are written in C.

I’ll let you what I find when I try it out.