Take pixels from input image

조회 수: 1 (최근 30일)
Sara Salimi
Sara Salimi 2016년 10월 29일
답변: Image Analyst 2016년 10월 30일
How to take pixels from an input image by using Gaussian sampling?
  댓글 수: 2
Image Analyst
Image Analyst 2016년 10월 29일
What does that mean? What do you want as an output? A 1-D vector of intensity values? What is Gaussian Sampling? Do you mean the locations are to be taken like in a shotgun pattern concentrated in the middle of the image? Please include more info, such as a diagram.
Sara Salimi
Sara Salimi 2016년 10월 30일
편집: Sara Salimi 2016년 10월 30일
Dear Image Analyst,
Many thanks for your attention.
I want to do sampling since I do not want to do some specific process on all pixels of image. Yes, I want to do shotgun pattern like sampling in an image (i.e.,denser sampling in the middle of image). The output should be the coordinates of sampled pixels. I will be thankful if you guide me.
Thanks in advance.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2016년 10월 30일
Try this:
numPoints = 5000;
xCenter = 1000;
yCenter = 1000;
sigmax = 500;
sigmay = 500;
x = xCenter + sigmax * randn(numPoints, 1);
y = yCenter + sigmay * randn(numPoints, 1);
plot(x, y, 'b.', 'MarkerSize', 8);
grid on;
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by