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

  • Home
  • SEARCH
  • 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 9140553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:31:52+00:00 2026-06-17T09:31:52+00:00

I have been stumped by this for quite some time. could you please help

  • 0

I have been stumped by this for quite some time. could you please help me to know, what datatype does the minMaxLoc() in Opencv consider, while finding the max, min vlaues of a Mat variable? I got a certain value from the function, but I have no idea wat that value actually represents, and in what data type?

    Laplacian(src_gray,dst,ddepth,kernel_size,scale,delta,BORDER_DEFAULT);
    minMaxLoc(dst,&min,&estimate,&minLoc,&maxLoc,noArray());

The value of ‘estimate’ is somewhere around 1000’s, while if I try to access the value of ‘dst’ Mat variable, using

    dst.at<datatype>(k,l)

Am getting vague values, starting from 124, 125 for uchar, to 2,xxx,xxx,xxx if I use long int. What is the value actually given by the minMaxLoc function? Please help me.

  • 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-17T09:31:53+00:00Added an answer on June 17, 2026 at 9:31 am

    min and estimate should be of type double and I would imagine they are correct. The issue is probably with you accessing

    dst.at<datatype>(k,l)
    

    As Abhishek Thakur mentioned, the output depends on your input. If you are ever confused about the type of a matrix you can look at dst.type() which returns an integer corresponding to the list defined in types_c.h starting at line 557. The definitions for single channel types or “depths” are

    #define CV_8U   0
    #define CV_8S   1 
    #define CV_16U  2
    #define CV_16S  3
    #define CV_32S  4
    #define CV_32F  5
    #define CV_64F  6
    

    You can see the formula used to calculate the other type identifiers on line 573

    #define CV_CN_SHIFT   3
    #define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)
    
    #define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)
    #define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)
    
    #define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
    

    for example

    #define CV_8UC4 CV_MAKETYPE(CV_8U,4)
    

    has type

    0+((4-1) << 3) == 24
    

    so for a 4 channel uchar image, type() will return 24. From the above you can see that the depth of a type is represented by the last 3 bits of the type integer. If all you want is the depth (you don’t care how many channels it has) you can get that directly with dst.depth()

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

Sidebar

Related Questions

i have been stumped on this for quite a while now. I am trying
I have been stumped on this for quite awhile. Request#, SlotId, Segment, and Version
I have been trying to get this to work for some time. I'm just
I'm trying to a LINQ query, and I have been stumped for some time.
I ran into an issue today and I have been stumped for some time
I have been very stumped by this one. I have a fairly large (~1500
I have been stumped all day on this problem. Basically I want to check
I have been stumped for 3 hours now on this problem, I need to
Hey this might be a simple question, but i have been stumped on it
I have been stumped by this problem. I need to create a pattern such

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.