error in calcHist