Spresense Camera Examples
Is it possible to overwrite the captured image with "Hello World" and write it to the sd card?
Is there any solution? How do I do this?
You want to take a picture with the camera and instead of saving the picture in the sd card you want to save a text file with the text "Hello world"?
I haven't done anything like that and for what I researched online it might not be so easy to accomplish.
One thing to keep in mind is that you won't be able to use jpeg format since you will need to decode the picture and there will be not enough RAM.
There are no predefined functions to perform this task.. so you would need to find a library that does this and is small enough to work for microncontrollers.
You mentioned that you're using circuitpython, but I think you would have more luck moving to the sdk.
Here is one answer on stack overflow that might provide some insight:
They are recommending the Cimg library, which I haven't tried before.
I saw someone using it on a BeagleBone microcontroller, so maybe it works.
Also, if you tell me more details about your application and why you need to write text on your image, I might help you think of another option that is easier to implement.
In our application, we want to add date-time information and camera ID information on the picture. In this way, we will detect the pictures we have taken from different cameras.(We have to use more than one camera in our application.)
Probably Cimg could be a good try. However it seems like you will need un-compressed images in memory. So depending on the resolution on the images you take it will hardly be possible or at least large effort. A BeagleBone is has >100x more memory.
I would recommend to encode this information into the filename and let the import script (for example Python) write the information into the image. This is a very easy task for any PC or Linux based board.
If you want more information, write a metadata file with the same filename as the image.
That's a very good suggestion.