# cable dete detect_with = 0 detect_without = 0 not_detect_with = 0 not_detect_without = 0 detector_samples = 0 for j in range(0, len(ordered_files)): cont_samples += 1 print images_path + ordered_files[j] src = cv2.imread(images_path + ordered_files[j]) normalized = cv2.imread(normalized_path + ordered_files[j]) mat = src.copy() gradient, without_close, test = ipp.preprocess(mat) img_bounded, all_features, key, rgb_bounded, roi, flood, cols_intermedi_img, without_cable = detector_features.extractor( mat, without_close, gradient, cont_samples, normalized) # Segregation Mode if segregation: # Used to show images provided by the detector_features.extractor method # cv2.namedWindow('Depth', cv2.WINDOW_NORMAL) # When there is nothing to detect the method returns a roi equal None # if roi == None: # img_bounded = cv2.cvtColor(img_bounded, cv2.COLOR_BGR2GRAY) # rgb_bounded = img_bounded
clamp_extent = [] clamp_perimeter = [] clamp_eccentricity = [] clamp_label = [] cont_samples = 0 for j in range(0, len(clamp_ordered_files)): cont_samples += 1 print clamp_folder + clamp_ordered_files[j] src = cv2.imread(clamp_folder + clamp_ordered_files[j]) mat = src.copy() gradient = ipp.preprocess(mat) img_bounded, all_features, key = features.extractor( gradient, mat, cont_samples) if key == 27: cv2.destroyAllWindows() break clamp_sample.append(cont_samples) clamp_aspect_ratio.append(all_features[0]) clamp_contour_area.append(all_features[1]) clamp_solidity.append(all_features[2]) clamp_extent.append(all_features[3]) clamp_perimeter.append(all_features[4]) clamp_eccentricity.append(all_features[5])