Resampling using only filtered-out pixels
Posted: 2012-02-15T04:15:56-07:00
Hello,
First of all I would like to say what I am trying to achieve: the goal of my project is to spot the color of rooftop from the aerial photos.
I am dealing with bitmaps which correspond to approx 10x10m area, each centered onto given rooftop. I am applying Lanczos resampler to them to get a single output pixel. The results are quite satisfying but sometimes there are trees/green areas in the input bitmap which result in “greenish” output pixel (which is a bit unrealistic).
I’ve been trying to use ImageMagick to filter out green colour from input bitmaps (since normally there are green rooftops), using –opaque, -fuzz and –fill arguments. The problem is the argument for -fill parameter (replacement color) which always works only in certain cases (e.g. when it’s set to black it darkens the output pixel which is no good when remaining pixels are very bright)
Basically I would like to resample the input bitmap but taking into account only the pixels which are filtered out by –opaque argument (green pixels should be ignored).
Is it possible to achieve it with ImageMagick? Any other suggestions? (sorry for my limited English and knowledge of picture processing)
Radek
First of all I would like to say what I am trying to achieve: the goal of my project is to spot the color of rooftop from the aerial photos.
I am dealing with bitmaps which correspond to approx 10x10m area, each centered onto given rooftop. I am applying Lanczos resampler to them to get a single output pixel. The results are quite satisfying but sometimes there are trees/green areas in the input bitmap which result in “greenish” output pixel (which is a bit unrealistic).
I’ve been trying to use ImageMagick to filter out green colour from input bitmaps (since normally there are green rooftops), using –opaque, -fuzz and –fill arguments. The problem is the argument for -fill parameter (replacement color) which always works only in certain cases (e.g. when it’s set to black it darkens the output pixel which is no good when remaining pixels are very bright)
Basically I would like to resample the input bitmap but taking into account only the pixels which are filtered out by –opaque argument (green pixels should be ignored).
Is it possible to achieve it with ImageMagick? Any other suggestions? (sorry for my limited English and knowledge of picture processing)
Radek