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

5 views (last 30 days)
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

Image Analyst
Image Analyst on 16 Apr 2014
rgbImage(row, column, :) = [r, g, b]; % r, g, b are uint8 values.
imshow(rgbImage);
drawnow; % Force it to paint right now
  3 Comments
Shivani Pahuja
Shivani Pahuja on 31 Jan 2017
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??
Image Analyst
Image Analyst on 31 Jan 2017
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)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!