Site Tools


Hotfix release available: 2018-04-22b "Greebo". upgrade now! [50.2] (what's this?)
Hotfix release available: 2018-04-22a "Greebo". upgrade now! [50.1] (what's this?)
New release available: 2018-04-22 "Greebo". upgrade now! [50] (what's this?)
Hotfix release available: 2017-02-19f "Frusterick Manners". upgrade now! [49.6] (what's this?)
Hotfix release available: 2017-02-19e "Frusterick Manners". upgrade now! [49.5] (what's this?)
Hotfix release available fixing CVE-2017-12979 and CVE-2017-12980: 2017-02-19d "Frusterick Manners". upgrade now! [49.4] (what's this?)
Hotfix release available fixing CVE-2017-12583: 2017-02-19c "Frusterick Manners". upgrade now! [49.3] (what's this?)
camera

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
camera [2018/01/23 09:14]
82.150.18.118 [Test des lentilles]
camera [2018/01/23 09:16] (current)
82.150.18.118
Line 50: Line 50:
  
 ---- ----
-#​!/​usr/​bin/​python +    ​#​!/​usr/​bin/​python 
-import cv2, sys +    import cv2, sys 
-import operator +    import operator 
-files = sys.argv[1:​] +    files = sys.argv[1:​] 
-all_ratio = {} +    all_ratio = {} 
-for filename in files +    for filename in files 
-    orig = cv2.imread(filename) +        orig = cv2.imread(filename) 
-    sobel_dx = cv2.Sobel(orig,​ cv2.CV_64F, 1, 0, ksize=5) +        sobel_dx = cv2.Sobel(orig,​ cv2.CV_64F, 1, 0, ksize=5) 
-    sobel_dy = cv2.Sobel(orig,​ cv2.CV_64F, 0, 1, ksize=5) +        sobel_dy = cv2.Sobel(orig,​ cv2.CV_64F, 0, 1, ksize=5) 
-    magnitude_image = cv2.magnitude(sobel_dx,​sobel_dy,​sobel_dx);​ +        magnitude_image = cv2.magnitude(sobel_dx,​sobel_dy,​sobel_dx);​ 
-    mag, ang = cv2.cartToPolar(sobel_dx,​ sobel_dy, magnitude_image)  +        mag, ang = cv2.cartToPolar(sobel_dx,​ sobel_dy, magnitude_image)  
-    ratio = cv2.sumElems(mag[0]) +        ratio = cv2.sumElems(mag[0]) 
-    all_ratio[filename] = ratio[0] +        all_ratio[filename] = ratio[0] 
-sorted_ratio = sorted(all_ratio.items(),​ key=operator.itemgetter(1)) +    sorted_ratio = sorted(all_ratio.items(),​ key=operator.itemgetter(1)) 
-index = 1 +    index = 1 
-print("​ Rang | Fichier ​     | Valeur calculee"​) +    print("​ Rang | Fichier ​     | Valeur calculee"​) 
-print("​------|--------------|----------------"​) +    print("​------|--------------|----------------"​) 
-for (filename, ratio) in reversed(sorted_ratio):​ +    for (filename, ratio) in reversed(sorted_ratio):​ 
-    print("​ %04d | %s | %d" % (index, filename, ratio)) +        print("​ %04d | %s | %d" % (index, filename, ratio)) 
-    index += 1+        index += 1
 ---- ----
  
camera.txt · Last modified: 2018/01/23 09:16 by 82.150.18.118