How to draw/change the color of 1 pixel in an image

I want to take an image into matlab and edit it by changing one pixel at a set of coordinates to a different color so as to identify points of interest on the image.
The plot function won't work as I am creating a video with a series of frames and implay.
Any help much appreciated

 Accepted Answer

rgbImage(row, column, :) = [r, g, b]; % r, g, b are uint8 values.
imshow(rgbImage);
drawnow; % Force it to paint right now

3 Comments

the above code is giving error as Undefined function or variable 'r'.
Error in fill1 (line 3) rgbImage(row, column, :) = [r, g, b]; % r, g, b are uint8 values.
how to resolve it??
If you're going to assign something, you have to have something to assign. What did you assign for r? Show me the line that says
r = 123; % or whatever value you need.
I don't think you'll find that line, therefore there is no r to assign. What do you think it should assign? Just make up something? That's probably no good. You should make that decision.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!