How do I define a window in an image from specific coordination?

1 Ansicht (letzte 30 Tage)
Klara
Klara am 17 Mai 2014
Beantwortet: Image Analyst am 17 Mai 2014
In an image I would like to define a square window, the place where I want to define a square, its coordination in pixel is known. The size of window should be 120x120.
I have tried but it results in a line instead of window.
Any comments?

Antworten (1)

Image Analyst
Image Analyst am 17 Mai 2014
I don't know how the word coordination applies here. It means how skillful you are at doing things with your body, like walking on a balance beam or something.
If you don't know the location, try rbbox or imrect(). If the user doesn't draw exactly 120x120, you can use any corner of what they did draw to draw a 120x120 box from that corner.
If you know the rows and columns that define your box, then you can just use plot():
xBox = [row1, row1, row2, row2, row1];
yBox = [col1, col2, col2, col1, col1];
plot(xBox, yBox, 'r-', 'LineWidth', 3);

Community Treasure Hunt

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

Start Hunting!

Translated by