"""# define an 3x3 neighborhoodneighborhood = generate_binary_structure(2,2)# apply the local maximum filter; all pixel of maximal value# in their neighborhood are set to 1local_min =maximum_filter(-image, footprint=neighborhood) == -image local_max =maximum_filter(image, footprint=neighborh...
这两种方法都不能保证找到的像素实际上是局部最大值。注意我在上面说的“更大或相等”。图像中任何足够...
max_bins = self.max_binsassertmax_bins >=1,'search range for the maximum filter must be >= 1'# calculate the diffdiff[diff_frames:] = spec[diff_frames:] - sim.maximum_filter(spec, size=[1, max_bins])[0:-diff_frames]# keep only positive valuesifpos: diff = diff * (diff >0)...
这两种方法都不能保证找到的像素实际上是局部最大值。注意我在上面说的“更大或相等”。图像中任何足够...