フィルターのクリア

video frame capturing and resizing

3 ビュー (過去 30 日間)
Max
Max 2011 年 10 月 18 日
編集済み: John Kelly 2015 年 2 月 26 日
i have installed a webcam .. following codes i am using for the video capturing the video
a = imaqhwinfo;
[camera_name, camera_id, format] = getCameraInfo(a);
vid = videoinput(camera_name, camera_id, format);
% Set the properties of the video object
set(vid, 'FramesPerTrigger', Inf);
set(vid, 'ReturnedColorspace', 'rgb')
vid.FrameGrabInterval = 5;
%start the video aquisition here
start(vid)
while(vid.FramesAcquired<=5)
data = getsnapshot(vid);
imwrite(data,'1.jpg');
end
the saved frame 1.jpg is of size 640X680...
but i want to capture the images of 104 X 120 poxel size,.. tell me how to do

採用された回答

Walter Roberson
Walter Roberson 2011 年 10 月 18 日
編集済み: John Kelly 2015 年 2 月 26 日
Do you want to clip down to 104 x 120, or do you want to resize down to 104 x 120 ?
If you want to clip down then the easiest thing to do is set vid.ROIPosition to the offset and height and width you want.
If you want to resize down to 104 x 120, then although that is possible using a custom preview (by using imresize() on the input data and sending that to be displayed), I would be concerned about whether the system could keep up, so I would suggest a pass afterwards to resize each .jpg .
  1 件のコメント
Max
Max 2011 年 10 月 18 日
thanks walter . i used the imresize() command ...

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by