标签: detection

检测噪声时间序列中的周期最大值(峰值)(在 R 中?)

这个问题是关于确定数字序列中最大值的数量和位置的算法。因此,这个问题有统计的味道,但它更倾向于编程,因为我对具体的统计属性不感兴趣,并且解决方案需要在R中。使用统计来回答这个问题是可以的,但不是要求。

我想提取时间序列数据(即数字的有序序列)中的最大周期。此类数据的一个示例是太阳耀斑时间序列(~11 年周期,9 至 14 年之间)。循环不会以完美的间隔重复,并且峰值并不总是相同的高度。

我发现最近有一篇论文描述了这种算法,该论文实际上使用了太阳耀斑作为示例(图 5,Scholkmann 等人,2012 年,算法)。我希望这个算法或同样有效的算法可以作为 R 包提供。

链接到 Scholkmann 论文“基于自动多尺度的峰值检测” http://www.mdpi.com/1999-4893/5/4/588

我已经尝试过“pastecs”包中的“转折点”功能,但它似乎太敏感(即检测到太多峰值)。我想首先尝试平滑时间序列,但我不确定这是否是最好的方法(我不是专家)。

感谢您的指点。

r time-series cycle detection

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

OpenCv Python 颜色检测

我正在尝试在 python 中使用 opencv 跟踪红色对象。这是我到目前为止的代码:

#Identify red objects in an image

#import OpenCV
import cv2
#Import numpy
import numpy as np

#open webcam
imgcap=cv2.VideoCapture(0)

while(1):

    #view the image from the webcam
    _, frame=imgcap.read()
    #convert the image to HSV
    hsv=cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    #lower threshold for red
    lower_red=np.array([0, 100, 75])
    #upper threshold for red
    upper_red=np.array([5, 76, 100])

    mask=cv2.inRange(hsv, lower_red, upper_red)
Run Code Online (Sandbox Code Playgroud)

当我运行它时,出现的错误如下:

OpenCV Error: Sizes of input arguments do not match (The lower bounary is             neither an array of the same size and same …
Run Code Online (Sandbox Code Playgroud)

python opencv image colors detection

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

如何在Python中使用麦克风获得准确的计时

我正在尝试使用 PC 麦克风进行节拍检测,然后使用节拍时间戳计算多个连续节拍之间的距离。我选择Python是因为有大量可用的材料并且开发速度很快。通过搜索互联网,我想出了这个简单的代码(还没有高级峰值检测或任何东西,如果需要的话稍后会出现):

import pyaudio
import struct
import math
import time


SHORT_NORMALIZE = (1.0/32768.0)


def get_rms(block):
    # RMS amplitude is defined as the square root of the
    # mean over time of the square of the amplitude.
    # so we need to convert this string of bytes into
    # a string of 16-bit samples...

    # we will get one short out for each
    # two chars in the string.
    count = len(block)/2
    format = "%dh" % (count)
    shorts = struct.unpack(format, …
Run Code Online (Sandbox Code Playgroud)

python signal-processing timing detection pyaudio

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

Python Opencv自定义控制(增加/减少)视频播放速度

我正在编写一个程序来控制视频播放速度为自定义速率。

有办法实现这一点吗?

应该添加什么代码来控制播放速度?

import cv2

cap = cv2.VideoCapture('video.mp4')

while(cap.isOpened()):
    ret, frame = cap.read()
    cv2.imshow('frame',frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
cv2.destroyAllWindows()
Run Code Online (Sandbox Code Playgroud)

python opencv image detection

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

使用 Pytesseract OCR 识别具有表格结构的图像的坏字符

我使用代码来定位文本框并在它们周围创建一个矩形。这使我可以围绕图像中的表格结构重建网格。

但是,即使文本框检测效果很好,如果我尝试定义每个矩形中存在的字符,pytesseract 也无法很好地识别它们并且无法找到原始文本。

这是我的 Python 代码:

    import os
    import cv2
    import imutils
    import argparse
    import numpy as np
    import pytesseract

    # This only works if there's only one table on a page
    # Important parameters:
    #  - morph_size
    #  - min_text_height_limit
    #  - max_text_height_limit
    #  - cell_threshold
    #  - min_columns


    def pre_process_image(img, save_in_file, morph_size=(8, 8)):

        # get rid of the color
        pre = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

        def img_estim(img, threshold=127):
            is_dark = np.mean(img) < threshold
            return True if is_dark else False

        # …
Run Code Online (Sandbox Code Playgroud)

python ocr opencv detection python-tesseract

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

如何使用用户脚本欺骗我的 userAgent?

我正在尝试访问一个网站,但它不允许我这样做,因为它不支持我的浏览器。我相信它正在通过 userAgent 检测来检测我的浏览器。因此,我想创建一个 userScript 来修改我的 userAgent,以便网站无法检测到我的浏览器。我试过:

// ==UserScript==
// @name         Change UserAgent
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Spoofs the userAgent
// @author       You
// @include      *
// @run-at       document-start
// ==/UserScript==

Object.defineProperty(navigator, 'userAgent', {
  value: "MyCustomUserAgent",
  configurable: false
});
Run Code Online (Sandbox Code Playgroud)

尽管它向我表明 userAgent 是一个自定义值,但我相信对 userAgent 的请求在我可以欺骗它之前就已完成。有什么方法可以在不使用扩展的情况下做到这一点?谢谢。

javascript user-agent detection spoofing userscripts

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

在C#中检测多个同时按键

我希望通过检测某些无法输入的键组合(转义序列)的按键来模拟C#中的串行通信的超级终端功能,例如Ctrl + C,Ctrl + Z等.我知道这些键有它们的ASCII等价物并且可以如此传输.但我遇到了检测多个按键的问题.我的一些代码是作为参考提供的:

private void Transmitted_KeyDown(object sender, KeyEventArgs e)
{


   if (e.Modifiers == Keys.Control || e.Modifiers== Keys.Shift || e.Modifiers==Keys.Alt)
   {
       var test = (char)e.KeyValue; // Only able to detect a single keypress!


       ComPort.Write(test.ToString());

   }
} 
Run Code Online (Sandbox Code Playgroud)

c# keypress detection

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

检测设备型号(iPhone/iPod Touch)的正确方法?

这是检测用户正在运行的设备的正确方法吗?

NSString *currentModel = [[UIDevice currentDevice] model];
if ([currentModel isEqualToString:@"iPhone"]) {
    // The user is running on iPhone so allow Call, Camera, etc.
} else {
    // The user is running on a different device (iPod / iPad / iPhone Simulator) disallow Call.
}
Run Code Online (Sandbox Code Playgroud)

iphone model ipod-touch detection

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

如何检测智能手机用户的语言

为了生产一套移动电话/智能手机迷你网站,您推荐什么技术来自动选择网站的语言:

  • 浏览器IP地址
  • 移动浏览器语言请求标头
  • 任何与某个国家/地区的设备细节或运营商细节相关的方法?
  • 任何其他方法

将要定位的语言是:

  • 越南
  • 德语
  • 泰国
  • 阿拉伯
  • 西班牙语
  • 印度尼西亚
  • 意大利
  • 日本
  • 中文,传统/简体中文
  • 朝鲜的
  • 俄语

我理解答案可能因语言而异,因此非常感谢对所有语言或任何语言的反馈.

locale detection

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

在PERL中检测黑色/近乎黑色的JPG图像

我想使用PERL从文件夹中检测黑/近黑的JPEG图像.您对我应该使用的方法/模块有什么建议吗?

perl image colors detection perlmagick

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