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;








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









share|improve this question




























    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









    share|improve this question
























      0












      0








      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









      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 18:48









      SaurabhSaurabh

      1




      1






















          2 Answers
          2






          active

          oldest

          votes


















          0














          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')





          share|improve this answer
































            0














            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.






            share|improve this answer

























              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
              );



              );













              draft saved

              draft discarded


















              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









              0














              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')





              share|improve this answer





























                0














                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')





                share|improve this answer



























                  0












                  0








                  0







                  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')





                  share|improve this answer















                  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')






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 26 at 19:47

























                  answered Mar 26 at 19:40









                  KarlsKarls

                  4594 silver badges15 bronze badges




                  4594 silver badges15 bronze badges























                      0














                      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.






                      share|improve this answer



























                        0














                        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.






                        share|improve this answer

























                          0












                          0








                          0







                          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.






                          share|improve this answer













                          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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 30 at 8:43









                          SaurabhSaurabh

                          1




                          1



























                              draft saved

                              draft discarded
















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                              SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                              은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현