精华内容
下载资源
问答
  • Threshold

    2020-12-02 06:09:14
    <div><p>Hi, I have a doubt on your code because you use two threshold, the first for MOG2 function and the second is for the processed Mog image and that is my question. Why did you use the second ...
  • threshold

    千次阅读 2013-12-21 16:52:23
    Applies a fixed-level threshold to each array element. C++: double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type) Python: cv2.threshold(src, thresh, maxval

    Applies a fixed-level threshold to each array element.

    C++: double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type)

    Python: cv2.threshold(src, thresh, maxval, type[, dst]) → retval, dst

    C: double cvThreshold(const CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type)

    Python: cv.Threshold(src, dst, threshold, maxValue, thresholdType) → None
    Parameters:
    • src – input array (single-channel, 8-bit or 32-bit floating point).
    • dst – output array of the same size and type as src.
    • threshthreshold value.
    • maxval – maximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding types.
    • typethresholding type (see the details below).

    The function applies fixed-level thresholdingto a single-channel array. The function is typically used to get abi-level (binary) image out of a grayscale image (compare() couldbe also used for this purpose) or for removing a noise, that is, filteringout pixels with too small or too large values. There are severaltypes of thresholding supported by the function. They are determined by type :

    • THRESH_BINARY

      \texttt{dst} (x,y) =  \fork{\texttt{maxval}}{if $\texttt{src}(x,y) > \texttt{thresh}$}{0}{otherwise}

    • THRESH_BINARY_INV

      \texttt{dst} (x,y) =  \fork{0}{if $\texttt{src}(x,y) > \texttt{thresh}$}{\texttt{maxval}}{otherwise}

    • THRESH_TRUNC

      \texttt{dst} (x,y) =  \fork{\texttt{threshold}}{if $\texttt{src}(x,y) > \texttt{thresh}$}{\texttt{src}(x,y)}{otherwise}

    • THRESH_TOZERO

      \texttt{dst} (x,y) =  \fork{\texttt{src}(x,y)}{if $\texttt{src}(x,y) > \texttt{thresh}$}{0}{otherwise}

    • THRESH_TOZERO_INV

      \texttt{dst} (x,y) =  \fork{0}{if $\texttt{src}(x,y) > \texttt{thresh}$}{\texttt{src}(x,y)}{otherwise}

    Also, the special value THRESH_OTSU may be combined withone of the above values. In this case, the function determines the optimal thresholdvalue using the Otsu’s algorithm and uses it instead of the specified thresh .The function returns the computed threshold value.Currently, the Otsu’s method is implemented only for 8-bit images.

    ../../../_images/threshold.png
    展开全文
  • THRESHOLD[,THRESHOLD[,THRESHOLD[,THRESHOLD]]] Warning thresholds specified in order that the metrics are returned. Specify -1 if no warning threshold. -c, --critical=THRESHOLD[,THRESHOLD[,...
  • <div><p>I think you might have mixed up the <code>detection_threshold</code> and <code>text_threshold</code> variables in <code>detection.py</code> since they differ from the original CRAFT ...
  • Threshold function

    2020-12-09 09:22:04
    <p>Is it possible to see the value of the threshold when using the threshold function? Normally the threshold is only applied to the image, without any information which threshold is choosen. <p>More ...
  • Opencv Threshold

    2013-05-28 14:10:45
    Opencv Threshold
  • Match threshold

    2020-12-28 14:30:24
    <div><p>Could you add an optional parameter to find that allows you to set a match threshold? I am looking for matches that are only really close vs. getting matches that are .2 or .3 in similarity. ...
  • Adaptive threshold

    2020-12-25 23:39:44
    I want help in writing the equation part in code using the Spike Response Model (SRM) and adaptive threshold. The threshold level is inversely proportional to the interspike interval between the ...
  • min threshold

    2020-12-01 13:17:34
    <div><p>Is it possible to add a threshold? So if the threshold is not reached, the list is displayed as django default? <p>Reason: Some Customers have 100 Objects, here the dropdown saves a lot of ...
  • Maximum Threshold

    2021-01-06 07:38:07
    and <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/FeatureRequest2012x10x19x155812">here, a maximum threshold option would be fantastic. <p>I have a camera outside and it often detects ...
  • Voting threshold

    2021-01-06 10:38:32
    <div><p>There should be a voting threshold (it's actually a threshold on the votes <em>difference). <p>Set to 1% of repo followers (currently, that means the difference between 👍 and ...
  • Custom threshold

    2020-12-25 20:47:50
    <div><p>Allow passing a custom error threshold</p><p>该提问来源于开源项目:skyweb07/Snap.swift</p></div>
  • changing threshold

    2020-11-27 20:09:19
    <div><p>Hi, How can we change the threshold of an model for mtcnn.</p><p>该提问来源于开源项目:ipazc/mtcnn</p></div>
  • Overlap threshold

    2020-12-28 12:30:40
    I have uncovered that in box.py, function snap_to_anchors(.), there are hardcoded overlap threshold parameters 0.4 and 0.5, which discard elongated objects. When I change these parameters, training ...
  • 一、threshold 全局阈值 threshold(Image : Region : MinGray, MaxGray : ) 对应参数分别为输入图像、输出区域、阈值下限、阈值上限 使用全局阈值分割图像,阈值选择输入图像中灰度值g满足以下条件的像素: ...

    一、threshold 全局阈值

    threshold(Image : Region : MinGray, MaxGray : )  对应参数分别为输入图像、输出区域、阈值下限、阈值上限

    使用全局阈值分割图像,阈值选择输入图像中灰度值g满足以下条件的像素:

    图像中所有满足条件的点会被作为一个整体区域被返回,对于矢量图像,阈值不是对应于灰度值,而是对应于矢量的长度。

    注意点:MaxGray >= MinGray,MaxGray和MinGray的值可以是浮点类型也可以是整数类型,如果图像是整数类型的,MaxGray和MinGray的值类型应当为整数类型,如果是浮点类型,小数部分会被舍弃;

     

    二、dyn_threshold 局部阈值

    dyn_threshold(OrigImage, ThresholdImage : RegionDynThresh : Offset, LightDark : ) 对应参数分别为原始图像、阈值图像、输出区域、偏移量、输出类型

    使用局部阈值分割图像,dyn_threshold从输入图像中选择满足条件的区域方法如下:

    注意:g0是原始图片,gt是阈值图片,通常,阈值图像是原始图像的平滑版本,可以利用 mean_image, binomial_filter, gauss_filter等来创建阈值图片;

    当LightDark = 'light' 时 g0 >= gt+Offset;

    当LightDark = 'dark' 时 g0 <= gt-Offset;

    当LightDark = 'equal' 时 gt-Offset <= g0 <= gt+Offset;

    当LightDark = 'not_equal' 时 gt+Offset < g0 或者 g0 < gt-Offset;

     

    利用dyn_threshold可以提取目标图片的轮廓,如下图

    代码如下:

    read_image (Image2, 'C:/Users/Administrator/Desktop/2注册图片.bmp')
    draw_rectangle1 (200000, Row1, Column1, Row2, Column2)
    gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)
    reduce_domain (Image2, Rectangle, ImageReduced)
    mean_image (ImageReduced, ImageMean, 3, 3)
    dyn_threshold (ImageReduced, ImageMean, RegionDynThresh, 10, 'light')

    MaskSize尺寸越大,发现的区域就越大,一般,MaskSize的大小应该是被提取对象直径的两倍,如下图:

    代码如下:

    read_image (Image2, 'C:/Users/Administrator/Desktop/2注册图片.bmp')
    draw_rectangle1 (200000, Row1, Column1, Row2, Column2)
    gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)
    reduce_domain (Image2, Rectangle, ImageReduced)
    mean_image (ImageReduced, ImageMean, 10,10)
    dyn_threshold (ImageReduced, ImageMean, RegionDynThresh,5, 'light')

    注意:offset不应该设置成0,如果设置成0会有很多干扰会被一起提取出来,建议值应该是5到40,offset越大,被提取的区域就会越小,超过60可能就发现不了任何点了,整个函数的返回就是一个空区域;

     

    三、bin_threshold 

    bin_threshold(Image : Region : : )对应参数为输入图像和输出区域

    使用自动确定的阈值分割图像,bin_threshold已经过时,只是为了向后兼容而提供的,新的应用程序应该使用binary_threshold来替代;

    bin_threshold使用自动确定的阈值分割单通道的灰度图像,首先,输入图像的相对直方图是确定的,然后,从直方图中提取相关的最小值,作为阈值操作的参数,为了减少最小值的数量,对直方图进行高斯平滑处理,掩模的大小被放大,直到平滑直方图中只有一个最小值

     

     

    四、binary_threshold 二值阈值

    binary_threshold(Image : Region : Method, LightDark : UsedThreshold)对应参数分别为输入图像、输出区域、使用方法、选择前景还是背景、输出使用的阈值

    使用二值阈值分割图像,binary_threshold使用自动确定的全局阈值分割单通道图像,并在region中返回分割后的区域,分割所使用的阈值由method中给出的方法确定,非常适用于在均匀照明的背景下分割字符;

    目前,method总共提供两种方法:'max_separability' 和 'smooth_histo',这两种方法都只能用于具有双峰直方图的图像

     'smooth_histo' 方法和bin_threshold的功能一致,可以参考bin_threshold的分割过程;

    'max_separability' 方法是靠UsedThreshold来决定最小阈值的,速度比'smooth_histo'要快,对于干扰也不是那么敏感;

     

    五、auto_theshold 直方图阈值

    auto_threshold(Image : Regions : Sigma : ) 对应参数分别为输入图像、输出区域、高斯参数

    利用直方图确定的阈值分割图像,通过多阈值分割单通道图像,会返回多个区域;首先输入图像的绝对直方图的灰度值是确定的,然后高斯平滑(Sigma)后从直方图中提取相关的最小值,Sigma越大,提取的区域就越小;

    代码如下:

    read_image (Image2, 'C:/Users/Administrator/Desktop/2注册图片.bmp')
    draw_rectangle1 (200000, Row1, Column1, Row2, Column2)
    gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)
    reduce_domain (Image2, Rectangle, ImageReduced)
    median_image (ImageReduced, ImageMedian, 'circle', 5, 'mirrored')  为了过滤干扰因素,不进行过滤的话,会返回很多个干扰区域;
    auto_threshold (ImageMedian, Regions, 5)

     

    六、fast_threshod 全局阈值

    fast_threshold(Image : Region : MinGray, MaxGray, MinSize : ) 对应参数分别为输入图像、输出区域、阈值下限、阈值上限、处理参数

    基于全局阈值的图像快速阈值化,fast_threshold从输入图像中选择灰度值g满足以下条件的像素:

    此方法为了节约处理时间,分成两步去阈值图像,第一步是通过MinSize的值来先处理行列间隔为Minsize的所有像素点,第二步是再处理邻域(size (2*MinSize+1) x (2*MinSize+1))的所有点;

    对于不需要深入研究的人,在理解MinSize的时候,可以直接理解为就是一个加速参数,把图像分成两块来分别处理,MinSize决定了两块的比例;

    虽然Fast_threshold已经分了两步去处理,但是由于多核计算机支持SSE2指令集的,所以再多核计算机上threshold的速度是大于fast_threshold的,基本上fast_threshold主要用于嵌入式系统中,速度才会快于threshold;

    测试速度:

    代码如下:处理一幅大图时

    没有循环的情况下,只执行一遍,fast_threshold的MinSize=1,执行时间如下:

    没有循环的情况下,只执行一遍,fast_threshold的MinSize=200,执行时间如下:

    把fast_threshold更换成threshold (ImageReduced, Region,20, 255),执行时间如下:

    注意:只是简单论证两种方式的时间,不够严谨性,如需要大量验证,必须保证条件的一致性,以及执行的次数够过才行;

     

    七、var_threshold 

    var_threshold(Image : Region : MaskWidth, MaskHeight, StdDevScale, AbsThreshold, LightDark : )
    分别对应于参数

    输入图像、输出区域、掩膜宽度、掩膜高度、灰度值的标准差因子、与平均值的最小灰度差值、阈值类型

    在不均匀的,嘈杂的,或不均匀照明的背景上分割区域是比较合适的;

    通过局部均值和标准差分析阈值图像,主要通过以下几个条件来选择像素:

    1、提取像素的局部灰度值是亮的还是暗的,也就是提取前景还是背景,取决于参数LightDark;

    2、MaskWidth和MaskHeight如下图,其他参数相同的情况下,(1)是原始图片,(2)是MaskWidth和MaskHeight等于12,(3)是MaskWidth和MaskHeight等于3,(4)是MaskWidth和MaskHeight等于40

    因此MaskWidth和MaskHeight的最小值应该要大于等于3,值3可以被认为是最小的敏感值;

    3、如果StdDevScale是正值,那么像素灰度值需要具有较高的标准偏差(不均匀的图像);如果StdDevScale是负值,那么像素灰度值需要具有较低的标准偏差(均匀的图像);StdDevScale 局部标准差被用来衡量图像中的噪声,标准差可以通过StdDevScale进行缩放(最后一张图体现了缩放的意义),以反映所需的灵敏度,较高的值意味着只选择与周围环境非常不同的像素,建议值是在-1.0到1.0之间,0.2是建议值,如下图:

    图(1)是StdDevScale的值过于小,导致很多像素没有被选中,图(2)是值过大,导致不需要的像素值被选中;

     

    4、AbsThreshold 在均匀的图像中,标准差较低;因此,单个灰度值的影响较大,为了减小算子的灵敏度,需要调整AbsThreshold的值,这样单个灰度值的变化就可以被忽略;

    值得注意的是,如果StdDevScale是负值,AbsThreshold也应该选择为负值,因为标准差比较低,在介绍StdDevScale时有提到;

     

    补充:标准差可以通过StdDevScale进行缩放

    结果灰度值GrayValues,经过StdDev的值来放大,主要在平均灰度值Mean的基础上,从而拉大灰度值的差距,提高对比来选出需要的区域

     

    总结:

    1、使用最多的基本就是threshold、dyn_threshold、binary_threshold和var_threshold;

    2、正常干扰不多的情况下直接用threshold即可;

    3、复杂情况根据具体需要选择dyn_threshold、binary_threshold、var_threshold;

     

     

     

    展开全文
  • IOU threshold

    2020-11-20 22:41:26
    <p>I wonder if you use IOU threshold for box matching. <p>If you do, can you explain me what criterion to decide the anchor size? <p>Thanks in advance. Byeonghak</p><p>该提问来源于开源项目:...
  • <div><p>Threshold command-line option <code>/P:Threshold</code> seems to use a single value for all threshold type. I would like to specify different threshold level for each threshold types. <p>like ...
  • VarianceThreshold

    万次阅读 多人点赞 2018-09-28 17:19:06
    最近在数据的与处理中遇到了VarianceThreshold操作,这是sklearn.feature_selection,就是数据特征值选择,为什么会有这种操作呢,其实这是在进行数据分析之前的一种数据预处理作业,以为我们遇到的数据是复杂多变的...

    最近在数据的预处理中遇到了VarianceThreshold操作,这是sklearn.feature_selection,就是数据特征值选择,为什么会有这种操作呢,其实这是在进行数据分析之前的一种数据预处理作业,以为我们遇到的数据是复杂多变的,有可能会存在很多个特征值,但是并不是每一个特征值都能很好的体现区分度,那么这样的特征值就不存在分析的价值了。

    假设某特征的特征值只有0和1,并且在所有输入样本中,95%的实例的该特征取值都是1,那就可以认为这个特征作用不大。如果100%都是1,那这个特征就没意义了。当特征值都是离散型变量的时候这种方法才能用,如果是连续型变量,就需要将连续变量离散化之后才能用。而且实际当中,一般不太会有95%以上都取某个值的特征存在,所以这种方法虽然简单但是不太好用。可以把它作为特征选择的预处理,先去掉那些取值变化小的特征,然后再从接下来提到的的特征选择方法中选择合适的进行进一步的特征选择。

    那我们怎么来评判一个特征值是不是存在对分析结果而言的高区分度呢,VarianceThreshold就是来帮我们做这一处理的,这样会简化数据分析的复杂程度,也会使得分析结果更有效的。

    下面举一个简单的例子:

    
    def var():
        var=VarianceThreshold(threshold=1.0)
        data=var.fit_transform([[0,2,0,3],[0,1,4,3],[0,1,1,3]])
        print(data)
        return None
    var()

    调用函数以后出现的结果是:

    [[0]
     [4]
     [1]]

    我们发现在三组数据里,我们发现第一列,(注意是观察每一列的数据)全是0,第二列方差小于1,第四列也是相同的值,那么这些列的区分度就会很微弱,也就不具备分析的价值了,而至于threshold的理解,官网上面也给出了具体的解释。

    Features with a training-set variance lower than this threshold will be removed. The default is to keep all features with non-zero variance, i.e. remove the features that have the same value in all samples.

    如果想了解更多可以访问http://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.VarianceThreshold.html

    展开全文
  • Linear Threshold教学

    2018-07-08 10:56:50
    the tutorial of linear threshold and independent cascade in social contagions network
  • 图像阈值处理cv2.threshold()函数(python)

    万次阅读 多人点赞 2018-07-23 18:26:48
    cv2.threshold()函数:在opencv中比较常用,但一开始不是很理解是什么意思。 下面是官方文档中给的解释 Python: cv2.threshold(src, thresh, maxval, type[, dst]) → retval, dst 在其中: src:表示的是...

    内容

    cv2.threshold()函数:在opencv中比较常用,但一开始不是很理解是什么意思。
    下面是官方文档中给的解释

    Python: cv2.threshold(src, thresh, maxval, type[, dst]) → retval, dst

    在其中:

    • src:表示的是图片源
    • thresh:表示的是阈值(起始值)
    • maxval:表示的是最大值
    • type:表示的是这里划分的时候使用的是什么类型的算法**,常用值为0(cv2.THRESH_BINARY)**

    这里写图片描述

    • (x,y)表示的是图像中的坐标
    • INV 表示的是取反
    • 一般的(BINARY)效果是:
      将一个灰色的图片,变成要么是白色要么就是黑色。(大于规定thresh值就是设置的最大值(常为255,也就是白色))
    import cv2
    import numpy as np
    
    img = np.zeros((200, 200), dtype=np.uint8)
    img[50:150, 50:150] = 255  # create a image with black color in the middle and its background is white.
    cv2.imshow("Image-Old", img)
    ret, thresh = cv2.threshold(img, 127, 255, 0)
    cv2.imshow("Image-New", thresh)
    cv2.waitKey()
    cv2.destroyAllWindows()
    
    

    注意: 这里的两张图其实是一样的。

    在这里插入图片描述

    展开全文
  • RSSI Threshold

    2012-11-30 10:16:04
    FM RSSI Threshold FM frequency modulation Android FM RSSI
  • Add key threshold

    2020-12-02 14:00:59
    <div><h1>Adds threshold field <ul><li>added threshold field in the layout model</li><li>added validate function to verify if threshold is an integer</li><li>changed naming scheme of link metadata ...
  • add threshold setting

    2020-12-29 12:09:27
    <div><p>Add threshold setting to move only if mouse moves farther than threshold. Threshold setting can be a function. fixes #83 </p><p>该提问来源于开源项目:davetayls/jquery.kinetic</p></div>
  • Threshold函数

    2019-11-20 14:14:15
    threshold 方法是通过遍历灰度图中点,将图像信息二值化,处理过后的图片只有二种色值。 其函数原型如下: double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type) 参数信息...
  • Coverage Threshold parameter

    2020-12-27 04:05:40
    <div><p>An optional Threshold parameter could be given e.g. --threshold=90 and when the merged threshold is >90% the script could return 0, otherwise return 1. <p>Would be great for CI.</p><p>...
  • Adaptive resign threshold

    2021-01-11 07:49:45
    The adaptive resign threshold could be scaled with game length, so not only do you set a % but also a number (like 300), and every move the adaptive resign threshold is decreased by 1/300th and ...
  • <div><ul><li>For single threshold value behavior will be same as present, i.e same threshold values is used to check against specified threshold types. Otherwise parse the value in the same order as ...
  • However, I found some inconsistency, using threshold_otsu and threshold_multiotsu with two classes produces different results. <h2>Way to reproduce <pre><code>python import numpy as np from skimage....

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 22,830
精华内容 9,132
关键字:

threshold