SlideShare a Scribd company logo
Autor Conducător științific
Universitatea
Politehnica
București
Facultatea de
Automatică și
Calculatoare
Catedra de
Calculatoare
Hearthstone Helper - Using Optical
Character Recognition Techniques For
Cards Detection
Costin-Gabriel CHIRU, Florin Oprea
costin.chiru@cs.pub.ro
Introduction
• Purpose: capture, process and analyze images
from the video stream of the Hearthstone
game in order to obtain relevant information
on the conduct of parties in this game
• Constraint: results should be offered in real-
time on a regular computer / tablet
• Methodology: apply different techniques for
extracting information from the images and
then use this information to identify and log
the cards that have been played.
09.09.2016 AIMSA 2016 1
Heartstone (Heroes of Warcraft)
• Free-to-play online game developed by Blizzard (2014)
• Turn-based game involving 2 players in a 1vs1 match
• Each player has his/her own deck of cards with 30 cards
• Each player start with 30 life points and the purpose of
the game is to play their cards so that to destroy the
opponent before they are themselves defeated
• The game features between 814 and 1003 different
cards used to cast spells, summon minions to help in the
battle or equip weapons
– They are classified in 5 categories based on their rarity and
usefulness and in 10 different classes according to their
availability to all the heroes, or to a specific one.
09.09.2016 AIMSA 2016 2
Application Usefulness
• By monitoring the game, the application is able to
memorize the cards that have been played and
thus:
– the player knows what remaining cards he/she has and
can compute the likelihood of extracting a particular
card
– he/she knows which cards will no longer be available in
the opponent deck (the decks may contain at most two
cards of the same type, or only one if it is a legendary
card)
– the player can predict the most probable deck of the
opponent based on the cards played so far, previous
history, opponent's rating, game style and current
meta-game.
09.09.2016 AIMSA 2016 3
Theoretical Background (1)
• To determine real time in-game events,
methods that are fast, efficient and accurate
are needed both for image capturing and for
cards recognition.
• Image capturing: acquire sufficient game
snapshots per seconds to detect changes
– Using API provided by Windows that allows direct
access to the opened windows from the
operating system
– up to 15 frames per second without
overwhelming the CPU
09.09.2016 AIMSA 2016 4
Theoretical Background (2)
• Cards recognition: needed to
– detect when a new card appeared (to avoid
continuous processing of video stream)
• Using Background Subtraction
– recognize different pictures based on the elements
from them. Can be done by:
• comparing their histograms (colors distribution)
• key points matching: choose specific points of interest and
then find the association between them.
• using key points in combination with decision trees (to
accelerate the execution)
• using perceptual hashes
• using OCR on the text appearing in the pictures and
comparing the text
09.09.2016 AIMSA 2016 5
Implementation Details (1)
• First of all, the Windows API was used to extract
the snapshots  extract information from the
snapshots
• Resolution might be large involving a large
processing time  only analyze specific regions
in the images to determine the start and end of a
game (analyzed areas are about 10 times smaller
than the original image)
• Next step: identify the moments of time when
these areas contain images of cards using
Background Subtraction and analyze the frames
sufficiently highlighted
09.09.2016 AIMSA 2016 6
Implementation Details (2)
09.09.2016 AIMSA 2016 7
Implementation Details (3)
• Next, we investigated the methods for image
recognition:
– Histograms: bad results due to the fact that all the
images were created from the same template
– Key points matching - invariant to rotation, scaling or
brightness: SURF (Speeded up robust features) and
SIFT (Scale-invariant feature transform) in
combination with Flann (Fast Library for approximate
nearest neighbor) for matching the key points
• Can be done offline for the cards from the DB, but the
matching algorithm might take minutes (~ 1000 cards *
tenths of a second for each card)  can’t be used for real-
time recognition
• For heroes recognition, SURF and Flann takes ~ 3 seconds
(only 9 possible heroes)  acceptable for this part  used
09.09.2016 AIMSA 2016 8
Implementation Details (4)
09.09.2016 AIMSA 2016 9
Implementation Details (5)
– Apply OCR techniques: used Tesseract and specified
specific text areas that help determining the playing
card (the card name and its attributes - cost, attack
and life points)
• Binarized the picture  better results for OCR and smaller
execution times
• Wavy text  problems for the recognition engine  had to
post-process the OCR output:
– compute the Levenshtein distance between the obtained text
and the cards name and
– use the attribute values returned by the OCR to filter out cards
• Very fast: took between 0.1 and 1.5 s
• Using OCR, the whole process (from capturing
the window image to the card classification) < 2 s
09.09.2016 AIMSA 2016 10
Application Output
• The GUI is to inform the player about relevant
changes in the application:
– the status of the application,
– the cards that have been played,
– the remaining cards
09.09.2016 AIMSA 2016 10
• The information
is updated in
real-time as the
cards are played
Cards Identification (1)
• Stormwind Knight:
– Cards from the DB with their
scores:
• "Silver Hand Knight": 2,
• "Stormwind Knight": 10,
• "Blood Knight": 10
• "The Black Knight": 2
– Use Levenshtein Distance:
• "Stormwind Knight": 9, 11, 11, 4, 8, 5
• "Blood Knight": 11, 12, 15, 8, 12, 10
– and cards’ attributes
• "Stormwind Knight": 4, 2, 5
• "Blood Knight": 3, 3, 3
• The card is correctly identified
09.09.2016 AIMSA 2016 12
• Kor'kron Elite :
– Do not contain any words from
the DB:
– Use cards’ attributes (4, 4, 3):
• "Kor’kron Elite"
• "Houndmaster”
• "Spellbreaker”
– And then Levenshtein Distance:
• "Kor’kron Elite": 4, 6, 2, 5, 3, 4
• "Houndmaster": 11, 13, 11, 10,
11, 12
• "Spellbreaker": 12, 14, 13, 11, 12
• The card is correctly
identified
09.09.2016 AIMSA 2016 12
Cards Identification (2)
Runtime and Errors
• Results obtained using an Intel(R) Core(TM) i7-4500U CPU @ 2.40 GHz
• Time analysis:
– Detection of a new game (SURF & FLANN): avg. 0.104s
– of the heroes of the two players (SURF & FLANN): avg. 0.346s
– Cards’ detection (OCR):
• Accuracy: system average accuracy was 99.1%.
– Errors due to partial occlusion of the card that needs to be detected.
– GUI offers the possibility of manually correcting the errors.
09.09.2016 AIMSA 2016 12
Type of cards OCR attributes OCR names Total
Cards extracted by the user 0.0146 0.7305 1.0159
Cards played by the opponent 0.0086 0.8234 0.9361
Type of cards Identified cards Errors
Cards extracted by the user 209 1
Cards played by the opponent 227 3
Total 436 4
Conclusions
• We presented an application whose purpose was to
monitor in-game events that occur in the Hearthstone
game
• Main requirement was to be quick enough to provide
answers in real time
• For the recognition of the analyzed images, we have
tried two categories of methods:
– One based on the picture recognition: using histograms or
using algorithms for key point matching  time
consuming
– one based on OCR use only the text from the pictures
 fast and accurate
• The application helps players in making the right
decisions or in taking calculated risks, thus improving
their performance and gaming experience
09.09.2016 AIMSA 2016 12
Questions
09.09.2016 AIMSA 2016 12
Thank you very much!

More Related Content

Similar to Hearthstone helper using optical character recognition techniques for cards detection

Beginners guide to khepera robot soccer
Beginners guide to khepera robot soccerBeginners guide to khepera robot soccer
Beginners guide to khepera robot soccer
boimiim
 
Multiplayer Networking Game
Multiplayer Networking GameMultiplayer Networking Game
Multiplayer Networking Game
Tanmay Krishna
 
Computer system Hardware components.pptx
Computer system Hardware components.pptxComputer system Hardware components.pptx
Computer system Hardware components.pptx
Roshni814224
 
Computer system Hardware components.pptx
Computer system Hardware components.pptxComputer system Hardware components.pptx
Computer system Hardware components.pptx
Roshni814224
 
Dedicated Game Servers
Dedicated Game ServersDedicated Game Servers
Dedicated Game Servers
webhostingguy
 
98 374 Lesson 02-slides
98 374 Lesson 02-slides98 374 Lesson 02-slides
98 374 Lesson 02-slides
Tracie King
 
C PROGRAM CODE FOR SNAKE AND LADDER GAME
C PROGRAM CODE FOR SNAKE AND LADDER GAMEC PROGRAM CODE FOR SNAKE AND LADDER GAME
C PROGRAM CODE FOR SNAKE AND LADDER GAME
Abarajitha3
 
Next generation mobile gp us and rendering techniques - niklas smedberg
Next generation mobile gp us and rendering techniques - niklas smedbergNext generation mobile gp us and rendering techniques - niklas smedberg
Next generation mobile gp us and rendering techniques - niklas smedberg
Mary Chan
 
98 374 Lesson 04-slides
98 374 Lesson 04-slides98 374 Lesson 04-slides
98 374 Lesson 04-slides
Tracie King
 
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Unity Technologies
 
EE4214+Real+Time+Embedded+System
EE4214+Real+Time+Embedded+SystemEE4214+Real+Time+Embedded+System
EE4214+Real+Time+Embedded+System
webuiltit
 
Unit 5
Unit 5Unit 5
IMQA Poster
IMQA PosterIMQA Poster
IMQA Poster
Vignesh Kannan
 
CLUSTERED PEER-TO-PEER COMMUNICATION SYSTEM FOR MULTIPLAYER ONLINE GAMES
CLUSTERED PEER-TO-PEER COMMUNICATION SYSTEM FOR MULTIPLAYER ONLINE GAMES CLUSTERED PEER-TO-PEER COMMUNICATION SYSTEM FOR MULTIPLAYER ONLINE GAMES
CLUSTERED PEER-TO-PEER COMMUNICATION SYSTEM FOR MULTIPLAYER ONLINE GAMES
Yomna Mahmoud Ibrahim Hassan
 
Slot Yield Presentation 2015
Slot Yield Presentation 2015Slot Yield Presentation 2015
Slot Yield Presentation 2015
richlehman
 
DS_Report
DS_ReportDS_Report
DS_Report
Pablo Panero
 
Hardware devices
Hardware devicesHardware devices
Hardware devices
Breach_P
 
98 374 Lesson 06-slides
98 374 Lesson 06-slides98 374 Lesson 06-slides
98 374 Lesson 06-slides
Tracie King
 
Topic 12
Topic 12Topic 12
Topic 12
thomasmcd6
 
Architectural Analysis of Game Machines
Architectural Analysis of Game MachinesArchitectural Analysis of Game Machines
Architectural Analysis of Game Machines
Praveen AP
 

Similar to Hearthstone helper using optical character recognition techniques for cards detection (20)

Beginners guide to khepera robot soccer
Beginners guide to khepera robot soccerBeginners guide to khepera robot soccer
Beginners guide to khepera robot soccer
 
Multiplayer Networking Game
Multiplayer Networking GameMultiplayer Networking Game
Multiplayer Networking Game
 
Computer system Hardware components.pptx
Computer system Hardware components.pptxComputer system Hardware components.pptx
Computer system Hardware components.pptx
 
Computer system Hardware components.pptx
Computer system Hardware components.pptxComputer system Hardware components.pptx
Computer system Hardware components.pptx
 
Dedicated Game Servers
Dedicated Game ServersDedicated Game Servers
Dedicated Game Servers
 
98 374 Lesson 02-slides
98 374 Lesson 02-slides98 374 Lesson 02-slides
98 374 Lesson 02-slides
 
C PROGRAM CODE FOR SNAKE AND LADDER GAME
C PROGRAM CODE FOR SNAKE AND LADDER GAMEC PROGRAM CODE FOR SNAKE AND LADDER GAME
C PROGRAM CODE FOR SNAKE AND LADDER GAME
 
Next generation mobile gp us and rendering techniques - niklas smedberg
Next generation mobile gp us and rendering techniques - niklas smedbergNext generation mobile gp us and rendering techniques - niklas smedberg
Next generation mobile gp us and rendering techniques - niklas smedberg
 
98 374 Lesson 04-slides
98 374 Lesson 04-slides98 374 Lesson 04-slides
98 374 Lesson 04-slides
 
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
Developing and optimizing a procedural game: The Elder Scrolls Blades- Unite ...
 
EE4214+Real+Time+Embedded+System
EE4214+Real+Time+Embedded+SystemEE4214+Real+Time+Embedded+System
EE4214+Real+Time+Embedded+System
 
Unit 5
Unit 5Unit 5
Unit 5
 
IMQA Poster
IMQA PosterIMQA Poster
IMQA Poster
 
CLUSTERED PEER-TO-PEER COMMUNICATION SYSTEM FOR MULTIPLAYER ONLINE GAMES
CLUSTERED PEER-TO-PEER COMMUNICATION SYSTEM FOR MULTIPLAYER ONLINE GAMES CLUSTERED PEER-TO-PEER COMMUNICATION SYSTEM FOR MULTIPLAYER ONLINE GAMES
CLUSTERED PEER-TO-PEER COMMUNICATION SYSTEM FOR MULTIPLAYER ONLINE GAMES
 
Slot Yield Presentation 2015
Slot Yield Presentation 2015Slot Yield Presentation 2015
Slot Yield Presentation 2015
 
DS_Report
DS_ReportDS_Report
DS_Report
 
Hardware devices
Hardware devicesHardware devices
Hardware devices
 
98 374 Lesson 06-slides
98 374 Lesson 06-slides98 374 Lesson 06-slides
98 374 Lesson 06-slides
 
Topic 12
Topic 12Topic 12
Topic 12
 
Architectural Analysis of Game Machines
Architectural Analysis of Game MachinesArchitectural Analysis of Game Machines
Architectural Analysis of Game Machines
 

More from University Politehnica Bucharest

PhD Thesis - Influence of Repetitions on Discourse and Semantic Analysis
PhD Thesis - Influence of Repetitions on Discourse and Semantic AnalysisPhD Thesis - Influence of Repetitions on Discourse and Semantic Analysis
PhD Thesis - Influence of Repetitions on Discourse and Semantic Analysis
University Politehnica Bucharest
 
Time series analysis for sales prediction
Time series analysis for sales predictionTime series analysis for sales prediction
Time series analysis for sales prediction
University Politehnica Bucharest
 
Identification and Classification of the Most Important Moments in Students’ ...
Identification and Classification of the Most Important Moments in Students’ ...Identification and Classification of the Most Important Moments in Students’ ...
Identification and Classification of the Most Important Moments in Students’ ...
University Politehnica Bucharest
 
Digital Services Development Using Statistics Tools to Emphasize Pollution Ph...
Digital Services Development Using Statistics Tools to Emphasize Pollution Ph...Digital Services Development Using Statistics Tools to Emphasize Pollution Ph...
Digital Services Development Using Statistics Tools to Emphasize Pollution Ph...
University Politehnica Bucharest
 
Identifying cyclic words with the help of google
Identifying cyclic words with the help of googleIdentifying cyclic words with the help of google
Identifying cyclic words with the help of google
University Politehnica Bucharest
 
Expression of Political Opinions in Press
Expression of Political Opinions in PressExpression of Political Opinions in Press
Expression of Political Opinions in Press
University Politehnica Bucharest
 
Determine the time period when a text was written using time series analysis
Determine the time period when a text was written using time series analysisDetermine the time period when a text was written using time series analysis
Determine the time period when a text was written using time series analysis
University Politehnica Bucharest
 
Using machine learning to generate predictions based on the information extra...
Using machine learning to generate predictions based on the information extra...Using machine learning to generate predictions based on the information extra...
Using machine learning to generate predictions based on the information extra...
University Politehnica Bucharest
 
Movie recommender system using the user's psychological profile
Movie recommender system using the user's psychological profileMovie recommender system using the user's psychological profile
Movie recommender system using the user's psychological profile
University Politehnica Bucharest
 
Tracing the paths between concepts in large bio medical corpora
Tracing the paths between concepts in large bio medical corporaTracing the paths between concepts in large bio medical corpora
Tracing the paths between concepts in large bio medical corpora
University Politehnica Bucharest
 
The collection and analysis of public data - Bucharest case study
The collection and analysis of public data - Bucharest case studyThe collection and analysis of public data - Bucharest case study
The collection and analysis of public data - Bucharest case study
University Politehnica Bucharest
 
Archaisms and neologisms identification in texts
Archaisms and neologisms identification in textsArchaisms and neologisms identification in texts
Archaisms and neologisms identification in texts
University Politehnica Bucharest
 
Unsupervised system for automatic grading of bachelor and master thesis
Unsupervised system for automatic grading of bachelor and master thesisUnsupervised system for automatic grading of bachelor and master thesis
Unsupervised system for automatic grading of bachelor and master thesis
University Politehnica Bucharest
 
Tweets topic modelling across different countries prezentarea
Tweets topic modelling across different countries   prezentareaTweets topic modelling across different countries   prezentarea
Tweets topic modelling across different countries prezentarea
University Politehnica Bucharest
 
Sentiment based text segmentation
Sentiment based text segmentationSentiment based text segmentation
Sentiment based text segmentation
University Politehnica Bucharest
 
Creativity detection in texts
Creativity detection in textsCreativity detection in texts
Creativity detection in texts
University Politehnica Bucharest
 
Nlp based heuristics for assessing participants in cscl chats
Nlp based heuristics for assessing participants in cscl chatsNlp based heuristics for assessing participants in cscl chats
Nlp based heuristics for assessing participants in cscl chats
University Politehnica Bucharest
 
Detecting discourse creativity in chat conversations
Detecting discourse creativity in chat conversationsDetecting discourse creativity in chat conversations
Detecting discourse creativity in chat conversations
University Politehnica Bucharest
 
Metaphor detection
Metaphor detectionMetaphor detection
2012 Presidential Elections on Twitter - An Analysis of How the US and French...
2012 Presidential Elections on Twitter - An Analysis of How the US and French...2012 Presidential Elections on Twitter - An Analysis of How the US and French...
2012 Presidential Elections on Twitter - An Analysis of How the US and French...
University Politehnica Bucharest
 

More from University Politehnica Bucharest (20)

PhD Thesis - Influence of Repetitions on Discourse and Semantic Analysis
PhD Thesis - Influence of Repetitions on Discourse and Semantic AnalysisPhD Thesis - Influence of Repetitions on Discourse and Semantic Analysis
PhD Thesis - Influence of Repetitions on Discourse and Semantic Analysis
 
Time series analysis for sales prediction
Time series analysis for sales predictionTime series analysis for sales prediction
Time series analysis for sales prediction
 
Identification and Classification of the Most Important Moments in Students’ ...
Identification and Classification of the Most Important Moments in Students’ ...Identification and Classification of the Most Important Moments in Students’ ...
Identification and Classification of the Most Important Moments in Students’ ...
 
Digital Services Development Using Statistics Tools to Emphasize Pollution Ph...
Digital Services Development Using Statistics Tools to Emphasize Pollution Ph...Digital Services Development Using Statistics Tools to Emphasize Pollution Ph...
Digital Services Development Using Statistics Tools to Emphasize Pollution Ph...
 
Identifying cyclic words with the help of google
Identifying cyclic words with the help of googleIdentifying cyclic words with the help of google
Identifying cyclic words with the help of google
 
Expression of Political Opinions in Press
Expression of Political Opinions in PressExpression of Political Opinions in Press
Expression of Political Opinions in Press
 
Determine the time period when a text was written using time series analysis
Determine the time period when a text was written using time series analysisDetermine the time period when a text was written using time series analysis
Determine the time period when a text was written using time series analysis
 
Using machine learning to generate predictions based on the information extra...
Using machine learning to generate predictions based on the information extra...Using machine learning to generate predictions based on the information extra...
Using machine learning to generate predictions based on the information extra...
 
Movie recommender system using the user's psychological profile
Movie recommender system using the user's psychological profileMovie recommender system using the user's psychological profile
Movie recommender system using the user's psychological profile
 
Tracing the paths between concepts in large bio medical corpora
Tracing the paths between concepts in large bio medical corporaTracing the paths between concepts in large bio medical corpora
Tracing the paths between concepts in large bio medical corpora
 
The collection and analysis of public data - Bucharest case study
The collection and analysis of public data - Bucharest case studyThe collection and analysis of public data - Bucharest case study
The collection and analysis of public data - Bucharest case study
 
Archaisms and neologisms identification in texts
Archaisms and neologisms identification in textsArchaisms and neologisms identification in texts
Archaisms and neologisms identification in texts
 
Unsupervised system for automatic grading of bachelor and master thesis
Unsupervised system for automatic grading of bachelor and master thesisUnsupervised system for automatic grading of bachelor and master thesis
Unsupervised system for automatic grading of bachelor and master thesis
 
Tweets topic modelling across different countries prezentarea
Tweets topic modelling across different countries   prezentareaTweets topic modelling across different countries   prezentarea
Tweets topic modelling across different countries prezentarea
 
Sentiment based text segmentation
Sentiment based text segmentationSentiment based text segmentation
Sentiment based text segmentation
 
Creativity detection in texts
Creativity detection in textsCreativity detection in texts
Creativity detection in texts
 
Nlp based heuristics for assessing participants in cscl chats
Nlp based heuristics for assessing participants in cscl chatsNlp based heuristics for assessing participants in cscl chats
Nlp based heuristics for assessing participants in cscl chats
 
Detecting discourse creativity in chat conversations
Detecting discourse creativity in chat conversationsDetecting discourse creativity in chat conversations
Detecting discourse creativity in chat conversations
 
Metaphor detection
Metaphor detectionMetaphor detection
Metaphor detection
 
2012 Presidential Elections on Twitter - An Analysis of How the US and French...
2012 Presidential Elections on Twitter - An Analysis of How the US and French...2012 Presidential Elections on Twitter - An Analysis of How the US and French...
2012 Presidential Elections on Twitter - An Analysis of How the US and French...
 

Recently uploaded

3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
David Osipyan
 
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Leonel Morgado
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
HongcNguyn6
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
kejapriya1
 
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
Abdul Wali Khan University Mardan,kP,Pakistan
 
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxThe use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
MAGOTI ERNEST
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
KrushnaDarade1
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
RitabrataSarkar3
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
Sérgio Sacani
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
Anagha Prasad
 
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
AbdullaAlAsif1
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
yqqaatn0
 
Thornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdfThornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdf
European Sustainable Phosphorus Platform
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
İsa Badur
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
vluwdy49
 
Shallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptxShallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptx
Gokturk Mehmet Dilci
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
Vandana Devesh Sharma
 
Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.
Aditi Bajpai
 
Cytokines and their role in immune regulation.pptx
Cytokines and their role in immune regulation.pptxCytokines and their role in immune regulation.pptx
Cytokines and their role in immune regulation.pptx
Hitesh Sikarwar
 

Recently uploaded (20)

3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
 
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
 
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
 
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxThe use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
 
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
 
Thornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdfThornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdf
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
 
Shallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptxShallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptx
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
 
Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.
 
Cytokines and their role in immune regulation.pptx
Cytokines and their role in immune regulation.pptxCytokines and their role in immune regulation.pptx
Cytokines and their role in immune regulation.pptx
 

Hearthstone helper using optical character recognition techniques for cards detection

  • 1. Autor Conducător științific Universitatea Politehnica București Facultatea de Automatică și Calculatoare Catedra de Calculatoare Hearthstone Helper - Using Optical Character Recognition Techniques For Cards Detection Costin-Gabriel CHIRU, Florin Oprea costin.chiru@cs.pub.ro
  • 2. Introduction • Purpose: capture, process and analyze images from the video stream of the Hearthstone game in order to obtain relevant information on the conduct of parties in this game • Constraint: results should be offered in real- time on a regular computer / tablet • Methodology: apply different techniques for extracting information from the images and then use this information to identify and log the cards that have been played. 09.09.2016 AIMSA 2016 1
  • 3. Heartstone (Heroes of Warcraft) • Free-to-play online game developed by Blizzard (2014) • Turn-based game involving 2 players in a 1vs1 match • Each player has his/her own deck of cards with 30 cards • Each player start with 30 life points and the purpose of the game is to play their cards so that to destroy the opponent before they are themselves defeated • The game features between 814 and 1003 different cards used to cast spells, summon minions to help in the battle or equip weapons – They are classified in 5 categories based on their rarity and usefulness and in 10 different classes according to their availability to all the heroes, or to a specific one. 09.09.2016 AIMSA 2016 2
  • 4. Application Usefulness • By monitoring the game, the application is able to memorize the cards that have been played and thus: – the player knows what remaining cards he/she has and can compute the likelihood of extracting a particular card – he/she knows which cards will no longer be available in the opponent deck (the decks may contain at most two cards of the same type, or only one if it is a legendary card) – the player can predict the most probable deck of the opponent based on the cards played so far, previous history, opponent's rating, game style and current meta-game. 09.09.2016 AIMSA 2016 3
  • 5. Theoretical Background (1) • To determine real time in-game events, methods that are fast, efficient and accurate are needed both for image capturing and for cards recognition. • Image capturing: acquire sufficient game snapshots per seconds to detect changes – Using API provided by Windows that allows direct access to the opened windows from the operating system – up to 15 frames per second without overwhelming the CPU 09.09.2016 AIMSA 2016 4
  • 6. Theoretical Background (2) • Cards recognition: needed to – detect when a new card appeared (to avoid continuous processing of video stream) • Using Background Subtraction – recognize different pictures based on the elements from them. Can be done by: • comparing their histograms (colors distribution) • key points matching: choose specific points of interest and then find the association between them. • using key points in combination with decision trees (to accelerate the execution) • using perceptual hashes • using OCR on the text appearing in the pictures and comparing the text 09.09.2016 AIMSA 2016 5
  • 7. Implementation Details (1) • First of all, the Windows API was used to extract the snapshots  extract information from the snapshots • Resolution might be large involving a large processing time  only analyze specific regions in the images to determine the start and end of a game (analyzed areas are about 10 times smaller than the original image) • Next step: identify the moments of time when these areas contain images of cards using Background Subtraction and analyze the frames sufficiently highlighted 09.09.2016 AIMSA 2016 6
  • 9. Implementation Details (3) • Next, we investigated the methods for image recognition: – Histograms: bad results due to the fact that all the images were created from the same template – Key points matching - invariant to rotation, scaling or brightness: SURF (Speeded up robust features) and SIFT (Scale-invariant feature transform) in combination with Flann (Fast Library for approximate nearest neighbor) for matching the key points • Can be done offline for the cards from the DB, but the matching algorithm might take minutes (~ 1000 cards * tenths of a second for each card)  can’t be used for real- time recognition • For heroes recognition, SURF and Flann takes ~ 3 seconds (only 9 possible heroes)  acceptable for this part  used 09.09.2016 AIMSA 2016 8
  • 11. Implementation Details (5) – Apply OCR techniques: used Tesseract and specified specific text areas that help determining the playing card (the card name and its attributes - cost, attack and life points) • Binarized the picture  better results for OCR and smaller execution times • Wavy text  problems for the recognition engine  had to post-process the OCR output: – compute the Levenshtein distance between the obtained text and the cards name and – use the attribute values returned by the OCR to filter out cards • Very fast: took between 0.1 and 1.5 s • Using OCR, the whole process (from capturing the window image to the card classification) < 2 s 09.09.2016 AIMSA 2016 10
  • 12. Application Output • The GUI is to inform the player about relevant changes in the application: – the status of the application, – the cards that have been played, – the remaining cards 09.09.2016 AIMSA 2016 10 • The information is updated in real-time as the cards are played
  • 13. Cards Identification (1) • Stormwind Knight: – Cards from the DB with their scores: • "Silver Hand Knight": 2, • "Stormwind Knight": 10, • "Blood Knight": 10 • "The Black Knight": 2 – Use Levenshtein Distance: • "Stormwind Knight": 9, 11, 11, 4, 8, 5 • "Blood Knight": 11, 12, 15, 8, 12, 10 – and cards’ attributes • "Stormwind Knight": 4, 2, 5 • "Blood Knight": 3, 3, 3 • The card is correctly identified 09.09.2016 AIMSA 2016 12
  • 14. • Kor'kron Elite : – Do not contain any words from the DB: – Use cards’ attributes (4, 4, 3): • "Kor’kron Elite" • "Houndmaster” • "Spellbreaker” – And then Levenshtein Distance: • "Kor’kron Elite": 4, 6, 2, 5, 3, 4 • "Houndmaster": 11, 13, 11, 10, 11, 12 • "Spellbreaker": 12, 14, 13, 11, 12 • The card is correctly identified 09.09.2016 AIMSA 2016 12 Cards Identification (2)
  • 15. Runtime and Errors • Results obtained using an Intel(R) Core(TM) i7-4500U CPU @ 2.40 GHz • Time analysis: – Detection of a new game (SURF & FLANN): avg. 0.104s – of the heroes of the two players (SURF & FLANN): avg. 0.346s – Cards’ detection (OCR): • Accuracy: system average accuracy was 99.1%. – Errors due to partial occlusion of the card that needs to be detected. – GUI offers the possibility of manually correcting the errors. 09.09.2016 AIMSA 2016 12 Type of cards OCR attributes OCR names Total Cards extracted by the user 0.0146 0.7305 1.0159 Cards played by the opponent 0.0086 0.8234 0.9361 Type of cards Identified cards Errors Cards extracted by the user 209 1 Cards played by the opponent 227 3 Total 436 4
  • 16. Conclusions • We presented an application whose purpose was to monitor in-game events that occur in the Hearthstone game • Main requirement was to be quick enough to provide answers in real time • For the recognition of the analyzed images, we have tried two categories of methods: – One based on the picture recognition: using histograms or using algorithms for key point matching  time consuming – one based on OCR use only the text from the pictures  fast and accurate • The application helps players in making the right decisions or in taking calculated risks, thus improving their performance and gaming experience 09.09.2016 AIMSA 2016 12
  • 17. Questions 09.09.2016 AIMSA 2016 12 Thank you very much!

Editor's Notes

  1. overloads
  2. Cards containing words: 1 p / contained word 5p / contained word in position
  3. \