How to recognize histograms with a specific shape in opencv / python

前端 未结 2 598
星月不相逢
星月不相逢 2021-02-04 18:20

I want to segment images (from magazines) in text and image parts. I have several histograms for several ROIs in my picture. I use opencv with python (cv2).

I want to re

2条回答
  •  一个人的身影
    2021-02-04 18:57

    You can use a simple correlation metric.

    • make sure that the histogram you compute and your reference are normalized (ie represent probapilities)

    • for each histogram compute (given that myRef and myHist are numpy arrays):

      metric = (myRef * myHist).sum()

    • this metric is a measure of how much the histogram looks like your reference.

提交回复
热议问题