Morphological Reconstruction in OpenCV

后端 未结 2 1290
没有蜡笔的小新
没有蜡笔的小新 2021-01-20 03:11

When processing an image with text in OpenCV, my opening operation does not result in proper output data. The issue is quite similar to the one described in this article: ht

2条回答
  •  粉色の甜心
    2021-01-20 03:43

    This answer arrives late, but here is the basic algorithm for under-reconstruction:

    1. Inputs are two images: ImReference and ImMarker, with marker <= reference
    2. Intermediate image: ImRec
    3. Output image: ImResult
    4. Copy ImMarker into ImRec
    5. copy ImRec into ImResult
    6. ImDilated = Dilation(ImResult)
    7. ImRec = Minimum(ImDilated, ImReference)
    8. If ImRec != ImResult then return to step 5.

    It's not the most optimal algorithm, but it uses only basic operations.

提交回复
热议问题