free hand drawing on photo matlab
4 views (last 30 days)
Show older comments
How can I draw freehand on photo opened by imshow
%a=imread('tree.jpg)
imshow(a);
%then how can i draw on tree photos as i wish??


As mentioned above, I would like to open a gray scale photos (left) and then want to draw on it by freehand (as shown in right). What command shall I use to allow me to draw on photo? Can anyone suggest me? Thanks.
0 Comments
Answers (3)
Image Analyst
on 23 May 2016
You might want to use Photoshop or Gimp.
3 Comments
Image Analyst
on 23 May 2016
You have to get a mask
mask = M.createMask;
Then for each color channel, set the value, like to 255:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Burn line into images
redChannel(mask) = 255;
greenChannel(mask) = 255;
blueChannel(mask) = 255;
% Recombine separate color channels into a single, true color RGB image.
rgbImage = cat(3, redChannel, greenChannel, blueChannel);
You can probably do it all in one line with bsxfun() but I don't know what it is.
See Also
Categories
Find more on Image Processing Toolbox 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!
