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
7
votes
4 answers

Proper image thresholding to prepare it for OCR in python using opencv

I am really new to opencv and a beginner to python. I have this image: I want to somehow apply proper thresholding to keep nothing but the 6 digits. The bigger picture is that I intend to try to perform manual OCR to the image for each digit…
5
votes
3 answers

denoising binary image in python

For my project i'm trying to binarize an image with openCV in python. I used the adaptive gaussian thresholding from openCV to convert the image with the following result: I want to use the binary image for OCR but it's too noisy. Is there any way…
R.hagens
  • 325
  • 4
  • 19
4
votes
1 answer

Use data matrix as a fiducial to obtain angle of rotation

I have a bunch of images such as the one above. They each contain a data matrix, but do not guarantee that it is oriented to an axis. Nevertheless, I can read these matrices with libdmtx pretty reliably regardless of their rotation. However, I also…
4
votes
2 answers

How to detect an object that blends with the background?

I am a beginner and I am trying to apply an outline to the white remote control on the left that shares the same color with the background. a = cv2.imread(file_name) imgGray = cv2.cvtColor(a,cv2.COLOR_BGR2GRAY) imgGray =…
4
votes
1 answer

Moment Preserving Thresholding: Trilevel Case

I'm currently implementing the segmentation method proposed by Tsai for the trilevel case in an 8-bit image in Python 3.6. This is the code, considering the mathematical relations explained in the paper Annex: ### EXAMPLE GIVEN BY TSAI ### #…
4
votes
2 answers

Why is Tesseract OCR using Otsu binarization?

Why is Tesseract OCR engine using a global thresholding technique such as Otsu binarization? Aren't local thresholding techniques (e.g. Sauvola, Niblack, etc.) more effective in leaving out text from images?
cjbayron
  • 143
  • 1
  • 4
4
votes
1 answer

How to automatically select best result from try_all_threshold?

I am applying thresholding on a text-digit based image. Using skimage.filters.try_all_threshold results in 7 of thresholding algorithms getting applied. I am able to get the resut but I am thinking on how I can choose only 1 result to pass the…
3
votes
1 answer

remove the black line on the edge

I have a program that detects floors, so the floors I detect are removed and become a transparent png, but there are still black lines around the edges before adding threshold enter image description here enter image description here src =…
3
votes
1 answer

Way to apply smart thresholding in images

I'm writing an OCR app (for Hebrew script). The first part in the app is thresholding, This is how my original image looks like: And this is how it looks like after the thresholding: As you can see, it is mostly fine, but the "crowns" or…
Binyamin Even
  • 3,318
  • 1
  • 18
  • 45
3
votes
1 answer

Opencv Threshold Otsu with Threshold Binary Logic

At the opencv threshold page there is a code like: import cv2 as cv import numpy as np from matplotlib import pyplot as plt img = cv.imread('noisy2.png',0) # global thresholding ret1,th1 = cv.threshold(img,127,255,cv.THRESH_BINARY) # Otsu's…
strafor
  • 61
  • 4
3
votes
3 answers

Can I add a bias to Otsu thresholding in OpenCV?

Here's my example. Left to right: original image grayscale + (3,3) gaussian blur Otsu thresholding + invert pixels I want to capture more of the faint part of the pen stroke. I understand that Otsu Thresholding tries to apply the threshold point…
Alexander Soare
  • 2,825
  • 3
  • 25
  • 53
3
votes
1 answer

How to remove white pixels that are not connected to a loop in binary image

I have a image which I have binarized and the problem is I want to remove the white spots in that image which are not connected in a loop i.e. small white dots. The reason is I want to take a measurement of that section like shown here. I have tried…
3
votes
1 answer

How to find the exact edges/binary threshold of a metallic part like drill bit?

I am new to OpenCV and python, so kindly help me like a 12 grader. My problem is that I want to detect the right threshold or edge of the drill bit for measurement but what I have done gives a lot of noise in the image due to which I cannot find the…
3
votes
1 answer

separate characters from borders after thresholding

I would like to separate characters from borders after thresholding the images: Original image Touching areas Desired Output I'm using python and OpenCV to do the thresholding. Thanks in advance for your help. This is part of the code that makes…
3
votes
2 answers

How to obtain an image's single colour channel without using the split function in OpenCV Python?

I'd like to highlight a hand for real-time gesture recognition. I observed that the image of a hand gets highlighted differently for different colour channels using the cv2.imsplit function. But this split function is very costly in terms of time.…
1
2 3
12 13