How to count the frequency of flashing light in a video
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi, I have a video-file, rgb, format avi, dimension 62x62, rate 60fps. duration 1min. The event is a flashing red light otherwise dark.
The flashing frequency very from video to video. So I wonder if someone could suggest me how to count the frequency using image-processing or video-processing tool box.
Thank you in advance for your attention
Emerson
댓글 수: 1
채택된 답변
Star Strider
2015년 4월 30일
Cedric Wannaz posted this code to do just that about a year ago. You can probably adapt it to your application.
댓글 수: 5
Star Strider
2020년 12월 1일
Luke Abellanosa —
I just now looked through the Supplements, and (as you already discovered) neither the code nor the algorithm is published. You’d likely have to write to the authors, however I doubt they’d currently be forthcoming with the information.
Note that in the Acknowledgements section:
- Competing interests: A U.S. provisional patent application has been filed by Duke University on 12 June 2020. The authors of the current manuscript are identical to the inventors on the patent application. The patent information is as follows: Title: “Optical Method to Test Efficacy of Face Masks”; inventors: M.C.F., E.P.F., D.G., W.S.W., I.H., and E.W.; application number: 63/038331.
Since they’re applying for a U.S. patent (and likely foreign patents) on this technique, that information will not be available until the patent is granted (typically about four years after the application is filed).
In the interim, see if anything in the Image Processing Toolbox — Examples documentation section has anything you can use to build on. (I have done some medical image processing, however it is not an area of my expertise, so I likely cannot help you with it.)
Luke Abellanosa
2021년 2월 4일
hello again can i ask if what are to be edited in this script depending on the properties of the video im still a beginner to this
vidObj = VideoReader( '1.avi' ) ;
nFrames = vidObj.NumberOfFrames ;
tFrame = (1:nFrames) / vidObj.FrameRate ;
ghostCom = zeros( nFrames, 1 ) ;
for fId = 1 : nFrames
grayImage = rgb2gray( read( vidObj, fId )) ;
ghostCom(fId) = sum( grayImage(:) ) ;
end
figure() ; clf ;
set( gcf, 'Color', 'White', 'Units', 'Normalized', ...
'OuterPosition', [0, 0.1, 1, 0.6] ) ;
plot( tFrame, ghostCom/max(ghostCom), 'b' ) ;
set( gca, 'YTick', [0, 1] ) ;
xlabel( 'Time [s]' ) ;
[r] =risetime(ghostCom);
FREQUENCY =numel(r)/60;
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!