Bug: xphoto::Inpaint crash without exception

asked 2018-02-14 03:33:06 -0500

laxn_pander gravatar image

updated 2018-02-14 03:37:43 -0500

Hey guys,

I compiled opencv with contrib module. It works well, however as soon as I try to use xphoto::Inpaint method the code crashes without an exception. Datatype of the mat is CV_64F. All inputs are correct.

Further informations: OpenCV 3.3.1 Linux 64 Bit Contrib 3.3.1 Compiler: GCC

Additionally I ran valgrind and here is the output. I have no experience with it so far, so I don't know if it helps.

==1554== Warning: set address range perms: large range [0x1000000000, 0x1500000000) (noaccess)

==1554== Warning: set address range perms: large range [0xb00000000, 0xd00000000) (noaccess)

==1554== Warning: noted but unhandled ioctl 0x42 with no size/direction hints.

==1554== This could cause spurious value errors to appear.

==1554== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.

==1554== Warning: noted but unhandled ioctl 0x22 with no size/direction hints.

==1554== This could cause spurious value errors to appear.

==1554== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper. Stage [densification]: Successfully densified frame!

==1554== Thread 6:

==1554== Use of uninitialised value of size 8

==1554== at 0x114FD0B5: void std::__introselect<__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator> >(__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator>) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)

==1554== by 0x114FE313: KDTree<float, 24="">::KDTree(cv::Mat const&, int, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)

==1554== by 0x114FFF0C: dominantTransforms(cv::Mat const&, std::vector<cv::point_<int>, std::allocator<cv::point_<int> > >&, int, int) [clone .constprop.560] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)

==1554== by 0x11502B56: void cv::xphoto::shiftMapInpaint<double, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int, int, cv::Point_<int>) [clone .constprop.553] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)

==1554== by 0x1150492A: void cv::xphoto::inpaint<char, 1u="">(cv::Mat const&, cv::Mat const&, cv::Mat&, int) [clone .part.457] (in /usr/local/lib/libopencv_xphoto.so.3.3.1)

==1554== by 0x1150D9F5: cv::xphoto::inpaint(cv::Mat const&, cv::Mat const&, cv::Mat&, int) (in /usr/local/lib/libopencv_xphoto.so.3.3.1)

==1554== by 0x7EE22E3: realm::stages::Densification::computeGuidanceDisparity(std::shared_ptr<realm::frame> const&) const (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)

==1554== by 0x7EE8DA5: realm::stages::Densification::process() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_stages.so)

==1554== by 0x87C0D47: realm::WorkerThreadBase::run() (in /home/lachs/Documents/Workspace/catkin_ws/masterarbeit/devel/lib/librealm_core.so)

==1554== by 0x6735C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)

==1554== by 0x93406B9: start_thread (pthread_create.c:333)

==1554== by 0x6D1C41C: clone (clone.S:109)

==1554==

==1554== Invalid read of size 4

==1554== at 0x114FD0A8: void std::__introselect<__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> > >, long, __gnu_cxx::__ops::_Iter_comp_iter<kdtree<float, 24="">::KDTreeComparator> >(__gnu_cxx::__normal_iterator<int*, std::vector<int,="" std::allocator<int=""> ... (more)

edit retag flag offensive close merge delete

Comments

can you try to reproduce the problem using the provided sample ?

berak gravatar imageberak ( 2018-02-14 03:41:10 -0500 )edit

Sorry, didn't see your answer. Installed opencv 3.4 and it works now. I think it stills bugs, when the images are too small (had some thumbnails with 50x30 that caused crashes). And it also seems to be, that the mask must be inverted (areas which are to be inpainted should be set zero). But I am on a good way now, thanks! If i find the time I will try to reproduce with thumbnails!

laxn_pander gravatar imagelaxn_pander ( 2018-02-15 09:50:14 -0500 )edit