- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm a little confused. The function RGBToGray will work for BGR format too? Or I have to do the conversion before? Thank you very much.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If there's a version with planar input, then yes you could and just swap the R and B planes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page