Sample to comprehensively try OpenCV Optical Flow

HSV

(Updated 2016.5.7) Support for Raspberry Pi (Updated September 22, 2016) Corrected the spelling of Professor Kanade ⇒ Takeo Kanade, the man who gave the robot "eyes": Meet the Legend | WIRED.jp 04 / interview-takeo-kanade /)

Introduction

Optical Flow | Wikipedia is one of the methods to analyze the movement of images. When I want to use this, I have put together a sample that is easy to try.

You can find some samples of Optical Flow | Wikipedia by searching the Web. Especially the OpenCV article and the attached sample are easy to understand.

Also, especially here, in principle it is very helpful,

-Dynamic image captured by OpenCV, Optical Flow | Qiita

The following explanation linked from there is very easy to understand, and it will help you think about how to apply it.

-Tutorial of the Society of Quantitative Biology What are image informatics researchers doing?

I tried several, so as a "summary", I tried to make it possible to comprehensively check the movement when the webcam image is input to OpenCV. (Samples may be scattered in pieces)

I put it on Github

I put it here. clone

$ git clone https://github.com/daisukelab/cv_opt_flow.git
$ cd cv_opt_flow

You can try it by running main.py (* camera required, built-in laptop, etc.).

Organize the code a little

Each display is classified separately in OpticalFlowShowcase.py.

Class diagram

sample

This is a sample when you slowly wave your hand from side to side.

HSV HSV SRC

LINESLINESSRC

WARPWARPSRC

Lucas-Kanade

Recommended Posts

Sample to comprehensively try OpenCV Optical Flow
Try to detect fish with python + OpenCV2.4 (unfinished)
Optical Flow, the dynamics of images captured by OpenCV
[GCP] Try a sample to authenticate users with Firebase
A sample to try Factorization Machines quickly with fastFM
I tried to interpolate Mask R-CNN with Optical Flow
Introduction to OpenCV (python)-(2)
Try to implement yolact