Re: interpolation for a color image?



aruzinsky <aruzinsky@xxxxxxxxxxxxxxxxxxxx> wrote in
news:0bf42d72-1f92-44df-aba2-687532433ede@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

Let me paraphrase that:

1. Y = a*R + b*G + c*B + d, (d is small positive number to prevent
division by zero)

2. ratioR = R/Y, ratioG = G/Y, ratioB = B/Y

3. Interpolate: Y' = bilinear(Y), ratioR' = box(ratioR), ratioG'
box(ratioG), ratioB' = box(ratioB)

4. R' = Y'*ratioR', G' = Y'*ratioG', B' = Y'*ratioB'


Bilinear interpolation on RGB is faster than these conversions.

I will digress here and say it that it is bad practice to put one's
thoughts ahead of empiricism. This is an ethical issue because it is
a major cause of chaos in society.

I know from experience that you can do fancy interpolation on the Y
channel of YCbCr space and sloppy interpolation on th Cb and Cr
channels, but "fancy" here is nonlinear and relatively slow.


I really don't understand what your opinions (or mine) on social chaos has to do with image
processing. If you mean to say that I said a stupid thing just to look smart, then just say it.

My answer is this: bilinear is not a good interpolation method but it is fast. Since it works in 2D, it
requires 12 multiplications and 4 divisions per (new) pixel estimate. If you have any doubt, see:
http://en.wikipedia.org/wiki/Bilinear_interpolation. Your "paraphrase" of what I initially proposed is too
slow, because you don't really need all these conversions, only an intensity estimate (RGB -> mono)
and the original image:

(1). I(x,y) = a*R(x,y)+b*G(x,y)+c*B(x,y)
(2). apply bilinear interpolation on I(x,y)
(3). convert back to RGB

Step 2 is the same as above, e.g. 12 multiplications and 4 divisions for bilinear per (new) pixel value.
Step 3 can be implemented using the original channel value and the value range: if I'(x,y) is the
interpolated value, then new Red is: R'(x,y) = I'(x,y)/I(x,y) * R(x,y).

As you can see, you proposal with full RGB interpolation requires 3x (12.mul+4.div) = 36.mul + 12.div
per pixel, probably with floating-point arithmetic due to the use of ratios. My proposal requires 1x (3.mul
+ bilinear + 1.mul+1.div) = 16.mul+5.div per pixel, which can be implemented easily with integer
arithmetic in steps 1 and 3 (no explicit ratios used).

Please do the math before you criticise someone else's motives and knowledge here.



--
Harris
.



Relevant Pages

  • Re: interpolation for a color image?
    ... , to apply a bilinear interpolation, will we apply the ... I think I've seen where you get color artifacts if you do this in RGB ... You cannot properly interpolate on the H channel. ...
    (sci.image.processing)
  • Re: interpolation for a color image?
    ... , to apply a bilinear interpolation, will we apply the ... I think I've seen where you get color artifacts if you do this in RGB ... (which takes into account interactions, like you say, because the HSI ...
    (sci.image.processing)
  • Re: interpolation for a color image?
    ... , to apply a bilinear interpolation, will we apply the ... I think I've seen where you get color artifacts if you do this in RGB ... (which takes into account interactions, like you say, because the HSI ...
    (sci.image.processing)
  • Re: Understanding bilinear interpolation
    ... Trying to understand how bi-linear interpolation is done. ... interpolated values are calculated from this 5 X 5 grid. ... In addition to the bilinear interpolation, ... a rectangle to extend the values to the entire rectangle. ...
    (sci.math)
  • Re: interpolation for a color image?
    ... , to apply a bilinear interpolation, will we apply the ... I think I've seen where you get color artifacts if you do this in RGB ... could be a reasonable and acceptable interpolation of red and blue.- Hide quoted text - ...
    (sci.image.processing)