From 8dad6520729d26d90ebee48939d7f2a1fd73dd38 Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Thu, 24 Jan 2019 15:24:06 +0000 Subject: [PATCH] Fix in pages that don't have qr code --- aoi_ocr/sid_process.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/aoi_ocr/sid_process.py b/aoi_ocr/sid_process.py index 93fbd89..5d965ec 100644 --- a/aoi_ocr/sid_process.py +++ b/aoi_ocr/sid_process.py @@ -84,7 +84,11 @@ # cv2.rectangle(image,(x,y),( x + w, y + h ),(0,255,0),2) cv2.imwrite("/tmp/sid_no_{}.png".format(i), roi) - sid_no = sid_no + str(classifier.predict(roi.reshape(1, -1) / 255.0)[0]) + sid_currno= str(classifier.predict(roi.reshape(1, -1) / 255.0)[0]) + sid_no = sid_no + sid_currno + fname="/tmp/SID/"+str(sid_currno)+"/sid"+str(np.random.randint(0,1000000))+".png" + print("Writing all the sid images ", fname) + cv2.imwrite(fname, roi) return sid_no -- Gitblit v1.9.3