I am working on tracking an object in a video by using its color. what i did is that i have converted the color of a selected object into LAB color space since it is a uniform color space. and then in each frame of video i am searching for same color by finding color difference in LAB color space. Now main problem is arising when more than one object of same color is appearing in the video scene. one method i adopted for avoiding detection of wrong object is to search for same color in limited area around last detected position of the object. but this is causing failure to detect fast moving objects and leaving my methods suitable for slow moving targets only. so i want to know is there any method i can apply for avoiding wrong detection.
You can check the area of the same-color region. It should be close to the last one and it should be around some value (you can filter out very small and very big regions).
You can check rectangularity, circularity, convexity, angle, width, height depending on your object to be tracked.
If your false-detected regions are very small, you can try to a bit smooth the image first and then check for values.
Besides that if the false detected objects are very similar to the correct ones, your method seems to be the most feasible way to do it. You can consider making it faster by choosing different platform or optimizations.
You can use meanshift from OpenCV: