コード例 #1
0
	def make_blobs(self):
		'''
		This adds hole stats to holes.
		'''
		if self.__results['original'] is None:
			raise RuntimeError('need original to make dummy blobs')
		im = self.__results['original']
		blobs = []
		realblobs = self.makeblobs_config['center_list']
		for realblob in realblobs:
			coord = [realblob[1],realblob[0]]
		        blob = imagefun.Blob(im,None,None,coord,None,None)
			blobs.append(blob)
		self.__results['blobs']=blobs
コード例 #2
0
	def calc_holestats(self, radius=None):
		'''
		This adds hole stats to holes.
		'''
		if self.__results['original'] is None:
			raise RuntimeError('need original to calculate picked hole stats')
		self.configure_holestats(radius=radius)
		im = self.__results['original']
		r = self.holestats_config['radius']
		holes = []
		realholes = self.pickhole_config['center_list']
		for realhole in realholes:
			coord = [realhole[1],realhole[0]]
			holestats = self.get_hole_stats(im, coord, r)
			'''
			First create a dummy blob from the coordinate then fill in the stats
			'''
		        hole = imagefun.Blob(im,None,None,coord,None,None)
			hole.stats['n'] = holestats['n']
			hole.stats['hole_mean'] = holestats['mean']
			hole.stats['hole_std'] = holestats['std']
			holes.append(hole)
		self.__results['holes']=holes
コード例 #3
0
	def points_to_blobs(self, points):
			blobs = []
			for point in points:
				blob = imagefun.Blob(None, None, 1, point, 1.0, 1.0, 1.0, 1.0)
				blobs.append(blob)
			return blobs