Position property of a system object

2 次查看(过去 30 天)
can somebody please explain the concept of position property of an object. Is it the pixel position ? why it is a row matrix only?
videoPlayer = vision.VideoPlayer('Position',[100,100,680,520]);
In one of the example, its given as:
hVideoOut = vision.VideoPlayer('Name', 'Video Stabilization');
hVideoOut.Position(1) = round(0.4*hVideoOut.Position(1));
hVideoOut.Position(2) = round(1.5*(hVideoOut.Position(2)));
hVideoOut.Position(3:4) = [650 350];
I didn't get the concept of setting the positions to these values.
I know this is a silly question, but I tried to find the answer and its not well explained anywhere. so, if somebody has time, please help me.

采纳的回答

Steven Lord
Steven Lord 2018-8-29
This particular object has a Position property that controls where on your screen the video player window is located. The description on that page lists it as "Size and position of the video player window in pixels"
Not all objects have a Position property, though. Usually it's just those objects that need to show something graphically on the screen that have such a property.
Those computations look like they move the object left, move it up, and set it to a fixed width and height. Run those commands one at a time and you should see the window move.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing and Computer Vision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by