Ask Your Question

Regarding Feature.left\right\below\above methods

asked 2013-07-22 14:48:41 -0500

oetroc gravatar image

updated 2013-07-22 14:49:30 -0500

According to the documentation it says the object passed to it can be a closed polygon.

For example if I'm trying to detect if a specific blob is to the left of a defined 4 sided polygon would this be correct:

my_poly = ( (top_left_x,top_left_y), (top_right_x,top_right_y), (bottom_right_x,bottom_right_y), (bottom_left_x,bottom_right_y),(top_left_x,top_left_y))

if blobs[0].left(my_poly):
   print 'The blob is to the left of the polygon'

Using this it does not trigger the if statement. Am I declaring the polygon incorrectly? I assume that the last element of the polygon array must be equal to the first element, so that it will be a closed polygon.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-07-22 15:09:31 -0500

oetroc gravatar image

updated 2013-07-22 15:22:49 -0500

I see that for the FeatureSet version of these methods it only performs the bounding box test for speed. Is this also true for the Feature version (the one I'm interested in)? It does not have a note in its definition.

Also here is an image of what I'm trying to do. I'm trying to get my program to let me know when the object I'm tracking (blue circle) moves outside the boundary lines. The polygon in question is what you see in green.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-07-22 14:48:41 -0500

Seen: 33 times

Last updated: Jul 22 '13