scraping_10_as_ten - OpenHoldem/openholdembot GitHub Wiki
When it comes to text-scraping cards most things work intuitively the natural way:
-
we select a region that shows the rank of the card
-
we select a transformation (here text3, but it might also be a hash or an image if there is no fuzzyness)
-
we select a foreground-colour with the colour-picker and define a reasonable colour-tolerance.Sometimes we take the background-colour and a negative radius if we want to accept everything except the background. This is especially useful for blinking fonts on a non-blinking background. The colour-tolerance, called βradiusβ, has to be in the range [0..255=0xff], where 0 requires exact identity and 255 accepts everything. (You might notice the radius of 225 below, which is near the upper end of the range. This is because the probably inexperienced creator of this tablemap chose a bad foreground-colour (the dirty red (d2, 2a, 03) at the bottom left of β1β) but he wanted to accept black (0, 0, 0) which differs significantly. This only works because the small blue component (02) of his chosen foreground-colour differs from the white background colour (ff, ff, ff) by more than 225 (0xff = 255)). Usually a radius of 10 or 20 is perfect to accept a slightly fuzzy fore-ground-colour perfectly.
-
if the rank of the card does not get recognized we create a new font.
And thatβs it!

But what about the topic of this chapter? What is so special about scraping the ten?
Well β nothing β except that some people try to create fonts for both β1β and β0β, but the scraper expects a single character for a card rank: β2β...β9β for the cards of lower value, βJβ, βQβ, βKβ and βAβ for the face-cards and βTβ for βtenβ. Thatβs the whole βdifficultyβ here. As you can see in the picture above we did it right, scraping the rank of ten as βTβ. In the picture below we do the same work, but there we scrape rank and suit together as βp4cardface0β and the result is βThβ.
