Square detection in image

后端 未结 2 1832
-上瘾入骨i
-上瘾入骨i 2021-02-13 15:31

I am trying to detect all the squared shaped dice images so that i can crop them individually and use that for OCR. Below is the Original image:

Here is the co

2条回答
  •  你的背包
    2021-02-13 15:45

    That extra piece of information is absolutely golden. Yes, given the 5x5 matrix of dice, you can nail the positions quite well. The dice you can identify give you the center, size, and orientation of the dice. Simply continue those patterns along both axes. For your second pass, increase the contrast in each "region of interest" where you expect to find the edge of a douse (never say die!). You know within a few pixels where the edges will be: simply attenuate the image until you identify those edges.

提交回复
热议问题