How to find object containment vs object support? [closed]

How do we know that an object is contained inside another object or is just lying on top of it. Lets take an example of a cup-plate-spoon. The cup is lying on top of the plate. But the spoon is inside the cup.

1. How do we distinguish between the 2 situation?

2. What are the criteria to decide whether A is contained inside B or just lying above B?

-

migration rejected from physics.stackexchange.comMay 18 at 4:07

This question came from our site for active researchers, academics and students of physics. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by ronno, T. Bongers, tetori, RecklessReckoner, Claude LeiboviciMay 18 at 4:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is not about mathematics, within the scope defined in the help center." – ronno, Community, tetori, RecklessReckoner, Claude Leibovici
If this question can be reworded to fit the rules in the help center, please edit the question.

This is a fuzzy question of language, and there are not going to be any clear-cut mathematical solutions. Suppose you gradually lift the spoon out of the cup. At what point would you say the spoon stops being "inside" the cup? There is no clear distinction between inside and outside. –  Rahul Jan 2 '13 at 16:10
That said, you could consider the fraction of the volume of $A$ that lies inside the convex hull of $B$ to be a kind of "insideness" value that lies between $0$ and $1$. –  Rahul Jan 2 '13 at 16:13
Thanks...I should probably try this.. –  Swagatika Jan 3 '13 at 18:47

In topological terms, we could say that set $A$ is inside of set $B$ (where the sets are disjoint) if $A$ is contained in a bounded connected component of $\mathbb R^3\setminus B$. In other words, $B$ separates $A$ from $\infty$. However, this does not help in your plate-cup-spoon example, because the spoon is not inside of the cup in the topological sense. Indeed, if the plate were elastic (as all things are in topology), we would be able to deform it gradually until it becomes a bigger cup with smaller cup inside of it. So there is no clear cut between the plate-cup and the cup-spoon configurations.
If your objects are presented as sets of points in $\mathbb R^3$, you can use a linear SVM with soft margin to find the best separating plane between them. Then look at the quality of separation: if it's not very good, then one of the objects is probably inside of the other. This algorithm is not infallible, but it would work for plate-cup-spoon.