Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

RGBToGray with cv::Mat

$
0
0

Hi Guys,

i'm trying to use ipp to convert rgb image to grayscale one.

 

following code:

        gray_frame = Mat(color_frame.size().width, color_frame.size().height, CV_8UC1);

        IppiSize roi;
        roi.width = color_frame.size().width;
        roi.height = color_frame.size().height;
        Ipp8u* ippRGBPtr = (Ipp8u*)&color_frame.data[0]; // Get pointer to the data
        int ipprgbStep = color_frame.step; // get step value in bytes
        Ipp8u* ippGrayPtr = (Ipp8u*)&gray_frame.data[0]; // Get pointer to the data
        int ippGrayStep = gray_frame.step; // get step value in bytes
        ippiRGBToGray_8u_C3C1R(ippRGBPtr, ipprgbStep, ippGrayPtr, ippGrayStep, roi); // do the color conversion

 

the problem i'm facing is that the image i now fully procced,

when i cv::imshow(gray_frame) i see half of the image. 

what can be the problem?

 

thank you!

TCE Level: 

TCE Open Date: 

Sunday, March 22, 2020 - 12:53

Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>