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 8020115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:35:46+00:00 2026-06-04T21:35:46+00:00

I am really confused by using Mat and IplImage objects in OpenCV. I read

  • 0

I am really confused by using Mat and IplImage objects in OpenCV. I read a lot of questions and answers here but I am still in trouble with these 2 types.

Many times, I need converting them to each other that is what makes me lost in those conversions. The functions I know and use sometimes take IplImage objects and sometimes Mat objects.

For example, “cvThreshold” method takes IplImages and “threshold” method takes Mat objects, no problem here but “cvSmooth” method is only for IplImages, I couldn’t find a dedicated method for Mat objects (is there?), then I unwillingly convert Mat to IplImage then use in “cvSmooth” and then again convert to Mat. At this point, how can I use Mat object with cvSmooth? I am sure this is not a normal way to handle this issue and there are better ways. Maybe I am missing something in understanding these types.

Can you please help me out to get rid of this problem ?

  • 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-04T21:35:47+00:00Added an answer on June 4, 2026 at 9:35 pm

    Calling cvSmooth:

    void callCvSmooth(cv::Mat srcmtx, cv::Mat dstmtx, int smooth_type,
          int param1, int param2, double param3, double param4 )
    {
       IplImage src = srcmtx;
       IplImage dst = dstmtx;
       cvSmooth( &src, &dst, smooth_type, param1, param2, param3, param4 );
    }
    

    But if you look into the cvSmooth implementation you will easily find the C++ analogs:

    CV_IMPL void
    cvSmooth( const void* srcarr, void* dstarr, int smooth_type,
              int param1, int param2, double param3, double param4 )
    {
        cv::Mat src = cv::cvarrToMat(srcarr), dst0 = cv::cvarrToMat(dstarr), dst = dst0;
    
        CV_Assert( dst.size() == src.size() &&
            (smooth_type == CV_BLUR_NO_SCALE || dst.type() == src.type()) );
    
        if( param2 <= 0 )
            param2 = param1;
    
        if( smooth_type == CV_BLUR || smooth_type == CV_BLUR_NO_SCALE )
            cv::boxFilter( src, dst, dst.depth(), cv::Size(param1, param2), cv::Point(-1,-1),
                smooth_type == CV_BLUR, cv::BORDER_REPLICATE );
        else if( smooth_type == CV_GAUSSIAN )
            cv::GaussianBlur( src, dst, cv::Size(param1, param2), param3, param4, cv::BORDER_REPLICATE );
        else if( smooth_type == CV_MEDIAN )
            cv::medianBlur( src, dst, param1 );
        else
            cv::bilateralFilter( src, dst, param1, param3, param4, cv::BORDER_REPLICATE );
    
        if( dst.data != dst0.data )
            CV_Error( CV_StsUnmatchedFormats, "The destination image does not have the proper type" );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really confused here. I am trying to understand this code (it's javascript) but
I'm really confused as to using preg_replace but slowly learning. I need help with
Nested lists in Common Lisp really confused me. Here is the problem: By using
I am really confused with everybody in JS community using Node.js and NPM with
I´m using Mysql since quite a while and am really confused by the result
I am really confused. I want to create a Select drop down menu using
I am really confused right now and I can't get any right answers anywhere.
I know it is broad question but I am really confused. I have table
I have been reading about using Spring with Hibernate and I am really confused
I'm really confused by this... still. I asked a similar question to this a

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.