Comparing Two Frames
古いコメントを表示
Hi all,
I am using Matlab 2009a for experimental purposes. I am using Image Acquisiton Toolbox for capturing and then comparing the captured items.
I am using an external webcam (2.0MP) for input, recording 2 frames and exporting them to workspace for comparison. I am shooting at the lowest possible resolution (160x120) and grayscale. Camera is still, connected to a tripod - capturing a constant frame.
When I ran;
all(test1 == test2,2)
where test1 being the first captured frame and test2 the second. Result is all '0', instead of all '1's because above expression should return '1' for same values of same elements and '0' if different. Since camera is still I would expect it to return all '1's instead of '0's.
What do you think is happening ?
採用された回答
その他の回答 (1 件)
Florin Neacsu
2011 年 5 月 27 日
0 投票
Hello,
"expression should return '1' for same values of same elements and '0' if different" - yes
"Result is all '0', instead of all '1's" No.
from the documentation of all "Determine whether all array elements are nonzero"
when you call all(test1==test2,2) you are looking at the columns of a logical matrix and ask if they are all equal to 1. The output is 1 if yes, 0 if no. Unless test1=test2 you will not get 1's as you stated. If you are getting all 0's that means that at least one pixel on each column is different.
Regards, Florin
カテゴリ
ヘルプ センター および File Exchange で Video Formats and Interfaces についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!