I want to detect the letters in the image of the following detective's answer.source here.
I answered it with kanren logic code:
from kanren import run, eq, conde, var, Relation, facts
from kanren import run, var, fact, Relation
x = var()
murderer = Relation()
# Murder suspects
facts(murderer ,("Mr Ronald", "Jack Green"),
("Mr Ronald", "John jacobson"),
("Mr Ronald", "June Green"))
sol = run(3,x,murderer("Mr Ronald",x))
findings = Relation()
facts(findings,("First of","January"),
("Fourth of","October"),
("Fifth of","March"),
("Third of","June"))
January = run(1,x,findings ("First of",x))
October = run(1,x,findings("Fourth of",x))
March = run(1,x,findings ("Fifth of",x))
June = run(1,x, findings("Third of",x))
print(January[0][0])
print(October[0][3])
print(March[0][4])
print(June[0][2])
So, Kanren's logic answered that the culprit was: John
So when I want to detect letters that match opencv it fails and keeps on failing. I study here and here.
I want the output to be like
, and it matches the answer from kanren's logic which is: John
Thank you, any help will be highly appreciated.
