Author: Antonio Cuni <[email protected]>
Branch: extradoc
Changeset: r5832:2f9fbc4cb3d1
Date: 2017-10-04 16:00 +0200
http://bitbucket.org/pypy/extradoc/changeset/2f9fbc4cb3d1/
Log: (antocuni, arigo, ronan): a picture of what we are seeing right now
diff --git a/sprintinfo/cape-town-2017/2017-10-04-155524.jpg
b/sprintinfo/cape-town-2017/2017-10-04-155524.jpg
new file mode 100644
index
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4bbb25cda6773e5d1b87986645f036127a38bce6
GIT binary patch
[cut]
diff --git a/talk/ep2017/the-joy-of-pypy-jit/sobel/v5.py
b/talk/ep2017/the-joy-of-pypy-jit/sobel/v5.py
--- a/talk/ep2017/the-joy-of-pypy-jit/sobel/v5.py
+++ b/talk/ep2017/the-joy-of-pypy-jit/sobel/v5.py
@@ -19,13 +19,6 @@
code.compile()
return code['apply']
-Gx = Kernel([[-1.0, 0.0, +1.0],
- [-2.0, 0.0, +2.0],
- [-1.0, 0.0, +1.0]])
-
-Gy = Kernel([[-1.0, -2.0, -1.0],
- [0.0, 0.0, 0.0],
- [+1.0, +2.0, +1.0]])
def sobel(img):
"""
@@ -34,6 +27,14 @@
img = Image(*img)
out = Image(img.width, img.height)
for p in img.noborder():
+ Gx = Kernel([[-1.0, 0.0, +1.0],
+ [-2.0, 0.0, +2.0],
+ [-1.0, 0.0, +1.0]])
+
+ Gy = Kernel([[-1.0, -2.0, -1.0],
+ [0.0, 0.0, 0.0],
+ [+1.0, +2.0, +1.0]])
+
dx = Gx(img, p)
dy = Gy(img, p)
value = min(int(sqrt(dx*dx + dy*dy) / 2.0), 255)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit