iphoneimage-processingcomputer-vision

Color overlaying algorithm


I'm looking for an algorithm to overlay a color on top of existing picture. Something similar to the following app (wall painter): http://itunes.apple.com/us/app/wall-painter/id396799182?mt=8

I want a similar functionality so I can paint walls in an existing picture and change them to a different color.

I can work both in yuv or rgb mode.


Solution

  • To successfully paint the walls in a picture, you have to do two steps:

    1. Find the boundary of the wall within the picture (select the part of the image to be colored)

    2. Apply the desired color to the selected area

    The first step is the hard part. It similar to what Photoshop's magic wand tool would do. And indeed a search for magic wand algorithm turns up a few good articles such as this article with Objective-C code.

    The second step is much easier and can be achieve with CGContextSetBlendMode and CGContextDrawImage.