#23 create tool path from image, close #23

This commit is contained in:
Ian
2019-02-11 18:24:57 -05:00
parent 66955cb2c3
commit 1c2919ccd5
2 changed files with 6 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
from pcbdevice.utils.path import path
from pcbdevice.utils.pbmformator import formatPbm
from pcbdevice.utils.plotimg import plotPath
from pcbdevice.utils.savetofile import matrixToFile
if __name__ == "__main__":
@@ -11,7 +12,7 @@ if __name__ == "__main__":
matrixToFile(formatPbm(resourcesRawPath + 'test1ascii.pbm'), resourcesFormattedPath + 'test1.csv')
matrixToFile(path(formatPbm(resourcesRawPath + 'test100x100.pbm'), 4), resourcesPathOutput + 'test100x100.csv')
plotPath(path(formatPbm(resourcesRawPath + 'test100x100.pbm'), 5))

View File

@@ -63,10 +63,10 @@ def twoRemoving(image, rTool):
for column in range(width):
if image[line][column] == 1:
for px in range(1, 2 * rTool):
for pixel in range(1, 2*rTool):
if image[line - rTool + px][column - rTool + pixel] == 2:
image[line - rTool + px][column - rTool + pixel] = 0
for pixelx in range(1, 2 * rTool):
for pixely in range(1, 2*rTool):
if image[line - rTool + pixelx][column - rTool + pixely] == 2:
image[line - rTool + pixelx][column - rTool + pixely] = 0
print("image width = " + str(width))
print("image height = " + str(height))