Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find this kind of geometry in images

scene

Suppose I have an image of a scene as depicted above. A sort of a pole with a blob on it next to possibly similar objects with no blobs. How can I find the blob marked by the red circle (a binary image indicating which pixels belong to the blob).

Note that the pole together with the blob may be rotated arbitrarily and also size may vary.

like image 493
Leo Avatar asked Nov 04 '22 10:11

Leo


1 Answers

Can you try to do it in below 4 steps?

  1. Circle detection like: writing robust (color and size invariant) circle detection with opencv (based on Hough transform or other features)
  2. Line detection, like: Finding location of rectangles in an image with OpenCV
  3. Identify rectangle position by combining neighboring lines (For each line segment you have the start and end point position, you also know the direction of each line segment. So that you can figure out if two connecting line segments (whose endpoints are close) are orthogonal. Your goal is to find 3 such segments for each rectangle.)

  4. Check the relative position of each circle and rectangle to see if any pair can form the knob shape.

like image 147
greeness Avatar answered Nov 11 '22 00:11

greeness