-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
cv::distanceTransform() fail on a large image #12218
Copy link
Copy link
Closed
Labels
Description
- OpenCV => 3.4.2
- Operating System / Platform => Ubuntu 18.04
- Compiler => gcc 8
Run
int main() {
cv::Mat non_valid = cv::imread("surfaces_nonvalid.tif", cv::IMREAD_ANYDEPTH);
cv::Mat dst;
cv::Mat labels;
cv::distanceTransform(non_valid, dst, labels, cv::DIST_L2, cv::DIST_MASK_3,
cv::DIST_LABEL_PIXEL);
std::cout << labels.at<int>(0, 0) << std::endl; // <-- Error here: 0
std::cout << labels.at<int>(50, 50) << std::endl; // <-- Error here: 0
std::cout << labels.at<int>(5000, 5000) << std::endl; // Looks reasonable
return 0;
}
on non_valid image from surfaces_nonvalid.zip. The labels output has a lot of erroneous zero label values on the left part of the output as seen on this screenshot (left image: input non_valid image, right image: output labels image. black pixels = 0):

Reactions are currently unavailable