Questions tagged [threshold]
The starting point for a new state.
threshold
56
questions
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 ...
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(...
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.
...
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 ...
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 ...
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 ...
2
votes
1
answer
9k
views
Remove Background from Image - Python
I am trying to remove the black background from an image using OpenCV, but I am unable to remove the pixels to capture just the main imagery without the black background. Here is the code I am using, ...
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. ...
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 ...
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 ...
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 ...
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 ...
4
votes
1
answer
3k
views
document image binarization [closed]
I'm trying to find effective binarization techniques for document images. I've currently implemented the niblack and sauvola thresholding algorithms and tried binarization based on histogram ...
3
votes
1
answer
3k
views
Object detecting using thresholding
I'm working on a program in matlab to detect an object in a sequence of images. The object I'm trying to detect a red ball.
First, I tried to use thresholding to segment the ball from the image, but ...
3
votes
3
answers
9k
views
niblack thresholding
I am trying to implement the niblack thresholding algorithm which uses the formula:
pixel = ( pixel > mean + k * standard_deviation ) ? object : background
where k has standard value 0.
Could ...
2
votes
1
answer
7k
views
Matching ORB Features with a threshold
My project is herbs recognition based on android. I use ORB to get keypoints, features, and matching the features.
I want to use this algorithm:
I use 4 reference image, and matching their features ...
1
vote
1
answer
1k
views
Return coordinates that passes threshold value for bounding boxes Google's Object Detection API
Does anyone know how to get bounding box coordinates which only passes threshold value?
I found this answer (here's a link), so I tried using it and done the following:
vis_util....
1
vote
1
answer
981
views
Soft Thresholding CUDA implementation
I am wondering how should I implement a nice soft thresholding function kernel in CUDA?
The soft thresholding function is like following:
where lambda is the threshold, and x is the input vector or ...
0
votes
1
answer
1k
views
Aggregate count of timeseries values which exceed threshold, by year-month
I am now learning R and using the SEAS package to help me with some calculation in R and data is the same format as SEAS package likes. It is a time series
require(seas)
data(mscdata)
dat.int <- ...
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 ...
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 ...
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 ...
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
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(...
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 ...
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 ...
4
votes
4
answers
6k
views
Damerau - Levenshtein Distance, adding a threshold
I have the following implementation, but I want to add a threshold, so if the result is going to be greater than it, just stop calculating and return.
How would I go about that?
EDIT: Here is my ...
4
votes
1
answer
10k
views
tracking multiple objects by color OpenCV 2.x
Currently i am trying to track multiple objects by color. I've based on documentation code.
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while(1):
# Take each frame
_, frame = ...
4
votes
2
answers
618
views
Count the number of values per column above a range of thresholds in R
How to count the number of values per column above a sequence of thresholds ?
i.e.: calculate for each column, the number of values above 100, then above 150, then above ... and store the results in a ...
3
votes
1
answer
2k
views
How to chose the optimal HSV values for InRange thresholding in OpenCV
I have two related questions:
I'm doing color object detection in OpenCV with the inRange threshold function. I'm getting excellent results if I manually choose the lower and upper HSV bounds, but ...
3
votes
1
answer
550
views
Finding several regions of interest in an array
Say I have conducted an experiment where I've left a python program running for some long time and in that time I've taken several measurements of some quantity against time. Each measurement is ...
2
votes
2
answers
299
views
split a dataframe
print (df)
A B
0 10
1 30
2 50
3 20
4 10
5 30
A B
0 10
1 30
A B
2 50
A B
3 20
4 10
5 30
2
votes
2
answers
3k
views
Removing points from list if distance between 2 points is below a certain threshold
I have a list of points and I want to keep the points of the list only if the distance between them is greater than a certain threshold. So, starting from the first point, if the the distance between ...
2
votes
1
answer
3k
views
Photoshop like Magic Wand for selecting pixels of a similar color, but in VB.NET
Im a noob.
I need to write some vb.net code that looks at a picture and "removes" the blackish pixels.
Here's the scenario. A wound care doctor takes a picture of a persons hand on a flat bed ...
2
votes
0
answers
467
views
Threshold frequency is not working in spell check in Solr
I am get stuck in middle of Solr. I need only most popular words w.r.t query. I have used phonetic filter on both index and query but here the problem is that it is giving too many terms. I need only ...
1
vote
3
answers
1k
views
R finding the first value in a data frame that falls within a given threshold
I am a fairly new user and I need your help with a task that I am stuck on. If my question has been asked/answered before I would be grateful if you could kindly guide me to the relevant page.
I ...
1
vote
3
answers
2k
views
Compare two vectors of numbers based on threshold of tolerance (±) of 0.5
I have two vectors g and h. I want to compare the numbers in these two vectors and find out whether there are any common elements between them. But the common elements do not have to be exactly the ...
1
vote
1
answer
519
views
javascript, is there a way to set a (smaller) threshold on touchmove event
At this moment my touch input device generates a touchmove event (after a touchstart event) AFTER a number of pixels have been moved (I think it's about 10 pixels)
This means that when using this ...
1
vote
3
answers
8k
views
I want to apply a threshold to pixels in image using python. Where did I make a mistake?
I want to generate the output that is a threshold. And my error:
img_thres = n_pix[y, x]
TypeError: 'int' object is not subscriptable
import cv2
import numpy as np
import matplotlib as plt
img =...
1
vote
1
answer
560
views
Find a threshold value for confusion matrix in R
I was doing a logistic regression and made a table that represents the predicted probability ,actual class, and predicted class.
If the predicted probability is more than 0.5, I classified it as 1,so ...
1
vote
2
answers
4k
views
How to speed up my color thresholding in C#
I'm working on tracking objects based on color and I was using EmguCV library to threshold my color image to binary black and white image. Thresholding itself was quite fast, 50 ms on 320x240 image. I'...
1
vote
2
answers
2k
views
Line chart/graph with an irregular threshold field
Looking to create a bar chart with an irregular, colored threshold field in the background, so that each data point has its own individual set of min/max thresholds, which ultimately would look ...
1
vote
1
answer
5k
views
R, find, dates, consecutive
My job is to find consecutive values in a dataframe beneath a certain threshold.
First I have a extracted a subset from a dataframe with values lower than the threshold. Now my data looks like this:
...
1
vote
1
answer
2k
views
Stop Scipy differential_evolution() after a time threshold
My question has already been partially answered here. I just need to extend the answer to another Scipy function. (Scipy 1.4.0, Python 3.7 on Windows 10)
Referring to the answer given by @ali_m, I ...
1
vote
1
answer
206
views
How to fix the colors of the image to get a better thresholding result?
I'm trying to threshold the hand in the following image
original image
using the following code:
img = cv2.GaussianBlur(crop_img,(25,25),0)
img_YCrCb = cv2.cvtColor(img, cv2.COLOR_BGR2YCrCb)
...
1
vote
1
answer
2k
views
Adaptive thresholding for scanned images
I would like to improve a number of images accquired with document scanning, does anybody have any VB sample code for dynamic thresholding to achieve a result something similar to the images shown at ...
0
votes
2
answers
67
views
How do I create a function that defines a moving threshold along local maxima in R?
The goal is to quantify a certain growth. The definition is as follows:
Every value in the sequence shall be compared to the preceding value and if the following value is greater than the preceding ...
0
votes
1
answer
3k
views
R: Finding the nearest raster cell within a threshold calculated between two rasters
I have two perfectly overlapping rasters (same extents and cell size). For every cell in one raster (i.e. for every XY), I would like to determine the Euclidean geographical distance to the closest ...
0
votes
1
answer
220
views
Java - Make Plot Points, Near Linear - Exactly Linear
How would I go about changing points that are 'near' linear (within a threshold), actually linear?
I have some code that checks if 3 points are linear to one another (give or take), and I want to ...