Presentation is loading. Please wait.

Presentation is loading. Please wait.

2004/03/22 Color Models 1 Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.

Similar presentations


Presentation on theme: "2004/03/22 Color Models 1 Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University."— Presentation transcript:

1 2004/03/22 Color Models 1 Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University

2 22004/03/22Color Models Outline Color models Color Images C***Document & C***View C***Document & C***View Tools library

3 32004/03/22Color Models To facilitate the specification of colors in some standard Hardware-oriented Hardware-oriented RGB: color monitors CYM: printers YIQ: TV broadcast Application-oriented Application-oriented HSI: color image manipulation HSV: color image manipulation

4 42004/03/22Color Models RGB Color Model R G B Cyan Yellow Green Magenta Red Blue White Black (0,1,0) (0,0,1) (1,0,0) Gray Scale

5 52004/03/22Color Models YIQ Used for commercial color TV broadcasting Compatibility with monochrome TV standards Compatibility with monochrome TV standards Take advantage of human visual system’s greater sensitivity to changes in luminance Take advantage of human visual system’s greater sensitivity to changes in luminance Y (luminance) The amount of light perceived by the eye The amount of light perceived by the eye IQ (color information)

6 62004/03/22Color Models RGB to YIQ Y = 0.299 R + 0.587 G + 0.114 B I = 0.596 R - 0.275 G – 0.321 B Q = 0.212 R – 0.523 G + 0.311 B

7 72004/03/22Color Models C***Document Add data short * m_p2BImage; short * m_p2BImage; unsigned char * m_p1BImage; unsigned char * m_p1BImage; unsigned char * m_pRedImage; unsigned char * m_pRedImage; unsigned char * m_pGreenImage; unsigned char * m_pGreenImage; unsigned char * m_pBlueImage; unsigned char * m_pBlueImage; int m_nWidth; int m_nWidth; int m_nHeight; int m_nHeight;

8 82004/03/22Color Models C***Document Add core functions short * Get2BImageBuffer(); short * Get2BImageBuffer(); unsigned char * Get1BImageBuffer(); unsigned char * Get1BImageBuffer(); unsigned char * GetRedImageBuffer(); unsigned char * GetRedImageBuffer(); unsigned char * GetGreenImageBuffer(); unsigned char * GetGreenImageBuffer(); unsigned char * GetBlueImageBuffer(); unsigned char * GetBlueImageBuffer(); int GetImageWidth(); int GetImageWidth(); int GetImageHeight(); int GetImageHeight();

9 92004/03/22Color Models C***View #include “tools.h” C***View::OnDraw(CDC * pDC){ intnWidth = pDoc->GetImageWidth(); intnHeight = pDoc->GetImageHeight(); intnHeight = pDoc->GetImageHeight(); ShowImage_1B(pDC, pDoc->Get1BImageBuffer(), nWidth, nHeight ); ShowImage_2B(pDC, pDoc->Get2BImageBuffer(), nWidth, nHeight, nWidth, 0 ); ShowImage_3B(pDC, pDoc->GetRedImageBuffer(), pDoc->GetGreenImageBuffer(), pDoc->GetBlueImageBuffer(), nWidth, nHeight, 0, nHeight); }

10 102004/03/22Color Models Tools Library Providing functions of displaying images 1-byte 1-byte void ShowImage_1B(CDC * pDC, unsigned char * pImage, int nWidth, int nHeight); 2-byte 2-byte void ShowImage_2B(CDC * pDC, short * pImage, int nWidth, int nHeight); 3-byte 3-byte void ShowImage_3B(CDC * pDC, unsigned char * pRedImage, unsigned char * pGreenImage, unsigned char * pBlueImage, int nWidth, int nHeight);

11 112004/03/22Color Models Results


Download ppt "2004/03/22 Color Models 1 Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University."

Similar presentations


Ads by Google