[ptx] dirty lens and autopano-sift?

Sebastian Nowozin nowozin at cs.tu-berlin.de
Mon Jan 30 13:12:33 GMT 2006


Hi Bruno,

nice idea to use only the HS and drop the rest.


On Mon, Jan 30, 2006 at 12:19:52PM +0000, Bruno Postle wrote:

> Unfortunately autopano-sift depends on the brightness intensity to 
> locate features, so you need to flatten the image and discard two of 
> the colour channels to get something with usable features.


Alternatively, if you are a little familar with programming, you can
try modifying the file "src/util/BasicImagingInterface.cs", which has a
method.

public double Convert (byte r, byte g, byte b) {
	return ((r + g + b) / (255.0 * 3.0));
}

There the intensity value is calculated, here by just taking the mean
value of all. You can do a simple RGB to HSV colorspace
transformation, (http://answers.google.com/answers/threadview?id=68501)
and return the intensity based on that value.

(untested code follows)

public double Convert (byte r, byte g, byte b) {
    int x = (r < g) ? r : g;
    x = (x < b) ? x : b;

    int v = (r > g) ? r : g;
    v = (v > b) ? v : b;

    if (v == x)
        return (v / 255.0);

    int f = (r == x) ? (g - b) : ((g == x) ? (b - r) : (r - g));
    int i = (r == x) ? 3 : ((g == x) ? 5 : 1);

    // Only use hue and saturization
    return ( ( ((i - f) / ((double)(v - x))) +
        ((v - x) / ((double) v)) ) / (255.0 * 2.0));
}

Greetings,
Sebastian

-- 
nowozin at cs.tu-berlin.de --- http://user.cs.tu-berlin.de/~nowozin/


More information about the ptx mailing list