change grayscale pixel color by xy coordinates
Ältere Kommentare anzeigen
I have a piece of code that returns the x and y coordinates of a rectangle that I draw on a grayscale image.
frameA=read('abc.jpg');
imshow(frameA);
H=imrect;
Position = wait(H);
Position contains [x y h w], where x,y = xy coordinates of top left corner of rectangle, h=rectangle height, w =rectangle width. So I have all the coordinates I need.
How can I use these coordinates to modify the color of the pixels in this rectangle?
If I use frameA(x,y) = 1 for instance, the x,y here corresponds to the indices of the pixels and not their spatial coordinates.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Blue finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!