fixed bug

This commit is contained in:
Jacob Holder 2023-04-19 16:54:25 +02:00
parent 4bbc802ee4
commit 458998d1f7
Signed by: jacob
GPG Key ID: 2194FC747048A7FD

View File

@ -1,12 +1,13 @@
import numpy as np
import logging
from abc import abstractmethod, ABC
from tools import clean_bounds_offset
from spin_image import FFT
from cache import persist_to_file, timeit
import tqdm
import numpy as np
import matplotlib.pyplot as plt
# from scipy.spatial import Voronoi
# import cv2
from cache import persist_to_file, timeit
from spin_image import FFT
from tools import clean_bounds_offset
from abc import abstractmethod, ABC
import logging
logger = logging.getLogger("fft")
@ -76,11 +77,17 @@ class Rect_Evaluator(Evaluator):
def merge_mask_helper(self):
new_eval_points = np.arange(len(self.eval_points))
mask = self.mask
mask = self.mask.copy()
for nc, ev_points in zip(new_eval_points, self.eval_points):
maske_low = np.min(ev_points) >= self.mask
maske_high = np.max(ev_points) <= self.mask
mask[np.logical_and(maske_high, maske_low)] = nc
maske_low = np.min(ev_points) <= self.mask
maske_high = np.max(ev_points) >= self.mask
maske = np.logical_and(maske_high, maske_low)
print("Debug: ", np.sum(maske))
mask[maske] = nc
plt.figure()
plt.imshow(mask)
plt.show()
return mask
def gen_mask_helper(self, img: FFT):