Questions tagged [adaptive-threshold]

80 questions
1
vote
1 answer

OpenCV output of Adaptive Threshold

I am a newbie in android, and open CV both. However, I am trying to take an image from the camera, convert it into the desired format, and pass it to the tflite model. Code for capturing image, and applying image processing to it. public Mat…
1
vote
1 answer

OpenCV Each pixel in the return image from adaptiveThreshold function is value 255

I apply adaptive thresholding to gray scale image, and I would like to apply normal thresholding to the return image of that function. This doesn't work since somehow every pixel in the return image is set to 255. I don't understand why this is…
Peyton Hanel
  • 374
  • 1
  • 3
  • 13
1
vote
0 answers

Setting the optimal thresholds for a multiclass random forest and gbt model in pyspark (ml) on an imbalanced dataset

Currently a Random Forest Classifier (from Spark ML) has been build on a imbalanced dataset which has the following distribution: +-------+----------------+ | score | n_observations | +-------+----------------+ | 0 | 256741 | | 1 | …
1
vote
1 answer

Apply openCV-python adaptive threshold to 3D tiff

I work with 3D volumes produced by confocal microscopy. These images have x,y,z dimensions around ~1024,1024,50 and are stored in a .tif file. I want to apply OpenCV-python cv2.adaptiveThreshold to the whole image stack. The below code works well…
1
vote
0 answers

How to remove noise after Otsu Binarization using OpenCV in Python?

I am using a Raspberry Pi and it's Camera to perform some Image Processing algorithm. So , I am performing a background subtraction on successive frames of the captured stream and trying to find if there is any object present in the image and if…
1
vote
0 answers

Grayscale eight colors image instead of bitonal as output using python script page_dewarp

I am using this python scripts https://github.com/mzucker/page_dewarp, which manages the rendering and the color conversion of the images with adaptiveThreshold (from OpenCV) and pillow. I would ask if it is possibile to modify the script in order…
1
vote
1 answer

Applying adaptive threshold to a grayscale image

I have a png image which is in grayscale 'test.png'. I need apply adaptive threshold to this image. I am using OpenCV. image = cv2.imread('test_big.png') im = cv2.adaptiveThreshold(image, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV,…
1
vote
1 answer

Find shapes on white background. Thinning the lines

I have the following image as a test image: I attempt to find the shapes on the image (and other images). My approch right now is the following: Gaussian blur with a 3x3 kernel Canny edge detection using list (to get all shapes) Morphology with…
MortenGR
  • 803
  • 1
  • 8
  • 22
1
vote
2 answers

thresholding an image with bright zones

I am developing an app for iOS with openCV that take a picture from a monitor and extract a curve, but when the image has some bright zones after thresholding, I don't get the complete curve but some black zones Original image processed image after…
1
vote
0 answers

How can I use fuzzy logic to analyze two images in MATLAB?

I have two grayscale images I1 and I2, and three fuzzy rules. The rules are: IF gray value is low in I1 AND gray value is low in I2 THEN case A IF gray value is high in I1 AND gray value is high in I2 THEN case B IF gray value is high in I1 AND…
Michael
  • 280
  • 2
  • 13
1
vote
2 answers

OpenCV Adaptive Thresholding a HSV image

We (my group and I) want to be able to track a hand (well the index fingertip mostly). The hand is basically the same colour as the face in the picture, but as you can see, so is a lot of the noise we get. It works very well with a black "screen"…
1
vote
1 answer

How to use adaptiveThreshold from OpenCV for values larger than 255 (i.e. type CV_8UC1)?

I want to use the adaptiveThreshold function from OpenCV in order to determine appropriate, local thresholds for values in a vector. adaptiveThreshold is specified in the docs as follows: void adaptiveThreshold(InputArray src, OutputArray…
nburk
  • 22,409
  • 18
  • 87
  • 132
1
vote
1 answer

Output image not displaying properly

I'm currently working on a piece of code which prepares an image for thresholding, although there seems to be a mismatch between the output image and the pixel data which is returned. I'll talk you through the code. First, I define the function…
Zetland
  • 569
  • 2
  • 11
  • 25
1
vote
1 answer

Segmenting an image using adaptive threshholding

I have done some research on the difference between segmentation using global thresh-holding and adaptive thresh-holding and here is my understanding... Note: Assume a 16-bit grayscale image Global thresh-holding: define a pixel value 0-65535. Scan…
Ogen
  • 6,499
  • 7
  • 58
  • 124
1
vote
1 answer

adaptivethreshold gives an error (opencv, java)

I am trying to do adaptiveThresholding on an image but it gives me this error: OpenCV Error: Assertion failed (src.type() == CV_8UC1) in adaptiveThreshold I can't seem to understand why, here is my code: Mat source =…
user3524239
  • 189
  • 4
  • 11