CoolFace
Apppublic

alexlib/openpiv_streamlit_app

sourceHugging Faceafl-3.0updated 4y agoView on Hugging Face
0likes
settings.py122 linesDownload Raw Back to root
1from openpiv import windef2 3windef_settings = windef.Settings()4 5 6'Data related settings'7# Folder with the images to process8windef_settings.filepath_images = "./demo/"9 10# Folder for the outputs11windef_settings.save_path = './results/'12 13# Root name of the output Folder for Result Files14windef_settings.save_folder_suffix = 'test'15 16# Format and Image Sequence17windef_settings.frame_pattern_a = '*.bmp' # file_list[0]18 19# windef_settings.frame_pattern_b = file_list[1]20windef_settings.frame_pattern_b = None21 22# If you want only one pair23# windef_settings.frame_pattern_a = file_list[0]24# windef_settings.frame_pattern_b = file_list[1]25 26'Region of interest'27# (50,300,50,300) #Region of interest: (xmin,xmax,ymin,ymax) or 'full' for full image28windef_settings.ROI = 'full' # (0,300,0,1024) #'full'29 30'Image preprocessing'31# 'None' for no masking, 'edges' for edges masking, 'intensity' for intensity masking32# WARNING: This part is under development so better not to use MASKS33windef_settings.dynamic_masking_method = 'None'34windef_settings.dynamic_masking_threshold = 0.00535windef_settings.dynamic_masking_filter_size = 736 37'Processing Parameters'38windef_settings.correlation_method='circular'  # 'circular' or 'linear'39windef_settings.iterations = 2  # select the number of PIV passes40 41# add the interroagtion window size for each pass. 42# For the moment, it should be a power of 2 43windef_settings.windowsizes = (64,32,16) # if longer than n iteration the rest is ignored44 45# The overlap of the interroagtion window for each pass.46windef_settings.overlap = (32,16,8) # This is 50% overlap47# Has to be a value with base two. In general window size/2 is a good choice.48 49# methode used for subpixel interpolation: 'gaussian','centroid','parabolic'50windef_settings.subpixel_method = 'gaussian'51 52# order of the image interpolation for the window deformation53windef_settings.interpolation_order = 354windef_settings.scaling_factor = 1  # scaling factor pixel/meter55windef_settings.dt = 1  # time between to frames (in seconds)56 57# 'Signal to noise ratio options (only for the last pass)'58# It is possible to decide if the S/N should be computed (for the last pass) or not59windef_settings.extract_sig2noise = False  # 'True' or 'False' (only for the last pass)60 61# method used to calculate the signal to noise ratio 'peak2peak' or 'peak2mean'62windef_settings.sig2noise_method = 'peak2peak'63 64# select the width of the masked to masked out pixels next to the main peak65windef_settings.sig2noise_mask = 1.266 67# If extract_sig2noise==False the values in the signal to noise ratio68# output column are set to NaN69 70'vector validation options'71 72# choose if you want to do validation of the first pass: True or False73windef_settings.validation_first_pass = True74# only effecting the first pass of the interrogation the following passes75# in the multipass will be validated76 77'Validation Parameters'78# The validation is done at each iteration based on three filters.79# The first filter is based on the min/max ranges. Observe that these values are defined in80# terms of minimum and maximum displacement in pixel/frames.81windef_settings.MinMax_U_disp = (-50, 50)82windef_settings.MinMax_V_disp = (-50, 50)83 84# The second filter is based on the global STD threshold85windef_settings.std_threshold = 3  # threshold of the std validation86 87# The third filter is the median test (not normalized at the moment)88windef_settings.median_threshold = 3  # threshold of the median validation89 90# On the last iteration, an additional validation can be done based on the S/N.91windef_settings.median_size=1 #defines the size of the local median92 93'Validation based on the signal to noise ratio'94# Note: only available when extract_sig2noise==True and only for the last95# pass of the interrogation96# Enable the signal to noise ratio validation. Options: True or False97windef_settings.do_sig2noise_validation = True # This is time consuming98 99# minmum signal to noise ratio that is need for a valid vector100windef_settings.sig2noise_threshold = 2101 102'Outlier replacement or Smoothing options'103 104# Replacment options for vectors which are masked as invalid by the validation105windef_settings.replace_vectors = True # Enable the replacment. Chosse: True or False106windef_settings.smoothn=True #Enables smoothing of the displacemenet field107windef_settings.smoothn_p = 0.5 # This is a smoothing parameter108 109# select a method to replace the outliers: 'localmean', 'disk', 'distance'110windef_settings.filter_method = 'localmean'111# maximum iterations performed to replace the outliers112windef_settings.max_filter_iteration = 4113windef_settings.filter_kernel_size = 3  # kernel size for the localmean method114 115'Output options'116# Select if you want to save the plotted vectorfield: True or False117windef_settings.save_plot = False118# Choose wether you want to see the vectorfield or not :True or False119windef_settings.show_plot = False120windef_settings.scale_plot = 50  # select a value to scale the quiver plot of the vectorfield121# run the script with the given settings122