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

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?

답변 (1개)

Image Analyst
Image Analyst 2014년 5월 17일
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);

카테고리

도움말 센터File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

질문:

2014년 5월 17일

답변:

2014년 5월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by