Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash with zero map size #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ysolovyov
Copy link

@ysolovyov ysolovyov commented Aug 15, 2018

This is workaround for crash caused by _tmpl_sz.width or _tmpl_sz.height be equal to 2*cell_size. Later in getFeatureMaps(&z_ipl, cell_size, &map) dimensions of the CvLSVMFeatureMapCaskade *map will be set to [_tmpl_sz.width / cell_size, _tmpl_sz.height / cell_size] and in normalizeAndTruncate(map, 0.2f) they will be changed to map.sizeX -= 2 and map.sizeY -= 2, so if, for example, _tmpl_sz.height == 2*cell_size then final map dimension will be map.sizeY == 0, that does not make sense and there will be crash in createHanningMats() during multiplacation of two matrixes.

Actual assert in OpenCV

OpenCV Error: Assertion failed (type == (((6) & ((1 << 3) - 1)) + (((2)-1) << 3))) in gemmImpl, file /opencv/modules/core/src/matmul.cpp, line 1218

in

cv::Mat hann2d = hann2t * hann1t; because hann2t has size [1 x 0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant