Hey, see if anyone can fix a problem I have. I add an example using the sample image 'cameraman.tif', the image of the real code is another one but to get an idea it works perfectly.
I need to highlight the detected outline, so what I came up with was to get the pixel coordinates and represent them on top of the image by saying that these points are thicker.
Also, I make a crop of the image and I need to show in the original image the crop rectangle used.
When I save it, I want the highlighted pixels to look white and the square to look any other color, for example red.
Do you have any ideas on how to make the image as tight as possible so that the white pixels look white and not black?
Translated with www.DeepL.com/Translator (free version)
I = imread('cameraman.tif');BW = edge(I,'canny');[J,rect2] = imcrop(BW);[r,c] = find ( BW == 1 );pP = [c r];f = figure;imshow(I)hold onplot(pP(:,1),pP(:,2),'.w','MarkerSize',5)rectangle('Position',rect2,'EdgeColor','red','LineWidth',3)print('TH.tif','-dtiff')
What i want to obtain
Related Question
- How to smooth / refine edges ?
- How to produce edge detected image
- How to draw a filled circle
- How to extract connected chains in canny edge image? Specifically asking, how would I extract connected chains when there are so many edges are available, so that I could come up with top 10 results (top 10 long edges).
- Issue with getframe and getimage commands while saving the image (image size mismatch).
Best Answer