How Matlab coder convert the image to unsinged char
Show older comments
good day
I am working with matlab Coder which convert a image function to c++ code. the function looks something like this array=findsomething(I); where I is an image has been read with the function Imread. the result code in c++ code which has emxArray_uint8_T which looks like this struct emxArray_uint8_T { unsigned char *data; int *size; int allocatedSize; int numDimensions; boolean_T canFreeData; }; the data from the image should be a stream in unsigned char *data,i can read an image from OpenCV but i need to convert the image type from Mat to unsighed char, i have already read http://www.mathworks.com/help/matlab/matlab_external/matlab-data.html#f22019 but i dont know which comes first red blue or green,and if red should i start with coloms or rows? can someone help
Accepted Answer
More Answers (1)
Saipraveen
on 30 Sep 2019
0 votes
Answering for other users, I have created a file exchange file that converts image to a c/c++ array file that could be used. https://www.mathworks.com/matlabcentral/fileexchange/72535-image-to-c-c-array-converter.
Categories
Find more on MATLAB Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!