CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Location
    Pakistan
    Posts
    1

    RGB to grayscale using YUV

    I have a bitmap file. I have to convert it in gray scale using YUV color model. Can any one help me?Please hurry assignment due within 3 hours

  2. #2
    Join Date
    Apr 2000
    Location
    Frederick, Maryland
    Posts
    507
    Try this

    First convert YUV into RGB using these formulae

    R = Y + V
    G = Y - 0.166667U - 0.5V
    B = Y + U

    Then calculate Gray scale from this by using this formula

    GrayLevel = R * 0.30 + G * 0.59 + B * 0.11

    Hope it helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured