Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienChagnon committed Aug 28, 2017
1 parent 45fe262 commit 67d49eb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
Binary file added AutomaticPatch/Lumenera/screenshots/canny.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AutomaticPatch/Lumenera/screenshots/contour.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions AutomaticPatch/Lumenera/screenshots/rapport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import cv2

img = cv2.imread('screenshot2.jpg', 0)
img = cv2.bilateralFilter(img, 4, 10, 5)
img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)
canny = cv2.Canny(img, 40, 50)


ret,thresh = cv2.threshold(canny,127,255,0)
im2,contours,hierarchy = cv2.findContours(thresh, 1, 2)
rows,cols = img.shape[:2]
for cnt in contours:
M = cv2.moments(cnt)
if (cv2.arcLength(cnt, True) > 90) & bool(M['m00']):
[vx,vy,x,y] = cv2.fitLine(cnt, cv2.DIST_L2,0,0.01,0.01)
lefty = int((-x*vy/vx) + y)
righty = int(((cols-x)*vy/vx)+y)
cv2.line(img,(cols-1,righty),(0,lefty),(0,255,0),2)

cv2.imwrite('contour.jpg', img)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion AutomaticPatch/PatchClampRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def get_template_series(self, nb_images):
for i in range(3):
for j in range(3):
if (i != 1) & (j != 1):
# divide template zone into 9 images
# divide template zone into 8 images
temp = template[i * height / 4:height / 2 + i * height / 4, j * width / 4:width / 2 + j * width / 4]

# Search the tip using the number of darkest pixel in the image
Expand Down
2 changes: 2 additions & 0 deletions AutomaticPatch/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
resistance = [i for i in f]

graph = plt.plot(resistance)
plt.ylabel('Resistance in Ohm')
plt.xlabel('Time by tick')
plt.show(graph)

0 comments on commit 67d49eb

Please sign in to comment.