title: Matlab: Differentiate between p and d
body: <p>I am trying to write a script to automatically evalute a test (D2 Concentration Endurance Test)
  An examplary image is shown here:</p>
  
  <p><a href="https://i.stack.imgur.com/S4XDL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S4XDL.png" alt="enter image description here"></a></p>
  
  <p>The goal is to cross all d's with to strikes: So you would have to cross all d's with 2 strikes below, 2 strikes above, 1 strike below and 1 strike above the letter.</p>
  
  <p>So my main question is: <strong>How can I automatically differentiate if the printed letter is a d or p?</strong>
  Is there a metric than I can apply to all letters, which differentiates the two letters? I tried entropy, but difference is not discernable using that metric.</p>
  
  <p>I already tried OCR, but weirdly enough, ocr doesn't return any result for the letters I put in. And I think that ocr is maybe not necessary - I am only trying to differntiate between p's and d's - maybe an ocr is a bit overkill for this? This is why I thought a simple metric could be enough..</p>
  
  <p>Thank you for your help!!</p>