How to Process Image data when they are at Hex format (for embedded C applications)

조회 수: 2 (최근 30일)
I have a matlab code that is intended for embedded hardware. The matlab code is about Image Classification which will be deployed in STM32 (uC, not the Discovery board) using C code generator.
This is the simple block diagram of my architecture:
The image that will be captured by the camera in arduino is at [480, 640] pixels (RGB) which will be saved into the external shared flash memory. Then, the STM32 will retrieve the image in the shared flash memory which are at HEX format (jpg image).
My problem is that how can I process the Hex in my matlab generated C code such that it can resize the image and turn the image into grayscale.
I have found some code related to my problem but it is not intended for code generation in C.
If someone is knowledgeable on this, please help. Thanks!
  댓글 수: 4
Chandler Timm Doloriel
Chandler Timm Doloriel 2021년 2월 13일
편집: Chandler Timm Doloriel 2021년 2월 13일
@Walter Roberson Hi Sir. Thanks for your input. Let's say I saved the image in shared flash memory as a Hex (8-bit) and a real jpeg image which starts at 0xFF, 0xD8 and ends at 0xFF, 0xD9. How can then I use this data to be processed in matlab? for resizing to [32, 32] pixels and turning into greyscale.
Walter Roberson
Walter Roberson 2021년 2월 13일
https://www.file-recovery.com/jpg-signature-format.htm
Write the hex to a file as binary and imread the binary.
There are probably also Java methods.

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by