Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Paulo_César_B_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-10-2013
07:53 AM

151 Views

RGBToGray

Link Copied

6 Replies

andy4us

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-10-2013
08:23 AM

151 Views

If there's a version with planar input, then yes you could and just swap the R and B planes

Paulo_César_B_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-10-2013
08:49 AM

151 Views

Paulo_César_B_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-10-2013
11:52 AM

151 Views

Thank you very much! So, here worked fine with BGR format too =]

SergeyKostrov

Valued Contributor II

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-11-2013
09:42 PM

151 Views

Igor_A_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-14-2013
05:13 AM

151 Views

If Sergey are right and you see wrong coefficients for B & R - use another function, please:

/* /////////////////////////////////////////////////////////////////////////////

// Name: ippiColorToGray

// Purpose: Converts an RGB image to gray scale (custom coefficients)

// Parameters:

// pSrc Pointer to the source image , points to point(0,0)

// pDst Pointer to the destination image , points to point(0,0)

// roiSize Size of the ROI in pixels. Since the function performs point

// operations (without a border), the ROI may be the whole image.

// srcStep Step in bytes through the source image to jump on the next line

// dstStep Step in bytes through the destination image to jump on the next line

// coeffs[3] User-defined vector of coefficients.

// The sum of the coefficients should be less than or equal to 1

// Returns:

// ippStsNullPtrErr pSrc == NULL, or pDst == NULL

// ippStsSizeErr roiSize has a field with zero or negative value

// ippStsNoErr No errors

//

// The following equation is used to convert an RGB image to gray scale:

//

// Y = coeffs[0] * R + coeffs[1] * G + coeffs[2] * B;

//

//

*/

just swap coefficients from the formula above.

Regards, Igor

SergeyKostrov

Valued Contributor II

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-22-2013
07:30 AM

151 Views

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.