### Run SurfRCaT Application Source: https://conlin-matt.github.io/SurfRCaT/download.html Execute this command to launch the SurfRCaT application after all dependencies have been installed and the correct directory is active. This command is used to invoke the tool. ```bash fbs run ``` -------------------------------- ### Install Python Packages with Pip Source: https://conlin-matt.github.io/SurfRCaT/download.html Install additional Python packages required for the GUI and data processing after activating the Conda environment. These packages include fbs, pptk, and reverse_geocoder. ```bash pip install fbs pptk reverse_geocoder ``` -------------------------------- ### Create and Activate Conda Environment Source: https://conlin-matt.github.io/SurfRCaT/download.html Use these commands to create a new Conda environment named 'SurfRCaT_env' with specified Python version and packages, then activate it. Ensure Anaconda is installed and accessible via the prompt. ```bash conda config --set channel_priority strict conda create -n SurfRCaT_env -c conda-forge python=3.6 python-pdal pyqt numpy pandas matplotlib opencv requests pyshp utm lxml conda activate SurfRCaT_env ``` -------------------------------- ### Navigate to Project Directory Source: https://conlin-matt.github.io/SurfRCaT/download.html Change the current directory to the location where the SurfRCaT repository has been cloned or downloaded. Replace '' with the actual path. ```bash cd \SurfRCaT-master ``` -------------------------------- ### Import Rectified Products into Python Source: https://conlin-matt.github.io/SurfRCaT/extensions.html Load a .pkl rectified image file using the pickle module. ```python import pickle f = open('/_rectif.pkl','rb') frameRect = pickle.load(f) ``` -------------------------------- ### Download Airborne Lidar Datasets Source: https://conlin-matt.github.io/SurfRCaT/extensions.html Automate the discovery, filtering, and downloading of coastal lidar datasets based on geographic coordinates. ```python import SurfRCaT import ftplib import numpy as np camera_latitude = camera_longitude = # Get the IDs of datasets that are near this location (same state and/or coast) # closeIDs = SurfRCaT.getLidar_FindPossibleIDs(camera_latitude,camera_longitude) # Search these close datasets to find those that cover this location # ftp = ftplib.FTP('ftp.coast.noaa.gov',timeout=1000000) ftp.login('anonymous','anonymous') ftp.cwd('/pub/DigitalCoast') dirs = [i for i in ftp.nlst() if 'lidar' in i] alldirs = [] for ii in dirs: ftp.cwd(ii) alldirs.append([ii+'/'+i for i in ftp.nlst() if 'geoid' in i]) ftp.cwd('../') appropID = list() # Initiate list of IDs that contain the camera location # i = 0 for ID in IDs: i = i+=1 check = SurfRCaT.getLidar_TryID(ftp,alldirs,ID,camera_latitude,camera_longitude) ftp.cwd('../../../../') if check: if len(check)>0: appropID.append(ID) # Choose a dataset # IDToDownload = appropID[] # Determine the tiles that are close enough to the camera to download # sf = SurfRCaT.getLidar_GetShapefile(IDToDownload) poly = SurfRCaT.getLidar_CalcViewArea(30,20,1000,camera_latitude,camera_longitude) tilesKeep = list() for shapeNum in range(0,len(sf)): out = SurfRCaT.getLidar_SearchTiles(sf,poly,shapeNum,camera_latitude,camera_longitude) if out: tilesKeep.append(out) # Download the portion of the dataset close to the camera # lidarDat = np.empty([0,3]) for thisFile in tilesKeep: lidarXYZsmall = SurfRCaT.getLidar_Download(thisFile,IDToDownload,camera_latitude,camera_longitude) lidarDat = np.append(lidarDat,lidarXYZsmall,axis=0) # Format the point cloud as a Pandas DataFrame (coordinates relative to input location) # pc = SurfRCaT.getLidar_CreatePC(lidarDat,camera_latitude,camera_longitude) ``` -------------------------------- ### Import Rectified Products into Matlab Source: https://conlin-matt.github.io/SurfRCaT/extensions.html Load a .mat rectified image file and structure it into a frameRect struct compatible with CIRN routines. ```matlab load('/_rectif.mat'); frameRect.x = x; frameRect.y = y; frameRect.I = I; ``` -------------------------------- ### Extract Video Frames Programmatically Source: https://conlin-matt.github.io/SurfRCaT/extensions.html Use SurfRCaT to extract frames from a video file at a specified rate. ```python import SurfRCaT import cv2 vid = 'C:/path/to/video.mp4' saveDir = 'C:/directory/to/save/frames/to' cap = cv2.VideoCapture(vid) numFrames = int(cap.get(7)) fps = cap.get(5) vidLen = int(numFrames/fps) secondsPerFrame = 1 # Leave as 1 to ignore this parameter # rate = 2 # 2 frames/second # SurfRCaT.getImagery_GetStills(vid,secondsPerFrame,rate,vidLen,saveDir) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.