Fixed an opencv2 compatibility issue.