Commit 45b3da7a authored by Alessandro dos Santos Ferreira's avatar Alessandro dos Santos Ferreira
Browse files

Pynovisao - Correcoes e Documentacao

parent dd7fed36
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
""" """
Runs collection of machine learning algorithms for data mining tasks available in Weka. Runs collection of machine learning algorithms for data mining tasks available in Weka.
Hall, Mark, et al, The WEKA data mining software: an update, ACM SIGKDD explorations newsletter, 2009.
Name: weka_classifiers.py Name: weka_classifiers.py
Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com ) Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com )
""" """
...@@ -148,7 +150,7 @@ class WekaClassifiers(Classifier): ...@@ -148,7 +150,7 @@ class WekaClassifiers(Classifier):
aliases = sorted(WekaAlias.get_aliases()) aliases = sorted(WekaAlias.get_aliases())
for alias in aliases: for alias in aliases:
try: try:
if alias == "MultilayerPerceptron": if alias == 'KStar' or alias == 'LWL' or alias == 'MultilayerPerceptron':
continue continue
start_time = TimeUtils.get_time() start_time = TimeUtils.get_time()
...@@ -158,7 +160,7 @@ class WekaClassifiers(Classifier): ...@@ -158,7 +160,7 @@ class WekaClassifiers(Classifier):
info += "Scheme:\t%s %s\n" % (str(classifier.classname) , " ".join([str(option) for option in classifier.options])) info += "Scheme:\t%s %s\n" % (str(classifier.classname) , " ".join([str(option) for option in classifier.options]))
evl = WEvaluation(self.data) evl = WEvaluation(self.data)
evl.crossvalidate_model(classifier, self.data, 10, WRandom(1)) evl.evaluate_train_test_split(classifier, self.data, 66, WRandom(1))
info += "Correctly Classified Instances: %0.4f%%\n" % (evl.percent_correct) info += "Correctly Classified Instances: %0.4f%%\n" % (evl.percent_correct)
info += "Time taken to build model: %0.5f seconds\n\n" % (TimeUtils.get_time() - start_time) info += "Time taken to build model: %0.5f seconds\n\n" % (TimeUtils.get_time() - start_time)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
""" """
Extract GLCM (Gray-Level Co-Occurrence Matrix) feature. Extract GLCM (Gray-Level Co-Occurrence Matrix) feature.
Soh and Costas Tsatsoulis, Texture analysis of SAR sea ice imagery using gray level co-occurrence matrices, IEEE Transactions on geoscience and remote sensing, 1999.
Name: glcm.py Name: glcm.py
Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com ) Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com )
""" """
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
""" """
Extract HOG (Histogram of Oriented Gradient) feature. Extract HOG (Histogram of Oriented Gradient) feature.
Dalal, N and Triggs, B, Histograms of Oriented Gradients for Human Detection, IEEE Computer Society Conference on Computer Vision and Pattern Recognition 2005 San Diego, CA, USA
Name: hog.py Name: hog.py
Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com ) Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com )
""" """
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
""" """
Calculate raw, central and Hu's set of image moments. Calculate raw, central and Hu's set of image moments.
M. K. Hu, “Visual Pattern Recognition by Moment Invariants”, IRE Trans. Info. Theory, vol. IT-8, pp. 179-187, 1962
Name: image_moments.py Name: image_moments.py
Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com ) Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com )
""" """
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
""" """
Extract LBP (Local Binary Patterns) feature. Extract LBP (Local Binary Patterns) feature.
Multiresolution Gray-Scale and Rotation Invariant Texture Classification with Local Binary Patterns. Timo Ojala, Matti Pietikainen, Topi Maenpaa. 2002.
Name: lpb.py Name: lpb.py
Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com ) Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com )
""" """
......
...@@ -48,6 +48,8 @@ class ImageUtils(object): ...@@ -48,6 +48,8 @@ class ImageUtils(object):
def image_binary(image, bgr = False, grayscale = False): def image_binary(image, bgr = False, grayscale = False):
if grayscale == False: if grayscale == False:
image = ImageUtils.image_grayscale(image, bgr) image = ImageUtils.image_grayscale(image, bgr)
image = cv2.GaussianBlur(image,(5,5),0)
_, image = cv2.threshold(image, 0, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU) _, image = cv2.threshold(image, 0, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU)
return image return image
......
...@@ -147,7 +147,6 @@ _x11_colors = { ...@@ -147,7 +147,6 @@ _x11_colors = {
"Tomato" : (255, 99, 71), "Tomato" : (255, 99, 71),
"Turquoise" : (64, 224, 208), "Turquoise" : (64, 224, 208),
"Violet" : (238, 130, 238), "Violet" : (238, 130, 238),
"Web" : (187, 408, 281),
"WebGray" : (128, 128, 128), "WebGray" : (128, 128, 128),
"WebGreen" : (0, 128, 0), "WebGreen" : (0, 128, 0),
"WebPurple" : (127, 0, 127), "WebPurple" : (127, 0, 127),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment