def __init__(self, image, threshold=1): self.__threshold = threshold self.__image = image grayscale = imgtools.ndarray_to_grayscale(image) self.__grayscale = imgtools.ndarray_normalize_image(grayscale) self.__features = [] self.__traces = [] self.__responses = [] self.__descriptors = [] self.__integral_image = None
def to_grayscale(self): selected_indices = self.get_selected_img_indices() for idx in selected_indices: img = imgtools.ndarray_to_grayscale(self.images[idx]) self.images[idx] = img list_item = self.img_list.item(idx) list_item.setIcon(QtGui.QIcon( convert_to_qt_pixmap(img).scaled(StitchingWidget.ICON_SIZE, StitchingWidget.ICON_SIZE, QtCore.Qt.KeepAspectRatio)) ) self.preview_label.clear()