Comparing Two Frames
Ältere Kommentare anzeigen
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 ?
Akzeptierte Antwort
Weitere Antworten (1)
Florin Neacsu
am 27 Mai 2011
0 Stimmen
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
Kategorien
Mehr zu Video Formats and Interfaces finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!