Frame Differecning help using matrices and pixels
24 views (last 30 days)
Show older comments
I created a frame differencing script that compares frames, but I need help on printing the frames that my script is finding to be different across frames.
I just want to print the values of those pixels are are effected. Right now I have it set up so those frames that are different, they are colored red, but I am not sure on how to print those values.
0 Comments
Answers (1)
Walter Roberson
on 15 May 2021
Replace
temp = im2gray(temp);
temp2 = frames(:,:,:,l + 1);
temp2 = im2gray(temp2);
with
temp = double(im2gray(temp));
temp2 = frames(:,:,:,l + 1);
temp2 = double(im2gray(temp2));
Replace
temp3(w, h) = 255; 255;
with
temp3(w, h,:) = [255, 0, 0];
Note: if the difference is less than 30 then the pixel will be left the original color.
2 Comments
Image Analyst
on 15 May 2021
Attach your new, updated code. Do you still get the flickering if you use the standard rhinos.avi video that ships with MATLAB? If tens of thousands of pixels change from one frame to the next, why do you want to print them all out? And what do you want printed? The row, column, red value, green value, and blue value? So, for 10 thousand changed pixels you'd print out 50 thousand numbers. Are you sure that's what you want? Are you actually going to look at all of them or not?
See my attached demo where I do frame differencing.
See Also
Categories
Find more on Image Processing and Computer Vision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!