Questions tagged [adaptive-threshold]

80 questions
14
votes
3 answers

Adaptive Threshold error: (-215:Assertion failed) src.type() == CV_8UC1 in function 'adaptiveThreshold'

I am working on pre-trained vgg16 model, for that I need to have input size of image file to be (224,224,3). The code I am working on is: from tensorflow.keras.preprocessing import image import cv2 import matplotlib.pyplot as plt img =…
ashish
  • 143
  • 1
  • 1
  • 4
12
votes
2 answers

Bradley adaptive thresholding algorithm

I am currently working on implementing a thresholding algorithm called Bradley Adaptive Thresholding. I have been following mainly two links in order to work out how to implement this algorithm. I have also successfully been able to implement two…
BigBerger
  • 1,765
  • 4
  • 23
  • 43
8
votes
3 answers

Adaptive Threshold CIKernel/CIFilter iOS

I have researched all over in order to find a kernel that performs adaptive thresholding on iOS. Unfortunately I do not understand the kernel language or the logic behind it. Below, I have found a routine that performs thresholding…
mmackh
  • 3,550
  • 3
  • 35
  • 51
8
votes
4 answers

Adaptive threshold with blurry image

I'm in search for best Adaptive Threshold method for image binarization. But I have any problems with dark and blurry image. Input image: and when I use Adaptive threshold method I receive this Output Image: This is not good for me! So, could…
minhthuan
  • 201
  • 1
  • 4
  • 8
7
votes
2 answers

openCV AdaptiveThreshold versus Otsu Threshold. ROI

I'm tried to use both of the methods but it seems like Adaptive threshold seems to be giving a better result. I used cvSmooth( temp, dst,CV_GAUSSIAN,9,9, 0); on the original image then only i used the threshold. Is there anything I can tweak…
user3396218
  • 255
  • 2
  • 8
  • 20
6
votes
2 answers

What thresholding (binarization) algorithm is used in Tesseract OCR?

I am working on a project that needs accurate OCR results for images with rich background. So I am comparing results of two OCRs (one of them is Tesseract) to make my choice. The point is that results are strongly affected by the pre-processing step…
Baraa
  • 1,476
  • 1
  • 16
  • 19
4
votes
2 answers

How to achieve adaptive threshold filter with color

I'm looking for a algorithm similar adaptive thresholding, but that keeps color. I'm trying take an image like this: And make it look like this: If it matters, I'm working in ios.
3
votes
1 answer

Intuition behind adjusting adaptive thresholding parameters

While following this guide and using the adaptive thresholding function, I was confused about the intuition with adjusting the blocksize and C to find an ideal value. What approach should one take when adjusting these parameters instead of doing a…
3
votes
0 answers

How to find optimal parameter for Adaptivethreshold in opencv Python?

I'm learning adaptivethreshold technique, I'm wondering is there any calculation for choosing blocksize and constant C (which are parameters of adaptivethreshold function), or I just find the optimal values by iterating each number?
authorNoob
  • 31
  • 6
3
votes
0 answers

Iterate over a tensor's rows and cols in Tensorflow

A part of my project is to use a thresholding kernel on an image. The thresholding kernel could look like this: [50 100] [150 200] I would like to go over each group of 3x3 pixels (without overlap), and threshold them using my kernel. For…
Ori Linial
  • 63
  • 3
3
votes
1 answer

adaptive thresholding ---ValueError: too many values to unpack

I'm pretty amateur at image processing. I could successfully do normal thresholding but however I'm facing an error in Adaptive Thresholding. Here is my code: import cv2 import numpy as np img = cv2.imread("vehicle004.jpg") img =…
3
votes
1 answer

Bradley Adaptive Thresholding -- Confused (questions)

I have some questions, probably stupid, about the implementation of the adaptive thresholding by Bradley. I have read paper about it http://people.scs.carleton.ca:8008/~roth/iit-publications-iti/docs/gerh-50002.pdf and I am a bit confused. Mainly…
equinox
  • 35
  • 3
3
votes
0 answers

Re sizing and thresholding small font scanned Arabic words

I am working on an arabic OCR for printed scanned documents ... Some of the scanned documents may written with font size of height 8 which is quite small ... I want to resize the height to 60 pixels but some artifacts may occur due to nature of…
Ibrahim Amer
  • 1,147
  • 4
  • 19
  • 46
2
votes
0 answers

What is the meaning of the C(constant) in adaptive thresholding function parameters?

I know that the adaptive thresholding function and its parameters are given below: cv2.adaptiveThreshold(src, maxValue, adaptiveMethod, thresholdType, blockSize, C) And I understand in the documentation it says: C – Constant subtracted from the…
Anthony
  • 43
  • 4
2
votes
3 answers

OpenCV - Draw contours on fingers using convex-hulls & adaptive thresholding

I am pretty new to OpenCV and am trying to achieve drawing simple contours along the outline of my hand using a webcam. I decided on using cv2.adaptiveThreshold() to deal with the different light intensities when the camera adjusts to the hand…
itsolidude
  • 1,119
  • 3
  • 11
  • 22
1
2 3 4 5 6