Ejemplo n.º 1
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     # self.log.setLevel(logging.DEBUG)
     # Make inputs and ouptuts list
     params = dict()
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 2
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     #self.log.setLevel(logging.DEBUG) 
     params = dict(
                   micron_pix = 3.67, # 5.13 for LD_*                                  
                   # Morphology
                   m_operation = 3,
                   m_ksize = 4,    
                   m_iters = 1,                      
                   # Threshold
                   t_ksize = 9,
                   t_c = 5,
                   # Contours for cross finding
                   curve_epsilon = 8,
                   ar_err = 0.15,
                   # Canny        
                   canny_thresh = 110,
                   # Output
                   step = 7,                      
                   ltype = -1,
                   lsize = -1, 
                   lx = -1.,
                   ly = -1.,
                   ch = -1.                                                          
                   )
     # import a morphology plugin to do filtering
     self.morph = Morph()        
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 3
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     self.log.setLevel(logging.DEBUG)         
     params = dict(
                   # Morphology
                   m_operation = 3,
                   m_ksize = 4,    
                   m_iters = 1,                      
                   # Threshold
                   t_ksize = 999,
                   t_c = 5,
                   # Contours
                   c_epsilon = 8,
                   c_min = 100,
                   c_max = 1800,
                   # Output
                   step = 4,                      
                   )
     # make a detector and get its param types
     detector_formats = ["","Grid","Pyramid"]        
     detector_types = ["FAST","STAR","SIFT","SURF","ORB","MSER","GFTT","HARRIS","Dense","SimpleBlob"]
     ########## Change these indexes
     detector_format = 0
     detector_type = 0
     ###############
     self.det = cv2.FeatureDetector_create(detector_formats[detector_format] + detector_types[detector_type])
     self.ranges = {}
     for param in self.det.getParams():
         typ = self.det.paramType(param)
         d_param = "d_" + param
         if typ in (FLOAT, REAL):
             params[d_param] = float(self.det.getDouble(param))
             print param, params[d_param]
             step = params[d_param] / 10.0
             if step > 1:
                 step = 1
             elif step > 0.1:
                 step = 0.1
             elif step > 0.01:
                 step = 0.01
             elif step > 0.001:
                 step = 0.001                    
             else:
                 step = 0.01
                 params[d_param] = 1.0
             self.ranges[d_param] = (0, min(params[d_param]*4, 1000), step)
         elif typ == BOOLEAN:
             params[d_param] = int(self.det.getBool(param))
             self.ranges[d_param] = 2
         elif typ in (UNSIGNED_INT, UINT64, SHORT):
             params[d_param] = int(self.det.getInt(param))
             self.ranges[d_param] = (params[d_param]+1)
     # import a morphology plugin to do filtering
     self.morph = Morph()        
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 4
0
 def __init__(self):
     # Set a debug logging level in the local logger
     #self.log.setLevel(logging.DEBUG)
     params = dict(ksize=3,
                   prefilter=0,
                   iters=1,
                   sum=0.0,
                   filtered_mean=0.0,
                   filtered_stddev=0.0)
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 5
0
    def __init__(self):
        self.log.setLevel(logging.DEBUG)
        params = dict(tcpport=34567, num_clients=0, level=6, ratio=0.0)
        AdPythonPlugin.__init__(self, params)

        self.zmq_context = zmq.Context()
        self.zmq_socket = self.zmq_context.socket(zmq.PUB)
        self.zmq_socket.bind("tcp://*:%d" % self['tcpport'])
        self.log.debug("HWM: %d", self.zmq_socket.get_hwm())
        self.zmq_socket.set_hwm(2)
Ejemplo n.º 6
0
 def __init__(self):
     #self.log.setLevel(logging.DEBUG)
     params = dict(data="",
                   type="",
                   count=0,
                   quality=0,
                   threshold=25,
                   busy=0,
                   scanner=self.SCANNER_ZBAR)
     AdPythonPlugin.__init__(self, params)
     self.scanners = {self.SCANNER_ZBAR: ZBarDecoder()}
     self._busy = 0
Ejemplo n.º 7
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     #self.log.setLevel(logging.DEBUG) 
     # Make some generic parameters
     params = dict(clip = 0,
                   rotCentreX = -1,
                   rotCentreY = -1,
                   rotAngle = 0.0,
                   fillBlue = 0,
                   fillGreen = 0,
                   fillRed = 0)
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 8
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     self.log.setLevel(logging.DEBUG) 
     # Make some generic parameters
     # You can change the Name fields on the EDM screen here
     # Hide them by making their name -1
     params = dict(int1 = 1,      int1Name = "Array offset",
                   int2 = 2,      int2Name = "Int 2",
                   int3 = 3,      int3Name = "-1",
                   double1 = 1.0, double1Name = "Double 1",
                   double2 = 2.0, double2Name = "Double 2",
                   double3 = 3.0, double3Name = "-1")
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 9
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     self.log.setLevel(logging.DEBUG) 
     # Make some generic parameters
     # You can change the Name fields on the EDM screen here
     # Hide them by making their name -1
     params = dict(int1 = 101,      int1Name = "Threshold block size",
                   int2 = 13,      int2Name = "Threshold C",
                   int3 = 3,      int3Name = "Kernel size",
                   double1 = 0.35, double1Name = "Angle cos",
                   double2 = 6.0, double2Name = "Curve epsilon",
                   double3 = 15.0, double3Name = "Length diff")
     self.dm=DataMatrix()
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 10
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     self.log.setLevel(logging.DEBUG)
     # Make some generic parameters
     # You can change the Name fields on the EDM screen here
     # Hide them by making their name -1
     params = dict(dp=2.0,
                   minDist=50,
                   minRadius=50,
                   maxRadius=200,
                   drawCircles=1,
                   param1=315,
                   x=0.0,
                   y=0.0)
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 11
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     self.log.setLevel(logging.DEBUG)
     # Make some generic parameters
     # You can change the Name fields on the EDM screen here
     # Hide them by making their name -1
     #        params = dict(int1 = 101,      int1Name = "Threshold block size",
     #                      int2 = 13,      int2Name = "Threshold C",
     #                      int3 = 3,      int3Name = "Kernel size",
     #                      double1 = 0.35, double1Name = "Angle cos",
     #                      double2 = 6.0, double2Name = "Curve epsilon",
     #                      double3 = 15.0, double3Name = "Length diff")
     self.dm = pydmtx.DataMatrix()
     params = dict(int1=35,
                   int2=13,
                   int3=3,
                   double1=0.35,
                   double2=6.0,
                   double3=15.0,
                   dp=2.2,
                   minDist=100,
                   minRadius=50,
                   maxRadius=100,
                   param1=500,
                   step=6,
                   bc1="",
                   bc2="",
                   bc3="",
                   bc4="",
                   bc5="",
                   bc6="",
                   bc7="",
                   bc8="",
                   bc9="",
                   bc10="",
                   bc11="",
                   bc12="",
                   bc13="",
                   bc14="",
                   bc15="",
                   bc16="",
                   message="")
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 12
0
    def __init__(self):
        # Set logging level
        self.log.setLevel(logging.INFO)

        # Attributes
        self.attributes_missed_on_last_array = 0

        # Parameters
        params = dict(
            Status="Good",
            MissedAttributeCounter=0,
            ResetMissed=0,
            NumAttributes=0,
        )

        # Create attribute parameters
        for i in range(1, 9):
            params["Attribute{0}Name".format(i)] = ""
            params["Attribute{0}Value".format(i)] = 0.0

        AdPythonPlugin.__init__(self, params)
Ejemplo n.º 13
0
 def __init__(self):
     # The default logging level is INFO.
     # Comment this line to set debug logging off
     # self.log.setLevel(logging.DEBUG)
     # Make inputs and ouptuts list
     params = dict(PeakHeight=1,
                   OriginX=2,
                   OriginY=3,
                   Baseline=3.,
                   SigmaX=1.0,
                   SigmaY=2.0,
                   Angle=3.0,
                   Error=2.0,
                   FitWindowSize=3,
                   FitThinning=5,
                   Maxiter=20,
                   FitStatus="",
                   OverlayROI=0,
                   Overlayellipse=0,
                   OverlayCross=0,
                   OutputType=0,
                   FitType=-1)
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 14
0
    def __init__(self):

        # Default values. All params are integers in this case.
        params = dict(
            preprocess=0,  # Choose from the list of candidate functions.
            pp_param1=3,  # Generic parameter for preprocessing.
            pp_param2=1,  # Another. (Meaning imbued by use.)
            canny_upper=100,  # Thresholds for Canny edge detection.
            canny_lower=50,
            close_ksize=5,  # Kernel size for "close" operation.
            close_iterations=1,
            scan_direction=+1,  # +1:LtR, -1:RtL
            min_tip_height=5,
            tip_x=-1,  # Pixel positions of detected tip.
            tip_y=-1,  # (Not really parameters...)
            top=np.asarray([0], dtype=np.int32),  # Edge waveforms.
            bottom=np.asarray([0], dtype=np.int32),  # (Not parameters either.)
            out_arr=0,  # Which array to put downstream.
            draw_circle=0,  # Annotation options.
            draw_edges=0,
            force_color=0,  # Expand colour depth to show colour annotations?
        )

        AdPythonPlugin.__init__(self, params)
Ejemplo n.º 15
0
 def __init__(self):
     params = dict(ksize = 3, operation = 1, iters = 1)
     AdPythonPlugin.__init__(self, params)
Ejemplo n.º 16
0
    def __init__(self):
        # The only parameter is the sample count for averaging.
        params = dict(count=1)
        AdPythonPlugin.__init__(self, params)

        self.seen = 0