def generate_wavelet_esp(): images = get_numpy_array(gray_photos) mkdir(wave_photos_esp) for i, image in enumerate(images): comp = full_compress_wavelets(image) imwrite(wave_photos_esp + '/frame' + str(i) + '.jpg', comp) prt(wave_photos_esp, i)
def generate_fft_unmbral(): images = get_numpy_array(gray_photos) mkdir(fft_photos_umbral) blocks = compress_image(image) _std = std(image) blocks_umbral = [[umbral(block, _std) for block in row] for row in blocks] data = decompress_image(blocks_umbral) imwrite(fft_photos_umbral + '/frame' + str(i) + '.jpg', data) prt(fft_photos_umbral, i)
def generate_fft_qratio(qratio): images = get_numpy_array(gray_photos) blocks = compress_image(image) mkdir(fft_photos_quantification) blocks_quantification = [ [quntification(block, Q, qratio) for block in row] for row in blocks ] data = decompress_image(blocks_quantification) imwrite(fft_photos_quantification + '/frame' + str(i) + '.jpg', data) prt(fft_photos_quantification, i)
def generate_wavelet_temp(rows, columns): images = get_numpy_array(gray_photos) result = [] mkdir(wave_photos_temp) for j in range(0, rows): temp = [] for i in range(0, columns): temp.append(images[j * columns + i]) temp_result = time_compression(temp, 3000000) for item in temp_result: result.append(full_compress_wavelets(item)) for i, image in enumerate(result): imwrite(wave_photos_temp + '/frame' + str(i) + '.jpg', image) prt(wave_photos_temp, i)
def generate_fft_images(qratio): images = get_numpy_array(gray_photos) mkdir(fft_photos_umbral) mkdir(fft_photos_quantification) for i, image in enumerate(images): blocks = compress_image(image) blocks_quantification2 = [[ quntification(block, Q, qratio) for block in row ] for row in blocks] comp1 = decompress_image(blocks_quantification2) _std = std(image) blocks_umbral = [[umbral(block, _std) for block in row] for row in blocks] comp = decompress_image(blocks_umbral) imwrite(fft_photos_quantification + '/frame' + str(i) + '.jpg', comp1) imwrite(fft_photos_umbral + '/frame' + str(i) + '.jpg', comp) prt(fft_photos_quantification, i) prt(fft_photos_umbral, i) print('FFT Done!!')