Questions tagged [threshold]
The starting point for a new state.
threshold
716
questions
86
votes
2
answers
115k
views
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(...
46
votes
3
answers
109k
views
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. ...
30
votes
5
answers
20k
views
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 ...
22
votes
4
answers
19k
views
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 ...
19
votes
2
answers
20k
views
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 ...
17
votes
3
answers
22k
views
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 ...
15
votes
3
answers
12k
views
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 ...
15
votes
2
answers
17k
views
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 ...
14
votes
5
answers
29k
views
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 ...
13
votes
2
answers
31k
views
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 ...
12
votes
1
answer
8k
views
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] -...
11
votes
1
answer
11k
views
Scikit - changing the threshold to create multiple confusion matrixes
I'm building a classifier that goes through lending club data, and selects the best X loans. I've trained a Random Forest, and created the usual ROC curves, Confusion Matrices, etc.
The confusion ...
10
votes
4
answers
8k
views
Threshold of blurry image - part 2
How can I threshold this blurry image to make the digits as clear as possible?
In a previous post, I tried adaptively thresholding a blurry image (left), which resulted in distorted and disconnected ...
10
votes
3
answers
6k
views
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 ...
10
votes
1
answer
2k
views
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 ...
10
votes
1
answer
11k
views
Plotly: How to display different color segments on a line chart for specified thresholds?
I have a multi-line graph that displays percent increase over time. I'd like to set a threshold in my code to have an upper and lower bound. If the line falls outside these bounds, I'd like that ...
9
votes
2
answers
31k
views
OpenCV Binary Image Mask for Image Analysis in C++
I'm trying to analyse some images which have a lot of noise around the outside of the image, but a clear circular centre with a shape inside. The centre is the part I'm interested in, but the outside ...
9
votes
1
answer
22k
views
OpenCV threshold with mask
I'm trying to use OpenCV's cv::threshold function (more specific THRESH_OTSU), only that I'd like to do it with a mask (any shape), so that the outside (background) is ignored during calculation.
...
9
votes
2
answers
25k
views
Load custom image from file system in scikit-image
I am new to Python and I am trying to do the tutorial, shown on the official page. My goal is, to analyze a picture I've created, using the Local Otsu Threshold method.
The code with an example ...
9
votes
2
answers
21k
views
How to count steps using an Accelerometer?
I have to develop the same functionality as of this Pedometer App
I have observed this Pedometer app in very high detail.
It's not a perfect pedometer app. For example, if you stay/sit at one place ...
9
votes
2
answers
9k
views
log4j2 threshold for consoleappender
How to set threshold value for ConsoleAppender in new log4j2 using xml file.
Usually we do it in log4j 1.x in the below way.
Ref link:
Log4j - priority value and param name concept explanation
How ...
8
votes
1
answer
4k
views
ImageMagick - How do I flatten white levels to pure white?
I have a png image with a white background which I'd like to turn transparent. This is fairly simple with this command:
$ convert image.png -transparent white image-trans.png
However, if the white ...
8
votes
2
answers
25k
views
how to calculate roc curves?
I write a classifier (Gaussian Mixture Model) to classify five human actions. For every observation the classifier compute the posterior probability to belong to a cluster.
I want to valutate the ...
8
votes
1
answer
5k
views
OpenCV Finding Correct Threshold to Determine Image Match or Not with Matching Score
I'm currently making a recognition program using various feature extractor and various matcher. Using the score from the matcher, I want to create a score threshold which can further determine if it's ...
7
votes
5
answers
13k
views
Pandas - group by id and drop duplicate with threshold
I have the following data:
userid itemid
1 1
1 1
1 3
1 4
2 1
2 2
2 3
I want to drop userIDs who has viewed the same itemID more than or equal ...
7
votes
1
answer
6k
views
Delete 90% of random rows by condition pandas
I have a pandas dataframe and want to delete 90% of data which satisfies condition.
The condition is very simple. If the value of the column "Parameter1" is greater than a threshold, then delete it.
...
7
votes
3
answers
10k
views
binary_accuracy in keras Metrices , what's the threshold value to predicted one sample as positive and negative cases
What's the threshold value of binary_accuracy in keras Metrices is used to predicted one sample as positive and negative cases? is that threshold value 0.5? how to adjust it? I want to set the ...
7
votes
2
answers
19k
views
Get coordinates of white pixels (OpenCV)
In OpenCV (C++) I have a b&w image where some shapes appear filled with white (255). Knowing this, how can I get the coordinate points in the image where theses objects are? I'm interested on ...
7
votes
1
answer
1k
views
Notification of memory shortage in Java
Is there any delivered feature in Java notifying a memory shortage in an application (or notifying that it has reach a predefined level)?
I was wondering whether it was possible to register a ...
7
votes
1
answer
2k
views
Hashmap Capacity not increased even on reaching threshold
Java doc says - When the number of entries in the hash table exceeds the product of the load factor and the current capacity, the hash table is rehashed
In below program -
HashMap<Integer, String&...
7
votes
2
answers
23k
views
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 ...
6
votes
4
answers
7k
views
Two different thresholds in HighCharts 3.0
With HighCharts 3.0, it is now possible to indicate to colors above and below one threshold. Like this example :
http://jsfiddle.net/highcharts/YWVHx/
Following code :
$(function () {
$.getJSON(...
6
votes
2
answers
5k
views
Android: Adaptive Thresholding
I'm trying to implement adaptive thresholding algorithm by Derek Bradley using Android. But it is returning black pixels all the time. Here is my code snippet. Please suggest me about what should I do....
6
votes
3
answers
33k
views
Sharepoint: The view cannot be displayed because the number of lookup and workflow columns it contains exceeds the threshold (8)
I have following problem with my Sharepoint website. (The view cannot be displayed because the number of lookup and workflow columns it contains exceeds the threshold (8) enforced by the administrator)...
6
votes
1
answer
16k
views
vertical line in histogram with pyplot
i've computed an Otsu's thresholding for a kinect depth image and now i want point out the optimal thresholding value on the histogram, using for example axvline with pyplot in opencv2.
I'm a ...
6
votes
3
answers
7k
views
Android Real Time Black-White Threshold Image
I have a code that turns a bitmap that has the grey colors into a bitmap of black and white colors, using this code:
// scan through all pixels
for (int x = 0; x < width; ++x) { ...
6
votes
3
answers
3k
views
Detect the vein pattern in leaves?
My aim is to detect the vein pattern in leaves which characterize various species of plants
I have already done the following:
Original image:
After Adaptive thresholding:
However the veins aren'...
6
votes
1
answer
5k
views
What is the main difference between rootMargin & threshold in Intersection Observer API?
As I learned that once you have set rootMargin:"0px", it means that the effect will be produced when the element you have selected has been completed visible on screen and have 0px of margin ...
6
votes
2
answers
7k
views
How do I define color groups based on numerical threshold values for ggplot2 scatterplot
I have a data set that contains 2 variables x = event number & y = assay amplitude. I am trying to create a scatterplot in ggplot2 where all of the points that are > 3000 are colored in one ...
6
votes
2
answers
1k
views
How to calculate the total time duration of concentration crossing a threshold multiple times?
Using R, I am trying to calculate the total time duration for each individual where this time duration is the time spent above certain threshold.
For example, in the plot below I have the ...
6
votes
1
answer
262
views
How to solve ODEs with an internal threshold?
I have the following function containing some odes:
myfunction <- function(t, state, parameters) {
with(as.list(c(state, parameters)),{
if (X>20) { # this is an internal ...
5
votes
2
answers
8k
views
Set every pixel of a Mat to a certain value, if it´s lower than a value?
Im trying to do the following in OpenCV. How can I set every pixel of a Mat to a certain value, if it´s lower than a value?
So I want to do something like the threshold, but not quite, as I don't ...
5
votes
3
answers
8k
views
Does a Neural Network with Sigmoid Activation use Thresholds?
I'm a tad confused here. I just started on the subject of Neural Networks and the first one I constructed used the Step-Activation with thresholds on each neuron. Now I wan't to implement the sigmoid ...
5
votes
3
answers
8k
views
Finding first samples greater than a threshold value efficiently in Python (and MATLAB comparison)
Instead of finding all the samples / data points within a list or an array which are greater than a particular threshold, I would like to find only the first samples where a signal becomes greater ...
5
votes
4
answers
67
views
R- Find date when cumulative sum is above threshold
I am working with thermal requirements for crop growth. I have a table which contains cumulative temperature for a 6-month time period. Sample seen below:
date temp cum_temp
1: 2020-...
5
votes
3
answers
2k
views
Python module Mahotas thresholding issue
I'm using this tutorial
http://pythonvision.org/basic-tutorial
However when I pass a png image:
T = mahotas.thresholding.otsu(dna)
I get an error:
TypeError: mahotas.otsu: This function only ...
5
votes
2
answers
2k
views
What should be the ideal thresholding technique for enhancing parts of the image?
What thresholding techique should i apply for the image in order to highlight the bright regions inside the image as well as the outer boundary..
The im2bw function does not give a good result
Help!...
5
votes
1
answer
6k
views
What is the purpose of ignore_thresh and truth_thresh in the YOLO layers in yolov3.cfg?
I am attempting to explain the purposes of different parameters in the yolov3.cfg file, however, I can't find any explanation for ignore_thresh and truth_thresh.
My current (limited) understanding is ...
5
votes
1
answer
227
views
Evaluating a statistical model in R
I have a very big data set (ds). One of its columns is Popularity, of type factor ('High' / ' Low').
I split the data to 70% and 30% in order to create a training set (ds_tr) and a test set (ds_te).
...
5
votes
1
answer
10k
views
Illumination normalization in OpenCV
I am working on a face recognition project. I have pictures with different lighting so I need to do illumination normalization. I read a paper which which claims to do illumination normalization. The ...