-
-
Notifications
You must be signed in to change notification settings - Fork 829
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
[depthMap] bug fix: use RAII instead of pointers #671
Conversation
In particular configurations (failed to find Tc cameras), sgmrc can stop early before allocating the _volumeBestIdVal, which is later used in refine step.
@@ -520,13 +519,13 @@ bool SemiGlobalMatchingRc::sgmrc(bool checkIfExists) | |||
|
|||
if(_sp->exportIntermediateResults) | |||
{ | |||
DepthSimMap* depthSimMapFinal = _sp->getDepthSimMapFromBestIdVal(_width, _height, _volumeBestIdVal, _scale, _step, _rc, zborder, _depths); | |||
DepthSimMap* depthSimMapFinal = _sp->getDepthSimMapFromBestIdVal(_width, _height, &_volumeBestIdVal, _scale, _step, _rc, zborder, _depths); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just asking, any chances that it returns a nullptr
? In case it would be better to deal with it. Also an assert(depthSimMapFinal)
would not kill anyone... ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function cannot return null.
The refactoring done here has been started for months now. It's quite close to be merged, but it will be done after the release.
So I would prefer to limit conflicts, as most of these things (like the bug fixed in this PR) are already fixed on the other side.
unsigned char* _volumeStepZPtr = _volumeStepZ->getDataWritable().data(); | ||
int* _volumeBestZPtr = _volumeBestZ->getDataWritable().data(); | ||
IdValue* volumeBestIdValPtr = volumeBestIdVal->getDataWritable().data(); | ||
IdValue* out_volumeBestIdValPtr = out_volumeBestIdVal.getDataWritable().data(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, I'd put an assert and if it is the case deal with the nullptr (but i don't know how the funciton works)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to be null here.
In particular configurations (failed to find Tc cameras),
sgmrc
can stop early before allocating the_volumeBestIdVal
, which is later used in the refine step.This bug fix in combination with #616 and #642, should fix the issues reported in alicevision/Meshroom#504, alicevision/Meshroom#481, alicevision/Meshroom#458, alicevision/Meshroom#431, alicevision/Meshroom#425.