Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Returns normalized image array from image path

  • Loading branch information...
commit 7c759e6be6e94298c9efae6d5f794f3d67f34316 1 parent b084bf1
@swvist authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 ocrn/data.py
View
6 ocrn/data.py
@@ -17,7 +17,7 @@ def normalizeArrayCell(self, array, x, y):
if array[i,j] < array[x,y] and array[i,j] < array[x,y]-0.2*c:
array[i,j]=array[x,y]-0.2*c
- # Returns a Normalized 2D Array.
+ # Returns a Normalized 2D Array from an Input Array.
# normalizeArrayCell is called for all non zero cells
def getNormalizedArray(self, imagearray):
nonzerocells = np.transpose(imagearray.nonzero())
@@ -25,5 +25,9 @@ def getNormalizedArray(self, imagearray):
self.normalizeArrayCell(imagearray, nonzerocells[i][0],nonzerocells[i][1])
return imagearray
+ # Returns Normalized 2D array from an Image
+ def getNormalizedImageArray(self, imagepath):
+ return self.getNormalizedArray(self.getImageArray(imagepath))
+

0 comments on commit 7c759e6

Please sign in to comment.
Something went wrong with that request. Please try again.