title: Image Processing Edge Detection in Java
body: <p>This is my situation. It involves aligning a scanned image which will account for incorrect scanning. I must align the scanned image with my Java program.</p>
  
  <p>These are more details:</p>
  
  <ul>
  <li>There is a table-like form printed on a sheet of paper, which will be scanned into an image file.</li>
  <li>I will open the picture with Java, and I will have an OVERLAY of text boxes.</li>
  <li>The text boxes are supposed to align correctly with the scanned image.</li>
  <li>In order to align correctly, my Java program must analyze the scanned image and detect the coordinates of the edges of the table on the scanned image, and thus position the image and the textboxes so that the textboxes and the image both align properly  (in case of incorrect scanning)</li>
  </ul>
  
  <p>You see, the guy scanning the image might not necessarily place the image in a perfectly correct position, so I need my program to automatically align the scanned image as it loads it. This program will be reusable on many of such scanned images, so I need the program to be flexible in this way.</p>
  
  <p>My question is one of the following:</p>
  
  <ol>
  <li><p>How can I use Java to detect the y coordinate of the upper edge of the table and the x-coordinate of the leftmost edge of the table. The table is a a regular table with many cells, with black thin border, printed on a white sheet of paper (horizontal printout)</p></li>
  <li><p>If an easier method exists to automatically align the scanned image in such a way that all scanned images will have the graphical table align to the same x, y coordinates, then share this method :).</p></li>
  <li><p>If you don't know the answer to the above to questions, do tell me where I should start. I don't know much about graphics java programming and I have about 1 month to finish this program. Just assume that I have a tight schedule and I have to make the graphics part as simple as possible for me.</p></li>
  </ol>
  
  <p>Cheers and thank you.</p>