Thread: Simple Pattern Recognition

  1. #1
    Registered /usr
    Join Date
    Aug 2001
    Newport, South Wales, UK

    Question Simple Pattern Recognition


    In another one of my bizarre hobby programs I'm trying to match sections of a 24-bit colour image to one of a number of 1-bit patterns.

    Currently the steps I'm taking are:-

    1. Reduce image colour depth to 8-bit greyscale
    2. Increase pattern depth to 8-bit (essentially 0 and 255)
    3. Compare the sums of the Euclidean distances between source and pattern pixels.

    The thing is, I don't think that's right. I shouldn't be blindly checking colours against colours, because the colours are irrelevant. What I should be checking are that the edges of the colours roughly match up and maybe introduce a heuristic so that close matches with a few pixels out are still acceptable. Does that sound correct?

    Also, three of the patterns involved are essentially all the same bit (0 or 1) so I should classify them and hold off testing against them unless everything else is a bad match, yeah?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Mmm, what about
    - changes in luminosity of the captured image,
    - changes in position (translation)
    - changes in rotation
    - changes in scale (zoom)

    All of these will mess up a simple bit-for-bit attempt at comparing the image.

    I'm gonna assume that you've googled already.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. creating very simple text editor using c
    By if13121 in forum C Programming
    Replies: 9
    Last Post: 10-19-2010, 05:26 PM
  2. Visitor / Decorator Pattern
    By MarkZWEERS in forum C++ Programming
    Replies: 9
    Last Post: 05-16-2009, 11:53 AM
  3. Music enhancement through statistical pattern recognition and approximation
    By ChadJohnson in forum A Brief History of
    Replies: 31
    Last Post: 01-06-2006, 11:47 AM
  4. Simple message encryption
    By Vicious in forum C++ Programming
    Replies: 10
    Last Post: 11-07-2004, 11:48 PM
  5. Binary Search Trees Part III
    By Prelude in forum A Brief History of
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM