Hello everyone,
I’m working on a program that can recognize playing cards from an image. The cards will always have the same design, but they can appear in different positions on the screen and may vary in size depending on the window size. The goal is to select a specific area of the screen where the cards will be displayed, and the program should be able to identify between 2 to 6 cards in that area.
I’ve already attempted this using OCR by capturing the text on the card and identifying the suit based on color. However, OCR tends to fail frequently, especially at lower resolutions.
To improve accuracy, I plan to use a template-matching approach, where I have a reference image (template) for each card. The program will compare the captured image with these templates to identify the cards.
Key Points:
- The cards will always have the same design.
- Cards can appear in different positions and sizes within a selected screen area.
- The number of cards can range from 2 to 6.
- OCR has been unreliable, particularly at lower resolutions.
- I will use a template-matching approach with a reference image for each card.
Questions:
1. What would be the best approach to implement template matching in this scenario?
2. Are there any specific libraries or tools (e.g., OpenCV) that you would recommend for this task?
3. How can I handle variations in card size and position effectively?
4. Are there any alternative methods to OCR and template matching that could improve accuracy?
Any advice, code snippets, or resources would be greatly appreciated!
Thank you in advance for your help!
Sample cads will go like this:
I’m working on a program that can recognize playing cards from an image. The cards will always have the same design, but they can appear in different positions on the screen and may vary in size depending on the window size. The goal is to select a specific area of the screen where the cards will be displayed, and the program should be able to identify between 2 to 6 cards in that area.
I’ve already attempted this using OCR by capturing the text on the card and identifying the suit based on color. However, OCR tends to fail frequently, especially at lower resolutions.
To improve accuracy, I plan to use a template-matching approach, where I have a reference image (template) for each card. The program will compare the captured image with these templates to identify the cards.
Key Points:
- The cards will always have the same design.
- Cards can appear in different positions and sizes within a selected screen area.
- The number of cards can range from 2 to 6.
- OCR has been unreliable, particularly at lower resolutions.
- I will use a template-matching approach with a reference image for each card.
Questions:
1. What would be the best approach to implement template matching in this scenario?
2. Are there any specific libraries or tools (e.g., OpenCV) that you would recommend for this task?
3. How can I handle variations in card size and position effectively?
4. Are there any alternative methods to OCR and template matching that could improve accuracy?
Any advice, code snippets, or resources would be greatly appreciated!
Thank you in advance for your help!
Sample cads will go like this: