Hi,
I am trying to convert a program from MATLAB to C using the MATLAB Coder App. I have a lot of the code in the Image Processing Toolbox, one which will not convert using the Coder. I am trying to convert functions to the Computer Vision System Toolbox in order to convert it.
My current issue is with the function regionprops. I have a line of code as follows:
———————————————————
% Filter the red pixels with the intensity constraints
imgbw_red = imgbw_int & imgbw_red;% Remove small objects by erosion
se = strel('square',3);imgbw_red = imclose(imgbw_red,se);imgbw_red = imfill(imgbw_red,'holes');% Find objects in the binary image
redBlobs = bwconncomp(imgbw_red);% Compute blob properties
S = regionprops(redBlobs,'Centroid','PixelList','BoundingBox');
—————————————————————–
The original variables are images in binary form. I believe the bwconncomp function will be unnecessary if using the function vision.BlobAnalysis, but I am unsure of how to use this function to obtain a variable equivalent to the PixelList from regionprops. This output is a p-by-q matrix that specifies the locations of pixels in the region, in coordinates. If you could give me an example of how to make this change, I would appreciate it.
Jon
Best Answer