Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -53,7 +53,6 @@ def index(): | ... | @@ -53,7 +53,6 @@ def index(): |
53 | def register(): | 53 | def register(): |
54 | if request.method == 'GET': | 54 | if request.method == 'GET': |
55 | return render_template('register.html') | 55 | return render_template('register.html') |
56 | - | ||
57 | attendance_db = pymysql.connect(read_default_file="./DB.cnf") | 56 | attendance_db = pymysql.connect(read_default_file="./DB.cnf") |
58 | cursor = attendance_db.cursor(pymysql.cursors.DictCursor) | 57 | cursor = attendance_db.cursor(pymysql.cursors.DictCursor) |
59 | send = {'form':'json'} | 58 | send = {'form':'json'} |
... | @@ -75,6 +74,7 @@ def register(): | ... | @@ -75,6 +74,7 @@ def register(): |
75 | image = base64.b64decode(request.form['image']) | 74 | image = base64.b64decode(request.form['image']) |
76 | image_np = np.frombuffer(image, dtype=np.uint8) | 75 | image_np = np.frombuffer(image, dtype=np.uint8) |
77 | image_np = cv2.imdecode(image_np, cv2.IMREAD_UNCHANGED) | 76 | image_np = cv2.imdecode(image_np, cv2.IMREAD_UNCHANGED) |
77 | + image_np = cv2.cvtColor(image_np, cv2.COLOR_BGR2RGB) | ||
78 | image_np = prewhiten(image_np) | 78 | image_np = prewhiten(image_np) |
79 | image_np = resize(image_np) | 79 | image_np = resize(image_np) |
80 | image_np = image_np.reshape(-1, image_size, image_size, 3) | 80 | image_np = image_np.reshape(-1, image_size, image_size, 3) | ... | ... |
-
Please register or login to post a comment