def batch_func(data_name): C_8U = loadData(data_name, loader_func=loadRGBA) A_8U = alpha(C_8U) I_32F = luminance(C_8U) N_32F, D_32F = estimateNormal(I_32F) result_dir = resultDir(batch_name) N_file = resultFile(result_dir, data_name) saveNormal(N_file, N_32F, A_8U)
def main(input_file, output_file, quiet): C_8U = loadRGBA(input_file) A_8U = alpha(C_8U) I_32F = luminance(C_8U) N_32F, D_32F = estimateNormal(I_32F) if output_file: saveResult(input_file, A_8U, N_32F) if quiet: return showResult(C_8U, D_32F, N_32F, A_8U)