can compute matches! no errors! yay!

This commit is contained in:
Jordan 2024-04-05 11:04:28 -07:00
parent e1137844ac
commit b84d40fd14

View File

@ -125,13 +125,15 @@ void DartOpenMvg::Frames::computeMatches()
// image sequences (video frames), we'll stick to the sequence order. // image sequences (video frames), we'll stick to the sequence order.
for (size_t i = 0; i < mFrames.size() - 1; ++i) for (size_t i = 0; i < mFrames.size() - 1; ++i)
{ {
const Frame &frame1 = mFrames[i]; Frame &frame1 = mFrames[i];
const Frame &frame2 = mFrames[i + 1]; Frame &frame2 = mFrames[i + 1];
frame1.calculateFeatures();
frame2.calculateFeatures();
auto regions1 = frame1.mRegions.get(); auto regions1 = frame1.mRegions.get();
auto regions2 = frame2.mRegions.get(); auto regions2 = frame2.mRegions.get();
if (!regions1) if (!regions1)
{ {
std::string msg = std::string("Did you remember to calculate regions for frame ") + std::to_string(i) + "?"; std::string msg = std::string("No frame. Did you remember to calculate regions for frame ") + std::to_string(i) + "?";
throw std::out_of_range(msg); throw std::out_of_range(msg);
} }
@ -182,7 +184,7 @@ void DartOpenMvg::Frame::calculateFeatures()
using namespace openMVG::features; using namespace openMVG::features;
MvgOverride::AKAZE_OCV_Image_describer desc; MvgOverride::AKAZE_OCV_Image_describer desc;
auto im = imageFromFrame(cFrame); auto im = imageFromFrame(cFrame);
mRegions = std::make_shared<Regions>(std::move(desc.Describe(im))); mRegions = desc.Describe(im);
if (!mRegions.get()) { if (!mRegions.get()) {
throw std::range_error("Could not set regions member."); throw std::range_error("Could not set regions member.");