move a window from top to bottom

2 次查看(过去 30 天)
ramya raj
ramya raj 2011-9-15
hai
any one please tell me how to make window of size 100 pixels centered at a particular location to move from top to bottom over a image
thanks in advance
  4 个评论
ramya raj
ramya raj 2011-10-4
i am projecting some features and obtaining a graph
in the graph i am getting peak value at the location of 600
now i have to make a window centered at 600 and move the window from top to bottom how to do this
Jan
Jan 2011-10-4
@Ramya: It is not getting clearer. Although you know exactly what "projecting some feature and obtain a graph" means, we cannot have the faintest idea of what you are talking about. Neither "projecting", nor "feature", nor "graph" are unequivocal terms in the field of mathematics and computer science. The same problem concerns "window" - do you want a rectangle drawn inside the AXES, a FIGURE window or do you want to perfom some calculation on rectangular parts of the data? What is the "location 600"? Pixels relative to the screen or to the figure, or the Y- or X-value of the data?

请先登录,再进行评论。

回答(2 个)

Walter Roberson
Walter Roberson 2011-9-15
If the window must move in a particular direction, top to bottom or bottom to top, then you will need to use a "for" loop or one of the compact equivalents (such as arrayfun())
If it does not matter which direction the window moves as long as everything gets covered, then see blockproc(), or blkproc() if you have an older version of MATLAB.

Walter Roberson
Walter Roberson 2011-10-4
Use rectangle() or patch() to create the window. Use a loop and set() and drawnow() to change the position of the window in a regular way and have the new position updated on the screen.
For example, if you created a patch, you could set() the YData property of the patch to change its vertical position.

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by