Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A fast image recognition algorithm for box?

  1. Jan 23, 2012 #1
    If you have an image (just black and white) with a box SOMEWHERE in the image, but there's also some noise in the image, is there a good way to find four corners?

    I'm sure someone has herd of an algorithm for this, it would just be good if I had a direction to go in.
  2. jcsd
  3. Jan 23, 2012 #2
    I would advise to use a 2D low pass filter first to get rid of the noise as much as possible. In other means convolve the image with a gaussian matrix. Or in other saying take fft of the image and multiply with the fft of the gaussian matrix. And then take the inverse of the solution. Dimensions of the gaussian matrix will determine the cut of spatial frequency:


    There should be a builtin gaussian filter in the environment you are working. Other than that if I were you I would take a gradient of the filtered image both x and y axis to see in which pixels the box started to appear.
    Last edited: Jan 23, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook