title: Detecting position of crop marks in a scanned document
body: <p>I am working on a project in which user gives us a scanned copy of a form, and we need to identify various fields within the image. </p>
  
  <p>I have a form like this:
  <img src="https://i.stack.imgur.com/yr3hS.jpg" alt="enter image description here"></p>
  
  <p>The form has four crop marks/ registration marks at four corners of the page. Now the user is supposed to fill the form and give back a scanned copy of his filled form. The scanned form that we get may have been rotated by some angle. For instance see the rotated form below:
  <img src="https://i.stack.imgur.com/Xd3In.jpg" alt="enter image description here"></p>
  
  <p>Now to extract the exact fields out of form, i.e. to extract any particular field like Title in the scanned form, we need to have exact coordinates but since our image has been rotated by unknown angle. We are unable to do so.</p>
  
  <p>I read about registration marks and their use to align the page to a standard form. 
  I tried searching for these registration marks in the image, but since it is rotated we may not find the position of the mark in the rotated image.</p>
  
  <p>I tried searching for the issue and found some questions on SO which although gave some direction but couldn't help much. </p>
  
  <p>This <a href="https://stackoverflow.com/questions/9809769/how-to-locate-alignment-marks-in-an-image">Question</a> gave me reference to LEADTools SDK which has <a href="http://www.leadtools.com/help/leadtools/v18/main/api/detectingregistrationmarks.html" rel="nofollow noreferrer">functions</a> to perform this tasks. Unfortunately this SDK is not for JAVA and along with that it's proprietary and not free.</p>
  
  <p>Is there any other open source tools for the same purpose. </p>
  
  <p>Additionally I am open to suggestions about other methods used to align the form. </p>