Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Regarding Feature.left\right\below\above methods

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:

mypoly = ( (topleftx,toplefty), (toprightx,toprighty), (bottomrightx,bottomrighty), (bottomleftx,bottomrighty),(topleftx,topleft_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.

Regarding Feature.left\right\below\above methods

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:

mypoly

my_poly = ( (topleftx,toplefty), (toprightx,toprighty), (bottomrightx,bottomrighty), (bottomleftx,bottomrighty),(topleftx,topleft_y))

(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'

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.