diff --git a/.vscode/launch.json b/.vscode/launch.json index ca5e2eba968104ef850e02e4c1de44a62cd21468..17e15f27ec2bb23f50627f046a7e8d1b225be974 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,13 +4,6 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "Python: Main File", - "type": "python", - "request": "launch", - "program": "${workspaceFolder}/main.py", - "console": "integratedTerminal" - }, { "name": "Python: Current File", "type": "python", diff --git a/app.py b/app.py index b1c5f47a1bcaa66421a111449070b8838323d025..15c3597d24819359a8a83460f61fcbf086258aed 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,6 @@ """Stream output of main.py script to index.html""" +# import matplotlib +# matplotlib.use('tkagg') import threading import cv2 from flask import Flask, render_template, Response diff --git a/settings.py b/settings.py index 4bd6c55595ef36bbc3ddcb1219f2ddb52ebf6db9..6366ac472a6e09038f9836ae6854f781b7e31eee 100644 --- a/settings.py +++ b/settings.py @@ -30,7 +30,7 @@ SHAPE = (960, 1280, 3) TYPE = np.uint16 # Blob detection size -BLOB_SIZE = 8 +BLOB_SIZE = 9 # Region of interest of the image REGION = np.array([[8, 466], [1260, 638]]) diff --git a/tools.py b/tools.py index 14ae2cbcc4bb8911d9b5156c25ab2fdae6cd3a45..b10883b74021f0eb01bbaeed77884cc2fccc4ada 100644 --- a/tools.py +++ b/tools.py @@ -66,7 +66,6 @@ class Main: """ Apply the processing on the images. """ - warnings.simplefilter("once", UserWarning) while True: dist_factor = read_factor(self.conn) image = load_image() @@ -118,6 +117,8 @@ class Main: if len(coord) > 0: roundness = ion_roundness(img, coord[0][:2]) img = compensate_gradient(img, coord) + else: + roundness = -1 max_int, num_pix = max_ion_intensity(img, coord) coord = detect_dim_ions(img, coord, max_int) linearity = ion_linearity(coord) @@ -582,9 +583,9 @@ def dark_ions(image, coord, dist_factor): coord = coord[coord[:, 1].argsort()].astype(int) coord = coord[coord[:, 1] < image.shape[1]] # remove points outside the image - if loss.min() > 20: - warnings.warn("Loss is too high... " - "Try calculating a new factor value using calibrate() function.") + # if loss.min() > 20: + # warnings.warn("Loss is too high... " + # "Try calculating a new factor value using calibrate() function.") return coord