sudoku downloader and recognizer
Download
Skip this Video
Download Presentation
Sudoku Downloader and Recognizer

Loading in 2 Seconds...

play fullscreen
1 / 19

Sudoku Downloader and Recognizer - PowerPoint PPT Presentation


  • 171 Views
  • Uploaded on

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 )

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Sudoku Downloader and Recognizer' - morgan


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

ad