MATLAB Answers

0

how do i use the rand command in an array of an image, i want the program to read the image and draw some elements from that array

Asked by Felipe Koga on 12 Oct 2019
Latest activity Commented on by Felipe Koga on 19 Oct 2019
Como uso o comando rand em uma matriz de uma imagem? Quero que o programa leia a imagem e desenhe alguns elementos dessa matriz.

  2 Comments

what is the size of image? and what size do you want in the output matrix?
seria de uma imagem qualquer, size(x), eu queria sortear pontos dentro da matriz dessa imagem, como se fosse o comando ''impixel'' , porem com pontos sorteado ao inves de selecionados

Sign in to comment.

2 Answers

Answer by Image Analyst
on 13 Oct 2019

Try something like this:
randomIndexes = randperm(numel(grayImage), numIndexes);
extractedPixels = grayImage(randomIndexes);
where grayImage is your grayscale image, and numIndexes is the number of pixels you want to extract from the full image.

  0 Comments

Sign in to comment.


Answer by Felipe Koga on 14 Oct 2019

obrigado !!

  0 Comments

Sign in to comment.