Line 25: Line 25:
 
For each R/G/B color channel of each pixel, I used the following blending equation that treated one image as a fully (100%) opaque background and the other image as a variably-opaque foreground.  Because the opacity value of the foreground was 50% here, the distinction between foreground and background is inconsequential:
 
For each R/G/B color channel of each pixel, I used the following blending equation that treated one image as a fully (100%) opaque background and the other image as a variably-opaque foreground.  Because the opacity value of the foreground was 50% here, the distinction between foreground and background is inconsequential:
  
<math>opacity = \sigma \in [0,1]</math>
+
<math>
 +
opacity_{foreground} = \sigma \in [0,1]
  
<math>R_tot = \sigma * </math>
+
R_{tot} = \sigma R_{foreground} + (1 - \sigma)R_{background}
  
And as previously described, <math>\sigma = .5</math> in this case.
+
G_{tot} = \sigma G_{foreground} + (1 - \sigma)G_{background}
 +
 
 +
B_{tot} = \sigma B_{foreground} + (1 - \sigma)B_{background}
 +
</math>
 +
 
 +
And as previously described, <math>\sigma = .5</math> in the following blend of 2 images.
  
 
[[image:Alpha_blending.PNG]]
 
[[image:Alpha_blending.PNG]]
  
 
[[image:Alpha_blending_zoom.PNG]]
 
[[image:Alpha_blending_zoom.PNG]]

Revision as of 16:53, 13 February 2013

Image Blending

(alec green)

Images below implicitly demonstrate how humans vision system perceives different ways of blending two distinct images. OpenCV was used to access images at pixel level.

Note that 'complete' images are likely aliased due to your internet browser, so I posted a zoomed in version for each form of image blending in the hopes that you see what kind of blending method was used. You can observe this alias on the 'complete' images by zooming in and out with your browser (usually ctrl+mouse_scroll).


[1] :: Alternating Pixels, with Aligned Columns

Alternating columns.PNG

Alternating columns zoom.PNG


[2] :: Alternating Pixels, with Misaligned Columns

Alternating pixels.PNG

Alternating pixels zoom.PNG


[3] :: Alpha Blending

For each R/G/B color channel of each pixel, I used the following blending equation that treated one image as a fully (100%) opaque background and the other image as a variably-opaque foreground. Because the opacity value of the foreground was 50% here, the distinction between foreground and background is inconsequential:

$ opacity_{foreground} = \sigma \in [0,1] R_{tot} = \sigma R_{foreground} + (1 - \sigma)R_{background} G_{tot} = \sigma G_{foreground} + (1 - \sigma)G_{background} B_{tot} = \sigma B_{foreground} + (1 - \sigma)B_{background} $

And as previously described, $ \sigma = .5 $ in the following blend of 2 images.

Alpha blending.PNG

Alpha blending zoom.PNG

Alumni Liaison

Basic linear algebra uncovers and clarifies very important geometry and algebra.

Dr. Paul Garrett