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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:45:29+00:00 2026-05-24T05:45:29+00:00

I am trying to convolve an image with a filter and storing it to

  • 0

I am trying to convolve an image with a filter and storing it to a matrix of type CV_64F with the help of filter2D function in opencv. but the type of the destination matrix get changed and i try to change it back to CV_64F with the help of assignTo 0r ConvertTo function but i am not able to do so. Can someone help? This is lines of my code

                     cv::Mat op = cv::Mat(25,25,a.type(),Arr1); // a is the image matrix and op is the filter.
         cv::Point anchor = Point(-1,-1);
         cv::Mat b = cv::Mat(a.size(),CV_64F);
         cv::Mat l = cv::Mat(a.size(),CV_64F);
         cv::Mat m = cv::Mat(a.size(),CV_64F);

        //prnmt(a);

         filter2D(a,b,-1,op,anchor,0,BORDER_DEFAULT);
         b.assignTo(l,CV_64F);
  • 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-05-24T05:45:32+00:00Added an answer on May 24, 2026 at 5:45 am

    I tried running the following similar code with OpenCV 2.3 and it worked i.e. b‘s type was CV_64F after the call to filter2D:

    cv::Mat a(100, 100, CV_64F); 
    cv::Mat op(25, 25, CV_64F);
    cv::Mat b(a.size(), CV_64F);
    cv::Mat l(a.size(), CV_64F);
    cv::Mat m(a.size(), CV_64F);
    cv::Point anchor(-1, -1);
    
    filter2D(a, b, -1, op, anchor, 0, cv::BORDER_DEFAULT);
    

    Are you sure a is CV_64F in your code?

    To what type is b getting converted to by filter2D?

    Which version of OpenCV are you using?

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

Sidebar

Related Questions

Trying to find some information on this but am unable to get any results
Trying to do this with a single query, but want to get a list
Trying to get my css / C# functions to look like this: body {
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
Trying to do this sort of thing... WHERE username LIKE '%$str%' ...but using bound
Trying to load a page fragment, or at least jump to a div but
Trying to do this, but is it wrong? Below is my style and script
Trying to write this small program to help me in my Stats class, everything
I'm trying to compute the laplacian of a 2d field A using scipy.ndimage.convolve .
Trying to execute a Powershell cmdlet from a MVC 3 Controller using impersonation but

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.