# Identifying geometry in images

There is a lot of information on the internet about image classification and object identification. I want to know how I can extract (or create) geometric information from an image.

For example, if the image classifier can identify that there is a sphere in the image, how can i generate 3d vertices's and edges from that knowledge? I want to find all the edges and points on these shapes

• I don't know why you require an ML algorithm for this task...at-least in the pics given the intensity and colour change is sudden, so simple program would do the job – DuttaA Mar 13 '18 at 10:15

## 1 Answer

To obtain the edges, you need to use an edge detector. Many exists, more or less efficient depending on the input image. Among the most broadly used are the Sobel and the Canny edge detectors that are implemented in many libraries for various programming languages. (Matlab, scikit-image in Python)

To obtain straight lines from these edges, I suggest that you start by using the Hough transform also available in many libraries for various programming languages. (Matlab, scikit-image in Python)

Lines output from the Hough transform are usually given in there parametric form. From there, it is easy to find the angles between the different lines. I imagine that some rules can be derived from there to identify a regular polygon that is in the image.

Regarding obtaining 3D information from an image, note that there isn't enough information in a single 2D image to reconstruct its 3D coordinates, since we are projecting information into a lower dimensional space.