I\'m still working on the last program and although I finally found out how to solve the problem (on how to filter the biggest contour), I now have a new question, or rather
Your problem isn't the edge detection algorithm. Your problem is that you are hard-coding the algorithm parameters and expecting it to magically work for all images you throw at it. Also, smoothing the image before using cvCanny
is unnecessary, as the Canny operator already performs smoothing for you.
Since it's a bit more clear what you want to achieve now, I can give a suggestion: work with the video instead of looking at each frame individually. If the camera is fixed, and the hand with the object is moving, then detecting the shape is trivial through background subtraction. If the camera is not fixed, you can still detect the hand (PDF link) and work from there. Also, use any other application-specific knowledge you may possess (e.g. item will be in the middle of the screen, hand will be below the item).