Search code examples
opencvcomputer-visionobject-detection

"Object placed on top" detection with OpenCV


I'm new to the field of computer vision and I want to solve the following task (preferrably with OpenCV and C#, but other solutions like with Scilab? are also gratefully welcome):

There is some reference object like a hand (more or less static) in the scene - the camera is looking down on the object. Now I want to recognize if there is something on my hand (whether it changes the overall shape of my hand or if its just as small as sitting in my palm).

This task is for demonstration purposes only hence I want to use as less effort as possible. I'd like to train it with a static picture and use it in a real environment.

Any help, hint or steps how to tackle this problem are deeply appreciated. Thank you in advance!


Solution

  • If it's largely static, then I'd recommend background subtraction. It will be very robust and blazingly fast.

    You can run a Gaussian filter + thresholding (fixed threshold/Otsu-type adjusting global thresholds/adaptive local threshold) to grab blobs in the difference image. The blobs will denote change and likely something new.

    You can then intersect that with the original detected palm region to figure out if there's an intersection.