home news articles forum gallery events contact
Tuesday, February 7, 2012 | Login

เข้าระบบ

ชื่อเรียก:

รหัสผ่าน:


ลืมรหัสผ่าน?

สมัครสมาชิก!

เมนูหลัก

ใครกำลังใช้งาน

มี 7 คนกำลังใช้งาน

สมาชิก: 1
บุคคลทั่วไป: 6

namfon, มีต่อ...

Link น่าสนใจ

Standard of Colcor

ตัวอย่างโปรแกรม การแปลงสีจากระบบ RGB (CIE) ไปเป็น XYZ

int cieRGB_XYZ (r ,g ,b ,x ,y ,z ,N1 ,M1 ,N2 ,M2)

image r,g,b,x,y,z;

int N1,M1,N2,M2;

/* Subruotine to perform cieRGB to XYZ transform

r,g,b : input image buffers

x,y,z: transform buffers

N1, M1: upper left corner coordinates

N2, M2: lower right corner coordinates */

{

int I, j; double R,G,B; double X,Y,Z;

for(I = N1;I< N2;I++)

for(j = M1;j<M2;j++)

{ R = (double)r[i][j]; G = (double)g[i][j]; B = (double)b[i][j];

X = 0.490*R + 0.310*B + 0.200* B;

Y = 0.177*R + 0.813*G + 0.011*B;

Z = 0.010*G + 0.990*B;

If(X>255.0) x[i][j]=255; else x[i][j]=(unsigned char)X;

If(Y>255.0) y[i][j]=255; else y[i][j]=(unsigned char)Y;

If(Z>255.0) z[i][j]=255; else z[i][j]=(unsigned char)Z;

}

return(0);

}

หน้าแรก

 

 

ขอบคุณข้อมูลจาก  รศ. ดร. มนตรี กาญจนะเดชะ