A stroboscopic device, comprising: a camera for acquiring video frames; a
light source; and at least one hardware processor; and
software that is configured to, when executed by the at least one hardware processor, acquire a sequence of video frames via the camera, convert the frames from RGB to
grayscale, for a first and second frame in the sequence of video frames, compute the dense
optical flow field between the two frames, wherein the
optical flow field contains a flow vector for each pixel in each of the first and second frames, indicating the motion of that pixel from the first frame to the second frame, calculate the average magnitude (Average
Optical Flow or AOF) of all flow vectors for each pixel in the first and second frames, compare the AOF to a threshold, and store a result based on the comparison, repeat the process for all frames in the sequence of video frames, determine whether a
stroboscopic effect has been achieved based on the store results, control the activation of the
light source until the results indicate that the
stroboscopic effect has been achieved, control the activation of the
light source until the results indicate that the
stroboscopic effect has been achieved, and obtain a further sequence of video frames after the stroboscopic effect is achieved, identify an object in the further sequence of video frames, and automatically detect movement or vibration of the identified object.