Пример #1
0
	def debug_history(self):
		iv = ImageViewer()
		iv.remove_axis_values()
		iv.add(self.source, 'source', cmap='bgr')
		for img, func in zip(self.debug_out_list, self.functions):
			iv.add(img, str(func), cmap='bgr')
		return iv
Пример #2
0
 def __init__(self):
     self.running = True
     self.running = True
     self.server_host = '127.0.1.1'
     self.my_socket = None
     self.image_viewer = ImageViewer(interval=INTERVAL)
     self.shape = None
Пример #3
0
    def __init__(self):
        self.cvbridge = CvBridge()
        self.img_buf = None
        self.image_subs = rospy.Subscriber("image", Image, callback=self._callback, queue_size=1)
        self.image_viewer = ImageViewer()

        self.test = rospy.get_param("/stop_param")
Пример #4
0
 def cell_double_clicked(self, row, column):
     filepath = self.__detailWidget.item(row,column).text()
     if column == 2:
         timestamp = self.__detailWidget.item(row,column-1).text()
         # print(f"you have clicked on {filepath}")
         self.viewer = ImageViewer(filepath,timestamp)
         self.viewer.view()
Пример #5
0
    def __init__(self, config, car_list):
        super().__init__()
        self._config = config
        self.main_layout = QHBoxLayout()
        
        self.car_list = []
        self.car_list_items = []
        self.car_list_ui = QListWidget()
        self.update_all_btn = QPushButton("Update All")
        self.remove_btn = QPushButton("Remove Car")
        
        self.car_add_ui = CarAddUI(self)

        self.center_layout = QVBoxLayout()
        self.image_viewer_widget = QLabel()
        self.image_viewer = ImageViewer(self.image_viewer_widget)
        self.image_list_ui = QListWidget()
        
        # self.car_image_widget = QWidget()
        self.current_car = QLabel()
        # self.image_preview_new = QGraphicsView()
        # self.image_preview = QLabel()
        
        self.car_info_ui = CarInfoUI(self)
        
        # maybe temporary
        self._current_image = 0
        
        self.InitUI(car_list)
Пример #6
0
    def click_view_raw(self):
        """ view the image stream """
        img = getattr(skimage.data, 'rocket')()
        self.viewer_raw = ImageViewer(img=img,
                                      resize=(600, 600),
                                      xy=(100, 600))
        self.vraw = True

        self.threadpool.add_to_queue(function=self.raw_queue_poll,
                                     delay=0.1,
                                     stop=self.buttons['stop'])
Пример #7
0
    def __init__(self):
        super().__init__()

        self.resize(1024, 720)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)

        # おまじない
        self.main_widget = QWidget(self)
        self.main_layout = QGridLayout(self.main_widget)
        self.setCentralWidget(self.main_widget)

        # 子供UI

        # window setup
        self.view_origin = ImageViewer()
        #self.view_origin.setFixedSize(512, 512)
        self.view_salient = ImageViewer()
        self.view3 = ImageViewer()
        self.view4 = ImageViewer()
        #self.view_salient.setFixedSize(512, 512)

        label1 = QLabel("Original")
        label1.setAlignment(Qt.AlignCenter)
        label1.setFont(QFont("Helvetica", 18, 2))

        label2 = QLabel("Saliency")
        label2.setAlignment(Qt.AlignCenter)
        label2.setFont(QFont("Helvetica", 18, 2))

        # レイアウトをセット
        self.main_layout.addWidget(label1, 0, 0)
        self.main_layout.addWidget(label2, 0, 1)
        self.main_layout.addWidget(self.view_origin, 1, 0)
        self.main_layout.addWidget(self.view_salient, 1, 1)
        self.main_layout.addWidget(self.view3, 2, 0)
        self.main_layout.addWidget(self.view4, 2, 1)
        #self.main_layout.addWidget(, 2, 0, 2,2 )
        #self.main_layout.addWidget(label4, 1, 1)

        # イベント
        self.fileLoaded.connect(self.draw_origin_image)
Пример #8
0
 def __init__(self, seq_info, update_ms):
     image_shape = seq_info["image_size"][::-1]
     aspect_ratio = float(image_shape[1]) / image_shape[0]
     image_shape = 1024, int(aspect_ratio * 1024)
     if update_ms is None:
         update_ms = seq_info["update_ms"]
     self.viewer = ImageViewer(update_ms, image_shape,
                               "Figure %s" % seq_info["sequence_name"])
     self.viewer.thickness = 2
     self.frame_idx = seq_info["min_frame_idx"]
     self.last_idx = seq_info["max_frame_idx"]
     self.results = seq_info["results"]
Пример #9
0
def main():
    args = parse_args()
    pprint.pprint(vars(args))

    runner = LatticeRunner(args)
    viewer = ImageViewer(width=args.size,
                         height=args.size,
                         updateRate=args.updateRate,
                         runner=runner)
    print("Hit ESC to abort")
    runner.start()
    viewer.start()
    runner.stop()
    runner.join()
Пример #10
0
    def init_ui(self):
        self.font_h1 = QFont("Arial", 32)
        self.font_p1 = QFont("Arial", 16)

        self.grid_top = QGridLayout()
        self.grid_body_upper = QGridLayout()
        self.grid_body = QGridLayout()
        self.grid_body_lower = QGridLayout()

        self.resize(1600, 1100)

        # Grid Top
        self.e_title = QLineEdit()
        self.e_title.setAlignment(Qt.AlignCenter)
        self.e_title.setFont(self.font_h1)
        self.e_title.setReadOnly(True)
        self.e_title.setText("Setup Sorted Filenames")
        self.e_title.setFrame(False)
        self.grid_top.addWidget(self.e_title, 0, 0)

        self.b_help = QPushButton("HELP")
        self.b_help.setDefault(True)
        self.b_help.setEnabled(True)
        self.grid_top.addWidget(self.b_help, 0, 1)

        # Grid BODY UPPER
        self.e_filename = QLineEdit()
        self.e_filename.setAlignment(Qt.AlignCenter)
        self.e_filename.setFont(self.font_p1)
        self.e_filename.setReadOnly(True)
        self.e_filename.setText("Filename: ")
        self.grid_body_upper.addWidget(self.e_filename, 0, 2)

        self.e_section = QLineEdit()
        self.e_section.setAlignment(Qt.AlignCenter)
        self.e_section.setFont(self.font_p1)
        self.e_section.setReadOnly(True)
        self.e_section.setText("Section: ")
        self.grid_body_upper.addWidget(self.e_section, 0, 3)

        # Grid BODY
        self.viewer = ImageViewer(self)
        self.grid_body.addWidget(self.viewer, 0, 0)

        # Grid BODY LOWER
        self.b_flip_vertical = QPushButton("Flip vertically")
        self.grid_body_lower.addWidget(self.b_flip_vertical, 0, 0)

        self.b_flip_horozontal = QPushButton("Flop horizontally")
        self.grid_body_lower.addWidget(self.b_flip_horozontal, 0, 1)

        self.b_rotate_left = QPushButton("Rotate Left")
        self.grid_body_lower.addWidget(self.b_rotate_left, 0, 2)

        self.b_rotate_right = QPushButton("Rotate Right")
        self.grid_body_lower.addWidget(self.b_rotate_right, 0, 3)

        self.b_move_left = QPushButton("<--   Move Section Left   <--")
        #self.grid_body_lower.addWidget(self.b_move_left, 1, 0)

        self.b_move_right = QPushButton("-->   Move Section Right   -->")
        #self.grid_body_lower.addWidget(self.b_move_right, 1, 1)

        self.b_quality = QComboBox()
        self.b_quality.addItems([
            'Section quality: unusable', 'Section quality: blurry',
            'Section quality: good'
        ])
        #self.grid_body_lower.addWidget(self.b_quality, 1, 2)

        self.b_remove = QPushButton("Remove section")
        #self.grid_body_lower.addWidget(self.b_remove, 1, 3)

        self.progress = QProgressBar(self)
        self.grid_body_lower.addWidget(self.progress, 2, 0, 1, 3)
        self.progress.hide()

        self.b_done = QPushButton("Finished")
        self.grid_body_lower.addWidget(self.b_done, 2, 3)

        # Super grid
        self.supergrid = QGridLayout()
        self.supergrid.addLayout(self.grid_top, 0, 0)
        self.supergrid.addLayout(self.grid_body_upper, 1, 0)
        self.supergrid.addLayout(self.grid_body, 2, 0)
        self.supergrid.addLayout(self.grid_body_lower, 3, 0)

        # Set layout and window title
        self.setLayout(self.supergrid)
        self.setWindowTitle("Q")
Пример #11
0
 def placeholder(self):
     img_viewer = ImageViewer(self)
     img_viewer.mainloop()
Пример #12
0
 def rx_thumbnail_double_clicked(self, item):
     image_path = item.whatsThis()
     image_timestamp = item.text()
     self.viewer = ImageViewer(image_path, image_timestamp)
     self.viewer.view()
Пример #13
0
    def init_ui(self):
        self.font_h1 = QFont("Arial", 32)
        self.font_p1 = QFont("Arial", 16)

        self.grid_top = QGridLayout()
        self.grid_body_upper = QGridLayout()
        self.grid_body = QGridLayout()
        self.grid_body_lower = QGridLayout()

        self.resize(1600, 1100)

        # Grid Top
        self.e_title = QLineEdit()
        self.e_title.setAlignment(Qt.AlignCenter)
        self.e_title.setFont(self.font_h1)
        self.e_title.setReadOnly(True)
        self.e_title.setText("Setup Sorted Filenames")
        self.e_title.setFrame(False)
        self.grid_top.addWidget(self.e_title, 0, 0)

        self.b_help = QPushButton("HELP")
        self.b_help.setDefault(True)
        self.b_help.setEnabled(True)
        self.grid_top.addWidget(self.b_help, 0, 1)

        # Grid BODY UPPER
        self.e_filename = QLineEdit()
        self.e_filename.setAlignment(Qt.AlignCenter)
        self.e_filename.setFont(self.font_p1)
        self.e_filename.setReadOnly(True)
        self.e_filename.setText("Filename: ")
        self.grid_body_upper.addWidget(self.e_filename, 0, 2)

        self.e_section = QLineEdit()
        self.e_section.setAlignment(Qt.AlignCenter)
        self.e_section.setFont(self.font_p1)
        self.e_section.setReadOnly(True)
        self.e_section.setText("Section: ")
        self.grid_body_upper.addWidget(self.e_section, 0, 3)

        # Grid BODY
        self.viewer = ImageViewer(self)
        self.grid_body.addWidget(self.viewer, 0, 0)

        # Grid BODY LOWER
        self.b_rostral = QPushButton("Rostral Limit:")
        self.grid_body_lower.addWidget(self.b_rostral, 0, 0)

        self.e_rostral = QLineEdit()
        self.e_rostral.setAlignment(Qt.AlignCenter)
        self.e_rostral.setFont(self.font_p1)
        self.grid_body_lower.addWidget(self.e_rostral, 0, 1)

        self.b_caudal = QPushButton("Caudal Limit:")
        self.grid_body_lower.addWidget(self.b_caudal, 1, 0)

        self.e_caudal = QLineEdit()
        self.e_caudal.setAlignment(Qt.AlignCenter)
        self.e_caudal.setFont(self.font_p1)
        self.grid_body_lower.addWidget(self.e_caudal, 1, 1)

        self.b_dorsal = QPushButton("Dorsal Limit:")
        self.grid_body_lower.addWidget(self.b_dorsal, 0, 2)

        self.e_dorsal = QLineEdit()
        self.e_dorsal.setAlignment(Qt.AlignCenter)
        self.e_dorsal.setFont(self.font_p1)
        self.grid_body_lower.addWidget(self.e_dorsal, 0, 3)

        self.b_ventral = QPushButton("Ventral Limit:")
        self.grid_body_lower.addWidget(self.b_ventral, 1, 2)

        self.e_ventral = QLineEdit()
        self.e_ventral.setAlignment(Qt.AlignCenter)
        self.e_ventral.setFont(self.font_p1)
        self.grid_body_lower.addWidget(self.e_ventral, 1, 3)

        self.b_first_slice = QPushButton("Mark as FIRST Slice With Brainstem:")
        self.grid_body_lower.addWidget(self.b_first_slice, 0, 4)

        self.e_first_slice = QLineEdit()
        self.e_first_slice.setAlignment(Qt.AlignCenter)
        self.e_first_slice.setFont(self.font_p1)
        self.grid_body_lower.addWidget(self.e_first_slice, 0, 5)

        self.b_last_slice = QPushButton("Mark as LAST Slice With Brainstem:")
        self.grid_body_lower.addWidget(self.b_last_slice, 1, 4)

        self.e_last_slice = QLineEdit()
        self.e_last_slice.setAlignment(Qt.AlignCenter)
        self.e_last_slice.setFont(self.font_p1)
        self.grid_body_lower.addWidget(self.e_last_slice, 1, 5)

        self.b_done = QPushButton("DONE")
        self.grid_body_lower.addWidget(self.b_done, 1, 6)

        # Super grid
        self.supergrid = QGridLayout()
        self.supergrid.addLayout(self.grid_top, 0, 0)
        self.supergrid.addLayout(self.grid_body_upper, 1, 0)
        self.supergrid.addLayout(self.grid_body, 2, 0)
        self.supergrid.addLayout(self.grid_body_lower, 3, 0)

        # Set layout and window title
        self.setLayout(self.supergrid)
        self.setWindowTitle("Q")
Пример #14
0
		for img, func in zip(self.debug_out_list, self.functions):
			iv.add(img, str(func), cmap='bgr')
		return iv

if __name__ == "__main__":
	from step_07_highlight_painting import highlight_paintings
	# from step_12_b_create_outer_rect import mask as mask_b
	from data_test.standard_samples import TEST_PAINTINGS, FISH_EYE, PEOPLE

	# By creating instantiating the Pipeline class you can pass as values
	# the list of functions that will be executed, passing as default value=True
	# The default functions will be set as the function pipeline 
	pipeline = Pipeline(default=True)

	# The ImageViewer now no longer needs the number of images that will be inserted a priori
	iv = ImageViewer(cols=3)
	iv.remove_axis_values()

	plots = []
	# I created a script to have the filenames of the images we use as tests
	# for filename in TEST_PAINTINGS:
	filename = "data_test/painting_09/00_calibration.jpg"
	img = np.array(cv2.imread(filename))
	# Via the append command you can add a function to the pipeline,
	# In this case I have to do it because the last function takes as source img
	pipeline.append(Function(highlight_paintings, source=img, pad=100))
	# Using the run command I execute the functions in order.
	# with debug=True for each step debug images are created that then
	# can be displayed in sequence
	# with print_time=True the times are printed for each function
	# Filename is optional, it's for printing
Пример #15
0
    def initUI(self):
        self.image_viewer = ImageViewer()

        self.setCentralWidget(self.image_viewer)
        self.resize(800, 600)
    def open_image_viewer(self):
        """Opens the biondi body image viewer.

        Calls the ImageViewer class in image_viewer.py.
        """
        ImageViewer(self.folder_path, self.marker_canvas)  #TEST CLASS
        time = evaluation['time']
        kwargs = evaluation['kwargs']
        test_perc = evaluation['test_perc']

        all_dices.append(dice_vals)
        all_filenames = filenames if all_filenames is None else all_filenames

        pairs = list(zip(dice_vals, filenames))
        pairs.sort()
        dice_vals = [x for x, _ in pairs]
        filenames = [x for _, x in pairs]

        plt.plot(dice_vals, label=f'dice {i}')
        plt.axhline(y=mean, color='rgb'[i % 3], ls='--', label=f'mean {i}')
        print(
            f'{FILENAME:<32} mean={mean:.04f} time={time:.02f}s fps={len(filenames)/time:.02f} test_perc={test_perc} kwargs={kwargs}'
        )
    plt.title('\n'.join(show_filenames))
    plt.legend()
    plt.show()

    if len(all_dices) == 2:
        worst = [(max(a - b, b - a), f)
                 for a, b, f in zip(*all_dices, filenames)]
        worst.sort()
        iv = ImageViewer()
        for s, f in worst[-12:]:
            iv.add(cv2.imread(f'data_test/paintings_gt/imgs/{f}'),
                   cmap='bgr',
                   title=f'{s}')
        iv.show()
Пример #18
0
from image_viewer import ImageViewer, show_vars
from config import config

if __name__ == "__main__":

    # comic = r"C:\Users\adrake.KEMPTOWN\Pictures\onepunchman\onepunchman.cbz"
    # comic = r"D:\Downloads\gallery.zip"

    my_gui = ImageViewer(comic)
    show_vars(config)
    show_vars(ImageViewer)

    my_gui.mainloop()
Пример #19
0
 def doubleClicked(self, vobj):
     ImageViewer(self.LithophaneImage.image)
Пример #20
0
 def __optionChosen(self, item: QListWidgetItem) -> NoReturn:
     selectedVolume = item.tags()['link']
     self._parent.goTo(
         ImageViewer(selectedVolume, self.__backEnd, parent=self._parent))
Пример #21
0
 def _on_click(self, event):
     ImageViewer(self.folder_path, self.marker_canvas).open_file(self.time)
Пример #22
0
 def render(self, mode="human"):
     if self.viewer is None:
         self.viewer = ImageViewer(caption="SnakeEnv", height=500, width=500,)
     # show the screen on the image viewer
     self.viewer.show(self.screen)