Questions tagged [image-thresholding]

To be used with regards to converting any image to a binary image having two values 0 and 1. It is a simple elementary image segmentation step.

For details on various methods used visit THIS WIKI PAGE

189 questions
3
votes
2 answers

What does opencv threshold THRESH_BINARY do on colored images?

The documentation on THRESH_BINARY says: dst(x,y) = maxval if src(x,y) > thresh else 0 Which to me does not imply that this won't work on colored images. I expected a two color output even when applied to a colored image, but the output is…
lo tolmencre
  • 3,804
  • 3
  • 30
  • 60
2
votes
1 answer

Extract text from image using pytesseract in two-tones background

I'm trying to extract text from an image using pytesseract on Python. This is the image where I want to extract the text: Original Image This is the image after applying threshold: Image with threshold Console Output: 20 hours 20…
2
votes
1 answer

Detecting (and rejecting) distorted images taken of computer/tv screens in OpenCV

Some of my algorithms rely on segmenting an image based on the count of significant horizontal lines detected, images taken of computer screens or monitors can be problematic because the distortion present results in poor binarization and unclearly…
Avan
  • 223
  • 3
  • 13
2
votes
2 answers

Determine the best classification threshold value for deep learning model

How to Determine the best threshold value for deep learning model. I am working on predicting seizure epilepsy using CNN. I want to determine the best threshold for my deep learning model in order to get best results. I am trying for more than 2…
2
votes
1 answer

OpenCV Thresholding adaptive to different lightning conditions

For a school project I am trying to write a program in Python that tracks the movement of the pupil. In order to do that I am using OpenCV. After looking up some tutorials on the internet, I noticed that almost everyone is using thresholding to…
2
votes
2 answers

create multi-colored thresholded image from grayscale heatmap in python

I have a gray-scale images and want to threshold them in 4 range of values (0.035, 0.7, 0.75), displayed by 4 different colors. I need the result saved as images in UINT8 format. The gray-scale image information is as…
2
votes
2 answers

Check if pixel is inside a connected component in opencv python

I'm thresholding an image which gives me some white regions. And I have a pixel location that's located in one of these regions. I'm using opencv connectedComponentsWithStats to get the regions and then find if the pixel is in any of these regions.…
Yasin
  • 609
  • 1
  • 10
  • 22
2
votes
1 answer

Extract the floor layout and threshold with OpenCV and Python

I've tried to use SSIM to extract the difference between two images to get only the floor area (image_a is the original and image_b has painted floor). The output that was expected, is a threshold mask. The problem I had was that the thresholding…
arturkuchynski
  • 790
  • 1
  • 9
  • 27
2
votes
0 answers

Detecting a sheet of paper inside an image like cam-scanner app

Out of an image, I need to extract a sheet of paper, just like camscanner app does, https://www.camscanner.com/ I know that I can do this by detecting the edges of the sheet of paper i want to detect. And later performing perspective transform. I…
2
votes
0 answers

OpenCV thresholding for wound detection, any better methods?

I have been fiddling around with convex hulls in OpenCV trying to detect an irregularly shaped wound (in order to calculate its size later on using a reference marker). The problem is that the wound's irregularity in color is providing a problem…
2
votes
1 answer

Is there any way to fill the interior of an image with white?

For example in the MATLAB Image Processing Toolbox we have imfill function. How can I do this in Python? So I am trying to segment various shapes and remove the interior blacks. I know if I get the borders, segmentation is still easy but I want to…
2
votes
1 answer

Calculate binary optimal threshold ImageJ based on foreground/background mean

I was researching on how to calculate an Optimal Threshold for ImageJ and found this explanation of the Otsu Thresholding, which I thought made perfect sense for me to use. I've struggled with implementing it though, and after some thought I found a…
gizmo
  • 81
  • 8
2
votes
1 answer

watershed segmentation always return black image

I've been recently working at a segmentation process for corneal endothelial cells, and I've found a pretty decent paper that describes ways to perform it with nice results. I have been trying to follow that paper and implement it all using…
2
votes
1 answer

Using masks to apply different thresholds to different parts of an image

I have an image, in which I want to threshold part of the image within a circular region, and then the remainder of the image outside of this region. Unfortunately my attempts seem to be thresholding the image as a whole, ignoring the masks. How can…
Sam
  • 1,052
  • 4
  • 13
  • 33
1
vote
1 answer

Preserving different color text when thresholding with OpenCV-Python

I have an image with mostly light text on a dark background. Some of the text is a darker color (purple). I'm using opencv-python to manipulate the image for better OCR parsing. There is a little more processing that happens before this, but I feel…
1
2
3
12 13