Frame Differecning help using matrices and pixels
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2021-5-15
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 个评论
Image Analyst
2021-5-15
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!