Detect which image is sharper

As e.g. shown in this Matlab Central page, the sharpness can be estimated by the average gradient magnitude. I used this in Python as from PIL import Image import numpy as np im = Image.open(filename).convert(‘L’) # to grayscale array = np.asarray(im, dtype=np.int32) gy, gx = np.gradient(array) gnorm = np.sqrt(gx**2 + gy**2) sharpness = np.average(gnorm) A … Read more

How to detect current JSF-Version?

Programmatically, you mean? You can get it from Package#getImplementationVersion(). String version = FacesContext.class.getPackage().getImplementationVersion(); There are by the way also getImplementationVendor() and getImplementationTitle() methods. You might want to use it as well in order to distinguish the vendor (MyFaces or Mojarra, for example). Or do you mean manually? Just look in /META-INF/MANIFEST.MF file of the JSF … Read more

Detecting CPU architecture compile-time

Enjoy, I was the original author of this. extern “C” { const char *getBuild() { //Get current architecture, detectx nearly every architecture. Coded by Freak #if defined(__x86_64__) || defined(_M_X64) return “x86_64”; #elif defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86) return “x86_32”; #elif defined(__ARM_ARCH_2__) return “ARM2”; #elif defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__) return “ARM3”; #elif defined(__ARM_ARCH_4T__) || defined(__TARGET_ARM_4T) … Read more

How can I detect if Flash is installed and if not, display a hidden div that informs the user?

If swfobject won’t suffice, or you need to create something a little more bespoke, try this: var hasFlash = false; try { hasFlash = Boolean(new ActiveXObject(‘ShockwaveFlash.ShockwaveFlash’)); } catch(exception) { hasFlash = (‘undefined’ != typeof navigator.mimeTypes[‘application/x-shockwave-flash’]); } It works with 7 and 8.

What is the mAP metric and how is it calculated? [closed]

Quotes are from the above mentioned Zisserman paper – 4.2 Evaluation of Results (Page 11): First an “overlap criterion” is defined as an intersection-over-union greater than 0.5. (e.g. if a predicted box satisfies this criterion with respect to a ground-truth box, it is considered a detection). Then a matching is made between the GT boxes … Read more