フィルターのクリア

how can I make looping for multiple videoReader?

2 ビュー (過去 30 日間)
aniseija
aniseija 2015 年 4 月 30 日
コメント済み: Bilal qureshi 2018 年 6 月 1 日
I am working on the project, face detection system.my input for this project is video. my question is how I make a looping for multiple video.I have 4 video and and need to use 2 frame from each video.below is may coding. Let say I have another 3 which is DSCN9371.avi,DSCN9372.avi,DSCN9373.avi.
faceObj = VideoReader('DSCN9370.avi');
for ii = 2:3; %selected frame
myimage = read(faceObj,ii);
crop_image = imcrop(myimage,[173.5 28.5 275 337]);
img_newsize=imresize(crop_image, [256,256]);
img_gray = rgb2gray(img_newsize);
img = histeq(img_gray);
end
For above coding it only make looping for one video.Anyone Please Help!!

回答 (1 件)

Image Analyst
Image Analyst 2015 年 4 月 30 日
Just make two objects:
faceObj1 = VideoReader('DSCN9370.avi');
faceObj2 = VideoReader('DSCN9371.avi');
Then pass the right one into read().
myimage1 = read(faceObj1,ii);
myimage2 = read(faceObj2,ii);
By the way, histeq() makes lousy images - they almost never look natural.
  3 件のコメント
Image Analyst
Image Analyst 2015 年 4 月 30 日
You don't know how? Just add a 1 or 2 after each variable to use the correctly named variable. Look what I already did for examples. Just do the same thing everywhere else in your code that you need to.
Bilal qureshi
Bilal qureshi 2018 年 6 月 1 日
How to write multiple video files with videoWriter?

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

Community Treasure Hunt

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

Start Hunting!

Translated by