mpatacchiola/deepgaze

A bit issue that i fixed for you use in opencv v3

Angeloabrita opened this issue · 1 comments

[Erro] = comparison = cv2.compareHist(hist_1, hist_2, cv2.cv.HISTCMP_INTERSECT)
AttributeError: module 'cv2.cv2' has no attribute 'cv'

I changed the Color_classification.py line 123 - 129

from:

comparison = cv2.compareHist(hist_1, hist_2, cv2.cv.HISTCMP_INTERSECT)
          elif(method=="correlation"):
              comparison = cv2.compareHist(hist_1, hist_2, cv2.cv.CV_COMP_CORREL)
          elif(method=="chisqr"):
              comparison = cv2.compareHist(hist_1, hist_2, cv2.cv.CV_COMP_CHISQR)
          elif(method=="bhattacharyya"):
              comparison = cv2.compareHist(hist_1, hist_2, cv2.cv.CV_COMP_BHATTACHARYYA)

To:

comparison = cv2.compareHist(hist_1, hist_2, cv2.HISTCMP_INTERSECT)
          elif(method=="correlation"):
              comparison = cv2.compareHist(hist_1, hist_2, cv2.HISTCMP_CORREL)
          elif(method=="chisqr"):
              comparison = cv2.compareHist(hist_1, hist_2, cv2.HISTCMP_CHISQR)
          elif(method=="bhattacharyya"):
              comparison = cv2.compareHist(hist_1, hist_2, cv2.HISTCMP_BHATTACHARYYA)

Now it work for me.

Hi @Angeloabrita thank you for pointing this out. Are you using the branch master or the branch 2.0 of the repository? This issue should have been fixed on branch 2.0 (which is compatible with OpenCV 3).