-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
根据特征向量对证件号码进行识别 #6
Comments
feature_0.txt 是识别到的第一个数字的特征数据
…---原始邮件---
发件人: "zhangxi"<notifications@github.com>
发送时间: 2019年8月5日(星期一) 晚上6:38
收件人: "18601949127/DiDiCallCar"<DiDiCallCar@noreply.github.com>;
抄送: "Subscribed"<subscribed@noreply.github.com>;
主题: [18601949127/DiDiCallCar] 根据特征向量对证件号码进行识别 (#6)
//根据特征向量对证件号码进行识别
public int recognitionChar(Mat charImage) {
String result = "";
File file = new File(FEATURE_FILE_PATH);
//遍历FEATURE_FILE_PATH 下的特征文件
File[] featureDataFiles = file.listFiles();
double minDistance = Double.MAX_VALUE;
//获取到特征数据
float[] fv = extractFeatureData(charImage);
for (File f : featureDataFiles) { //readFeatureVector 方法计算与目标特征的最小距离 double dist = calculateDistance(fv, readFeatureVector(f)); if (minDistance > dist) { minDistance = dist; result = f.getName(); } } Log.i("OCR-INFO", result); return Integer.parseInt(result.substring(0, 1)); }
return 这里为什么返回的是文件名字的substring ,文件名为feature_0.txt ,这里就崩溃了,没有看懂这里的含义,能否解释一下呢,多谢大神!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
result = f.getName(); // result = feature_0.txt |
我的分析是,自己制作一个卡片 数字是0~9,然后进行分析,分析完后,手动的吧这些特征数据改名为 |
嗯 是这样的,箭头那一句。
也可以多增加一些样本
…------------------ 原始邮件 ------------------
发件人: "zhangxi"<notifications@github.com>;
发送时间: 2019年8月8日(星期四) 下午4:27
收件人: "18601949127/DiDiCallCar"<DiDiCallCar@noreply.github.com>;
抄送: "谭妥"<1991201740@qq.com>;"Comment"<comment@noreply.github.com>;
主题: Re: [18601949127/DiDiCallCar] 根据特征向量对证件号码进行识别 (#6)
我的分析是,自己制作一个卡片 数字是0~9,然后进行分析,分析完后,手动的吧这些特征数据改名为
feature_0.txt -- >0.txt
feature_1.txt --->1.txt
....
feature_9.txt ---> 9.txt 必须和自己制作的卡片数字对应起来。
然后机器识别的时候匹配到对应的特征文本,就拿到文本的名(result = f.getName();),在进行
result.substring(0, 1) 就拿到了对应的数字,直接显示。这样子也是达到效果了
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
//根据特征向量对证件号码进行识别
public int recognitionChar(Mat charImage) {
String result = "";
File file = new File(FEATURE_FILE_PATH);
//遍历FEATURE_FILE_PATH 下的特征文件
File[] featureDataFiles = file.listFiles();
double minDistance = Double.MAX_VALUE;
//获取到特征数据
float[] fv = extractFeatureData(charImage);
return 这里为什么返回的是文件名字的substring ,文件名为feature_0.txt ,这里就崩溃了,没有看懂这里的含义,能否解释一下呢,多谢大神!
The text was updated successfully, but these errors were encountered: