move a window from top to bottom

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 commentaires

Jan
Jan le 15 Sep 2011
Could you post some more details? What should happen with the windowed area? Isn't it a contradiction that the window is moving and centered at a particualr location? What exactly does "image" mean? Should it be displayed in a figure are are you processing the values in a 2D-Matrix or RGB-Array?
Image Analyst
Image Analyst le 15 Sep 2011
I also am confused by your lack of information. Perhaps you mean to use the plot() or rectangle() command and a timer to move a box around in the overlay over an image. Perhaps you mean to use blockproc(), or even conv2(), imfilter(), nlfilter(), or something else.
ramya raj
ramya raj le 4 Oct 2011
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 le 4 Oct 2011
@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?

Connectez-vous pour commenter.

Réponses (2)

Walter Roberson
Walter Roberson le 15 Sep 2011

0 votes

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 le 4 Oct 2011

0 votes

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.

Catégories

En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange

Question posée :

le 15 Sep 2011

Community Treasure Hunt

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

Start Hunting!

Translated by