02-11-2013 03:57 PM - edited 02-11-2013 03:58 PM
I am trying to recognise sudoku from image
My idea:
input image:
thresh:
largest object:
find corners,extract and thresh again:
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??
02-11-2013 05:47 PM
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?!!
02-12-2013 04:09 AM
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.
02-12-2013 04:22 AM
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
02-12-2013 05:10 AM - edited 02-12-2013 05:11 AM
Hi pawhan11,
I benchmarked your code and there are some slow parts (you can try it out ... see 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 Paralel processing.zip 26 KB).
Good luck!
Ondrej
NIEE AE
02-12-2013 10:15 AM
@okubik wrote:
Hi @pawhan11,
I benchmarked your code and there are some slow parts (you can try it out ... see 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 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.
02-12-2013 10:37 AM - edited 02-12-2013 10:37 AM
Hi,
here it is...
02-14-2013 02:01 AM
So was it helpful?