Pawan
Pawan

Reputation: 324

Capture motion in Python

I want to capture the motion of a red paper on a white background in Linux using Python? I will be using OpenCV and an image library to create images at 30fps. Is there a way I can detetmine the position of the red paper (or a point on it) without going through every pixel in the image, since that would make it horribly slow. Or is there a better way of doing this altogether?

The code for reading the webcam is posted here.

Upvotes: 0

Views: 330

Answers (1)

Abid Rahman K
Abid Rahman K

Reputation: 52646

Here is the full code, but for yellow paper. Change color range in line 18 for red color. And it works only if single yellow paper is present.

And here is another code for the same, but now it works even if more than one yellow paper is present. Again change it to red yourself.

Upvotes: 2

Related Questions