标签: threshold

检测圆圈并测量像素

在此输入图像描述

在此图像中,我需要检测车辆轮辋并通过图像处理测量轮辋的像素长度.我想我应该遵循循环Hough变换的圆圈.你能告诉我哪些步骤可以获得轮辋的宽度?ex(灰度 - >边缘检测,或对此的任何其他评论)

image-processing edge-detection grayscale hough-transform threshold

2
推荐指数
1
解决办法
1858
查看次数

如何检测时间序列数据中的符号变化(例如,正到负)?

我有随时间变化的通量数据,并希望获得通量从负变为正或反之的时间列表.这看起来很简单,所以它可能有一个简单的答案,但我找不到我的搜索条件.

样本数据:

day=c(1,2,3,5,10,20)
flux=c(-2,-4,1,-2,4,11)
Run Code Online (Sandbox Code Playgroud)

我想得到一个类似矢量crossover_times =(2.5,4,7.5)的东西来表示变化发生的插值天数,理想情况下,还有表明符号变化走向的信息,例如sign_changes =(正,负,正).

当然,我可以编写一个循环来迭代数据,但我猜测R有一个或多个有用的功能.有什么建议?

r time-series threshold

2
推荐指数
2
解决办法
3893
查看次数

如何在opencv中的多个范围之间进行阈值

我是opencv的新手,我在windows7U(64位)上使用opencv2.4.5和VS10C++.我的项目是在140到160之间的阈值处理之后显示图像,但我是最后一行的挂断

下面是我的代码;

int main( int argc, char* argv[] ) 
{
    //open the video
VideoCapture cap2(argv[2]);
if ( !cap2.isOpened() )
    {
     cout << "Cannot open the video file" << endl;
     return -1;
    }

//Threshold value of 140 to 160
    if( cap2.isOpened() )
{
    Mat frame, frame_gray, result;

    for(;;)
    {
        int n;
        int t1=140, t2=160;
        n = 255;

        cap2>>frame;
        cvtColor( frame, frame_gray, CV_BGR2GRAY );

        for (int i=0;i<frame_gray.size().height;i++)
        {
            for(int j=0;j<frame_gray.size().width;j++)
            {
                uchar val;
                val = frame_gray.at<uchar>(j,i);
                if (val>t1 &&  val<t2) 
                    {val=255;}
                else …
Run Code Online (Sandbox Code Playgroud)

c++ opencv threshold

1
推荐指数
1
解决办法
4482
查看次数

R,查找,日期,连续

我的工作是在数据框中查找低于特定阈值的连续值。首先,我从数据框中提取了值低于阈值的子集。现在我的数据如下所示:

Value       dates
5105.47     1970-03-25
5398.53     1970-04-08
5520.65     1970-04-09
5052.68     1970-04-10
5406.77     1970-04-11
5501.05     1970-04-12
Run Code Online (Sandbox Code Playgroud)

结果基本上是一个不规则的时间序列。现在我想确定连续的日期。对如何做有任何猜测吗?

r date threshold

1
推荐指数
1
解决办法
4859
查看次数

阈值图像颜色 - Base64

我想使用 javaScript在 base64 字符串 ( )上使用阈值过滤器,data:image/png;base64,iVBOR...如下所示:

function threshold(base64) {
    some action whith base64 string...

    return base64; //base64 is updated by threshold filter    
}
Run Code Online (Sandbox Code Playgroud)

是否可能,如果可能,我该怎么做?

javascript base64 threshold

1
推荐指数
1
解决办法
1381
查看次数

Matlab 中 imbinarize 的 2015 替代方案是什么?

我需要使用imbinarize(I, T). 我正在使用 Matlab 2015a。

我可以使用哪个功能?

matlab threshold

1
推荐指数
1
解决办法
994
查看次数

根据 0.5 的容差阈值 (±) 比较两个数字向量

我有两个向量gh。我想比较这两个向量中的数字,看看它们之间是否有共同元素。但共同元素不必完全相同,可以在 的范围内(-0.5, +0.5)。因此,g\xc2\xb10.5正在与 进行比较h\xc2\xb10.5

\n\n
g <- c(0.5, 5956.3, 38, 22.666, 590.3, 21.992, 9.3)\nh <- c(0.7, 99.2, 39, 30, 21.68, 9.4, 22.333, 0.001, 0.000222, 9.999)\n
Run Code Online (Sandbox Code Playgroud)\n\n

例如,在上面的两个向量中,0.5fromg0.7from匹配,因为它们彼此h位于 from 附近。并且还匹配。而且,并且也匹配,因为它们的差异也在范围之内。\xc2\xb10.59.49.322.66622.333(-0.5, +0.5)

\n\n

值得注意的是,的每个元素都应该与 的每个元素进行g比较。h

\n\n

有没有一个函数可以做到这一点R

\n\n

all.equal不幸的是,函数仅将一个向量中的每个元素与另一个向量中具有相同索引的元素进行比较,因此期望向量的长度相等。我想做的是,我想将向量的每个元素g与向量的每个元素进行比较h

\n

r unique set-difference intersect threshold

1
推荐指数
1
解决办法
1521
查看次数

我想使用 python 对图像中的像素应用阈值。我哪里做错了?

我想生成作为阈值的输出。还有我的错误:

img_thres = n_pix[y, x]
TypeError: 'int' 对象不可下标

import cv2
import numpy as np
import matplotlib as plt

img = cv2.imread("cicek.png",0)
img_rgb = cv2.imread("cicek.png")

h = img.shape[0]
w = img.shape[1]

img_thres= []
n_pix = 0
# loop over the image, pixel by pixel
for y in range(0, h):
    for x in range(0, w):
        # threshold the pixel
        pixel = img[y, x]
        if pixel < 0.5:
            n_pix = 0
        img_thres = n_pix[y, x]

cv2.imshow("cicek", img_thres)
Run Code Online (Sandbox Code Playgroud)

python image image-processing threshold image-thresholding

1
推荐指数
1
解决办法
8227
查看次数

阈值与NULL值的比较

我们正在构建一个报告,其中将一些值与阈值进行比较。逻辑是

if value > lower_threshold and value < upper_threshold then PASS else FAIL
Run Code Online (Sandbox Code Playgroud)

但是,对于某些参数,upper_thresholds设置为NULL。从本质上讲,这意味着没有上限,如果值<= lower_threshold,则只会失败,否则将始终为PASS。我们正在使用Oracle SQL构建查询。由于将任何值与NULL进行比较将始终返回FALSE,因此报表无法正常工作。一种选择是:

if value > lower_threshold and value < nvl(upper_threshold, 9999999999999999) then PASS else FAIL
Run Code Online (Sandbox Code Playgroud)

这不是一个好方法。还有其他选择可以达到相同目的吗?

sql oracle threshold

1
推荐指数
1
解决办法
55
查看次数

将ORB功能与阈值匹配

我的项目是基于android的草药识别.我使用ORB来获取关键点,功能和匹配功能.

我想用这个算法:

  1. 我使用4参考图像,并将它们的特征image1匹配到图像1,1-2,1-3,1-4,2-3,3,4.
  2. 然后我将最小和最大距离存储到数据库作为阈值.(最小阈值=总最小值/ 6)
  3. 当我识别出新图像时,我将新的最小和最大距离与数据库进行比较.但我不知道该怎么做.

{

for (j=MinID; j<=MaxID; j++){
                        MatOfDMatch matches = DetectUtility.match(features, matFromJson(DB.GetORBFitur(j)));
                        List<DMatch> matchesList = matches.toList();
                        Double max_dist = 0.0;
                        Double min_dist = 100.0;
                        for (int i = 0; i < matchesList.size(); i++){
                            Double dist = (double) matchesList.get(i).distance;
                            if (dist < min_dist && dist != 0){
                                min_dist = dist;
                            }
                            if (dist > max_dist){
                                max_dist = dist;
                            }
                        }
Run Code Online (Sandbox Code Playgroud)

这个网站,我得到这个代码:

//-- Draw only "good" matches (i.e. whose distance is less than 3*min_dist )
std::vector< …
Run Code Online (Sandbox Code Playgroud)

android opencv matching threshold orb

0
推荐指数
1
解决办法
4783
查看次数

在MATLAB中识别满足阈值的数组中元素的方形子矩阵

我有一个矩阵(大约342乘342)表示C_{ij},我想根据条件识别原始的矩形子矩阵C_{ij}.我正在使用MATLAB

例如,如果我有矩阵C_{ij}:

C = 1     0.7    0.8
    0.7   1      0.5
    0.8   0.5    1
Run Code Online (Sandbox Code Playgroud)

并且rho = 0.6然后我希望我的代码识别的正确的方形子矩阵是:

C = 1     0.7    0.8
    0.7   1      0.5
    0.8   0.5    1
Run Code Online (Sandbox Code Playgroud)

我不确定如何/最好的方法是在MATLAB中做到这一点?虽然我现在使用的矩阵是对称的,但我更倾向于一种不假设的解决方案.

matlab matrix threshold

-1
推荐指数
1
解决办法
215
查看次数

哈斯克尔.将名称分配给值的阈值

我想弄清楚如何在Haskell中编写:

有一个由4个变量组成的列表:[w,x,y,z]通过ghci完成以下内容后:

collection :: Int -> Int -> Int -> Int -> [Int]
collection w x y z = [w,x,y,z]
Run Code Online (Sandbox Code Playgroud)

我想为w,x,y,z的每个阈值赋予"含义".例如:当0 <x <60时,则x ="低",当59 <x <80时,则x ="中",当79 <x <100时,则x ="高"

你如何把它放在Haskell代码中?

haskell function threshold

-1
推荐指数
1
解决办法
86
查看次数