Deal with grayscale images

Currently, the features are extracted in rrggbb format. However, my image is a grayscale image. Then how do I change the code. We are getting wrong outputs if I send one channeled image to the classifier.


what to change this part of the code to such that the classifier gives correct outputs. Below is the image for rrggbb format in hex. How to change it for grayscale format in hex?

Thank you

Hi @prarthana,

The Edge Impulse C++ library expects image input in 32-bit RGB format (where the first 8 bits of each pixel is 0) cast as a float: (float)00RRGGBB. If you are inputting grayscale images, you can copy the grayscale channel to each of the R, G, B channels, and it will work. See here for an example: ei-pico-visual-wake-words/main.cpp at 4a6f39cfa9b23f4e832c480f8c8c550498b14824 · ShawnHymel/ei-pico-visual-wake-words · GitHub