area

9 ビュー (過去 30 日間)
Annnnnn
Annnnnn 2012 年 1 月 2 日
How can I create a rectangle with a set area (for example a 1000) with imrect? I know you have the setResizable (h,TF) function, but I am looking for the kind of 'revert' version of this.

回答 (3 件)

Image Analyst
Image Analyst 2012 年 1 月 2 日
Create it where? In an array? As a graphics object in the overlay above some plot or image? Solid rectangle, or just the perimeter?

Annnnnn
Annnnnn 2012 年 1 月 3 日
Thank you for your reply. I have different movies (avi's) and in every movie I select the first frame and in that frame I want to make a rectangle of the same size (area) every time. However the position may vary (therefore I would like to use imrect), but also the length and the width may vary.
The only thing I want is that the area stays the same everytime I make a rectangle in the first frame of a movie.
Hope this is more clear?

Walter Roberson
Walter Roberson 2012 年 1 月 3 日
I suspect you want to set a position constraint function; see http://www.mathworks.com/help/toolbox/images/ref/imroi.html#imroi-setposcon
Each time the function was called, you would return the adjusted Position of the rectangle.
You may wish to remember some past positions in order to figure out which direction the user is "mostly" trying to drag a side.
  1 件のコメント
B
B 2012 年 1 月 3 日
Would this be done with addNewPositionCallback?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by