LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sudoku recognition time reduction

I am trying to recognise sudoku from image

 

My idea:

input image:

ScreenShot111.jpg

thresh:

ScreenShot112.jpg

largest object:

ScreenShot113.jpg

find corners,extract and thresh again:

ScreenShot114.jpg

 

My problem is that this works very slow 200ms ... and this is just the extraction...

I am not labview expert.

Could someone look in my code and see if this can work faster??

Download All
Message 1 of 8
(3,282 Views)

Why do you consider 200 msec very slow?  What are you actually trying to do that you need to break out the puzzle from an image faster than 5 times per second?!!

0 Kudos
Message 2 of 8
(3,255 Views)

I ve 30fps camera on my laptop.

I wanted do analyze 10 images and solve 10 sudoku puzzle per secound.

Sudoku is solved on +-20ms.

 

0 Kudos
Message 3 of 8
(3,227 Views)

I think your code is pretty good! Now your next step will be to do some OCR cell per cell to be able to give initial start to your sudoku solver. Have you worked on that part yet? because that will add quite some time to your processing...


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 8
(3,220 Views)

Hi pawhan11,

 

I benchmarked your code and there are some slow parts (you can try it out ... see Attachment benchmark.zip 61 KB). Basically you can try to replace the slowest steps with something faster or create good design of the main application which can fully utilize your hardware. For instance you can use producer/consumer design pattern (available in LabVIEW). This is basically two loops, one that will capture and put images into the queue and the second which will process those images. In detal consumer loop can process those images in bigger chunks which will be processed in paralel (to utilise all available cores).

So all what is needed to be done is to dequeue data in array of images and process those data in the FOR loop with paralel processing enabled (see Attachment Paralel processing.zip 26 KB).

 

Good luck!

 

Ondrej

NIEE AE

CLA, CTA, CLED
Download All
0 Kudos
Message 5 of 8
(3,214 Views)

@okubik wrote:

Hi @pawhan11,

 

I benchmarked your code and there are some slow parts (you can try it out ... see Attachment benchmark.zip 61 KB). Basically you can try to replace the slowest steps with something faster or create good design of the main application which can fully utilize your hardware. For instance you can use producer/consumer design pattern (available in LabVIEW). This is basically two loops, one that will capture and put images into the queue and the second which will process those images. In detal consumer loop can process those images in bigger chunks which will be processed in paralel (to utilise all available cores).

So all what is needed to be done is to dequeue data in array of images and process those data in the FOR loop with paralel processing enabled (see Attachment Paralel processing.zip 26 KB).

 

Good luck!

 

Ondrej

NIEE AE


Thanks for suggestions!

Could You sent that in LV 2011??

 

 

 


@TiTou wrote:

I think your code is pretty good! Now your next step will be to do some OCR cell per cell to be able to give initial start to your sudoku solver. Have you worked on that part yet? because that will add quite some time to your processing...



OCR works fast (at least in diffrent applications that i ve used), I want to make this scalable so it should work with any resolution and diffrent sudoku grids 9x9 and 16x16. But creating scalable ROIs for each cell may be problematic.

0 Kudos
Message 6 of 8
(3,175 Views)

Hi,

here it is...

CLA, CTA, CLED
0 Kudos
Message 7 of 8
(3,162 Views)

So was it helpful?

CLA, CTA, CLED
0 Kudos
Message 8 of 8
(3,128 Views)