def __init__(self, fchain):
        self.fchain = fchain
        fchain.add_image_observer(self.chain_observer)
        fchain.add_filter_observer(self.filters_changed_observer)

        self.win_list = []

        self.image = None

        self.filter = None
        self.size = 1.0
        self.image_shape = (320, 240, 0)

        ui = get_ui(self, "sourcesListStore", "filterChainListStore", "sizeListStore")

        self.window = ui.get_object(win_name(self))
        self.cboFilter = ui.get_object("cboFilter")
        self.filterChainListStore = ui.get_object("filterChainListStore")
        self.sizeListStore = ui.get_object("sizeListStore")
        self.imgSource = ui.get_object("imgSource")
        self.scwImage = ui.get_object("scwImage")
        self.vptImage = ui.get_object("vptImage")
        self.spnSize = ui.get_object("spnSize")
        self.cboSize = ui.get_object("cboSize")
        self.cboSize.set_active(5)  # 100%
        self.statusbar = ui.get_object("statusbar")

        self.fill_filters_source()
        self.set_default_filter()

        # FPS
        self.lastSecondFps = None
        self.fpsCount = 0
Beispiel #2
0
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnKernelErodeHeight = ui.get_object('spnKernelErodeHeight')
     self.spnKernelErodeHeight.set_adjustment(self.create_adj())
     self.spnKernelErodeWidth = ui.get_object('spnKernelErodeWidth')
     self.spnKernelErodeWidth.set_adjustment(self.create_adj())
     self.spnKernelDilateHeight = ui.get_object('spnKernelDilateHeight')
     self.spnKernelDilateHeight.set_adjustment(self.create_adj())
     self.spnKernelDilateWidth = ui.get_object('spnKernelDilateWidth')
     self.spnKernelDilateWidth.set_adjustment(self.create_adj())
     self.spnSections = ui.get_object('spnSections')
     self.spnSections.set_adjustment(self.create_adj())
     self.spnMinimumArea = ui.get_object('spnMinimumArea')
     self.spnMinimumArea.set_adjustment(Gtk.Adjustment(1, 0, 65535, 1, 1, 0))
     self.spnMinLight = ui.get_object('spnMinLight')
     self.spnMinLight.set_adjustment(self.create_adj())
     self.spnMinGrass = ui.get_object('spnMinGrass')
     self.spnMinGrass.set_adjustment(self.create_adj())
     self.spnMaxGrass = ui.get_object('spnMaxGrass')
     self.spnMaxGrass.set_adjustment(self.create_adj())
     self.init_window()
Beispiel #3
0
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnHueMin = ui.get_object('spnHueMin')
     self.spnHueMin.set_adjustment(self.create_adj_hue())
     self.spnHueMax = ui.get_object('spnHueMax')
     self.spnHueMax.set_adjustment(self.create_adj_hue())
     self.spnAreaMin = ui.get_object('spnAreaMin')
     self.spnAreaMin.set_adjustment(self.create_adj())
     self.spnNormal = ui.get_object('spnNormalHand')
     self.spnNormal.set_adjustment(self.create_adj())
     self.spnExtended = ui.get_object('spnExtendedHand')
     self.spnExtended.set_adjustment(self.create_adj())
     self.spnClosed = ui.get_object('spnClosedHand')
     self.spnClosed.set_adjustment(self.create_adj())
     self.spnAmplitude = ui.get_object('spnAmplitude')
     self.spnAmplitude.set_adjustment(self.create_adj())
     self.lblHue = ui.get_object('lblHue')
     self.lblNormal = ui.get_object('lblNormal')
     self.lblExtended = ui.get_object('lblExtended')
     self.lblClosed = ui.get_object('lblClosed')
     
     self.filtre.add_observer(self.filter_observer)
     
     self.init_window()
 def __init__(self):
     ui = get_ui(self, 'imageListStore', 'adjSize')
     self.window = ui.get_object(win_name(self))
     self.imageListStore = ui.get_object('imageListStore') 
     self.txtFolder = ui.get_object('txtFolder')
     self.lstImages = ui.get_object('lstImages')
     self.drwImage = ui.get_object('drwImage')
     self.spnSize = ui.get_object('spnSize')
     self.spnSize.set_value(16)
     
     self.drwImage.set_events(self.drwImage.get_events()
                   | Gdk.EventMask.LEAVE_NOTIFY_MASK
                   | Gdk.EventMask.BUTTON_PRESS_MASK
                   | Gdk.EventMask.BUTTON_RELEASE_MASK
                   | Gdk.EventMask.POINTER_MOTION_MASK
                   | Gdk.EventMask.POINTER_MOTION_HINT_MASK)
     
     self.image = None
     self.pixbuf_image = None
     self.surface = None
     self.color = Gdk.RGBA()
     self.color.red = 255
     self.color.green = 255
     self.color.blue = 255
     self.matrices = []
     self.undo_list = []
     self.current_index = 0
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.scwCurrent = ui.get_object("scwCurrent")
        self.scwWorking = ui.get_object("scwWorking")

        self.txtCurrent = GtkSource.View.new_with_buffer(GtkSource.Buffer())
        self.txtCurrent.set_editable(False)
        self.txtCurrent.set_can_focus(False)
        self.txtCurrent.set_show_line_numbers(True)

        self.txtWorking = GtkSource.View.new_with_buffer(GtkSource.Buffer())
        self.txtWorking.set_insert_spaces_instead_of_tabs(True)
        self.txtWorking.set_indent_on_tab(True)
        self.txtWorking.set_indent_width(4)
        self.txtWorking.set_show_line_numbers(True)
        self.txtWorking.set_can_default(True)

        self.rdoPython = ui.get_object("rdoPython")
        self.rdoCPP = ui.get_object("rdoCPP")
        self.rdoCPP.join_group(self.rdoPython)

        self.scwCurrent.add(self.txtCurrent)
        self.scwWorking.add(self.txtWorking)

        self.window.set_default(self.txtWorking)
        self.window.set_focus(self.txtWorking)

        self.init_window()
        self.set_used_language()
Beispiel #6
0
    def __init__(self):
        ui = get_ui(self, 'imageListStore', 'paramsListStore',
                    'paramvaluesListStore')
        self.window = ui.get_object(win_name(self))
        self.imageListStore = ui.get_object('imageListStore')
        self.txtFilterchain = ui.get_object('txtFilterchain')
        self.txtTestFolder = ui.get_object('txtTestFolder')
        self.lblPrecision = ui.get_object('lblPrecision')
        self.lblNoise = ui.get_object('lblNoise')
        self.lblNbImages = ui.get_object('lblNbImages')
        self.lstImage = ui.get_object('lstImage')
        self.imgOriginal = ui.get_object('imgOriginal')
        self.imgExample = ui.get_object('imgExample')
        self.imgGraphPrecision = ui.get_object('imgGraphPrecision')

        self.paramsListStore = ui.get_object('paramsListStore')
        self.paramvaluesListStore = ui.get_object('paramvaluesListStore')

        self.cboParams = ui.get_object('cboParams')
        self.spnFrom = ui.get_object('spnFrom')
        self.spnFrom.set_adjustment(self.create_adj(0))
        self.spnTo = ui.get_object('spnTo')
        self.spnTo.set_adjustment(self.create_adj(255))
        self.lblBestPrecision = ui.get_object('lblBestPrecision')
        self.lblBestNoise = ui.get_object('lblBestNoise')
        self.lblOverallBest = ui.get_object('lblOverallBest')
        self.imgGraphEval = ui.get_object('imgGraphEval')
        self.lblValue = ui.get_object('lblValue')

        self.test = None
        self.chain = None
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb
        
        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.scwCurrent = ui.get_object('scwCurrent')
        self.scwWorking = ui.get_object('scwWorking')
        
        self.txtCurrent = GtkSource.View.new_with_buffer(GtkSource.Buffer())
        self.txtCurrent.set_editable(False)
        self.txtCurrent.set_can_focus(False)
        self.txtCurrent.set_show_line_numbers(True)
        
        self.txtWorking = GtkSource.View.new_with_buffer(GtkSource.Buffer())
        self.txtWorking.set_insert_spaces_instead_of_tabs(True)
        self.txtWorking.set_indent_on_tab(True)
        self.txtWorking.set_indent_width(4)
        self.txtWorking.set_show_line_numbers(True)
        self.txtWorking.set_can_default(True)

        self.rdoPython = ui.get_object('rdoPython')
        self.rdoCPP = ui.get_object('rdoCPP')
        self.rdoCPP.join_group(self.rdoPython)
                
        self.scwCurrent.add(self.txtCurrent)
        self.scwWorking.add(self.txtWorking)
        
        self.window.set_default(self.txtWorking)
        self.window.set_focus(self.txtWorking)
        
        self.init_window()
        self.set_used_language()
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnKernelErodeHeight = ui.get_object('spnKernelErodeHeight')
        self.spnKernelErodeHeight.set_adjustment(self.create_adj())
        self.spnKernelErodeWidth = ui.get_object('spnKernelErodeWidth')
        self.spnKernelErodeWidth.set_adjustment(self.create_adj())
        self.spnKernelDilateHeight = ui.get_object('spnKernelDilateHeight')
        self.spnKernelDilateHeight.set_adjustment(self.create_adj())
        self.spnKernelDilateWidth = ui.get_object('spnKernelDilateWidth')
        self.spnKernelDilateWidth.set_adjustment(self.create_adj())
        self.spnSections = ui.get_object('spnSections')
        self.spnSections.set_adjustment(self.create_adj())
        self.spnMinimumArea = ui.get_object('spnMinimumArea')
        self.spnMinimumArea.set_adjustment(Gtk.Adjustment(
            1, 0, 65535, 1, 1, 0))
        self.spnMinLight = ui.get_object('spnMinLight')
        self.spnMinLight.set_adjustment(self.create_adj())
        self.spnMinGrass = ui.get_object('spnMinGrass')
        self.spnMinGrass.set_adjustment(self.create_adj())
        self.spnMaxGrass = ui.get_object('spnMaxGrass')
        self.spnMaxGrass.set_adjustment(self.create_adj())
        self.init_window()
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnHueMin = ui.get_object('spnHueMin')
        self.spnHueMin.set_adjustment(self.create_adj_hue())
        self.spnHueMax = ui.get_object('spnHueMax')
        self.spnHueMax.set_adjustment(self.create_adj_hue())
        self.spnAreaMin = ui.get_object('spnAreaMin')
        self.spnAreaMin.set_adjustment(self.create_adj())
        self.spnNormal = ui.get_object('spnNormalHand')
        self.spnNormal.set_adjustment(self.create_adj())
        self.spnExtended = ui.get_object('spnExtendedHand')
        self.spnExtended.set_adjustment(self.create_adj())
        self.spnClosed = ui.get_object('spnClosedHand')
        self.spnClosed.set_adjustment(self.create_adj())
        self.spnAmplitude = ui.get_object('spnAmplitude')
        self.spnAmplitude.set_adjustment(self.create_adj())
        self.lblHue = ui.get_object('lblHue')
        self.lblNormal = ui.get_object('lblNormal')
        self.lblExtended = ui.get_object('lblExtended')
        self.lblClosed = ui.get_object('lblClosed')

        self.filtre.add_observer(self.filter_observer)

        self.init_window()
    def __init__(self, fchain):
        self.fchain = fchain
        fchain.add_image_observer(self.chain_observer)
        fchain.add_filter_observer(self.filters_changed_observer)

        self.win_list = []

        self.image = None

        self.filter = None
        self.size = 1.0
        self.image_shape = (320, 240, 0)

        ui = get_ui(self, 'sourcesListStore', 'filterChainListStore',
                    'sizeListStore')

        self.window = ui.get_object(win_name(self))
        self.cboFilter = ui.get_object('cboFilter')
        self.filterChainListStore = ui.get_object('filterChainListStore')
        self.sizeListStore = ui.get_object('sizeListStore')
        self.imgSource = ui.get_object('imgSource')
        self.scwImage = ui.get_object('scwImage')
        self.vptImage = ui.get_object('vptImage')
        self.spnSize = ui.get_object('spnSize')
        self.cboSize = ui.get_object('cboSize')
        self.cboSize.set_active(5)  # 100%
        self.statusbar = ui.get_object('statusbar')

        self.fill_filters_source()
        self.set_default_filter()

        #FPS
        self.lastSecondFps = None
        self.fpsCount = 0
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnImages = ui.get_object('spnImages')
     self.spnImages.set_adjustment(self.create_adj())
     self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self, 'adjResize')
     self.window = ui.get_object(win_name(self))
     self.spnWidth = ui.get_object('spnWidth')
     self.spnHeight = ui.get_object('spnHeight')
     self.init_window()
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnChannels = ui.get_object('spnChannels')
        self.spnChannels.set_adjustment(self.create_adj())
        self.init_window()
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.hscRed = ui.get_object('hscRed')
        self.hscGreen = ui.get_object('hscGreen')
        self.hscBlue = ui.get_object('hscBlue')
        self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.hscRed = ui.get_object('hscRed')
     self.hscGreen = ui.get_object('hscGreen')
     self.hscBlue = ui.get_object('hscBlue')
     self.init_window()
Beispiel #16
0
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self, 'lstTechnique')
        self.window = ui.get_object(win_name(self))
        self.lstTechnique = ui.get_object('lstTechnique')
        self.cboTechnique = ui.get_object('cboTechnique')
        self.spnThreshold = ui.get_object('spnThreshold')
        self.spnThreshold.set_adjustment(self.create_adj())
        self.init_window()
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnHeight = ui.get_object('spnHeight')
        self.spnHeight.set_adjustment(self.create_adj())
        self.spnWidth = ui.get_object('spnWidth')
        self.spnWidth.set_adjustment(self.create_adj())
        self.init_window()
Beispiel #18
0
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnThreshold1 = ui.get_object('spnThreshold1')
        self.spnThreshold1.set_adjustment(self.create_adj())
        self.spnThreshold2 = ui.get_object('spnThreshold2')
        self.spnThreshold2.set_adjustment(self.create_adj())
        self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnHeight = ui.get_object('spnHeight')
     self.spnHeight.set_adjustment(self.create_adj())
     self.spnWidth = ui.get_object('spnWidth')
     self.spnWidth.set_adjustment(self.create_adj())
     self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self, 'lstTechnique')
     self.window = ui.get_object(win_name(self))
     self.lstTechnique = ui.get_object('lstTechnique')
     self.cboTechnique = ui.get_object('cboTechnique')
     self.spnThreshold = ui.get_object('spnThreshold')
     self.spnThreshold.set_adjustment(self.create_adj())
     self.init_window()
    def __init__(self):
        self.filter_list = filters.load_filters()
        ui = get_ui(self, 'filtersListStore')
        self.window = ui.get_object(win_name(self))
        self.filtersListStore = ui.get_object('filtersListStore')
        self.lstFilters = ui.get_object('lstFilters')

        self.window.set_modal(True)
        for name, filtre in self.filter_list.items():
            self.filtersListStore.append([name, filtre.__doc__])
        self.filtersListStore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
        
        self.selected_filter = None
    def __init__(self):
        self.filter_list = filters.load_filters()
        ui = get_ui(self, 'filtersListStore')
        self.window = ui.get_object(win_name(self))
        self.filtersListStore = ui.get_object('filtersListStore')
        self.lstFilters = ui.get_object('lstFilters')

        self.window.set_modal(True)
        for name, filtre in self.filter_list.items():
            self.filtersListStore.append([name, filtre.__doc__])
        self.filtersListStore.set_sort_column_id(0, Gtk.SortType.ASCENDING)

        self.selected_filter = None
Beispiel #23
0
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnDiameter = ui.get_object('spnDiameter')
        self.spnDiameter.set_adjustment(self.create_adj())
        self.spnSigmaColor = ui.get_object('spnSigmaColor')
        self.spnSigmaColor.set_adjustment(self.create_adj())
        self.spnSigmaSpace = ui.get_object('spnSigmaSpace')
        self.spnSigmaSpace.set_adjustment(self.create_adj())
        self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnDiameter = ui.get_object('spnDiameter')
     self.spnDiameter.set_adjustment(self.create_adj())
     self.spnSigmaColor = ui.get_object('spnSigmaColor')
     self.spnSigmaColor.set_adjustment(self.create_adj())
     self.spnSigmaSpace = ui.get_object('spnSigmaSpace')
     self.spnSigmaSpace.set_adjustment(self.create_adj())
     self.init_window()
Beispiel #25
0
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.hscc1min = ui.get_object('hscc1min')
     self.hscc1max = ui.get_object('hscc1max')
     self.hscc2min = ui.get_object('hscc2min')
     self.hscc2max = ui.get_object('hscc2max')
     self.hscc3min = ui.get_object('hscc3min')
     self.hscc3max = ui.get_object('hscc3max')
     self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnThreshold =ui.get_object('spnThreshold')
     self.spnThreshold.set_adjustment(self.create_adj())
     self.spnVBlur = ui.get_object('spnVBlur')
     self.spnVBlur.set_adjustment(self.create_adj())
     self.spnHBlur = ui.get_object('spnHBlur')
     self.spnHBlur.set_adjustment(self.create_adj())
     
     self.init_window()
Beispiel #27
0
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnRotationX = ui.get_object('spnRotationX')
        self.spnRotationX.set_adjustment(self.create_adj_rotation())
        self.spnRotationY = ui.get_object('spnRotationY')
        self.spnRotationY.set_adjustment(self.create_adj_rotation())
        self.spnZoom = ui.get_object('spnZoom')
        self.spnZoom.set_adjustment(self.create_adj_zoom())

        self.init_window()
Beispiel #28
0
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnRotationX = ui.get_object('spnRotationX')
     self.spnRotationX.set_adjustment(self.create_adj_rotation())
     self.spnRotationY = ui.get_object('spnRotationY')
     self.spnRotationY.set_adjustment(self.create_adj_rotation())
     self.spnZoom = ui.get_object('spnZoom')
     self.spnZoom.set_adjustment(self.create_adj_zoom())
     
     self.init_window()
Beispiel #29
0
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self, 'adjPerspective')
        self.window = ui.get_object(win_name(self))
        self.spnTopLeftX = ui.get_object('spnTopLeftX')
        self.spnTopLeftY = ui.get_object('spnTopLeftY')
        self.spnBottomLeftX = ui.get_object('spnBottomLeftX')
        self.spnBottomLeftY = ui.get_object('spnBottomLeftY')
        self.spnTopRightX = ui.get_object('spnTopRightX')
        self.spnTopRightY = ui.get_object('spnTopRightY')
        self.spnBottomRightX = ui.get_object('spnBottomRightX')
        self.spnBottomRightY = ui.get_object('spnBottomRightY')
        self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self, 'adjPerspective')
     self.window = ui.get_object(win_name(self))
     self.spnTopLeftX = ui.get_object('spnTopLeftX')
     self.spnTopLeftY = ui.get_object('spnTopLeftY')
     self.spnBottomLeftX = ui.get_object('spnBottomLeftX')
     self.spnBottomLeftY = ui.get_object('spnBottomLeftY')
     self.spnTopRightX = ui.get_object('spnTopRightX')
     self.spnTopRightY = ui.get_object('spnTopRightY')
     self.spnBottomRightX = ui.get_object('spnBottomRightX')
     self.spnBottomRightY = ui.get_object('spnBottomRightY')
     self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnX1 = ui.get_object('spnX1')
     self.spnX1.set_adjustment(self.create_adj())
     self.spnX2 = ui.get_object('spnX2')
     self.spnX2.set_adjustment(self.create_adj())
     self.spnY1 = ui.get_object('spnY1')
     self.spnY1.set_adjustment(self.create_adj())
     self.spnY2 = ui.get_object('spnY2')
     self.spnY2.set_adjustment(self.create_adj())
     
     self.init_window()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnCenterX = ui.get_object('spnCenterX')
     self.spnCenterX.set_adjustment(self.create_adj())
     self.spnCenterY = ui.get_object('spnCenterY')
     self.spnCenterY.set_adjustment(self.create_adj())
     self.spnSizeX = ui.get_object('spnSizeX')
     self.spnSizeX.set_adjustment(self.create_adj())
     self.spnSizeY = ui.get_object('spnSizeY')
     self.spnSizeY.set_adjustment(self.create_adj())
              
     self.init_window()
    def init_window(self, controller):
        self.lastSecondFps = 0
        self.fpsCount = 0
        self.image_size = None
        self.controler = controller
        self.controler.get_thread().add_observer(self.chain_observer)
        #self.controler.add_image_observer(self.chain_observer)
        self.controler.add_filter_observer(self.filters_changed_observer)
        self.controler.add_thread_observer(self.thread_observer)
        self.source_list = imageproviders.load_sources()
        self.source_window = None
        self.thread_running = self.controler.is_thread_running()
        self.recorder = None

        ui = get_ui(self, 'filterChainListStore', 'sourcesListStore',
                    'imgOpen', 'imgNew', 'imgUp', 'imgDown')
        self.window = ui.get_object(win_name(self))
        self.lstFilters = ui.get_object('lstFilters')
        self.btnView = ui.get_object('btnView')
        self.btnAdd = ui.get_object('btnAdd')
        self.btnRemove = ui.get_object('btnRemove')
        self.btnConfig = ui.get_object('btnConfig')
        self.btnUp = ui.get_object('btnUp')
        self.btnDown = ui.get_object('btnDown')
        self.btnRecord = ui.get_object('btnRecord')
        self.chkLoop = ui.get_object('chkLoop')
        self.lblLoopState = ui.get_object('lblLoopState')
        self.lblRealFPS = ui.get_object('lblRealFPS')
        self.txtFilterChain = ui.get_object('txtFilterChain')
        self.cboSource = ui.get_object('cboSource')
        self.spnFPS = ui.get_object('spnFPS')
        self.spnFPS.set_adjustment(self.create_adj())
        self.spnFPS.set_value(20)

        self.win_list = []

        self.sourcesListStore = ui.get_object('sourcesListStore')
        self.filterChainListStore = ui.get_object('filterChainListStore')
        self.set_state_empty()
        self.change_state()

        self.sourcesListStore.append(['None'])
        for name in self.source_list.keys():
            self.sourcesListStore.append([name])
        self.cboSource.set_active(0)
Beispiel #34
0
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnKernelWidth = ui.get_object('spnKernelWidth')
        self.spnKernelWidth.set_adjustment(self.create_adj())
        self.spnKernelHeight = ui.get_object('spnKernelHeight')
        self.spnKernelHeight.set_adjustment(self.create_adj())
        self.spnAnchorX = ui.get_object('spnAnchorX')
        self.spnAnchorX.set_adjustment(self.create_adj_anchor())
        self.spnAnchorY = ui.get_object('spnAnchorY')
        self.spnAnchorY.set_adjustment(self.create_adj_anchor())
        self.spnIterations = ui.get_object('spnIterations')
        self.spnIterations.set_adjustment(self.create_adj())
        self.init_window()
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnKernelWidth = ui.get_object("spnKernelWidth")
        self.spnKernelWidth.set_adjustment(self.create_adj())
        self.spnKernelHeight = ui.get_object("spnKernelHeight")
        self.spnKernelHeight.set_adjustment(self.create_adj())
        self.spnAnchorX = ui.get_object("spnAnchorX")
        self.spnAnchorX.set_adjustment(self.create_adj_anchor())
        self.spnAnchorY = ui.get_object("spnAnchorY")
        self.spnAnchorY.set_adjustment(self.create_adj_anchor())
        self.spnIterations = ui.get_object("spnIterations")
        self.spnIterations.set_adjustment(self.create_adj())
        self.init_window()
 def __init__(self, source):
     self.source = source
     self.source.set_auto_increment(False)
     
     ui = get_ui(self, 'imageListStore')
     self.window = ui.get_object(win_name(self))
     self.chkAutoPlay = ui.get_object('chkAutoPlay')
     self.txtFolder = ui.get_object('txtFolder')
     self.hscPosition = ui.get_object('hscPosition')
     self.lstImages = ui.get_object('lstImages')
     self.imageListStore = ui.get_object('imageListStore')
     
     if self.source.folder_name == '':
         self.open_folder()
     else:
         pos = self.source.position
         self.txtFolder.set_text(self.source.folder_name)
         self.fill_image_list(self.source.file_names)
         self.lstImages.set_cursor(pos)
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnTopLeftX = ui.get_object('spnTopLeftX')
        self.spnTopLeftY = ui.get_object('spnTopLeftY')
        self.spnBottomLeftX = ui.get_object('spnBottomLeftX')
        self.spnBottomLeftY = ui.get_object('spnBottomLeftY')
        self.spnTopRightX = ui.get_object('spnTopRightX')
        self.spnTopRightY = ui.get_object('spnTopRightY')
        self.spnBottomRightX = ui.get_object('spnBottomRightX')
        self.spnBottomRightY = ui.get_object('spnBottomRightY')
        self.spnTranslationX = ui.get_object('spnTranslationX')
        self.spnTranslationY = ui.get_object('spnTranslationY')
        self.spnZoom = ui.get_object('spnZoom')
        self.init_window()
    def __init__(self, source):
        self.source = source
        self.source.set_auto_increment(False)

        ui = get_ui(self, 'imageListStore')
        self.window = ui.get_object(win_name(self))
        self.chkAutoPlay = ui.get_object('chkAutoPlay')
        self.txtFolder = ui.get_object('txtFolder')
        self.hscPosition = ui.get_object('hscPosition')
        self.lstImages = ui.get_object('lstImages')
        self.imageListStore = ui.get_object('imageListStore')

        if self.source.folder_name == '':
            self.open_folder()
        else:
            pos = self.source.position
            self.txtFolder.set_text(self.source.folder_name)
            self.fill_image_list(self.source.file_names)
            self.lstImages.set_cursor(pos)
Beispiel #39
0
    def __init__(self, source):
        self.source = source
        self.source.add_observer(self.source_observer)
        self.update_scale = True

        ui = get_ui(self, 'adjPosition')
        self.window = ui.get_object(win_name(self))
        self.adjPosition = ui.get_object('adjPosition')
        self.txtMovie = ui.get_object('txtMovie')
        self.lblTotal = ui.get_object('lblTotal')
        self.sclPosition = ui.get_object('sclPosition')
        self.spnWidth = ui.get_object('spnWidth')
        self.spnWidth.set_adjustment(self.create_adj_res())
        self.spnHeight = ui.get_object('spnHeight')
        self.spnHeight.set_adjustment(self.create_adj_res())
        self.spnFPS = ui.get_object('spnFPS')
        self.spnFPS.set_adjustment(self.create_adj_fps())

        if self.source.file_name == '':
            self.open_video()
 def __init__(self, source):
     self.source = source
     self.source.add_observer(self.source_observer)
     self.update_scale = True
     
     ui = get_ui(self, 'adjPosition')
     self.window = ui.get_object(win_name(self))
     self.adjPosition = ui.get_object('adjPosition')
     self.txtMovie = ui.get_object('txtMovie')
     self.lblTotal = ui.get_object('lblTotal')
     self.sclPosition = ui.get_object('sclPosition')
     self.spnWidth = ui.get_object('spnWidth')
     self.spnWidth.set_adjustment(self.create_adj_res())
     self.spnHeight = ui.get_object('spnHeight')
     self.spnHeight.set_adjustment(self.create_adj_res())
     self.spnFPS = ui.get_object('spnFPS')
     self.spnFPS.set_adjustment(self.create_adj_fps())
     
     if self.source.file_name == '':
         self.open_video()
 def __init__(self, filtre, cb):
     self.filtre = filtre
     self.filtre_init = copy.copy(filtre)
     self.cb = cb
     
     ui = get_ui(self)
     self.window = ui.get_object(win_name(self))
     self.spnCanny1 = ui.get_object('spnCanny1')
     self.spnCanny1.set_adjustment(self.create_adj())
     self.spnCanny2 = ui.get_object('spnCanny2')
     self.spnCanny2.set_adjustment(self.create_adj())
     self.spnRho = ui.get_object('spnRho')
     self.spnRho.set_adjustment(self.create_adj())
     self.spnTheta = ui.get_object('spnTheta')
     self.spnTheta.set_adjustment(self.create_adj())
     self.spnThreshold = ui.get_object('spnThreshold')
     self.spnThreshold.set_adjustment(self.create_adj())
     self.spnLineSize = ui.get_object('spnLineSize')
     self.spnLineSize.set_adjustment(self.create_adj())
     self.init_window()
Beispiel #42
0
    def __init__(self, filtre, cb):
        self.filtre = filtre
        self.filtre_init = copy.copy(filtre)
        self.cb = cb

        ui = get_ui(self)
        self.window = ui.get_object(win_name(self))
        self.spnCanny1 = ui.get_object('spnCanny1')
        self.spnCanny1.set_adjustment(self.create_adj())
        self.spnCanny2 = ui.get_object('spnCanny2')
        self.spnCanny2.set_adjustment(self.create_adj())
        self.spnRho = ui.get_object('spnRho')
        self.spnRho.set_adjustment(self.create_adj())
        self.spnTheta = ui.get_object('spnTheta')
        self.spnTheta.set_adjustment(self.create_adj())
        self.spnThreshold = ui.get_object('spnThreshold')
        self.spnThreshold.set_adjustment(self.create_adj())
        self.spnLineSize = ui.get_object('spnLineSize')
        self.spnLineSize.set_adjustment(self.create_adj())
        self.init_window()
    def __init__(self, controller):
        self.controler = controller
        self.controler.add_filter_observer(self.filters_changed_observer)
        self.controler.add_thread_observer(self.thread_observer)
        self.source_list = imageproviders.load_sources()
        self.source_window = None
        self.thread_running = self.controler.is_thread_running()

        ui = get_ui(self,
                    'filterChainListStore',
                    'sourcesListStore',
                    'imgOpen', 'imgNew', 'imgUp', 'imgDown')
        self.window = ui.get_object(win_name(self))
        self.lstFilters = ui.get_object('lstFilters')
        self.btnView = ui.get_object('btnView')
        self.btnAdd = ui.get_object('btnAdd')
        self.btnRemove = ui.get_object('btnRemove')
        self.btnConfig = ui.get_object('btnConfig')
        self.btnUp = ui.get_object('btnUp')
        self.btnDown = ui.get_object('btnDown')
        self.chkLoop = ui.get_object('chkLoop')
        self.lblLoopState = ui.get_object('lblLoopState')
        self.txtFilterChain = ui.get_object('txtFilterChain')
        self.cboSource = ui.get_object('cboSource')
        self.spnFPS = ui.get_object('spnFPS')
        self.spnFPS.set_adjustment(self.create_adj())
        self.spnFPS.set_value(30)

        self.win_list = []

        self.sourcesListStore = ui.get_object('sourcesListStore')
        self.filterChainListStore = ui.get_object('filterChainListStore')
        self.set_state_empty()
        self.change_state()

        self.sourcesListStore.append(['None'])
        for name in self.source_list.keys():
            self.sourcesListStore.append([name])
        self.cboSource.set_active(1)