2014年6月13日 星期五

[HW5] Watermark

數位浮水印,是指將特定的資訊嵌入數位訊號中,數位訊號可能是音訊、圖片或是視訊等。若要拷貝有數位浮水印的訊號,所嵌入的資訊也會一併被拷貝。數位浮水印可分為浮現式和隱藏式兩種,前者是可被看見的浮水印(visible watermarking),其所包含的資訊可在觀看圖片或視訊時同時被看見。一般來說,浮現式的浮水印通常包含版權擁有者的名稱或標誌。

實作方式:    
  • Replacing a specific color in a bitmap to achieve transparency
  • Changing the opacity of an image through a 5x5 ColorMatrix

float[][] colorMatrixElements = { 
   new float[] {1.0f,  0.0f,  0.0f,  0.0f, 0.0f},
   new float[] {0.0f,  1.0f,  0.0f,  0.0f, 0.0f},
   new float[] {0.0f,  0.0f,  1.0f,  0.0f, 0.0f},
   new float[] {0.0f,  0.0f,  0.0f,  0.3f, 0.0f},
   new float[] {0.0f,  0.0f,  0.0f,  0.0f, 1.0f}
};
改變其中 3rd row 3rd column 的 0.3f 即可得到不同的透明度

Origin Picture


Logo

 Result



Reference :
http://www.codeproject.com/Articles/2927/Creating-a-Watermarked-Photograph-with-GDI-for-NET

2014年6月6日 星期五

[HW4] Skin Detection with HSV

The R,G,B values are divided by 255 to change the range from 0..255 to 0..1:

R' = R/255
G' = G/255
B' = B/255
Cmax = max(R', G', B')
Cmin = min(R', G', B')
Δ = Cmax - Cmin

Hue calculation:

Saturation calculation:

Value calculation:
V = Cmax

The skin in channel H is characterized by values between 0 and 50, in the channel S from 0.23 to 0.68 for Asian and Caucasian ethnics.
Origin Picture

Skin Detection

[HW4] Color Space RGB to HSI

Hue(色相)
    是色彩的基本屬性。

Saturation(飽和度)
    是指色彩的純度,越高色彩越純,低則逐漸變灰,取0-100%的數值。

Intensity(亮度)
    為亮暗程度,取0-100%。

並利用以下公式轉換:
The R,G,B values are divided by 255 to change the range from 0..255 to 0..1:
R' = R/255
G' = G/255
B' = B/255


Origin Picture

Hue(色相)

Saturation(飽和度)

Intensity(亮度)