defining a bounding box to test if a cv.jit centroid is within the box

apollonarius's icon

anyone can offer a novice the answer to defining a bounding box and testing if a centriod derived from a blob is within the box? the if then else statement does not have appear have a and if. i also cannot find a case in max, either...

jamesson's icon

Generally I do bounding boxes by doing linked sets of []

Combine them with an expr (condition 1* cond 2* cond 3*...cond n*) (thanks roman!) - that way if any of them are false then all of them are false.

apollonarius's icon

hi jamesson, do you think there may be another way to do this that processes faster? when i put four of these in, and pass the cv.jit. centroid location and start the media stream, the frame drops to 5 - 10 FPS...

3898.west.maxpat
Max Patch
apollonarius's icon

the linked if then else works great... thanks for the advice