Ask Your Question

Validate if object is completely in the image frame

asked 2020-03-18 11:33:52 -0500

stepovr gravatar image

Is there a way to check if any object of interest lies completely inside the frame of an image/video. The object should not be partially present in the frame but it should be 100% visible.

edit retag flag offensive close merge delete


just curious -- what's the context ? what do you need it for ?

berak gravatar imageberak ( 2020-03-18 13:24:21 -0500 )edit

I plan on using it to detect whether a plate of food is entirely in the frame or not. In a way to assist clicking pictures of food.

stepovr gravatar imagestepovr ( 2020-03-18 13:36:51 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2020-03-19 02:48:13 -0500

mvuori gravatar image

When you detect an object, you shoud get a contour or a rectangle or something that has a retrievable bounding box (perhaps with boundingRec()). Just check that all its points' coordinates are > 0 and less than height - 1 and width - 1.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-03-18 11:33:52 -0500

Seen: 338 times

Last updated: Mar 19 '20