import numpy as np def hist_match ( source , template ): """ Adjust the pixel values of a grayscale image such that its histogram matches that of a target image Arguments: ----------- source: np.ndarray Image to transform; the histogram is computed over the flattened array template: np.ndarray Template image; can have different dimensions to source Returns: ----------- matched: np.ndarray The transformed output image """ oldshape = source . shape source = source . ravel () template = template . ravel () # get the set of unique pixel values and their corresponding indices and # counts s_values , bin_idx , s_counts = np . unique ( source , return_inverse = True , return_counts = True ) t_values , t_counts = np . unique ( template , return_counts = True ) ...
1. 디렉토리 생성
답글삭제cat ../Malware_random_list_1st_500.csv | awk -F "," '{print $3}' | uniq | xargs mkdir
2. 파일들 카피
cat Malware_random_list_1st_500_noHeader.csv | awk -F "," '{print "cp Malware_samples_1st_500/"$1".vir Malware_samples_1st_500_class/"$3}' | sh