Example #1
0
    def __init__(self, node_name, sub_topic, pub_topic):
        self.bridge = CvBridge()
        self.img_proc = ImagePreprocessor()

        # Publishers
        #self.

        rospy.init_node(node_name)

        # Crop parameters
        self.above = rospy.get_param("/asv_lane_track/lane_detection_node/above", 0.35)
        self.below = rospy.get_param("/asv_lane_track/lane_detection_node/below", 0.1)
        self.side = rospy.get_param("/asv_lane_track/lane_detection_node/side", 0)

        # Lane tracking parameters
        self.deviation = rospy.get_param("/asv_lane_track/lane_detection_node/deviation", 15)
        self.border = rospy.get_param("/asv_lane_track/lane_detection_node/border", 0)
        # Canny parameters
        self.low_thresh = rospy.get_param("/asv_lane_track/lane_detection_node/low_threshold", 50)
        self.high_thresh = rospy.get_param("/asv_lane_track/lane_detection_node/high_threshold", 150)
        self.aperture = rospy.get_param("/asv_lane_track/lane_detection_node/aperture", 3)

        self.image_sub = rospy.Subscriber(sub_topic, Image, self.img_callback)
        self.image_pub = rospy.Publisher(pub_topic, Image, queue_size=5)

        self.yellow_masked_pub = rospy.Publisher("/yellow_masked", Image, queue_size=5)

        self.gray_pub = rospy.Publisher("/test", Image, queue_size=5)
        self.blur_pub = rospy.Publisher("/blur", Image, queue_size=5)

        self.left_lines = deque(maxlen=QUEUE_LENGTH)
        self.right_lines = deque(maxlen=QUEUE_LENGTH)
        rospy.spin()
    def get_dataset(self, image_dir):
        """

        :param image_dir:
        :return:
        """

        preporcessor = ImagePreprocessor(resize_ratio=.75)
        dataset = Mot17Tracking(root=image_dir, transform=preporcessor)

        return dataset
Example #3
0
    def get(self, images_dir):
        # Market150 dataset size is 64 width, height is 128, so we maintain the aspect ratio
        # NOTE: for some reason oly 224 / 224 works, any other shape results in NAN
        dataset = Market1501TripletDataset(images_dir,
                                           min_img_size_h=256,
                                           min_img_size_w=128)
        processor = ImagePreprocessor(min_img_size_h=dataset.min_img_size_h,
                                      min_img_size_w=dataset.min_img_size_w,
                                      original_height=dataset.original_height,
                                      original_width=dataset.original_width)

        dataset.preprocessor = processor
        return dataset
Example #4
0
    def __init__(self):
        self.preprocessor = ImagePreprocessor()

        # each of these attributes that start with show_ will be
        # turned into booleans
        self.show_contours = (False, 'Show all found contours')
        self.show_toosmall = (False, 'Show too small contours')
        self.show_horizontal = (True, 'Show horizontal targets')
        self.show_vertical = (True, 'Show vertical targets')

        self.show_aspect = (False, 'Show aspect ratios')
        self.show_rectangularity = (False, 'Show rectangularity')

        self.show_hot = (True, 'Show hot targets')
        self.show_hot_text = (True, 'Show hot text')