LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Playing card recognition using LabVIEW and a webcam

Solved!
Go to solution

Hello,

 

For our project at my school (2nd year electronics engineering) we are making a Blackjack dealer robot. Using LabVIEW and a webcam we would like to take a picture of the card he is going to deal, and then compare it to a database we made beforehand so the program knows what card it is dealing.

So what we actually want him to do is

-scan the card he is gonna deal (take a picture of it)

-compare it with our premade database of pictures of all the playing cards

-once he has the right info is obtained, channel it through to our program so we can count and whatnot with that number of card.

-he only needs to recognize the value of the card, not the type (i.e. has to know that it's a 4, not that it's a 4 of diamonds)

 

I haven't found a good solution yet, can anybody help us with out project? Any tips are kindly appreciated 🙂

 

Kind regards,

Vincent

0 Kudos
Message 1 of 12
(5,400 Views)

Do you have access to the NI Vision Toolkit?

Positioning and alignment of the card will be key. From there you should be able to use standard OCR functions to read the numbers.

Sounds like a fun project.

Message 2 of 12
(5,370 Views)

I do have access to the NI Vision Toolkit. We have a pretty good system for the positioning of the card using a wheel that deals them out 1 at a time. It's comparable to this example YouTube - Robotic card dealer

After installing the NI Vision Toolkit, getting the webcam and the cards, what would be my next best move?

 

Thanks for the fast reply Smiley Wink

0 Kudos
Message 3 of 12
(5,349 Views)

From there, get some practice acquiring still shots using your webcam and defining ROIs. I don't have the Vision Toolkit installed at the moment but I believe it has a whole palette for OCR where you can send it your ROI and it will give you the text.

0 Kudos
Message 4 of 12
(5,316 Views)
Or since you're looking for two "characters", built a "font" that includes the suit and ranks, match two characters from that ROI.
0 Kudos
Message 5 of 12
(5,291 Views)

What SnowMule said.

 

My thinking process would be:

 

- ensure the card positioning is consistent

- create a ROI around the corner of the card, which usually contains the number and the symbol, with enough additional space to accommodate positioning tolerance

- pattern match on the suit symbol (you might as well!)

- OCR on the card number/letter, which will require a bit of teaching

 

With access to the Vision toolkit, have a look at Vision Assistant for your initial efforts. For more control, you could then move to Vision VIs.

---
CLA
0 Kudos
Message 6 of 12
(5,270 Views)

Thanks for the replies!

 

Working with the Vision Assistant goes fine, I was able to implement the OCR on the numbers and letters to a point that it is reliable for our case.

 

I do have a software problem: for the Vision and Motion functions in LabVIEW (currently using 2015 version) I downloaded these drivers which my University provided http://www.ni.com/download/ni-vision-acquisition-software-august-2012/2975/en/

But the Vision and Motion functions still don't show inside of my LabVIEW? I re-installed them to make sure they are installed in the same directory, but it still didn't work..

Any help on this matter?

 

Vincent

0 Kudos
Message 7 of 12
(5,260 Views)

Edit: I installed all the latest software and now everything works like a charm 🙂

0 Kudos
Message 8 of 12
(5,235 Views)

So what I can do for now is:

 

In Vision Assistant:

-load in an image

-put it in a greyscale so i can apply OCR

-recognize the card that is in place

 

How can I automate this process/ put it in a LabVIEW VI? What is the best way to organize this?

The only thing I can do for the moment is snapping pictures with a VI...

Thanks in advance 🙂

0 Kudos
Message 9 of 12
(5,218 Views)

@vincentmees wrote:

So what I can do for now is:

 

In Vision Assistant:

-load in an image

-put it in a greyscale so i can apply OCR

-recognize the card that is in place

 

How can I automate this process/ put it in a LabVIEW VI? What is the best way to organize this?

The only thing I can do for the moment is snapping pictures with a VI...

Thanks in advance 🙂


Learn how to program in LabVIEW.

0 Kudos
Message 10 of 12
(5,192 Views)