0

Hey guys. Ive been having problems with something. Im trying to load a picture and put random dots on a square part of that image. Right now I got it to put dots on the whole image but I cant seem to get it to just a certain section of rows and columns. My code is the following:

img = imread('image.png','png');
[X,map] = rgb2ind(img,256);
i=randint(1,200,102720);
X(i)=54;
imshow(X,map);

This code will create 200 random white dots on the image.

Whenever I try to get a certain square section out of the image, it only shows that section and not the entire image. Any suggestions?? Thanks in advance

2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by Barefootsanders
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.