Mohamed Tarek
Mohamed Tarek

Reputation: 385

Detecting a pattern of dark/bright bands in an image

I'm trying to detect a pattern like this in some images

Pattern (ideal)

The actual image looks something like this

PAttern (actual)

It could be scaled and/or rotated. Is there a way to do that efficiently without resorting to neural nets or some learning algorithm? Can some detection be done based on the value gradient for example (dark-bright-dark-bright-dark)?

Upvotes: 0

Views: 181

Answers (2)

David Nilosek
David Nilosek

Reputation: 1412

You might be able to use Gabor Filters at varying orientations, and do standard threshold to identify objects.

If you know the frequency of the pattern you could try using a bandpass filter to isolate objects at that frequency. If it is a very strong frequency, you might be able to identify it in the image's Fourier transform.

Without much other knowledge about what you are looking for in your image, it will be very difficult to identify a specific repeating pattern.

Upvotes: 0

Mercury
Mercury

Reputation: 1965

input image is MxN (in your example M<N ):

  1. take mean RGB image
  2. mean Y to get 1xN vector
  3. derive
  4. abs
  5. threshold
  6. calculate the distance between peaks.
  7. search for a location where the ratio between the distances is as expected (from what i see in your example ~ 1:7:1)
  8. if a place found, validate the colors in the middle of the distance (from your example should be white-black-white)

Upvotes: 0

Related Questions