Plotting or choosing nth pixel in a binary image

1 Ansicht (letzte 30 Tage)
Elf
Elf am 17 Apr. 2017
Kommentiert: Image Analyst am 19 Apr. 2017
Hi
I have a binary image and I found the positions of the ones. I have x and y positions. I plotted from variables tables for example plot(1,94, 'g+'). I have selected every 60th pixel. I wonder is it possible to have a command or code to choose every nth pixel by itself instead of writing manually?
Thanks

Antworten (1)

Image Analyst
Image Analyst am 17 Apr. 2017
Yes, though I don't know why you'd want to do this
[y, x] = find(binaryImage);
hold on;
plot(x(1:60:end), y(1:60:end), 'g+', 'MarkerSize', 8, 'LineWidth', 1);
grid on;
Adapt as needed to suit your tastes.
  2 Kommentare
Elf
Elf am 19 Apr. 2017
Thanks a lot. I have a line in my binary image I am trying to get 10 points from this line. I want to get 10 out of all line. I tried your code and I got one result and it is not on the line. I dont know maybe it is not possible to do without manuelly.
Image Analyst
Image Analyst am 19 Apr. 2017
Show your image. Is the line a row in your image? Or a column? Or a white blob at some arbitrary angle? Is the line longer than 10 pixels? If so, which do you want - the first 10 pixels, the last 10 pixels, the middle 10 pixels. Have you read this link?

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