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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:29:32+00:00 2026-05-31T20:29:32+00:00

I would like to segment a part of an image (video stream), between 2

  • 0

I would like to segment a part of an image (video stream), between 2 gray images.

When the stream starts, I take an image. Then I make another IplImage but where each pixel’s intensity is added by a number. Now i would like to keep everything between these 2 image.

My code atm

 // Get the initial image 
 depthInit.copyFrom(result.getBufferedImage());  

 //Create an image where every intensity is 10, which will be added to the initial image.
 cvSet(scalarImage,cvScalar(10, 0, 0, 0));

 // De init image wordt verhoogt met de hoogte van de laag 
 cvAdd(depthInit, scalarImage, depthInitLayer2, null);

The 2 threshold images are : depthInit and depthInitLayer2

The stream is the variable “result”

Now to use these 2 image to threshold the stream

cvZero(difference);

// Select everything that is greater than the depthInit image
cvCmp(result, depthInit, difference, CV_CMP_GT);


cvZero(difference2);

// Select everything that is smaler than the depthInitLayer2 
cvCmp(difference, depthInitLayer2, difference2, CV_CMP_LT);

Though unfortunately this is not working.

My question why ?

Thx in advance

  • 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-31T20:29:33+00:00Added an answer on May 31, 2026 at 8:29 pm

    The method “inrange” by opencv does the trick . In my case (with some renamed variables)

     cvInRange(result, threshold1, threshold2,  difference2);
    

    The results of 1 pixel in the stream (output) :

    Stream value (189.0, 0.0, 0.0, 0.0)
    threshold1 value (187.0, 0.0, 0.0, 0.0)
    threshold2 value (217.0, 0.0, 0.0, 0.0)
    After thresholding value (255.0, 0.0, 0.0, 0.0)
    

    This pixel with intensity 189 is in the interval of [217,187] so it’s gets a 255 (white)

    On the other hand this pixel with intensity 240 is not in the interval , so gets 0

    Stream value (240.0, 0.0, 0.0, 0.0)
    threshold1 value (187.0, 0.0, 0.0, 0.0)
    threshold2 value (217.0, 0.0, 0.0, 0.0)
    After thresholding value (0.0, 0.0, 0.0, 0.0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two points (a line segment) and a rectangle. I would like to
Would like to make anapplication in Java that will not automatically parse parameters used
The Java SE don't have a iPhone like segment button. So, I would like
Given an input of 2D points, I would like to segment them in lines.
With respect to the following code segment, I would like to know whether my
I found this interesting interface(starts at 33 seconds http://vimeo.com/22946428 ), and would like to
I would like to apply OCR to some pictures of 7 segment displays on
i would like to know if a point in a plane segment, and its
I'm new to CI and would like to make loading of views, navigation &
for a project in OpenCV I would like to segment moving objects as good

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.