Algorithm to detect intersection of two rectangles

Can someone give me direction to find intersection of two rectangles (“T” shape).
I’m going to use live video (webcam), locate dark object in light background (shadow), detect intersection and send this coordinates via OSC to client…


you could use freeman-chaincodes; i’m using them in the OCR part of a license plate recognition software and they do their job :slight_smile:

this is a conversation about doing intersection via pixels of two images using an AND (&) operation:;-embedding-event-on-object/1285/0

  • z

For example, as shown in the image below (webcam snapshot)…
What I need is the marked red dot position.

not sure I understand what you want to track – if and where two objects are intersecting? the cross of a T shape? In the example image, I read the hand as part of the shape too. it might help if you can post a video or more images to document what you mean.


Yes, the cross of a T shape. This will be a target of bird flocking.
One of the birds will land on this point…
Can I isolate T shape from person silhouette and then track desired position (only shape with straight line edges and sharp corners)?
Maybe the simplest way will be to use hand or fingers as target (Gamuza has already integrated algorithm)?!?
When I already have contour of T shape or hand, how to find the highest point position?

Thanks Zach!