Sudoku downloader and recognizer
This presentation is the property of its rightful owner.
Sponsored Links
1 / 19

Sudoku Downloader and Recognizer PowerPoint PPT Presentation


  • 122 Views
  • Uploaded on
  • Presentation posted in: General

Sudoku Downloader and Recognizer. Author : Pedro Evaristo González Sánchez. Main Activity ( Portrait ). Recognizement. Custom View. Gaming. Backtracking. Board Downloader. Custom view. Paint and Canvas to draw , background , lines and numbers Adaptable ( OnSizeChanged )

Download Presentation

Sudoku Downloader and Recognizer

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Sudoku downloader and recognizer

Sudoku Downloader and Recognizer

Author: Pedro Evaristo González Sánchez


Main activity portrait

MainActivity(Portrait)

Recognizement

Custom View

Gaming

Backtracking

BoardDownloader


Custom view

Customview

  • Paintand Canvastodraw, background, lines and numbers

  • Adaptable ( OnSizeChanged)

  • EventsSelf-management( onTouchEvent, onKeypressed )

  • InteractionwithMainActivity


Custom view main activity

Custom View –MainActivity

  • MainActivityinstancesCustom View

  • Mainactivity set sensorial’smethods of theCustom View (Focusable…)

  • Whether a Buttonnumberispressed, MainActivityrecievesthe actual cell position iluminated

  • MainActivityupdatesthe Sudoku Board and orderthecustomviewto be paintedonDraw() and invalidate() )


Class sudoku i

ClassSudoku (I)

  • Matrix[9][9] of Integers

  • Constructor overload( String) toimplementthecommunicationbetweenactivities

  • Theclassreturn a Stringwhichcontainsthe sudoku board. Thisisveryhelpfulforseveralsituations. Forinnstance( Bundleand Activitiescommunication)

  • Neighborchecking( row, column and block )


Sudoku class ii backtracking

Sudoku Class II ( Backtracking )

  • Ifthe actual Cellis(9,9) => Ends

  • Ifyoufind a number, gotothenextcell ( Original Sudoku )

  • Foreachvalue1..9

    • Ifneighborcheckingis positive

    • Sudoku(i+1,j+1)

    • Ifyoudon’tfind a candidate, restore and go back onecell


Download activity i

DownloadActivity (I)

  • A waytoupdatetheappgame

  • Itexist a Sudoku boardholded in a web server

  • “Goodformed” Boardwithin a *.txt file.

  • Thegoalistorescuethisboard and takeittotheGame


Download activity ii

DownloadActivity (II)


3 sudoku recognizer

3. Sudoku Recognizer

  • 3.0 Androidpreviousconcepts

  • 3.1 Image Capture

  • 3.2 Imageprocessing(OpenCV)

  • 3.3 OpticalChracterRecognition (OCR)

    • Tesseract


3 0 android previous concepts

3.0 Androidpreviousconcepts

  • SDK and OpenCV Library (OpenCV)

  • NDK (NativeDeveloping Kit) ( Tesseract )

    • Buildlibraries and referencethem in theapplication.


3 1 image capture

3.1 Image Capture

  • CallingtheIntentin charge of capturingimages of Android

  • Capture and savetheimage in a temporal file

  • Pre-processing=> Findingthe balance betweengoodqualitiy and computability


3 2 image processing i

3.2 ImageProcessing (I)

  • Firstcontroversy, theimageis in perspective=> theboardisnot a quad, is a trapezoid

  • TheMainconcernis a processing in twolevels (RGB and GRAY)


Image processing ii

ImageProcessing (II)

  • Border’sdetection

  • Next, searchingthebiggestcontourwithintheimage. (ROI)


Image processing iii

ImageProcessing (III)

  • Houghalgorithm and transformtofindtheboardslines

  • Two fundamental concepts in line processing:

    • Every single line will be deletepaintingthem of whiteorblack in each case (RGB and GRAY).

    • Checkifthestartpointorendpoint of line isinsidesome of thefourrectcorners of theimage


Image processing iv

ImageProcessing (IV)

  • Gettingthematrixthat defines theperspectivetransformationneededtoextrapolatethecorners of theboardtothecorners of theimage

  • Apply a WarpPerspectiveTransformationwiththe matriz obtained.


Image processing v

ImageProcessing (V)

  • At thispoint, theboardisdivided in equalcellstoprocesseachone of them


Procesamiento de la imagen vi

Procesamiento de la Imagen (VI)

  • Single cellprocessing in paralell (RGB and Gray) bearing in mindTesseractsrequeriments.

Equalizing

Histogram

Threshold

Smooth

+

Dilate

findContours()


Tesseract ocr

Tesseract ( OCR )

  • ¡Don’twaitfor a miracle!. Youneedanstrongimageprocessing

  • Delimitingdictionarytonumbers(1..9)

  • Foreachnumberitisnecessaryreleasingthememoryallocatedbytheimage and bythetesseractsobject. We are on a phone and we’vegotlessmemoryresources.

Tesseract

6


That s all thank you

That’sall. Thankyou!!


  • Login