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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:49:49+00:00 2026-05-31T04:49:49+00:00

I’m writing an android application in OpenCV, and have been spending a few hours

  • 0

I’m writing an android application in OpenCV, and have been spending a few hours looking into a few functions used in a C example http://www.shervinemami.info/blobs.html

The cvThreshold function is used in the example program like so –

cvThreshold(planeH, planeH, 18, UCHAR_MAX, CV_THRESH_BINARY_INV);
cvThreshold(planeS, planeS, 50, UCHAR_MAX, CV_THRESH_BINARY);
cvThreshold(planeV, planeV, 80, UCHAR_MAX, CV_THRESH_BINARY);

with 5 parameters. Documentation I’ve found for the function shows the same parameters, however the function seems to return a double rather than a void.

The parameters are –

cvThreshold(sourceImage, destinationImage, minThreshold, maxThreshold, 
            thresholdType);

As far as I can tell (and is documented), the function checks the source image to see which elements fall within the specified range (between min and max threshold) based on the thresholdType selected, and outputs the result to the destination image. But I have no idea why a double is returned…

The documentation provided with the Android version is included below.

/**
 * Applies a fixed-level threshold to each array element.
 *
 * The function applies fixed-level thresholding to a single-channel array. The
 * function is typically used to get a bi-level (binary) image out of a
 * grayscale image ("compare" could be also used for this purpose) or for
 * removing a noise, that is, filtering out pixels with too small or too large
 * values. There are several types of thresholding supported by the function.
 * They are determined by "thresholdType" :
 *   * THRESH_BINARY
 *
 * dst(x,y) = maxVal if src(x,y) > thresh; 0 otherwise
 *
 *   * THRESH_BINARY_INV
 *
 * dst(x,y) = 0 if src(x,y) > thresh; maxVal otherwise
 *
 *   * THRESH_TRUNC
 *
 * dst(x,y) = threshold if src(x,y) > thresh; src(x,y) otherwise
 *
 *   * THRESH_TOZERO
 *
 * dst(x,y) = src(x,y) if src(x,y) > thresh; 0 otherwise
 *
 *   * THRESH_TOZERO_INV
 *
 * dst(x,y) = 0 if src(x,y) > thresh; src(x,y) otherwise
 *
 * Also, the special value "THRESH_OTSU" may be combined with one of the above
 * values. In this case, the function determines the optimal threshold value
 * using the Otsu's algorithm and uses it instead of the specified "thresh".
 * The function returns the computed threshold value.
 * Currently, the Otsu's method is implemented only for 8-bit images.
 *
 * @param src Source array (single-channel, 8-bit of 32-bit floating point).
 * @param dst Destination array of the same size and type as "src".
 * @param thresh Threshold value.
 * @param maxval a maxval
 * @param type a type
 *
 * @see <a href="http://opencv.itseez.com/modules/imgproc/doc/miscellaneous_transformations.html#threshold">org.opencv.imgproc.Imgproc.threshold</a>
 * @see org.opencv.imgproc.Imgproc.findContours
 * @see org.opencv.core.Core.max
 * @see org.opencv.imgproc.Imgproc.adaptiveThreshold
 * @see org.opencv.core.Core.compare
 * @see org.opencv.core.Core.min
 */
  • 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-31T04:49:50+00:00Added an answer on May 31, 2026 at 4:49 am

    It’s only really meaningful for the automatic threshold mode THRESH_OTSU using Otsu’s method

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.