Most important characters extraction
I'm extracting the character via OCR from id card. I have 4 different image but all images for 1 person(me). There'are 4 different text extraction results. For example, name extraction
[' BEYHAN', ' S BEYHAN h of', ' 2EYHAN', ' B3YHAN U']
this kind of array is returning. So i want to extract BEYHAN but there is some missing parts.
I can do most common words in array and of course will return BEYHAN but this is just works for this case. I want to get information of '2EYHAN'
and 'B3YHAN'
. This are not BEYHAN but it has some information (2-EYHAN
) and (B-3-YHAN
). So do you know is there any algorithm or methods to use this kind of results ?
python string ocr
add a comment |
I'm extracting the character via OCR from id card. I have 4 different image but all images for 1 person(me). There'are 4 different text extraction results. For example, name extraction
[' BEYHAN', ' S BEYHAN h of', ' 2EYHAN', ' B3YHAN U']
this kind of array is returning. So i want to extract BEYHAN but there is some missing parts.
I can do most common words in array and of course will return BEYHAN but this is just works for this case. I want to get information of '2EYHAN'
and 'B3YHAN'
. This are not BEYHAN but it has some information (2-EYHAN
) and (B-3-YHAN
). So do you know is there any algorithm or methods to use this kind of results ?
python string ocr
problem is extarct the name of person correctly. There are 4 different results but which one is correct ? We don't know. But we can combine the different results and can undersant what name is
– Beyhan Gül
Jan 1 at 14:34
add a comment |
I'm extracting the character via OCR from id card. I have 4 different image but all images for 1 person(me). There'are 4 different text extraction results. For example, name extraction
[' BEYHAN', ' S BEYHAN h of', ' 2EYHAN', ' B3YHAN U']
this kind of array is returning. So i want to extract BEYHAN but there is some missing parts.
I can do most common words in array and of course will return BEYHAN but this is just works for this case. I want to get information of '2EYHAN'
and 'B3YHAN'
. This are not BEYHAN but it has some information (2-EYHAN
) and (B-3-YHAN
). So do you know is there any algorithm or methods to use this kind of results ?
python string ocr
I'm extracting the character via OCR from id card. I have 4 different image but all images for 1 person(me). There'are 4 different text extraction results. For example, name extraction
[' BEYHAN', ' S BEYHAN h of', ' 2EYHAN', ' B3YHAN U']
this kind of array is returning. So i want to extract BEYHAN but there is some missing parts.
I can do most common words in array and of course will return BEYHAN but this is just works for this case. I want to get information of '2EYHAN'
and 'B3YHAN'
. This are not BEYHAN but it has some information (2-EYHAN
) and (B-3-YHAN
). So do you know is there any algorithm or methods to use this kind of results ?
python string ocr
python string ocr
edited Jan 1 at 22:03
desertnaut
19.1k73976
19.1k73976
asked Jan 1 at 14:27
Beyhan GülBeyhan Gül
9918
9918
problem is extarct the name of person correctly. There are 4 different results but which one is correct ? We don't know. But we can combine the different results and can undersant what name is
– Beyhan Gül
Jan 1 at 14:34
add a comment |
problem is extarct the name of person correctly. There are 4 different results but which one is correct ? We don't know. But we can combine the different results and can undersant what name is
– Beyhan Gül
Jan 1 at 14:34
problem is extarct the name of person correctly. There are 4 different results but which one is correct ? We don't know. But we can combine the different results and can undersant what name is
– Beyhan Gül
Jan 1 at 14:34
problem is extarct the name of person correctly. There are 4 different results but which one is correct ? We don't know. But we can combine the different results and can undersant what name is
– Beyhan Gül
Jan 1 at 14:34
add a comment |
1 Answer
1
active
oldest
votes
First of all, there are specific numbers that represent letters. So put in wordt
the word that you need to extract and in wordn
put the represented number. The code below is trying to match the word letter by letter and check if it is matched the letter or the represented number. if the all later matches then they will print the whole word if not he will start from the beginning.
I just put the number as an example.
Run the code https://onlinegdb.com/BJaknZFbE
words = ['BEYHAN', ' S BEYHAN h of', '2EYHAN', 'B3YHAN U']
wordt='BEYHAN';
wordn=["2","3","4","6","7","8"];
m=0
c=''
n=0
for word in words:
c=''
m=0
n=0
for letter in word:
if letter==wordt[n] or letter==wordn[n]:
m=m+1
c=c+letter;
else :
if len(wordt)!=m:
m=0
n=n-1
c=''
else:
print(c) ;
c=''
m=0
n=0
if len(wordt)-1>n:
n=n+1
else:
n=0
if len(wordt)==m:
print(c) ;
c=''
m=0
n=0
1
Can you give some explanation of what your code does, how it works, and what the variables represent?
– rassar
Jan 1 at 15:52
I already add the explanation.
– i_th
Jan 1 at 15:57
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53996265%2fmost-important-characters-extraction%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
First of all, there are specific numbers that represent letters. So put in wordt
the word that you need to extract and in wordn
put the represented number. The code below is trying to match the word letter by letter and check if it is matched the letter or the represented number. if the all later matches then they will print the whole word if not he will start from the beginning.
I just put the number as an example.
Run the code https://onlinegdb.com/BJaknZFbE
words = ['BEYHAN', ' S BEYHAN h of', '2EYHAN', 'B3YHAN U']
wordt='BEYHAN';
wordn=["2","3","4","6","7","8"];
m=0
c=''
n=0
for word in words:
c=''
m=0
n=0
for letter in word:
if letter==wordt[n] or letter==wordn[n]:
m=m+1
c=c+letter;
else :
if len(wordt)!=m:
m=0
n=n-1
c=''
else:
print(c) ;
c=''
m=0
n=0
if len(wordt)-1>n:
n=n+1
else:
n=0
if len(wordt)==m:
print(c) ;
c=''
m=0
n=0
1
Can you give some explanation of what your code does, how it works, and what the variables represent?
– rassar
Jan 1 at 15:52
I already add the explanation.
– i_th
Jan 1 at 15:57
add a comment |
First of all, there are specific numbers that represent letters. So put in wordt
the word that you need to extract and in wordn
put the represented number. The code below is trying to match the word letter by letter and check if it is matched the letter or the represented number. if the all later matches then they will print the whole word if not he will start from the beginning.
I just put the number as an example.
Run the code https://onlinegdb.com/BJaknZFbE
words = ['BEYHAN', ' S BEYHAN h of', '2EYHAN', 'B3YHAN U']
wordt='BEYHAN';
wordn=["2","3","4","6","7","8"];
m=0
c=''
n=0
for word in words:
c=''
m=0
n=0
for letter in word:
if letter==wordt[n] or letter==wordn[n]:
m=m+1
c=c+letter;
else :
if len(wordt)!=m:
m=0
n=n-1
c=''
else:
print(c) ;
c=''
m=0
n=0
if len(wordt)-1>n:
n=n+1
else:
n=0
if len(wordt)==m:
print(c) ;
c=''
m=0
n=0
1
Can you give some explanation of what your code does, how it works, and what the variables represent?
– rassar
Jan 1 at 15:52
I already add the explanation.
– i_th
Jan 1 at 15:57
add a comment |
First of all, there are specific numbers that represent letters. So put in wordt
the word that you need to extract and in wordn
put the represented number. The code below is trying to match the word letter by letter and check if it is matched the letter or the represented number. if the all later matches then they will print the whole word if not he will start from the beginning.
I just put the number as an example.
Run the code https://onlinegdb.com/BJaknZFbE
words = ['BEYHAN', ' S BEYHAN h of', '2EYHAN', 'B3YHAN U']
wordt='BEYHAN';
wordn=["2","3","4","6","7","8"];
m=0
c=''
n=0
for word in words:
c=''
m=0
n=0
for letter in word:
if letter==wordt[n] or letter==wordn[n]:
m=m+1
c=c+letter;
else :
if len(wordt)!=m:
m=0
n=n-1
c=''
else:
print(c) ;
c=''
m=0
n=0
if len(wordt)-1>n:
n=n+1
else:
n=0
if len(wordt)==m:
print(c) ;
c=''
m=0
n=0
First of all, there are specific numbers that represent letters. So put in wordt
the word that you need to extract and in wordn
put the represented number. The code below is trying to match the word letter by letter and check if it is matched the letter or the represented number. if the all later matches then they will print the whole word if not he will start from the beginning.
I just put the number as an example.
Run the code https://onlinegdb.com/BJaknZFbE
words = ['BEYHAN', ' S BEYHAN h of', '2EYHAN', 'B3YHAN U']
wordt='BEYHAN';
wordn=["2","3","4","6","7","8"];
m=0
c=''
n=0
for word in words:
c=''
m=0
n=0
for letter in word:
if letter==wordt[n] or letter==wordn[n]:
m=m+1
c=c+letter;
else :
if len(wordt)!=m:
m=0
n=n-1
c=''
else:
print(c) ;
c=''
m=0
n=0
if len(wordt)-1>n:
n=n+1
else:
n=0
if len(wordt)==m:
print(c) ;
c=''
m=0
n=0
edited Jan 1 at 15:56
answered Jan 1 at 15:44
i_thi_th
1,1851718
1,1851718
1
Can you give some explanation of what your code does, how it works, and what the variables represent?
– rassar
Jan 1 at 15:52
I already add the explanation.
– i_th
Jan 1 at 15:57
add a comment |
1
Can you give some explanation of what your code does, how it works, and what the variables represent?
– rassar
Jan 1 at 15:52
I already add the explanation.
– i_th
Jan 1 at 15:57
1
1
Can you give some explanation of what your code does, how it works, and what the variables represent?
– rassar
Jan 1 at 15:52
Can you give some explanation of what your code does, how it works, and what the variables represent?
– rassar
Jan 1 at 15:52
I already add the explanation.
– i_th
Jan 1 at 15:57
I already add the explanation.
– i_th
Jan 1 at 15:57
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53996265%2fmost-important-characters-extraction%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
problem is extarct the name of person correctly. There are 4 different results but which one is correct ? We don't know. But we can combine the different results and can undersant what name is
– Beyhan Gül
Jan 1 at 14:34