Questions tagged [threshold]

The starting point for a new state.

threshold
Filter by
Sorted by
Tagged with
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 ...
Erhannis's user avatar
  • 4,356
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(...
fortran's user avatar
  • 74.9k
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. ...
Jaka Konda's user avatar
  • 1,386
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 ...
1'''s user avatar
  • 26.6k
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 ...
Marco L.'s user avatar
  • 1,499
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 ...
Lynn's user avatar
  • 4,338
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, ...
mdl518's user avatar
  • 327
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. ...
U23r's user avatar
  • 1,683
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 ...
Axel Bayle's user avatar
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 ...
tahoar's user avatar
  • 1,798
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 ...
user3207875's user avatar
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 ...
Tariq's user avatar
  • 9,891
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 ...
NeedHelp's user avatar
  • 101
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 ...
N4LN's user avatar
  • 95
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 ...
NeedHelp's user avatar
  • 101
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 ...
gussurya_w's user avatar
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....
Melectro's user avatar
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 ...
Nick X Tsui's user avatar
  • 2,786
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 <- ...
Lam's user avatar
  • 23
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 ...
sapo_cosmico's user avatar
  • 6,384
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 ...
1'''s user avatar
  • 26.6k
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 ...
MSTTm's user avatar
  • 293
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 ...
sa125's user avatar
  • 28.6k
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 ...
Malek Ik's user avatar
  • 101
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(...
Thordax's user avatar
  • 1,713
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 ...
Shah's user avatar
  • 681
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 ...
Marnix v. R.'s user avatar
  • 1,688
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 ...
CaffGeek's user avatar
  • 22k
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 = ...
alejandro zuleta's user avatar
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 ...
Alex's user avatar
  • 158
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 ...
My other car is a cadr's user avatar
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 ...
user3394391's user avatar
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
maher's user avatar
  • 31
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 ...
S.sonia's user avatar
  • 73
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 ...
BlueStar's user avatar
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 ...
user974's user avatar
  • 41
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 ...
amir.fathi's user avatar
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 ...
benett's user avatar
  • 91
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 ...
Stefan Hesman's user avatar
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 =...
holyboy's user avatar
  • 43
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 ...
Lee's user avatar
  • 369
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'...
LadislavM's user avatar
  • 414
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 ...
user3241848's user avatar
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: ...
ChrM's user avatar
  • 61
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 ...
RF7's user avatar
  • 13
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) ...
SpiritedAwayCat's user avatar
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 ...
user529682's user avatar
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 ...
Eggimoney's user avatar
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 ...
David Roberts's user avatar
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 ...
Oliver Jones's user avatar
  • 1,430