Updated to use cv::findNonZero function