fixed bug
This commit is contained in:
parent
4bbc802ee4
commit
458998d1f7
@ -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 tqdm
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
# from scipy.spatial import Voronoi
|
# from scipy.spatial import Voronoi
|
||||||
# import cv2
|
# 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")
|
logger = logging.getLogger("fft")
|
||||||
|
|
||||||
|
|
||||||
@ -76,11 +77,17 @@ class Rect_Evaluator(Evaluator):
|
|||||||
|
|
||||||
def merge_mask_helper(self):
|
def merge_mask_helper(self):
|
||||||
new_eval_points = np.arange(len(self.eval_points))
|
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):
|
for nc, ev_points in zip(new_eval_points, self.eval_points):
|
||||||
maske_low = np.min(ev_points) >= self.mask
|
maske_low = np.min(ev_points) <= self.mask
|
||||||
maske_high = np.max(ev_points) <= self.mask
|
maske_high = np.max(ev_points) >= self.mask
|
||||||
mask[np.logical_and(maske_high, maske_low)] = nc
|
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
|
return mask
|
||||||
|
|
||||||
def gen_mask_helper(self, img: FFT):
|
def gen_mask_helper(self, img: FFT):
|
||||||
|
Loading…
Reference in New Issue
Block a user