This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[~/Yahtzee vramakrishnan]$ bash test_yahtzee_manager.sh node_name | |
erlc yahtzee_manager.erl | |
yahtzee_manager.erl:237: Warning: variable 'LoginTicket' is unused | |
yahtzee_manager.erl:253: Warning: variable 'Username' is unused | |
erlc tournament_manager.erl | |
tournament_manager.erl:64: Warning: variable 'ActiveUsernames' is unused | |
tournament_manager.erl:87: Warning: function calcRoundSize/2 is unused | |
erlc referee.erl | |
referee.erl:77: Warning: variable 'PlayerAPid' is unused | |
referee.erl:80: Warning: variable 'PlayerBPid' is unused |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-05-02 22:40:11.479: Referee<0.48.0> > My node is node_name@hollyhock | |
2014-05-02 22:40:11.479: Referee<0.48.0> > My pid is <0.48.0> | |
2014-05-02 22:40:11.893: Referee<0.48.0> > In handle game | |
Is timeout is false | |
inside true block | |
2014-05-02 22:40:12.171: Referee<0.48.0> > in handle roll | |
2014-05-02 22:40:12.171: Referee<0.48.0> > Before message sent | |
2014-05-02 22:40:12.172: Referee<0.48.0> > Player a username is: "enugent1" | |
2014-05-02 22:40:12.172: Referee<0.48.0> > Player b username is: "enugent2" | |
2014-05-02 22:40:12.172: Referee<0.48.0> > After message sent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-05-02 22:42:31.259: Referee<0.48.0> > Player A tuple is {<5378.2.0>,vijay1@ash, | |
"enugent1","hunter1", | |
#Ref<0.0.0.47>,true,0,0,0,0} | |
2014-05-02 22:42:31.259: Referee<0.48.0> > Player B tuple is {<5379.2.0>,vijay2@lothlorien, | |
"enugent2","hunter2", | |
#Ref<0.0.0.67>,true,0,0,0,0} | |
2014-05-02 22:42:31.260: Referee<0.48.0> > My node is node_name@hollyhock | |
2014-05-02 22:42:31.260: Referee<0.48.0> > My pid is <0.48.0> | |
2014-05-02 22:42:31.679: Referee<0.48.0> > In handle game | |
Is timeout is false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#importing some useful packages | |
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
import numpy as np | |
import cv2 | |
%matplotlib inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#importing some useful packages | |
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
import numpy as np | |
import cv2 | |
import math | |
import sys | |
%matplotlib inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def grayscale(img): | |
"""Applies the Grayscale transform | |
This will return an image with only one color channel | |
but NOTE: to see the returned image as grayscale | |
you should call plt.imshow(gray, cmap='gray')""" | |
return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
image = mpimg.imread('test_images/solidYellowCurve2.jpg') | |
# grayscale the image | |
grayscaled = grayscale(image) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gaussian_blur(img, kernel_size): | |
"""Applies a Gaussian Noise kernel""" | |
return cv2.GaussianBlur(img, (kernel_size, kernel_size), 0) | |
# apply gaussian blur | |
kernelSize = 5 | |
gaussianBlur = gaussian_blur(grayscaled, kernelSize) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def canny(img, low_threshold, high_threshold): | |
"""Applies the Canny transform""" | |
return cv2.Canny(img, low_threshold, high_threshold) | |
# canny | |
minThreshold = 100 | |
maxThreshold = 200 | |
edgeDetectedImage = canny(gaussianBlur, minThreshold, maxThreshold) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def region_of_interest(img, vertices): | |
""" | |
Applies an image mask. | |
Only keeps the region of the image defined by the polygon | |
formed from `vertices`. The rest of the image is set to black. | |
""" | |
#defining a blank mask to start with | |
mask = np.zeros_like(img) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hough_lines(img, rho, theta, threshold, min_line_len, max_line_gap): | |
""" | |
`img` should be the output of a Canny transform. | |
Returns an image with hough lines drawn. | |
""" | |
lines = cv2.HoughLinesP(img, rho, theta, threshold, np.array([]), minLineLength=min_line_len, maxLineGap=max_line_gap) | |
line_img = np.zeros((*img.shape, 3), dtype=np.uint8) | |
draw_lines(line_img, lines) |
OlderNewer