detection

How to detect if the script is running on a virtual machine?

允我心安 提交于 2019-12-21 11:36:04
问题 I don't think the question needs any explanation. I'm writing a software that can boot virtual machines to simulate a network. I would like to disable this feature if the software is already running on a virtual machine. I already read this post: How to detect if my application is running in a virtual machine? But I need to do it on Linux and that post covers only Windows. I'm tagging it as a Perl question as I've to do it in Perl, but probably there are some file in proc or somewhere else to

Detecting horizontal div overflow with JavaScript?

痴心易碎 提交于 2019-12-21 05:13:24
问题 I have a DIV that has plenty of child DIVs inside of it. What I want is similar to Firefox's tabs, when you have too many tabs open or the main DIV width is too small, the interface will detect overflow and show a button on the right side to list all hidden tabs. The problem is that I have no idea where to even start looking for help. 回答1: Is you main DIV set to overflow:hidden ? If so, you can test its need to overflow by incrementing the scrollLeft property and then querying it to see if it

Color detection opencv

自闭症网瘾萝莉.ら 提交于 2019-12-21 04:52:28
问题 Using opencv, can a detection of a certain colour(Between a certain range of rgb values) be carried out in an image or a video frame? 回答1: You need to the define the treshold in RGB, and process the pixels in the image (hopefully not the whole image but a smaller region of interest, maybe a moving foreground shape) that fit to the deffinition. Something similar to what is discussed here. I am understanding that you know the color(or colors) you want to detect a priori. I hope this helps. 回答2:

How to detect blow in android device microphone

我怕爱的太早我们不能终老 提交于 2019-12-21 04:49:22
问题 How can I detect when the user blows into the device microphone? This would then be used to trigger some action by the app. 回答1: The job of detecting when a user blows into the microphone is separable into two parts: (1) taking input from the microphone and (2) listening for a blowing sound. The noise/sound of someone blowing into the mic is made up of low-frequency sounds. We’ll use a low pass filter to reduce the high frequency sounds coming in on the mic; when the level of the filtered

How to detect Android's version number in Firefox for Android?

好久不见. 提交于 2019-12-21 02:20:26
问题 For a website we want to show a link in the play store if the user comes with an Android 4+ device. All browsers we tested sent the version number of Android in their user-agent string, except one: Firefox for Android. Firefox just sends this: Mozilla/5.0 (Android; Mobile; rv:19.0) Gecko/19.0 Firefox/19.0 and even with some JavaScript I can't find any evidence for the version number: <script language="JavaScript"> document.write(navigator.appVersion + "\n<br/>OS CPU: " + navigator.oscpu); <

HoughCircles circle detection using opencv and python-

帅比萌擦擦* 提交于 2019-12-21 00:14:42
问题 I am trying to use OpenCV's (Hough)Circle detection to.. detect circles. I created a solid circle on a black background, tried to play with the parameters, used blur and everything, but I am just not able to make it find anything. Any ideas, suggestions etc. would be great, thank you! my current code is something like this: import cv2 import numpy as np """ params = dict(dp=1, minDist=1, circles=None, param1=300, param2=290, minRadius=1, maxRadius=100) """ img = np.ones((200,250,3), dtype=np

How can I correctly classify the number of positive (bright color) circles and negative (dark color) circles in the image

久未见 提交于 2019-12-20 07:13:26
问题 Long post - please bear with me. For a better understanding of what the goal is and what I have done so far, I have posted the code. Please let me know if any further information is required. I have an image (as shown) and the goal is to correctly classify the number of positive (blue) and negative (purple) circles . I do not care about the semi-circles in the image . As shown in the image, there are 29 circles (excluding the semi circles) in which there 7 positive ones. But my code detects

Vanilla JS Div Collision Detection

心不动则不痛 提交于 2019-12-20 04:31:10
问题 My implementation of the following can be found on jsfiddle.net I have four divs. My goal is to make them draggable around the page but NOT to allow them to overlap one another. Each can be dragged around the page with a mousemove listener. container.addEventListener('mousemove',mouseMove); function mouseMove(e) { if (!mouseDown) {return;} let coords=e.target.getBoundingClientRect(); let movX=e.movementX; let movY=e.movementY; if (!collision(movX,movY,e.target.classList[1],coords)){ e.target

How to measure the success and percent accuracy of an image detection algorithm?

偶尔善良 提交于 2019-12-20 02:38:05
问题 Does anyone know how to properly quantify the success of an image detection algorithm? How do you combine the 2 sources of error? since one source is the number of objects that the algorithm failed to detect and the other is the number of false positives that the algorithm misidentified as the object. So if for example there were 574 objects in the image but the algorithm only detected 540 of them while producing 113 false positives, how do I get the percent accuracy? 回答1: You can calculate

PHP 5.3.5 fileinfo() MIME Type for MS Office 2007 files - magic.mime updates?

拥有回忆 提交于 2019-12-20 01:22:53
问题 On a PHP upload, I'm trying to validate the MIME Type of the files being uploaded to match a valid set of MIME types for the application. When attempting to use the fileinfo() to determine the MIME type of an Office 2007 file it is NOT detecting as their appropriate MIME Types. Instead the MIME type response is "application/zip" Office Document MIME types: http://filext.com/faq/office_mime_types.php Example PHP Code: $oFileInfo = new finfo( FILEINFO_MIME_TYPE ); $sMimeType = $oFileInfo ->