A fast image recognition algorithm for box?

AI Thread Summary
To locate the four corners of a box in a black and white image with noise, it's recommended to first apply a 2D low pass filter, such as a Gaussian blur, to reduce noise. This can be achieved by convolving the image with a Gaussian matrix or using the Fast Fourier Transform (FFT) to multiply the image's FFT with that of the Gaussian matrix, followed by an inverse FFT. The dimensions of the Gaussian matrix will influence the spatial frequency cut-off. After filtering, calculating the gradient of the image in both the x and y axes can help identify where the box begins to appear, aiding in corner detection.
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.
 
Technology 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:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
What percentage of programmers have learned to touch type? Have you? Do you think it's important, not just for programming, but for more-than-casual computer users generally? ChatGPT didn't have much on it ("Research indicates that less than 20% of people can touch type fluently, with many relying on the hunt-and-peck method for typing ."). 'Hunt-and-peck method' made me smile. It added, "For programmers, touch typing is a valuable skill that can enhance speed, accuracy, and focus. While...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top