From f064901a095fb33657b074627626508b60bc56ab Mon Sep 17 00:00:00 2001
From: dorababu <dorababu@subcom.tech>
Date: Thu, 8 Dec 2022 15:32:42 +0530
Subject: [PATCH] Extract sub-array from fp_sample

---
 ReadRawData/pyScripts/Merge.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/ReadRawData/pyScripts/Merge.py b/ReadRawData/pyScripts/Merge.py
index f95826b..29dfb5a 100644
--- a/ReadRawData/pyScripts/Merge.py
+++ b/ReadRawData/pyScripts/Merge.py
@@ -41,7 +41,7 @@ def removedot(invertThin):
     return temp2
 
 # plot fp sample
-def plot_sample(fp_image):
+def plot_sample(fp_image,x,y):
     '''
     plot the given sample
     '''
@@ -55,18 +55,18 @@ def plot_sample(fp_image):
     skeleton = np.array(skeleton, dtype=np.uint8)
     skeleton = removedot(skeleton)
 
+    plt.subplot(x,2,y)
     plt.imshow(skeleton, 'gray')
-    plt.show()
 
 # extract sub array
-def extract_sample(arry):
+def extract_sample(arry,x,y):
     '''
     plot the given sample
     '''
-    fp_sample = arry[0:32:1,0:32:1]
+    fp_sample = arry[0:64,0:64]
     
     print(fp_sample)
-    fp_image = np.reshape(fp_sample, (32,32))    
+    fp_image = np.reshape(fp_sample, (64,64))    
     
     print(fp_image.shape)
 
@@ -81,8 +81,8 @@ def extract_sample(arry):
     skeleton = np.array(skeleton, dtype=np.uint8)
     skeleton = removedot(skeleton)
 
+    plt.subplot(x,2,y)
     plt.imshow(skeleton, 'gray')
-    plt.show()
     
 
 # plot fp samples 
@@ -122,9 +122,9 @@ if __name__ == "__main__":
     arr7 = np.array(temps[6]).reshape(160,160)
     arr8 = np.array(temps[7]).reshape(160,160)
 
-    plot_sample(arr1)
+    plot_sample(arr1, 1, 1)
     
-    # extract_sample(arr1)
+    extract_sample(arr1, 1, 2)
 
     '''
     # plot samples 
@@ -138,9 +138,9 @@ if __name__ == "__main__":
     plot_samples(arr7,2,7)
     plot_samples(arr8,2,8)
   
-
-    plt.show()
     '''
+    plt.show()
+    
     
     # Merging all samples to single array 
 
-- 
GitLab