logging.info("find_aurora_hsv : imagePaths is %s", imagePaths) # -------------------------------------- # Loop over the input dataset of images # -------------------------------------- for imagePath in imagePaths: if args.list : if not os.path.isfile(imagePath) : sys.exit("imagePath " + imagePath + " does not exist") # load the image, describe the image, update the list of data #image = cv2.imread(imagePath) issimg = ISSIMAGE(imagePath) # resize the image # def resize(image, width = None, height = None, inter = cv2.INTER_AREA) issimg.resize(800) if (blurImage) : #resized = cv2.GaussianBlur(resized, (5,5), 0) #filtered = cv2.bilateralFilter(resized, 9, 75, 75) # preserves edges better filtered = cv2.bilateralFilter(issimg.image, 9, 75, 75) # preserves edges better else: filtered = resized.copy() if (doOpening) : # n = 3 # n = 5
# -------------------------------------- for filename in imagePaths: if args.list: if not os.path.isfile(filename): sys.exit("filename " + filename + " does not exist") # Read image img = cv2.imread(filename) # resize the image # def resize(image, width = None, height = None, inter = cv2.INTER_AREA) resized = resize(img, width=500) # initialize ISSIMAGE class for setting up the image xx = ISSIMAGE(filename) xx.resize() xx.show() # ---------------------- # Get the sun elevation # ---------------------- sunElev = xx.get_sun_elev() logging.debug("Sun elevation = %s", sunElev) # ---------------------- # Get the focal length # ---------------------- focalLength = xx.get_focal_length()
cv2.resizeWindow('d12-d10', 640, 426) # -------------------------------------- # Loop over the input dataset of images # -------------------------------------- for ii in range(1, len(imagePaths), 1): filename = imagePaths[ii] # will need to change this later if not os.path.isfile(filename): sys.exit("filename " + filename + " does not exist") logging.info("Filename = %s", filename) # set up the ISSIMAGE object issimg0 = ISSIMAGE(imagePaths[ii-1]) issimg1 = ISSIMAGE(imagePaths[ii]) issimg2 = ISSIMAGE(imagePaths[ii+1]) logging.info("comparing %s %s %s", imagePaths[ii-1], imagePaths[ii], imagePaths[ii+1]) # Smooth the image if (doSmoothing): filtered0 = cv2.bilateralFilter(issimg0.image, 9, 75, 75) filtered1 = cv2.bilateralFilter(issimg1.image, 9, 75, 75) filtered2 = cv2.bilateralFilter(issimg2.image, 9, 75, 75) else: filtered0 = issimg0.image.copy() filtered1 = issimg1.image.copy() filtered2 = issimg2.image.copy()
# ----------------------------------------------------- imagePaths = list(paths.list_images(args.dataset)) # sort the filenames imagePaths = sorted(imagePaths) logging.debug("imagePaths is %s", imagePaths) # -------------------------------------- # Loop over the input dataset of images # -------------------------------------- for imagePath in imagePaths: if args.list: if not os.path.isfile(imagePath): sys.exit("imagePath " + imagePath + " does not exist") # initialize ISSIMAGE class for setting up the image xx = ISSIMAGE(imagePath) xx.resize() xx.show() # plot histogram for this image if showHist: xx.plot_color_hist() cv2.waitKey(0) cv2.destroyAllWindows()
#----------------------------- desc = HSVColorTexture() #-------------------------------------------- # Loop over images in the query data set : #-------------------------------------------- with open(resultsName, 'wb') as csvfile: # -------------------------------------- # Loop over the input dataset of images # -------------------------------------- for filename in imagePaths: # for imagePath2 in imagePaths2: # # Grab the image and classify it # # Set up the ISSIMAGE object issimg = ISSIMAGE(filename) """Only look at images with sun elevation > minSunElev""" if issimg.get_sun_elev() > minSunElev: continue filename = os.path.basename(filename) # read the image - lrm logging.info("Reading test file %s", filename) image = cv2.imread(filename) # describe the image features = desc.describe(issimg.image) # Run model prediction on the features prediction = model.predict(features) logging.info("Prediction is %s", prediction)
logging.info("lightning_detection_nadir : blackLower = %s", blackLower) logging.info("lightning_detection_nadir : blackUpper = %s", blackUpper) # -------------------------------------- # Loop over the input dataset of images # -------------------------------------- for filename in imagePaths: if not os.path.isfile(filename): sys.exit("filename " + filename + " does not exist") logging.info("Filename = %s", filename) # set up the ISSIMAGE object issimg = ISSIMAGE(filename) """Only look at images with sun elevation > minSunElev""" # if sun elev larger, skip to next file if issimg.get_sun_elev() > minSunElev: logging.info("SunElev too large, skipping") continue # ------------------- # Resize the image # ------------------- issimg.resize(800) # Smooth the image if (doSmoothing): filtered = cv2.bilateralFilter(issimg.image, 9, 75, 75)
logging.info("imagePath is %s", imagePaths) # -------------------------------------- # Loop over the input dataset of images # -------------------------------------- for filename in imagePaths: #if args.list : if not os.path.isfile(filename): sys.exit("filename " + filename + " does not exist") # Read image #im = cv2.imread(filename, cv2.IMREAD_GRAYSCALE) #im = cv2.imread(filename) issimg = ISSIMAGE(filename) # ------------------- # Resize the image # ------------------- #resized = resize(im, width=500) issimg.resize(800) # Smooth the image if (doSmoothing): #filtered = cv2.bilateralFilter(resized, 9, 75, 75) filtered = cv2.bilateralFilter(issimg.image, 9, 75, 75) else: filtered = resized.copy()