MRPT / mrpt

:zap: The Mobile Robot Programming Toolkit (MRPT)
https://docs.mrpt.org/reference/latest/
BSD 3-Clause "New" or "Revised" License
1.93k stars 630 forks source link

CImage: Fix joinImagesHorz through exception #1160

Closed anhtuk54 closed 3 years ago

anhtuk54 commented 3 years ago

1) With empty image an exception will be through, eg: CDisplayWindow::showImagesAndMatchedPoints -> CImage::joinImagesHorz -> CImage::getChannelCount -> CImage::makeSureImageIsLoaded Run into "else if (!allowNonInitialized)" case and through exception. 2) After resize, ano ther cv::Mat is created and assign to m_impl->img. Therefore "img" will not point to correct current cv::Mat anymore.

This commit fixes these issue and makes CDisplayWindow::showImagesAndMatchedPoints works normally as expected.

codecov[bot] commented 3 years ago

Codecov Report

Merging #1160 (be2f543) into develop (f521664) will not change coverage. The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1160   +/-   ##
========================================
  Coverage    37.99%   37.99%           
========================================
  Files         1211     1211           
  Lines       106387   106387           
========================================
  Hits         40425    40425           
  Misses       65962    65962           
Impacted Files Coverage Δ
libs/img/src/CImage.cpp 49.07% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f521664...be2f543. Read the comment docs.

jlblancoc commented 3 years ago

LGTM, thanks! :+1: