itberrios / CV_projects

General Computer Vision Projects
MIT License
33 stars 14 forks source link

Optical flow motion mask #4

Closed ErdosG closed 3 days ago

ErdosG commented 6 days ago

Hello,

in the detection_with_optical_flow.ipynb notebook, the line mask = get_motion_mask(mag, motion_thresh=motion_thresh) produces strange results on my own frames. Based on my understanding, I have modified it to mask = get_motion_mask(mag/mag.max(), motion_thresh=motion_thresh) to normalize the magnitudes to be between 0 and 1 fitting in the range of the motion treshold function. Seems to work better on my frames this way. Is my understanding correct? If so might worth fixing. Thanks for the notebook, it was a great head start in the topic.

BR Gergő

itberrios commented 3 days ago

Hello, yes that's a good catch! I believe normalizing would be effective

itberrios commented 3 days ago

Just added a note in the notebook for normalization.