# Finding crosses and their orientation on a given image

I want to recognize table structure from some arbitrary photo image and store it in some formal notation (Let it be HTML table notation).

For example I have this blurry image as input:

After binarization I achieved this:

Now to detect structure I want to detect intersections between lines, their type (T-type, X-type, or simple corner), their orientations and their location on the image. After this I'm going to use all gained information for further joining of adjacent crosses in some structure, and translate this structure into formal representation.

The problem is in detecting crosses and their orientation:

In general these crosses may be scaled and/or rotated. Maybe someone could help with method of solving this problem? Or maybe recommend different methods for this whole task?

That's what I have written so far:

 # -*- coding: utf-8 -*-

import cv2
import cv
import numpy

grayscale = cv2.cvtColor(original, cv2.COLOR_BGR2GRAY)
smoothed = cv2.GaussianBlur(grayscale, (5,5), 0)
cv2.imshow("original", original)
cv2.imshow("grayscale", grayscale)

binarized = cv2.Canny(grayscale, 50, 200)
cv2.imshow("binarized", binarized)
cv2.waitKey(0)


Thanks in advance for any response/idea.

• You have a better chance of getting answers if you narrow down your question a bit. Your question as stated is too broad. Try explaining what you know, what you've tried, and what specific problem you're facing. – MBaz Mar 27 '16 at 21:18