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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:47:48+00:00 2026-06-08T23:47:48+00:00

I used a function called ‘calcHist’ in opencv. And its declaration is: void calcHist(const

  • 0

I used a function called ‘calcHist’ in opencv. And its declaration is:

void calcHist(const Mat* arrays, int narrays, const int* channels, InputArray mask, OutputArray hist, int dims, const int* histSize, const float** ranges, bool uniform=true, bool accumulate=false )

I wrote a code snippets:

Mat img = imread("lena.jpg", CV_LOAD_IMAGE_GRAYSCALE);

Mat* arrays = &img;
int narrays = 1;
int channels[] = { 0 };
InputArray mask = noArray();
Mat hist;
int dims = 1;
int histSize[] = { 256 };   
float hranges[] = { 0.0, 255.0 };
float *ranges[] = { hranges };

calcHist(arrays, narrays, channels, mask, hist, dims, histSize, ranges);

and then got an error:IntelliSense: no instance of overloaded function “calcHist” matches the argument list
But if I prefix ‘const’ to ‘float *ranges[] = {ranges};’ like const float *ranges[] = { hranges }; it’s okay.

So why this ‘const’ is necessary and the ‘const’ before histSize is not.

  • 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-08T23:47:51+00:00Added an answer on June 8, 2026 at 11:47 pm

    T* implicitly converts to const T*. Correspondingly, this means T** implicitly converts to T*const*. T*const* is not const T**, so this conversion doesn’t work to let you make the function call.

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

Sidebar

Related Questions

I have a callback function called got_packet: void got_packet(u_char *args, const struct pcap_pkthdr *header,
In Python there is a built-in function called dir . This is used to
Jquery has utility a function called ' extend ' which can be used to
In Python there is a really neat function called zip which can be used
i have a function called fun1() , which is used for recursion. I am
In my parent jsp page I've used: function popUpClosed() { window.location.reload(); } And in
I used same function ( OneWayEncrypt(edit1.Text) ) in Delphi 5 and 2010. Why the
What is the function used to create taxonomy terms in Drupal from the code?
I have used sendinput() function and windows keyboard hooks to develop a custom keyboard
I have used this function to convert string to bits. def a2bits(chars): return bin(reduce(lambda

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.