How to find the boundary pixel values round by round ?
1 view (last 30 days)
Show older comments
consider the two images below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163086/image.png)
The first image shows a damaged area of a image. By using the below code the boundary pixel values' co-ordinations can be found. Then I need to find the pixels of the inner rounds of the ROI's boundary one by one as mentioned in the second image in black again and again. How can I easily do that ?
rgbImage = imread('image.png');
redChannel = rgbImage(:, :, 1);
ZeroPlate = redChannel == 0;
for j = 1 : numberOfDamagedRegions
thisBoundary = boundaries{j};
x = thisBoundary(:, 1);
y = thisBoundary(:, 2);
for index = 1 : length(x)
row = x(index);
column = y(index);
ZeroPlate(row, column)=true;
end
end
0 Comments
Answers (0)
See Also
Categories
Find more on Computer Vision with Simulink 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!