How to overlay randomized point grid on photo?

4 Ansichten (letzte 30 Tage)
Harriet Minc
Harriet Minc am 18 Okt. 2017
Kommentiert: Cedric am 21 Okt. 2017
I need to take a randomized point grid with the code:
x=rand(1,50)*5
y=rand(1,50)*5
scatter(x,y)
And overlay it onto a picture. I am not sure if this can be done or how to do it? Any help would be appreciated!
  1 Kommentar
Jonathan Chin
Jonathan Chin am 18 Okt. 2017
im=imread('peppers.png');
imshow(im);
hold on
x=rand(1,50)*512
y=rand(1,50)*384
scatter(x,y)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Cedric
Cedric am 18 Okt. 2017
Bearbeitet: Cedric am 18 Okt. 2017
I = imread( 'MyImage.png' ) ;
x = rand( 1, 50 ) * size( I, 2 ) ;
y = rand( 1, 50 ) * size( I, 1 ) ;
imshow( I ) ;
hold on ;
scatter( x, y ) ;
  1 Kommentar
Cedric
Cedric am 21 Okt. 2017
Is this answer working for you? If so please [Accept it]. If not, I am happy to provide more information.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by