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
0
votes
2 answers

Python OpenCV thresholding by logical indexing

I am trying to threshold certain values in a grayscale image. So far I have been successful by inputting certain ranges of numbers, but I want to take the values that are between 50 and 150 and multiply them by 1.2. I am not sure how I can access…
Flawless
  • 47
  • 7
0
votes
1 answer

Image thresholding in LUA - LOVE

In order to only have only one input image for a "spread like" effect I would like to do some threshold operation on some drawable or to find any other way that work. Are there any such tools in LOVE2d/Lua ?
0
votes
0 answers

What is the equivalent of skimage’s "threshold_multiotsu" in OpenCV?

I'd like to use the equivalent of skimage.filters.threshold_multiotsu in OpenCV to detect object in video. I can get only one threshold in OpenCV, not multiple like in skimage. OpenCV usually runs faster than skimage for many reasons. Full…
0
votes
3 answers

Thresholding image using opencv library in python with different flags using for loop

I imported cv2 as cv, created a list of threshold flags, concatenated 'cv.' with the flags and then created a for loop for passing the flags as arguments. But python shows TypeError. I have attached the image of the output. Kindly help me create all…
Fu678
  • 324
  • 1
  • 2
  • 7
0
votes
3 answers

Thresholding multiple images in Python using OpenCv

I would like to binarize a whole folder of images and save them. I've already found a code that binarizes a single image and store it in the same folder: import cv2 im_gray = cv2.imread('blurredimg1.png', cv2.IMREAD_GRAYSCALE) (thresh, im_bw) =…
0
votes
0 answers

Some of the damaged parts are missing from an image (using image processing with python)

I am trying to display damaged parts of an image in order to restore them. I am quite new to image processing and I'm using cv2. Here are the images I'm working on. original damaged image required mask image And I'm getting the following…
0
votes
1 answer

Threshold segmentation in area defined by mask

I am having a problem with segmentation. I have an image (74, 78, 75) and mask (512, 512, 97). I would like to threshold all intensity values in the image above 500, but confine it to the area defined by the mask (pixels with non-zero…
Lamech
  • 23
  • 2
  • 8
0
votes
1 answer

Is there a faster way than a for loop for thresholding an image in javascript?

I want to do client side real-time interactive thresholding of large images using a slider. Is it possible to threshold an image in javascript to produce a binary image without using a for-loop over all pixels? And if so, is it faster?
Will
  • 198
  • 1
  • 6
0
votes
1 answer

Opencv Android : how to remove black background from thresholding output?

I am using OpenCV android library thresholding method for image segmentation, but the problem is that the output bitmap contains black background which I do not want please note that original image does not have any black background it is actually…
0
votes
1 answer

Color thresholding: Why does mask make a drastic difference according to limits specified?

We want to apply color thresholding to a RGB image: When we specify the lower limit as [0, 0, 0] and the upper limit as [255, 255, 255] the result is as follows: And, when the lower limit is [1, 1, 1] and the upper limit is [255, 255, 255] the…
0
votes
1 answer

Convert image to binary doesn't shows white lines of a soccer field

I am inspired by the following blogpost, however I am struggling with step 2/3. I want to creates a binary image from a gray image based on the threshold values and ultimately displaying all white lines on the image. My desired output looks as…
HJA24
  • 410
  • 2
  • 11
  • 33
0
votes
1 answer

Changing the values of a matrix above a threshold in python

I have a matrix : matrix = np.array([[[0,0.5,0.6],[0.9,1.2,0]],[[0,0.5,0.6],[0.9,1.2,0]]]) I want to replace all the values 0.55 < x < 0.95 by 0.55. PS : My question is similar to this question. But the answer does not work in my case.
J.A
  • 285
  • 3
  • 12
0
votes
0 answers

How to create a ROI and count both black and white pixels within that ROI?

I have the following b&W image with the ROI (Region of Interest) shown as dashed green lines with the solid line in the centre. I am hoping to develop some code where the ROI can be automatically drawn in by adding 30% of the distance between the…
0
votes
0 answers

I want to improve the accurracy of a binary image

I used Otsu thresholding to convert a grayscale img to binary. But the accuracy is not much, I want to improve it. import cv2 from matplotlib import pyplot as plt def…
Eddy
  • 1
  • 1
  • 5
0
votes
0 answers

Image contour area iteration calculator

I'm trying to find the filled area of a contour mask. It just produces the same value for the 33 contours. This is after thresholding a grayscale image to 0 and 255: contours, hier = cv.findContours(green, cv.RETR_LIST,…
Terra
  • 1