A fast image recognition algorithm for box?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
nhmllr
Messages
183
Reaction score
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.
 
Physics news on Phys.org
nhmllr said:
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.

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:

http://en.wikipedia.org/wiki/Gaussian_blur#Sample_Gaussian_matrix

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: