今天发现数据部门给过来的数据图片不是一一对应的
名字是这样:
1_00001_11.jpg
1_00001_12.jpg
00001代表同一个人,11是身份证照片,12是当前业务照片,要比对这两张照片的相似度。但是发现给过来的1000多张照片中,有很多只提供了身份证照片或者业务照片,那么这些照片肯定要踢出来,不然这些等于脏数据会影响认证对比的结果,用下面脚本可以实现过滤掉脏数据。
#!/bin/bash
ls tempbak|awk 'BEGIN{FS="_"}{print $2}' > 1.txt
sort 1.txt |uniq -u > 2.txt
for i in `cat 2.txt`
do
find ./tempbak/ -name "*$i*"|xargs -i rm {}
done