Questions tagged [threshold]

The starting point for a new state.

645 questions
82
votes
1 answer

Efficient thresholding filter of an array with numpy

I need to filter an array to remove the elements that are lower than a certain threshold. My current code is like this: threshold = 5 a = numpy.array(range(10)) # testing data b = numpy.array(filter(lambda x: x >= threshold, a)) The problem is that…
fortran
  • 67,715
  • 23
  • 125
  • 170
42
votes
3 answers

How to use the OTSU Threshold in opencv?

I was using a fixed threshold but turns out that it's not so good for me. Then, someone told me about the otsu threshold. How can I use it in my code? I read about it and I don't understand very well. Could someone explain to me how to use it in…
U23r
  • 1,461
  • 8
  • 23
  • 36
30
votes
5 answers

Fast image thresholding

What is a fast and reliable way to threshold images with possible blurring and non-uniform brightness? Example (blurring but uniform brightness): Because the image is not guaranteed to have uniform brightness, it's not feasible to use a fixed…
1''
  • 23,546
  • 28
  • 128
  • 192
20
votes
1 answer

How to define a threshold value to detect only green colour objects in an image :Opencv

I just want to detect only green objects from an image which captured in natural environment.How to define it? Because in here I want to pass the threshold value let's say 'x', by using this x I want to get only green colour objects in to one…
S.Am
  • 209
  • 1
  • 2
  • 6
18
votes
2 answers

How to set a threshold for a sklearn classifier based on ROC results?

I trained an ExtraTreesClassifier (gini index) using scikit-learn and it suits my needs fairly. Not so good accuracy, but using a 10-fold cross validation, AUC is 0.95. I would like to use this classifier on my work. I am quite new to ML, so please…
Colis
  • 303
  • 1
  • 2
  • 6
17
votes
3 answers

Adaptive threshold of blurry image

I have a fairly blurry 432x432 image of a Sudoku puzzle that doesn't adaptively threshold well (take the mean over a block size of 5x5 pixels, then subtract 2): As you can see, the digits are slightly distorted, there are a lot of breakages in…
1''
  • 23,546
  • 28
  • 128
  • 192
14
votes
5 answers

Python OpenCV - Find black areas in a binary image

There is any method/function in the python wrapper of Opencv that finds black areas in a binary image? (like regionprops in Matlab) Up to now I load my source image, transform it into a binary image via threshold and then invert it to highlight the…
Marco L.
  • 1,389
  • 4
  • 16
  • 24
14
votes
3 answers

Android ACTION_MOVE Threshold

I'm writing an app that involves writing on the screen using one's finger, or eventually a stylus. I have that part working. On ACTION_DOWN, starts drawing; on ACTION_MOVE, adds line segments; on ACTION_UP, finishes line. The problem is that after…
Erhannis
  • 3,613
  • 2
  • 24
  • 38
14
votes
2 answers

How to I use PIL Image.point(table) method to apply a threshold to a 256 gray image?

I have 8-bit greyscale TIFF images that I want to convert to Monochrome using a 75% white (decimal 190) threshold. In the Image.convert(mode) method section, the PIL manual says: "When translating a greyscale image into a bitlevel image (mode "1"),…
tahoar
  • 1,670
  • 3
  • 20
  • 35
13
votes
2 answers

Difference between adaptive thresholding and normal thresholding in opencv

I have this gray video stream: The histogram of this image: The thresholded image by : threshold( image, image, 150, 255, CV_THRESH_BINARY ); i get : Which i expect. When i do adaptive thresholding with : adaptiveThreshold(image,…
Olivier_s_j
  • 4,939
  • 21
  • 72
  • 125
11
votes
3 answers

How to apply threshold within multiple rectangular bounding boxes in an image?

My question is that: I have ROI's for the bounding boxes around the objects in an image. The ROI's are obtained by the Faster R-CNN. Now what I want is to apply the thresholding to get the object accurately contained within the bounding box. The ROI…
11
votes
3 answers

How to set a pylint score threshold?

I'd like to extract my pylint rating and set a threshold. Let me explain, for example, if the score is under 5, I want exit 1; And if my code is rated higher than 5, I want exit 0 and continue my Jenkins procedure.
Axel Bayle
  • 115
  • 1
  • 8
10
votes
3 answers

Counting colonies on a Petri dish

I have a bunch of Petri dishes full of dots which I'd like to count in Matlab. Can this be done reliably and in batches? E.g. This plate has 352 colonies I've tried ImageJ but need to do quite a bit of cropping out of the border and get variable…
HCAI
  • 1,955
  • 6
  • 25
  • 51
10
votes
1 answer

Jenkins xUnit test result report

I have a Jenkins job to copy some test reports(XML) to local and convert them to JUnit reports via xUnit. The issue is that there are no failed or skipped tests, but I always get [xUnit] [INFO] - Check 'Failed Tests' threshold. [xUnit]…
Jay Cui
  • 117
  • 1
  • 8
10
votes
1 answer

How to disable the move threshold when getting touch events?

I am creating an Android game that uses touch input. I noticed that, when I put down a finger and move it, there is a threshold of a couple of pixels until the first MotionEvent.ACTION_MOVE is generated. What is the correct way of disabling this…
Herr von Wurst
  • 2,356
  • 3
  • 27
  • 47
1
2 3
42 43