Beispiel #1
0
 def on_lstImage_cursor_changed(self, widget):
     index = tree_selected_index(self.lstImage)
     if index >= 0:
         file_name = self.imageListStore[index][0]
         self.imgExample.set_from_pixbuf(
             numpy_to_pixbuf(self.test.example_image(file_name)))
         self.imgOriginal.set_from_pixbuf(
             numpy_to_pixbuf(self.test.original_image(file_name)))
    def update_image(self, image):
        if image <> None:

            # fps
            iActualTime = time.time()
            if self.lastSecondFps is None:
                # Initiate fps
                self.lastSecondFps = iActualTime
                self.fpsCount = 1
            elif iActualTime - self.lastSecondFps > 1.0:
                # show fps
                context_id = self.statusbar.get_context_id("fps")
                self.statusbar.push(context_id, "%d fps" % int(self.fpsCount))
                # new set
                self.lastSecondFps = iActualTime
                self.fpsCount = 1
            else:
                self.fpsCount += 1

            if self.image_shape <> image.shape:
                self.image_shape = image.shape
                self.change_display_size()
            if self.size <> 1.0:
                image = cv2.resize(image, (int(image.shape[1] * self.size), int(image.shape[0] * self.size)))
            self.image = image
            self.imgSource.set_from_pixbuf(numpy_to_pixbuf(image))
 def update_image(self, image):
     if image <> None:
         if self.image_shape <> image.shape:
             self.image_shape = image.shape
             self.change_display_size()
         if self.size <> 1.0:
             image = cv2.resize(image, (int(image.shape[1] * self.size),
                                        int(image.shape[0] * self.size)))
         self.image = image
         if image[0, 0].size == 1:
             image = cv2.cvtColor(image, cv2.cv.CV_GRAY2BGR)
         self.imgSource.set_from_pixbuf(numpy_to_pixbuf(image))
 def on_lstImages_cursor_changed(self, widget):
     index = tree_selected_index(self.lstImages)
     if index >= 0:
         self.undo_list = []
         if len(self.matrices) > 1:
             self.save_matrix_to_disk()
         self.current_index = index 
         img = cv2.imread(self.imageListStore[index][2])
         self.pixbuf_image = numpy_to_pixbuf(img)
         self.drwImage.set_size_request(img.shape[1], img.shape[0])
         self.drwImage.queue_draw()
         self.configure()
Beispiel #5
0
    def on_btnExecPrecision_clicked(self, widget):
        folder = self.txtTestFolder.get_text()
        chain = self.txtFilterchain.get_text()
        if (self.validate_folder(folder) and self.validate_filterchain(chain)):

            self.test = LineTest(folder, self.chain)
            image_number = self.test.total_images()
            if self.validate_image_number(image_number):
                self.test.launch()
                self.fill_labels(self.test)
                self.fill_image_list(self.test.testable_images)
                self.imgGraphPrecision.set_from_pixbuf(
                    numpy_to_pixbuf(self.test.create_graphic()))
Beispiel #6
0
 def on_btnExecParams_clicked(self, widget):
     folder = self.txtTestFolder.get_text()
     chain = self.txtFilterchain.get_text()
     if (self.validate_folder(folder) and self.validate_filterchain(chain)):
         index = self.cboParams.get_active()
         if index >= 0:
             fname, pname, _, _ = self.paramsListStore[index]
             peval = ParameterEvaluation(folder, self.chain, fname, pname,
                                         self.spnFrom.get_value(),
                                         self.spnTo.get_value())
             peval.launch()
             self.imgGraphEval.set_from_pixbuf(
                 numpy_to_pixbuf(peval.create_graphic()))
             self.fill_values_list(peval.precisions, peval.noises)