تابع مستقیم سراغ ندارم ولی از طریق cv::findNonZero که در این مثال هم توضیح داده شده این کار قابل انجامه.
cv::Mat binaryImage; vector<Point> locations; cv::findNonZero(binaryImage, locations); cv::Range r(locations.front().y,locations.back().y);