detection

Python usb detection

霸气de小男生 提交于 2019-11-30 10:06:08
First sorry for my english ! my environement : python : 2.7.3 wxwidgets : 2.9.4-1 wxpython : 2.9.4-1 ubuntu : 12.04 context : I have to detect when an usb hard-drive is plugged or unplugged and do some action on it. For example when a disk is plugged i wan to get the mount point (ex:/media/usb0) and the system point (ex:/dev/sdb1). I need both two path and i do not want made a system call like (subprocess : mount -l). I have tried several ways : - pyudev : only get the system path on EVT_DEVICE_ADDED (like /dev/sdb1) - Gio (gi.repository) : get the mount point with 'mount-added' (like /media

Fastest Way Of Detecting User's Country

社会主义新天地 提交于 2019-11-30 09:36:50
I need detect user's country and show website's language by him / her country . (Turkish for Turkish people, English for all others) How can i do this fastest way ? Performance is important for me . I'm looking IPInfoDB' API , are there any better alternative ? (I'm using PHP) Well for people who might visit in 2017 this is a solution this extremely simple to use <button class="btn dropdown-toggle" style="cursor:pointer;z-index:1000!important;margin-top:-67px;background:none!important;font-size:1.4em;" onclick="window.location.href='language'"> (a) <?php if (!empty($_SERVER['HTTP_CLIENT_IP']))

iOS Determine the corners of a Business Card in realtime

血红的双手。 提交于 2019-11-30 09:32:10
I want to implement a business card detecting functionality like this app ( https://scanbot.io ). The camera should detect a business card and automatically take a picture of it (only the business card). My idea was using BradLarson's GPUImage library, detect the corners (using the Harris corner detection algorithm), calculate the biggest rectangle with the corners obtained and crop the image contained inside the rectangle. Here is my code: - (void)setupFilter { videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition

Peak detection algorithm in Python

青春壹個敷衍的年華 提交于 2019-11-30 08:54:14
问题 I'm implementing a peak detection algorithm in Python that detects only those peaks that are above a threshold magnitude. I don't want to use the inbuilt function as I have to extend this simulation to Hardware implementation also. from math import sin,isnan from pylab import * def peakdet(v, delta,thresh,x): delta=abs(delta) maxtab = [] mintab = [] v = asarray(v) mn, mx = v[0], v[0] mnpos, mxpos = NaN, NaN lookformax = True for i in arange(len(v)): this = v[i] if abs(this)>thresh: if this >

detect quite brighter spots on the image

瘦欲@ 提交于 2019-11-30 07:42:42
问题 I have a bit noisy image where the background is not homogeneous. The image contains brigther convex spots, and I need to detect them. Here's a link for an example image: I know there is a lot of circle detection algorithm, but the difference between the environment and the object is too small. Do you any suggestion, how to segment the brigther spot? Or any idea to increase the intensity difference between them? update: the OpenCV environment is C++. I tried the adaptive threshold with many

Detecting cycle maxima (peaks) in noisy time series (In R?) [closed]

风格不统一 提交于 2019-11-30 07:39:33
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . This question is about an algorithm for determining the number and location of maxima in a sequence of numbers. Thus, there is a statistical flavor to the question, but it is more leaning towards programming, because I am not interested in the specific statistical properties, and the solution needs to be in R.

Getting MimeType subtype with Apache tika

青春壹個敷衍的年華 提交于 2019-11-30 07:20:09
I'd need to get the iana.org MediaType rather than application/zip or application/x-tika-msoffice for documents like, odt, ppt, pptx, xlsx etc. If you look at mimetypes.xml there are mimeType elements composed of the iana.org mime-type and "sub-class-of" <mime-type type="application/msword"> <alias type="application/vnd.ms-word"/> ............................ <glob pattern="*.doc"/> <glob pattern="*.dot"/> <sub-class-of type="application/x-tika-msoffice"/> </mime-type> How to get the iana.org mime-type name instead of the parent type name ? When testing mime type detection, I do : MediaType

C/C++/Obj-C Real-time algorithm to ascertain Note (not Pitch) from Vocal Input

浪尽此生 提交于 2019-11-30 06:17:38
问题 I want to detect not the pitch, but the pitch class of a sung note. So, whether it is C4 or C5 is not important: they must both be detected as C. Imagine the 12 semitones arranged on a clock face, with the needle pointing to the pitch class. That's what I'm after! ideally I would like to be able to tell whether the sung note is spot-on or slightly off. This is not a duplicate of previously asked questions, as it introduces the constraints that: the sound source is a single human voice ,

Detecting my own Firefox extension from a webpage

纵然是瞬间 提交于 2019-11-30 05:33:44
问题 I am trying to find an easy way to detect if my extension is installed in Firefox 3.6. This should be done from a webpage, probably using javascript. I've read a lot of blogs that says that I should try loading an image from my extension. Since I own the extension, and I can write the code, that seems like an unnecessary hack. I've also thought about setting a global variable to the web document, but I havn't been able to achieve this. I thought I would be able to write: top.window.content

Detect which view your finger is sliding over in Android

纵饮孤独 提交于 2019-11-30 05:30:11
While similar questions have been asked in the past they don't seem to really have been answered which might be due to confusion as to what's being asked. Put simply, I'd like to detect which view is being entered as your finger slides over the screen. The best example of this in action is the soft keyboard on any android phone. When you press any key it shows up as a popup to tell you what letter is under your finger. If you now move your finger over the keyboard in a single gesture the various letters pop up as you move over the various letters of the alphabet. What listeners are used for