mirror of
https://github.com/opencv/opencv.git
synced 2025-01-23 18:33:16 +08:00
ec97c38ff9
Handle huge images in IPP distanceTransform #24535 ### Pull Request Readiness Checklist * Do not use IPP for huge Mat (reproduced with https://github.com/opencv/opencv/issues/23895#issuecomment-1708132367 on `DIST_MASK_5`) I have observed two types of errors on the reproducer from the issue: 1. When `temp` is not allocated: ``` Thread 1 "app" received signal SIGSEGV, Segmentation fault. 0x00007ffff65dc755 in icv_l9_ownDistanceTransform_5x5_8u32f_C1R_21B_g9e9 () from /home/dkurtaev/opencv_install/bin/../lib/libopencv_imgproc.so.408 (gdb) bt #0 0x00007ffff65dc755 in icv_l9_ownDistanceTransform_5x5_8u32f_C1R_21B_g9e9 () from /home/dkurtaev/opencv_install/bin/../lib/libopencv_imgproc.so.408 #1 0x00007ffff659e8df in icv_l9_ippiDistanceTransform_5x5_8u32f_C1R () from /home/dkurtaev/opencv_install/bin/../lib/libopencv_imgproc.so.408 #2 0x00007ffff5c390f0 in cv::distanceTransform (_src=..., _dst=..., _labels=..., distType=2, maskSize=5, labelType=1) at /home/dkurtaev/opencv/modules/imgproc/src/distransform.cpp:854 #3 0x00007ffff5c396ef in cv::distanceTransform (_src=..., _dst=..., distanceType=2, maskSize=5, dstType=5) at /home/dkurtaev/opencv/modules/imgproc/src/distransform.cpp:903 #4 0x000055555555669e in main (argc=1, argv=0x7fffffffdef8) at /home/dkurtaev/main.cpp:18 ``` 2. When we keep `temp` allocated every time: ``` OpenCV(4.8.0-dev) Error: Assertion failed (udata < (uchar*)ptr && ((uchar*)ptr - udata) <= (ptrdiff_t)(sizeof(void*)+64)) in fastFree, file /home/dkurtaev/opencv/modules/core/src/alloc.cpp, line 191 terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.8.0-dev) /home/dkurtaev/opencv/modules/core/src/alloc.cpp:191: error: (-215:Assertion failed) udata < (uchar*)ptr && ((uchar*)ptr - udata) <= (ptrdiff_t)(sizeof(void*)+64) in function 'fastFree' ``` * Try enable IPP for 3x3 (see https://github.com/opencv/opencv/issues/15904) * Reduce memory footprint with IPP See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake |
||
---|---|---|
.. | ||
opencl | ||
_geom.h | ||
accum.cpp | ||
accum.dispatch.cpp | ||
accum.simd.hpp | ||
approx.cpp | ||
bilateral_filter.dispatch.cpp | ||
bilateral_filter.simd.hpp | ||
blend.cpp | ||
box_filter.dispatch.cpp | ||
box_filter.simd.hpp | ||
canny.cpp | ||
ccl_bolelli_forest_firstline.inc.hpp | ||
ccl_bolelli_forest_lastline.inc.hpp | ||
ccl_bolelli_forest_singleline.inc.hpp | ||
ccl_bolelli_forest.inc.hpp | ||
clahe.cpp | ||
color_hsv.dispatch.cpp | ||
color_hsv.simd.hpp | ||
color_lab.cpp | ||
color_rgb.dispatch.cpp | ||
color_rgb.simd.hpp | ||
color_yuv.dispatch.cpp | ||
color_yuv.simd.hpp | ||
color.cpp | ||
color.hpp | ||
color.simd_helpers.hpp | ||
colormap.cpp | ||
connectedcomponents.cpp | ||
contours.cpp | ||
convhull.cpp | ||
corner.avx.cpp | ||
corner.cpp | ||
corner.hpp | ||
cornersubpix.cpp | ||
demosaicing.cpp | ||
deriv.cpp | ||
distransform.cpp | ||
drawing.cpp | ||
emd.cpp | ||
featureselect.cpp | ||
filter.dispatch.cpp | ||
filter.hpp | ||
filter.simd.hpp | ||
filterengine.hpp | ||
fixedpoint.inl.hpp | ||
floodfill.cpp | ||
gabor.cpp | ||
generalized_hough.cpp | ||
geometry.cpp | ||
grabcut.cpp | ||
hal_replacement.hpp | ||
hershey_fonts.cpp | ||
histogram.cpp | ||
hough.cpp | ||
imgwarp.avx2.cpp | ||
imgwarp.cpp | ||
imgwarp.hpp | ||
imgwarp.lasx.cpp | ||
imgwarp.sse4_1.cpp | ||
intelligent_scissors.cpp | ||
intersection.cpp | ||
linefit.cpp | ||
lsd.cpp | ||
main.cpp | ||
matchcontours.cpp | ||
median_blur.dispatch.cpp | ||
median_blur.simd.hpp | ||
min_enclosing_triangle.cpp | ||
moments.cpp | ||
morph.dispatch.cpp | ||
morph.simd.hpp | ||
phasecorr.cpp | ||
precomp.hpp | ||
pyramids.cpp | ||
resize.avx2.cpp | ||
resize.cpp | ||
resize.hpp | ||
resize.lasx.cpp | ||
resize.sse4_1.cpp | ||
rotcalipers.cpp | ||
samplers.cpp | ||
segmentation.cpp | ||
shapedescr.cpp | ||
smooth.dispatch.cpp | ||
smooth.simd.hpp | ||
spatialgradient.cpp | ||
stackblur.cpp | ||
subdivision2d.cpp | ||
sumpixels.avx512_skx.hpp | ||
sumpixels.dispatch.cpp | ||
sumpixels.simd.hpp | ||
tables.cpp | ||
templmatch.cpp | ||
thresh.cpp | ||
utils.cpp |