Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8857485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:36:03+00:00 2026-06-14T14:36:03+00:00

I’ve recently started using Intel Performance Primitives (IPP) for image processing. For those who

  • 0

I’ve recently started using Intel Performance Primitives (IPP) for image processing. For those who haven’t heard of IPP, think of IPP as the analogue of MKL for image processing instead of linear algebra.

I’ve already implemented a somewhat complicated vision system in OpenCV, and I’d like to swap out some of the OpenCV routines (e.g. convolution and FFT) for faster IPP routines. My OpenCV code always uses the cv::Mat image data structure. However, based on the IPP code samples, it seems that IPP prefers the CIppiImage data structure.

My system does several image transformations in OpenCV, then I want to do a couple of things in IPP, then do more work in OpenCV. Here’s a naive way to make OpenCV and IPP play nicely together:

 cv::Mat = load original image
 use OpenCV to do some work on cv::Mat
 write cv::Mat to file

 CIppiImage = read cv::Mat from file //for IPP
 use IPP to do some work on CIppiImage
 write CIppiImage to file

 cv::Mat = read CIppiImage from file
 use OpenCV to do more work on cv::Mat
 write final image to file

However, this is kind of tedious, and reading/writing files probably adds to the overall execution time.


I’m trying to make it more seamless to alternate between OpenCV and IPP in an image processing program. Here are a couple of things that could solve the problem:

  1. Is there a one-liner that would convert a cv::Mat to CIppiImage and vice versa?
  2. I am pretty familiar with the cv::Mat implementation details, but I don’t know much about CIppiImage. Do cv::Mat and CIppiImage have the same data layout? If so, could I do something similar to the following cast? CIppiImage cimg = (CIppiImage)(&myMat.data[0])?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:36:05+00:00Added an answer on June 14, 2026 at 2:36 pm

    There’s a clean way to pass OpenCV data into an IPP function.

    If we have an OpenCV Mat, we can cast *Mat.data[0] to an const Ipp<type>*. For example, if we’re dealing with 8-bit unsigned char (8u) data, we can plug (const Ipp8u*)&img.data[0] into an IPP function. Here’s an example using the ippiFilter function with the typical Lena image:

    Mat img = imread("./Lena.pgm"); //OpenCV 8U_C1 image
    Mat outImg = img.clone(); //allocate space for convolution results
    
    int step = img.cols; //pitch
    const Ipp32s kernel[9] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
    IppiSize kernelSize = {3,3};
    IppiSize dstRoiSize = {img.cols - kernelSize.width + 1, img.rows - kernelSize.height + 1};
    IppiPoint anchor = {2,2};
    int divisor = 1;
    
    IppStatus status = ippiFilter_8u_C1R((const Ipp8u*)&img.data[0], step,
                                         (Ipp8u*)&outImg.data[0], step, dstRoiSize,
                                         kernel, kernelSize, anchor, divisor);
    

    When I write outImg (from the above code) to a file, it gives the expected result:
    enter image description here

    This matches the result I got when I ran the Nvidia version, nppiFilter, with the same parameters:
    enter image description here


    I mentioned a structure called CIppiImage in the original question. CIppiImage just a simple wrapper for an array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.