cheind / inpaint

:pencil2: Inpaint is a C++ library providing image inpainting algorithms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crash in TemplateMatchCandidates::findCandidates

stiv-yakovenko opened this issue · comments

I observe crash on this assert:

    CV_Assert(
        templ.type() == CV_MAKETYPE(CV_8U, _integrals.size()) &&
        templ.size() == _templateSize && 
        (templMask.empty() || templMask.size() == _templateSize));

the problem is that templ.size() == _templateSize is FALSE. This is because _templateSize=[19,19] and templ is just [9,9]. Templ is [9,9] since centeredPatch returns half size of patch (because targetPatchLocation=(0,0) so it had to cut patch in half).

This happens if inpaint area is rectangle of 19x19 pixel larger then patchsize=17, and is located near left corner of the picture. Doesn't happen each time, but from time to time.