muPP API 参考
目录
Adjust Brightness
Adjust brightness of an image.
Functions
Function muppiAdjustBrightness_32f_C1R
![][public]
MUppStatus muppiAdjustBrightness_32f_C1R(const MUpp32f *pSrc, int nSrcStep, MUpp32f *pDst, int nDstStep, MUppiSize oSizeROI, MUpp32f brightness_factor)
1 channel 32-bit float GRAY adjust.
Parameters:
- pSrc: source_image_pointer.
- nSrcStep: source_image_line_step.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oSizeROI: roi_specification.
- brightness_factor: How much to adjust the brightness. Can be any non negative number. 0 gives a black image, 1 gives the original image while 2 increases the brightness by a factor of 2.
Returns:
MUppStatus image_data_error_codes, roi_error_codes
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
Return type: MUppStatus
Function muppiAdjustBrightness_32f_C3R
![][public]
MUppStatus muppiAdjustBrightness_32f_C3R(const MUpp32f *pSrc, int nSrcStep, MUpp32f *pDst, int nDstStep, MUppiSize oSizeROI, MUpp32f brightness_factor)
3 channel 32-bit float RGB adjust.
Parameters:
- pSrc: source_image_pointer.
- nSrcStep: source_image_line_step.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oSizeROI: roi_specification.
- brightness_factor: How much to adjust the brightness. Can be any non negative number. 0 gives a black image, 1 gives the original image while 2 increases the brightness by a factor of 2.
Returns:
MUppStatus image_data_error_codes, roi_error_codes
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
Return type: MUppStatus
Adjust Hue
Adjust hue of an image. The image hue is adjusted by converting the image to HSV and cyclically shifting the intensities in the hue channel (H). The image is then converted back to original image mode. hue_factor is the amount of shift in H channel and must be in the interval [-0.5, 0.5].
Functions
Function muppiAdjustHue_32f_C1R
![][public]
MUppStatus muppiAdjustHue_32f_C1R(const MUpp32f *pSrc, int nSrcStep, MUpp32f *pDst, int nDstStep, MUppiSize oSizeROI, MUpp32f hue_factor)
1 channel 32-bit float GRAY adjust.
Parameters:
- pSrc: source_image_pointer.
- nSrcStep: source_image_line_step.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oSizeROI: roi_specification.
- hue_factor: How much to shift the hue channel. Should be in [-0.5, 0.5]. 0.5 and -0.5 give complete reversal of hue channel in HSV space in positive and negative direction respectively. 0 means no shift. Therefore, both -0.5 and 0.5 will give an image with complementary colors while 0 gives the original image.
Returns:
MUppStatus image_data_error_codes, roi_error_codes
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
Return type: MUppStatus
Function muppiAdjustHue_32f_C3R
![][public]
MUppStatus muppiAdjustHue_32f_C3R(const MUpp32f *pSrc, int nSrcStep, MUpp32f *pDst, int nDstStep, MUppiSize oSizeROI, MUpp32f hue_factor)
3 channel 32-bit float RGB adjust.
Parameters:
- pSrc: source_image_pointer.
- nSrcStep: source_image_line_step.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oSizeROI: roi_specification.
- hue_factor: How much to shift the hue channel. Should be in [-0.5, 0.5]. 0.5 and -0.5 give complete reversal of hue channel in HSV space in positive and negative direction respectively. 0 means no shift. Therefore, both -0.5 and 0.5 will give an image with complementary colors while 0 gives the original image.
Returns:
MUppStatus image_data_error_codes, roi_error_codes
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
Return type: MUppStatus
Adjust Saturation
Adjust color saturation of an image.
Functions
Function muppiAdjustSaturation_32f_C1R
![][public]
MUppStatus muppiAdjustSaturation_32f_C1R(const MUpp32f *pSrc, int nSrcStep, MUpp32f *pDst, int nDstStep, MUppiSize oSizeROI, MUpp32f saturation_factor)
1 channel 32-bit float GRAY adjust.
Parameters:
- pSrc: source_image_pointer.
- nSrcStep: source_image_line_step.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oSizeROI: roi_specification.
- saturation_factor: How much to adjust the saturation. 0 will give a black and white image, 1 will give the original image while 2 will enhance the saturation by a factor of 2.
Returns:
MUppStatus image_data_error_codes, roi_error_codes
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
Return type: MUppStatus
Function muppiAdjustSaturation_32f_C3R
![][public]
MUppStatus muppiAdjustSaturation_32f_C3R(const MUpp32f *pSrc, int nSrcStep, MUpp32f *pDst, int nDstStep, MUppiSize oSizeROI, MUpp32f saturation_factor)
3 channel 32-bit float RGB adjust.
Parameters:
- pSrc: source_image_pointer.
- nSrcStep: source_image_line_step.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oSizeROI: roi_specification.
- saturation_factor:
Returns:
MUppStatus image_data_error_codes, roi_error_codes
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
Return type: MUppStatus
Affine Transform
Transforms (warps) an image based on an affine transform.
The affine transform is given as a formula {"type":"element","name":"formula","attributes":{"id":"24"},"children":[{"type":"text","text":"$2\\times 3$"}]} matrix C. A pixel location formula {"type":"element","name":"formula","attributes":{"id":"25"},"children":[{"type":"text","text":"$(x, y)$"}]} in the source image is mapped to the location formula {"type":"element","name":"formula","attributes":{"id":"26"},"children":[{"type":"text","text":"$(x', y')$"}]} in the destination image. The destination image coorodinates are computed as follows: formula {"type":"element","name":"formula","attributes":{"id":"27"},"children":[{"type":"text","text":"\\[\n x' = c_{00} * x + c_{01} * y + c_{02} \\qquad\n y' = c_{10} * x + c_{11} * y + c_{12} \\qquad\n C = \\left[ \\matrix{c_{00} & c_{01} & c_{02} \\cr\n c_{10} & c_{11} & c_{12} } \\right]\n \\]"}]} Affine transforms can be understood as a linear transformation (traditional matrix multiplication) and a shift operation. The formula {"type":"element","name":"formula","attributes":{"id":"28"},"children":[{"type":"text","text":"$2\\times 2$"}]} matrix formula {"type":"element","name":"formula","attributes":{"id":"29"},"children":[{"type":"text","text":"\\[\n L = \\left[ \\matrix{c_{00} & c_{01} \\cr\n c_{10} & c_{11} } \\right]\n \\]"}]} represents the linear transform portion of the affine transformation. The vector formula {"type":"element","name":"formula","attributes":{"id":"30"},"children":[{"type":"text","text":"\\[\n v = \\left( \\matrix{c_{02} \\cr\n c_{12} } \\right)\n \\]"}]} represents the post-transform shift, i.e. after the pixel location is transformed by formula {"type":"element","name":"formula","attributes":{"id":"31"},"children":[{"type":"text","text":"$L$"}]} it is translated by formula {"type":"element","name":"formula","attributes":{"id":"32"},"children":[{"type":"text","text":"$v$"}]}.
Common parameters for muppiWarpAffine packed pixel functions include:
Parameters:
- pSrc: source_image_pointer.
- oSrcSize: Size of source image in pixels.
- nSrcStep: source_image_line_step.
- oSrcROI: Source ROI.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oDstROI: Destination ROI.
- aCoeffs: Affine transform coefficients.
- eInterpolation: Interpolation mode: can be MUPPI_INTER_NN, MUPPI_INTER_LINEAR or MUPPI_INTER_CUBIC.
- muppStreamCtx: application_managed_stream_context.
Returns:
image_data_error_codes, roi_error_codes, Affine Transform Error Codes
Common parameters for muppiWarpAffine planar pixel functions include:
Parameters:
- pSrc: source_planar_image_pointer_array (host memory array containing device memory image plane pointers).
- oSrcSize: Size of source image in pixels.
- nSrcStep: source_image_line_step.
- oSrcROI: Source ROI.
- pDst: destination_planar_image_pointer_array. (host memory array containing device memory image plane pointers)
- nDstStep: destination_image_line_step.
- oDstROI: Destination ROI.
- aCoeffs: Affine transform coefficients.
- eInterpolation: Interpolation mode: can be MUPPI_INTER_NN, MUPPI_INTER_LINEAR or MUPPI_INTER_CUBIC.
- muppStreamCtx: application_managed_stream_context.
Returns:
image_data_error_codes, roi_error_codes, Affine Transform Error Codes
Functions
Function muppiWarpAffine_32f_C1R
![][public]
MUppStatus muppiWarpAffine_32f_C1R(const MUpp32f *pSrc, MUppiSize oSrcSize, int nSrcStep, MUppiRect oSrcROI, MUpp32f *pDst, int nDstStep, MUppiRect oDstROI, const double aCoeffs[2][3], int eInterpolation)
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
- const double aCoeffs
- int eInterpolation
Return type: MUppStatus
Function muppiWarpAffine_32f_C3R
![][public]
MUppStatus muppiWarpAffine_32f_C3R(const MUpp32f *pSrc, MUppiSize oSrcSize, int nSrcStep, MUppiRect oSrcROI, MUpp32f *pDst, int nDstStep, MUppiRect oDstROI, const double aCoeffs[2][3], int eInterpolation)
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
- const double aCoeffs
- int eInterpolation
Return type: MUppStatus
Affine Transform Batch
Details of the warp affine operation are described above in the WarpAffine section. WarpAffineBatch generally takes the same parameter list as WarpAffine except that there is a list of N instances of those parameters (N blockquote {"type":"element","name":"blockquote","attributes":{},"children":[{"type":"element","name":"para","attributes":{},"children":[{"type":"element","name":"zwj","attributes":{},"children":[]},{"type":"text","text":"1) and that list is passed in device memory. A convenient data structure is "}]},{"type":"text","text":"\n"}]}provided that allows for easy initialization of the parameter lists. The aTransformedCoeffs array is for internal use only and should not be directly initialized by the application. The only restriction on these functions is that there is one single source ROI rectangle and one single destination ROI rectangle which are applied respectively to each image in the batch. The primary purpose of this function is to provide improved performance for batches of smaller images as long as GPU resources are available. Therefore it is recommended that the function not be used for very large images as there may not be resources available for processing several large images simultaneously. A single set of oSrcRectROI and oDstRectROI values are applied to each source image and destination image in the batch. Source and destination image sizes may vary but oSmallestSrcSize must be set to the smallest source and image size in the batch. The parameters in the MUppiWarpAffineBatchCXR structure represent the corresponding per-image muppiWarpAffine parameters for each image in the batch. The MUppiWarpAffineBatchCXR array must be in device memory. The muppiWarpAffineBatchInit function MUST be called AFTER the application has initialized the array of MUppiWarpAffineBatchCXR structures and BEFORE calling any of the muppiWarpAffineBatch functions to so that the aTransformedCoeffs array can be internally pre-initialized for each image in the batch. The batch size passed to muppiWarpAffineBatchInit must match the batch size passed to the corresponding warp affine batch function.
WarpAffineBatch supports the following interpolation modes:
MUPPI_INTER_NN MUPPI_INTER_LINEAR MUPPI_INTER_CUBIC
Codes
The warp affine primitives return the following error codes:
- ::MUPP_RECTANGLE_ERROR if either destination ROI width or height is less than 1 pixel.
- ::MUPP_INTERPOLATION_ERROR if eInterpolation has an illegal value.
- ::MUPP_SIZE_ERROR if source size width or height is less than 2
pixels.
Common parameters for muppiWarpAffineBatch functions include:
Parameters:
- oSmallestSrcSize: Size in pixels of the entire smallest source image width and height, may be from different images.
- oSrcRectROI: Region of interest in the source images.
- oDstRectROI: Region of interest in the destination images.
- eInterpolation: The type of eInterpolation to perform resampling. Currently limited to MUPPI_INTER_NN, MUPPI_INTER_LINEAR, or MUPPI_INTER_CUBIC.
- pBatchList: Device memory pointer to nBatchSize list of
MUppiWarpAffineBatchCXRstructures. - nBatchSize: Number of
MUppiWarpAffineBatchCXRstructures in this call (must be > 1). - muppStreamCtx: application_managed_stream_context.
Returns:
image_data_error_codes, roi_error_codes
Affine Transform Utility
Functions The set of affine transform utility functions.
Functions
Function muppiGetAffineTransform
![][public]
MUppStatus muppiGetAffineTransform(MUppiRect oSrcROI, const double aQuad[4][2], double aCoeffs[2][3])
Computes affine transform coefficients based on source ROI and destination quadrilateral.
The function computes the coefficients of an affine transformation that maps the given source ROI (axis aligned rectangle with integer coordinates) to a quadrilateral in the destination image.
An affine transform in 2D is fully determined by the mapping of just three vertices. This function's API allows for passing a complete quadrilateral effectively making the prolem overdetermined. What this means in practice is, that for certain quadrilaterals it is not possible to find an affine transform that would map all four corners of the source ROI to the four vertices of that quadrilateral.
The function circumvents this problem by only looking at the first three vertices of the destination image quadrilateral to determine the affine transformation's coefficients. If the destination quadrilateral is indeed one that cannot be mapped using an affine transformation the functions informs the user of this situation by returning a MUPP_AFFINE_QUAD_INCORRECT_WARNING.
Parameters:
- oSrcROI: The source ROI. This rectangle needs to be at least one pixel wide and high. If either width or hight are less than one an MUPP_RECTANGLE_ERROR is returned.
- aQuad: The destination quadrilateral.
- aCoeffs: The resulting affine transform coefficients.
Returns:
Error codes:
Parameters:
- const double aQuad
- double aCoeffs
Return type: MUppStatus
Function muppiGetAffineQuad
![][public]
MUppStatus muppiGetAffineQuad(MUppiRect oSrcROI, double aQuad[4][2], const double aCoeffs[2][3])
Compute shape of transformed image.
This method computes the quadrilateral in the destination image that the source ROI is transformed into by the affine transformation expressed by the coefficients array (aCoeffs).
Parameters:
- oSrcROI: The source ROI.
- aQuad: The resulting destination quadrangle.
- aCoeffs: The afine transform coefficients.
Returns:
Error codes:
Parameters:
- double aQuad
- const double aCoeffs
Return type: MUppStatus
Function muppiGetAffineBound
![][public]
MUppStatus muppiGetAffineBound(MUppiRect oSrcROI, double aBound[2][2], const double aCoeffs[2][3])
Compute bounding-box of transformed image.
The method effectively computes the bounding box (axis aligned rectangle) of the transformed source ROI (see muppiGetAffineQuad()).
Parameters:
- oSrcROI: The source ROI.
- aBound: The resulting bounding box.
- aCoeffs: The afine transform coefficients.
Returns:
Error codes:
Parameters:
- double aBound
- const double aCoeffs
Return type: MUppStatus
Backwards Affine Transform
Transforms (warps) an image based on an affine transform.
The affine transform is given as a formula {"type":"element","name":"formula","attributes":{"id":"24"},"children":[{"type":"text","text":"$2\\times 3$"}]} matrix C. A pixel location formula {"type":"element","name":"formula","attributes":{"id":"25"},"children":[{"type":"text","text":"$(x, y)$"}]} in the source image is mapped to the location formula {"type":"element","name":"formula","attributes":{"id":"26"},"children":[{"type":"text","text":"$(x', y')$"}]} in the destination image. The destination image coorodinates fullfil the following properties: formula {"type":"element","name":"formula","attributes":{"id":"33"},"children":[{"type":"text","text":"\\[\n x = c_{00} * x' + c_{01} * y' + c_{02} \\qquad\n y = c_{10} * x' + c_{11} * y' + c_{12} \\qquad\n C = \\left[ \\matrix{c_{00} & c_{01} & c_{02} \\cr\n c_{10} & c_{11} & c_{12} } \\right]\n \\]"}]} In other words, given matrix formula {"type":"element","name":"formula","attributes":{"id":"34"},"children":[{"type":"text","text":"$C$"}]} the source image's shape is transfored to the destination image using the inverse matrix formula {"type":"element","name":"formula","attributes":{"id":"35"},"children":[{"type":"text","text":"$C^{-1}$"}]}: formula {"type":"element","name":"formula","attributes":{"id":"36"},"children":[{"type":"text","text":"\\[\n M = C^{-1} = \\left[ \\matrix{m_{00} & m_{01} & m_{02} \\cr\n m_{10} & m_{11} & m_{12} } \\right]\n x' = m_{00} * x + m_{01} * y + m_{02} \\qquad\n y' = m_{10} * x + m_{11} * y + m_{12} \\qquad\n \\]"}]}
Common parameters for muppiWarpAffineBack packed pixel functions include:
Parameters:
- pSrc: source_image_pointer.
- oSrcSize: Size of source image in pixels.
- nSrcStep: source_image_line_step.
- oSrcROI: Source ROI.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oDstROI: Destination ROI.
- aCoeffs: Affine transform coefficients.
- eInterpolation: Interpolation mode: can be MUPPI_INTER_NN, MUPPI_INTER_LINEAR or MUPPI_INTER_CUBIC.
- muppStreamCtx: application_managed_stream_context.
Returns:
image_data_error_codes, roi_error_codes, Affine Transform Error Codes
Common parameters for muppiWarpAffineBack planar pixel functions include:
Parameters:
- pSrc: source_planar_image_pointer_array (host memory array containing device memory image plane pointers).
- oSrcSize: Size of source image in pixels.
- nSrcStep: source_image_line_step.
- oSrcROI: Source ROI.
- pDst: destination_planar_image_pointer_array (host memory array containing device memory image plane pointers).
- nDstStep: destination_image_line_step.
- oDstROI: Destination ROI.
- aCoeffs: Affine transform coefficients.
- eInterpolation: Interpolation mode: can be MUPPI_INTER_NN, MUPPI_INTER_LINEAR or MUPPI_INTER_CUBIC.
- muppStreamCtx: application_managed_stream_context.
Returns:
image_data_error_codes, roi_error_codes, Affine Transform Error Codes
Backwards Perspective Transform
Transforms (warps) an image based on a perspective transform.
The perspective transform is given as a formula {"type":"element","name":"formula","attributes":{"id":"37"},"children":[{"type":"text","text":"$3\\times 3$"}]} matrix C. A pixel location formula {"type":"element","name":"formula","attributes":{"id":"25"},"children":[{"type":"text","text":"$(x, y)$"}]} in the source image is mapped to the location formula {"type":"element","name":"formula","attributes":{"id":"26"},"children":[{"type":"text","text":"$(x', y')$"}]} in the destination image. The destination image coorodinates fullfil the following properties: formula {"type":"element","name":"formula","attributes":{"id":"40"},"children":[{"type":"text","text":"\\[\n x = \\frac{c_{00} * x' + c_{01} * y' + c_{02}}{c_{20} * x' + c_{21} * y' +\nc_{22}} \\qquad\n y = \\frac{c_{10} * x' + c_{11} * y' + c_{12}}{c_{20} * x' + c_{21} * y' +\nc_{22}}\n \\]"}]} formula {"type":"element","name":"formula","attributes":{"id":"39"},"children":[{"type":"text","text":"\\[\n C = \\left[ \\matrix{c_{00} & c_{01} & c_{02} \\cr\n c_{10} & c_{11} & c_{12} \\cr\n c_{20} & c_{21} & c_{22} } \\right]\n \\]"}]} In other words, given matrix formula {"type":"element","name":"formula","attributes":{"id":"34"},"children":[{"type":"text","text":"$C$"}]} the source image's shape is transfored to the destination image using the inverse matrix formula {"type":"element","name":"formula","attributes":{"id":"35"},"children":[{"type":"text","text":"$C^{-1}$"}]}: formula {"type":"element","name":"formula","attributes":{"id":"41"},"children":[{"type":"text","text":"\\[\n M = C^{-1} = \\left[ \\matrix{m_{00} & m_{01} & m_{02} \\cr\n m_{10} & m_{11} & m_{12} \\cr\n m_{20} & m_{21} & m_{22} } \\right]\n x' = \\frac{c_{00} * x + c_{01} * y + c_{02}}{c_{20} * x + c_{21} * y +\nc_{22}} \\qquad\n y' = \\frac{c_{10} * x + c_{11} * y + c_{12}}{c_{20} * x + c_{21} * y +\nc_{22}}\n \\]"}]}
Common parameters for muppiWarpPerspectiveBack packed pixel functions include:
Parameters:
- pSrc: source_image_pointer.
- oSrcSize: Size of source image in pixels.
- nSrcStep: source_image_line_step.
- oSrcROI: Source ROI.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oDstROI: Destination ROI.
- aCoeffs: Perspective transform coefficients.
- eInterpolation: Interpolation mode: can be MUPPI_INTER_NN, MUPPI_INTER_LINEAR or MUPPI_INTER_CUBIC.
- muppStreamCtx: application_managed_stream_context.
Returns:
image_data_error_codes, roi_error_codes, Perspective Transform Error Codes
Common parameters for muppiWarpPerspectiveBack planar pixel functions include:
Parameters:
- pSrc: source_planar_image_pointer_array (host memory array containing device memory image plane pointers).
- oSrcSize: Size of source image in pixels.
- nSrcStep: source_image_line_step.
- oSrcROI: Source ROI.
- pDst: destination_planar_image_pointer_array (host memory array containing device memory image plane pointers).
- nDstStep: destination_image_line_step.
- oDstROI: Destination ROI.
- aCoeffs: Perspective transform coefficients.
- eInterpolation: Interpolation mode: can be MUPPI_INTER_NN, MUPPI_INTER_LINEAR or MUPPI_INTER_CUBIC.
- muppStreamCtx: application_managed_stream_context.
Returns:
image_data_error_codes, roi_error_codes, Perspective Transform Error Codes
IQABatch
Primitives for computing the image quality for a batch of image pairs, such as MSE, PSNR, SSIM, and MS-SSIM with a single roi_specification for all pairs of input images
IQABatchAdvanced
Primitives for computing the image quality for a batch of image pairs, such as MSE, PSNR, SSIM, and MS-SSIM with per-image roi_specification
BGRToCbYCr422
BGR to CbYCr422 color conversion.
BGRToCbYCr422_709HDTV
BGR to CbYCr422_709HDTV color conversion.
BGRToHLS
BGR to HLS color conversion.
BGRToLab
BGR to Lab color conversion.
This is how MUPP converts gamma corrected BGR or RGB to Lab using the CIE Lab D65 white point with a Y luminance of 1.0. The computed values of the L component are in the range [0..100], a and b component values are in the range [-128..127]. The code uses cbrtf() the 32 bit floating point cube root math function.
// use CIE Lab chromaticity coordinates #define nCIE_LAB_D65_xn 0.950455F #define nCIE_LAB_D65_yn 1.0F #define nCIE_LAB_D65_zn 1.088753F // First convert to XYZ MUpp32f nNormalizedR = (MUpp32f)R * 0.003921569F; // / 255.0F MUpp32f nNormalizedG = (MUpp32f)G * 0.003921569F; MUpp32f nNormalizedB = (MUpp32f)B * 0.003921569F; MUpp32f nX = 0.412453F * nNormalizedR + 0.35758F * nNormalizedG + 0.180423F
- nNormalizedB; MUpp32f nY = 0.212671F * nNormalizedR + 0.71516F * nNormalizedG + 0.072169F * nNormalizedB; MUpp32f nZ = 0.019334F * nNormalizedR
- 0.119193F * nNormalizedG + 0.950227F * nNormalizedB; MUpp32f nL = cbrtf(nY); MUpp32f nA; MUpp32f nB; MUpp32f nfX = nX * 1.052128F; // / nCIE_LAB_D65_xn; MUpp32f nfY = nY; MUpp32f nfZ = nZ * 0.918482F; // / nCIE_LAB_D65_zn; nfY = nL
- 16.0F; nL = 116.0F * nL - 16.0F; nA = cbrtf(nfX) - 16.0F; nA = 500.0F
- (nA - nfY); nB = cbrtf(nfZ) - 16.0F; nB = 200.0F * (nfY - nB); // Now scale Lab range nL = nL * 255.0F
- 0.01F; // / 100.0F nA = nA + 128.0F; nB = nB + 128.0F; L = (MUpp8u)nL; a = (MUpp8u)nA; b = (MUpp8u)nB;
BGRToNV12
BGR to NV12 color conversion.
Functions
Function muppiBGRToNV12_8u_C3P2R
![][public]
MUppStatus muppiBGRToNV12_8u_C3P2R(const MUpp8u *pSrc, int nSrcStep, MUpp8u *pDst[2], int rDstStep, MUppiSize oSizeROI)
Parameters:
-
const
MUpp8u* pSrc -
int nSrcStep TODO:
-
array {"type":"element","name":"array","attributes":{},"children":[{"type":"text","text":"[2]"}]}--> -
int rDstStep
Return type: MUppStatus
BGRToYCbCr
BGR to YCbCr color conversion.
BGRToYCbCr411
BGR to YCbCr411 color conversion.
BGRToYCbCr420
BGR to YCbCr420 color conversion.
Functions
Function muppiBGRToYCbCr420_8u_C3P3R
![][public]
MUppStatus muppiBGRToYCbCr420_8u_C3P3R(const MUpp8u *pSrc, int nSrcStep, MUpp8u *pDst[3], int rDstStep[3], MUppiSize oSizeROI)
Parameters:
-
const
MUpp8u* pSrc -
int nSrcStep TODO:
-
array {"type":"element","name":"array","attributes":{},"children":[{"type":"text","text":"[3]"}]}--> -
int rDstStep
Return type: MUppStatus
BGRToYCbCr420_709CSC
BGR to YCbCr420_709CSC color conversion.
BGRToYCbCr420_709HDTV
BGR to YCbCr420_709HDTV color conversion.
BGRToYCbCr422
BGR to YCbCr422 color conversion.
BGRToYCrCb420
BGR to YCrCb420 color conversion.
BGRToYCrCb420_709CSC
BGR to YCrCb420_709CSC color conversion.
BGRToYUV
BGR to YUV color conversion.
Here is how MUPP converts gamma corrected RGB or BGR to YUV. For digital RGB values in the range [0..255], Y has the range [0..255], U varies in the range [-112..+112], and V in the range [-157..+157]. To fit in the range of [0..255], a constant value of 128 is added to computed U and V values, and V is then saturated.
// For MUpp8u data MUpp32f nY = 0.299F * R + 0.587F * G + 0.114F * B; MUpp32f nU = (0.492F * ((MUpp32f)nB - nY)) + 128.0F; MUpp32f nV = (0.877F * ((MUpp32f)nR - nY)) + 128.0F; if (nV > 255.0F) nV = 255.0F;
// For MUpp32f data(normalized to [0,1]) MUpp32f nY = 0.299F * R + 0.587F * G + 0.114F * B; MUpp32f nU = (0.492F * ((MUpp32f)nB - nY)) + 0.5F; MUpp32f nV = (0.877F * ((MUpp32f)nR - nY)) + 0.5F; if (nV > 1.0F) nV = 1.0F;
Functions
Function muppiBGRToYUV_8u_C3R
![][public]
MUppStatus muppiBGRToYUV_8u_C3R(const MUpp8u *pSrc, int nSrcStep, MUpp8u *pDst, int nDstStep, MUppiSize oSizeROI)
Parameters:
- const
MUpp8u* pSrc - int nSrcStep
- int nDstStep
Return type: MUppStatus
Function muppiBGRToYUV_32f_C3R
![][public]
MUppStatus muppiBGRToYUV_32f_C3R(const MUpp32f *pSrc, int nSrcStep, MUpp32f *pDst, int nDstStep, MUppiSize oSizeROI)
3 channel 32-bit float packed BGR to 3 channel 32-bit float packed YUV color conversion.
Parameters:
- pSrc: source_image_pointer.
- nSrcStep: source_image_line_step.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oSizeROI: roi_specification.
Returns:
image_data_error_codes, roi_error_codes
Parameters:
- const
MUpp32f* pSrc - int nSrcStep
- int nDstStep
Return type: MUppStatus
BGRToYUV420
BGR to YUV420 color conversion.
CbYCr422ToRGB
CbYCr422 to RGB color conversion.
CbYCr422ToBGR
CbYCr422 to BGR color conversion.
CbYCr422ToBGR_709HDTV
CbYCr422 to BGR_709HDTV color conversion.
Compare_image_difference_to_constant_with_epsilon_operations
Compare Image Difference With Constant Within Epsilon Operations Compare differences between image pixels and constant within an epsilon value and create a binary result image. In case of multi-channel image types, the condition must be fulfilled for all channels, otherwise the comparison is considered false. The "binary" result image is of type 8u_C1. False is represented by 0, true by MUPP_MAX_8U.
Common parameters for muppiCompareEqualEpsC functions include:
Parameters:
- pSrc: source_image_pointer.
- nSrcStep: source_image_line_step.
- nConstant: constant value for single channel functions.
- pConstants: pointer to a list of constants, one per color channel for multi-channel image functions.
- pDst: destination_image_pointer.
- nDstStep: destination_image_line_step.
- oSizeROI: roi_specification.
- nEpsilon: epsilon tolerance value to compare to per color channel pixel absolute differences
- muppStreamCtx: application_managed_stream_context.
Returns:
image_data_error_codes, roi_error_codes