Need help in character recognitionOptical character recognition program for photographsMATLAB Optical character recognition - need helpSimple Digit Recognition OCR in OpenCV-PythonImage Processing: Algorithm Improvement for 'Coca-Cola Can' RecognitionImage-processing basicsOpenCV histogram equalization process using cv::equalizeHist():Need help understanding final step for thisCharacter recognitionCharacter recognition (OCR algorithm)Optical Character Recognition DevelopmentCharacter recognition from an image C++
Where to find an interactive PDF or HTML version of the tex.web documentation?
Why do planes need a roll motion?
To find islands of 1 and 0 in matrix
Why/when is AC-DC-AC conversion superior to direct AC-AC conversion?
What does "see" in "the Holy See" mean?
Writing a clean implementation of rock–paper–scissors game in C++
How do I explain an exponentially complex intuitively?
What is the most efficient way to write 'for' loops in Matlab?
What are the different qualities of the intervals?
Why is it considered Acid Rain with pH <5.6
Does a Rogue's Evasion work for spells?
How did Mysterio have these drones?
How to check what is edible on an alien world?
Interrupt pin type on the 6502
Why do all my history books divide Chinese history after the Han dynasty?
Word for showing a small part of something briefly to hint to its existence or beauty without fully uncovering it
How can I rectify up to 85 kV
What is the difference between 1/3, 1/2, and full casters?
Why didn't Britain or any other European power colonise Abyssinia/Ethiopia before 1936?
How to store my pliers and wire cutters on my desk?
How to judge a Ph.D. applicant that arrives "out of thin air"
What do I do with a party that is much stronger than their level?
How to kill my goat in Goat Simulator
Assuring luggage isn't lost with short layover
Need help in character recognition
Optical character recognition program for photographsMATLAB Optical character recognition - need helpSimple Digit Recognition OCR in OpenCV-PythonImage Processing: Algorithm Improvement for 'Coca-Cola Can' RecognitionImage-processing basicsOpenCV histogram equalization process using cv::equalizeHist():Need help understanding final step for thisCharacter recognitionCharacter recognition (OCR algorithm)Optical Character Recognition DevelopmentCharacter recognition from an image C++
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am not getting the use of if-else statements where it is written if ind==1 || ind==2 what is it comparing and how can it say that if it is equal to 1 or 2 then letter A, if 3 or 4 the letter B etc. Can anyone help me regarding this? The if-else statements how can we randomly give any number or the numbers compared have some meaning?
% This is a function called from the main file.
function letter=readLetter(snap)
load NewTemplates
snap=imresize(snap,[42 24]);
rec=[ ];
for n=1:length(NewTemplates)
cor=corr2(NewTemplates1,n,snap);
rec=[rec cor];
end
ind=find(rec==max(rec));
display(ind);
% Alphabets listings.
if ind==1 || ind==2
letter='A';
elseif ind==3 || ind==4
letter='B';
elseif ind==5
letter='C';
elseif ind==6 || ind==7
letter='D';
elseif ind==8
letter='E';
elseif ind==9
letter='F';
``` like so up to Z and 0 -9 ```
end
end
matlab image-processing signal-processing ocr correlation
add a comment |
I am not getting the use of if-else statements where it is written if ind==1 || ind==2 what is it comparing and how can it say that if it is equal to 1 or 2 then letter A, if 3 or 4 the letter B etc. Can anyone help me regarding this? The if-else statements how can we randomly give any number or the numbers compared have some meaning?
% This is a function called from the main file.
function letter=readLetter(snap)
load NewTemplates
snap=imresize(snap,[42 24]);
rec=[ ];
for n=1:length(NewTemplates)
cor=corr2(NewTemplates1,n,snap);
rec=[rec cor];
end
ind=find(rec==max(rec));
display(ind);
% Alphabets listings.
if ind==1 || ind==2
letter='A';
elseif ind==3 || ind==4
letter='B';
elseif ind==5
letter='C';
elseif ind==6 || ind==7
letter='D';
elseif ind==8
letter='E';
elseif ind==9
letter='F';
``` like so up to Z and 0 -9 ```
end
end
matlab image-processing signal-processing ocr correlation
add a comment |
I am not getting the use of if-else statements where it is written if ind==1 || ind==2 what is it comparing and how can it say that if it is equal to 1 or 2 then letter A, if 3 or 4 the letter B etc. Can anyone help me regarding this? The if-else statements how can we randomly give any number or the numbers compared have some meaning?
% This is a function called from the main file.
function letter=readLetter(snap)
load NewTemplates
snap=imresize(snap,[42 24]);
rec=[ ];
for n=1:length(NewTemplates)
cor=corr2(NewTemplates1,n,snap);
rec=[rec cor];
end
ind=find(rec==max(rec));
display(ind);
% Alphabets listings.
if ind==1 || ind==2
letter='A';
elseif ind==3 || ind==4
letter='B';
elseif ind==5
letter='C';
elseif ind==6 || ind==7
letter='D';
elseif ind==8
letter='E';
elseif ind==9
letter='F';
``` like so up to Z and 0 -9 ```
end
end
matlab image-processing signal-processing ocr correlation
I am not getting the use of if-else statements where it is written if ind==1 || ind==2 what is it comparing and how can it say that if it is equal to 1 or 2 then letter A, if 3 or 4 the letter B etc. Can anyone help me regarding this? The if-else statements how can we randomly give any number or the numbers compared have some meaning?
% This is a function called from the main file.
function letter=readLetter(snap)
load NewTemplates
snap=imresize(snap,[42 24]);
rec=[ ];
for n=1:length(NewTemplates)
cor=corr2(NewTemplates1,n,snap);
rec=[rec cor];
end
ind=find(rec==max(rec));
display(ind);
% Alphabets listings.
if ind==1 || ind==2
letter='A';
elseif ind==3 || ind==4
letter='B';
elseif ind==5
letter='C';
elseif ind==6 || ind==7
letter='D';
elseif ind==8
letter='E';
elseif ind==9
letter='F';
``` like so up to Z and 0 -9 ```
end
end
matlab image-processing signal-processing ocr correlation
matlab image-processing signal-processing ocr correlation
asked Mar 26 at 18:48
SaurabhSaurabh
1
1
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
In Matlab OR operator can be written as ||
. For example in your case:
if ind==1 || ind==2
letter='A';
Means: if ind
is equal to 1
OR ind
is equal to 2
- do the instruction (Set letter
variable to 'A'
).
However in this case switch
would have more sense. For example:
switch ind
case 1,2
letter='A';
case 3,4
letter='B';
case 5
letter='C';
``` like so up to Z and 0 -9 ```
otherwise
disp('Nothing matches')
add a comment |
I got my answer upon some debugging. The values that are being compared to are coming from the .mat file that is created by MATLAB to store the binaries of the images. 1 2 3 ... are the columns of respective Letters stored in .mat file. I converted the binary to image and it was correct.
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%2f55364317%2fneed-help-in-character-recognition%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In Matlab OR operator can be written as ||
. For example in your case:
if ind==1 || ind==2
letter='A';
Means: if ind
is equal to 1
OR ind
is equal to 2
- do the instruction (Set letter
variable to 'A'
).
However in this case switch
would have more sense. For example:
switch ind
case 1,2
letter='A';
case 3,4
letter='B';
case 5
letter='C';
``` like so up to Z and 0 -9 ```
otherwise
disp('Nothing matches')
add a comment |
In Matlab OR operator can be written as ||
. For example in your case:
if ind==1 || ind==2
letter='A';
Means: if ind
is equal to 1
OR ind
is equal to 2
- do the instruction (Set letter
variable to 'A'
).
However in this case switch
would have more sense. For example:
switch ind
case 1,2
letter='A';
case 3,4
letter='B';
case 5
letter='C';
``` like so up to Z and 0 -9 ```
otherwise
disp('Nothing matches')
add a comment |
In Matlab OR operator can be written as ||
. For example in your case:
if ind==1 || ind==2
letter='A';
Means: if ind
is equal to 1
OR ind
is equal to 2
- do the instruction (Set letter
variable to 'A'
).
However in this case switch
would have more sense. For example:
switch ind
case 1,2
letter='A';
case 3,4
letter='B';
case 5
letter='C';
``` like so up to Z and 0 -9 ```
otherwise
disp('Nothing matches')
In Matlab OR operator can be written as ||
. For example in your case:
if ind==1 || ind==2
letter='A';
Means: if ind
is equal to 1
OR ind
is equal to 2
- do the instruction (Set letter
variable to 'A'
).
However in this case switch
would have more sense. For example:
switch ind
case 1,2
letter='A';
case 3,4
letter='B';
case 5
letter='C';
``` like so up to Z and 0 -9 ```
otherwise
disp('Nothing matches')
edited Mar 26 at 19:47
answered Mar 26 at 19:40
KarlsKarls
4594 silver badges15 bronze badges
4594 silver badges15 bronze badges
add a comment |
add a comment |
I got my answer upon some debugging. The values that are being compared to are coming from the .mat file that is created by MATLAB to store the binaries of the images. 1 2 3 ... are the columns of respective Letters stored in .mat file. I converted the binary to image and it was correct.
add a comment |
I got my answer upon some debugging. The values that are being compared to are coming from the .mat file that is created by MATLAB to store the binaries of the images. 1 2 3 ... are the columns of respective Letters stored in .mat file. I converted the binary to image and it was correct.
add a comment |
I got my answer upon some debugging. The values that are being compared to are coming from the .mat file that is created by MATLAB to store the binaries of the images. 1 2 3 ... are the columns of respective Letters stored in .mat file. I converted the binary to image and it was correct.
I got my answer upon some debugging. The values that are being compared to are coming from the .mat file that is created by MATLAB to store the binaries of the images. 1 2 3 ... are the columns of respective Letters stored in .mat file. I converted the binary to image and it was correct.
answered Mar 30 at 8:43
SaurabhSaurabh
1
1
add a comment |
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%2f55364317%2fneed-help-in-character-recognition%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