def run(self, ips, snap, img, para = None): cimg = feature.corner_shi_tomasi(img, sigma=para['sigma']) pts = feature.corner_peaks(cimg, min_distance=1) ips.roi = ROI([Points(pts[:,::-1])])
def UpdateData(self): names = self.app.manager('roi').gets('name') objs = self.app.manager('roi').gets('obj') types = [ROI(mark2shp(i)).roitype for i in objs] self.lst_rois.SetValue(list(zip(names, types)))
def run(self, ips, snap, img, para = None): cimg = feature.corner_kitchen_rosenfeld(img, mode='constant', cval=para['cval']) pts = feature.corner_peaks(cimg, min_distance=1) ips.roi = ROI([Points(pts[:,::-1])])
def run(self, ips, snap, img, para = None): cimg = feature.corner_moravec(img, window_size=para['size']) pts = feature.corner_peaks(cimg, min_distance=1) ips.roi = ROI([Points(pts[:,::-1])])
def run(self, ips, imgs, para = None): a,b,c,d = ips.roi.to_geom().bounds ips.roi = ROI(Rectangle([a,b,c-a,d-b]))
def run(self, ips, imgs, para=None): geom = ips.roi.to_geom().buffer(para['r']) ips.roi = ROI(geom2shp(geom_flatten(geom)))
def run(self, ips, imgs, para = None): obj = mark2shp(self.app.manager('roi').get(name=para['name'])).to_geom() roi = geom_flatten(ips.roi.to_geom()) ips.roi = ROI(geom2shp(geom_flatten(roi.symmetric_difference(obj))))
def run(self, ips, imgs, para = None): geom = ips.roi.to_geom().convex_hull ips.roi = ROI(geom2shp(geom_flatten(geom)))
def run(self, ips, imgs, para = None): obj = mark2shp(self.app.manager('roi').get(name=para['name'])).to_geom() roi = geom_flatten(ips.roi.to_geom()) ips.roi = ROI(geom2shp(geom_flatten(roi.intersection(obj))))
def run(self, ips, imgs, para = None): with open(para['path']) as f: ips.roi = ROI(mark2shp(json.loads(f.read())))
def run(self, ips, imgs, para = None): rect = Rectangle([0, 0, ips.shape[1], ips.shape[0]]) geom = rect.to_geom().difference(geom_flatten(ips.roi.to_geom())) ips.roi = ROI(geom2shp(geom_flatten(geom)))
def run(self, ips, imgs, para = None): ips.roi = ROI(Rectangle([0, 0, ips.shape[1], ips.shape[0]]))
def run(self, ips, snap, img, para=None): pts = find_maximum(self.ips.img, para['tol'], False) ips.roi = ROI([Points(pts[:, ::-1])]) ips.update()