1 | initial version |
You could use background subtraction to detect the cat(blob detection) and use a tracking algorithm like Kalman filter to keep track of the detection.
As for counting, I guess you could try something like what's done in this video. He's drawn a line at the center of the screen and keeps count of the number of times a blob crosses that line(in your case it would be a vertical line near the side of the screen).
Actually, he uses background subtraction and a different algorithm for keeping track of the blob so you could check those out as well.