Changed the .at<> operator to ->at<> operator, since distributions is a pointer to a Mat and not a Mat element itself.