示例#1
0
    def testAcquire(self):
        im = self.acquireImage()
        if im is None:
            return

        # filter
        im = numpy.asarray(im, dtype=numpy.float32)
        medfilt = int(self.settings['medfilt'])
        lowfilt = float(self.settings['lowfilt'])
        if medfilt > 1:
            im = ndimage.median_filter(im, size=medfilt)
        if lowfilt > 0:
            im = ndimage.gaussian_filter(im, lowfilt)
        self.setImage(im)

        # find regions
        self.logger.info('running openCVcaller.FindFeatures')
        #try:
        features = openCVcaller.FindFeatures(im)
        #except:
        #       self.logger.error('openCVcaller.FindFeatures failed')
        #       features = []

        n = len(features)
        self.logger.info('Features found: %s' % (n, ))
        self.displayRegions(features)
示例#2
0
 def runFindRegions(self, im):
     minsize = self.settings['minsize']
     maxsize = self.settings['maxsize']
     #timeout = 300
     #features, image  = openCVcaller.FindRegions(im, minsize, maxsize)
     #self.logger.info('running libCV.FindRegions, timeout = %d' % (timeout,))
     #features,image = pyami.timedproc.call('leginon.openCVcaller', 'FindRegions', args=(im,minsize,maxsize), timeout=timeout)
     features = openCVcaller.FindFeatures(im)
     return features
示例#3
0
    def testAcquire(self):
        im = self.acquireImage()
        if im is None:
            return

        im = numpy.asarray(im, dtype=numpy.float32)
        self.setImage(im)

        # find regions
        self.logger.info('running openCVcaller.FindFeatures')
        try:
            features = openCVcaller.FindFeatures(im)
        except:
            self.logger.error('openCVcaller.FindFeatures')
            features = []

        # this is copied from targetfinder:
        n = len(features)
        self.logger.info('Regions found: %s' % (n, ))
        self.displayRegions(features)