add 200 frames.

This commit is contained in:
Jordan
2024-03-27 11:05:48 -07:00
parent 3022adcbb7
commit 301fc2ca75
202 changed files with 86 additions and 46 deletions

View File

@ -1,5 +1,7 @@
#include "frame.h"
#include <iostream>
#include <stdexcept>
#include <stdlib.h>
FILE *make_buffer(const uint8_t *data, const size_t data_len)
{
@ -105,6 +107,13 @@ DartOpenMvg::Frames::Frames(openMVG::sfm::Bundle_Adjustment_Ceres::BA_Ceres_opti
mAdjustment = openMVG::sfm::Bundle_Adjustment_Ceres(options);
}
void DartOpenMvg::Frames::add_frame(FILE *handle, int w, int h, int depth) {
CFrame *f = new_frame_from_handle(handle, w, h, depth);
mFrames.push_back(
Frame(f)
);
}
void DartOpenMvg::Frames::computeMatches()
{
#ifdef OPENMVG_USE_OPENMP
@ -123,6 +132,15 @@ void DartOpenMvg::Frames::computeMatches()
const Frame &frame2 = mFrames[i+1];
auto *regions1 = frame1.mRegions.get();
auto *regions2 = frame2.mRegions.get();
if (!regions1) {
std::string msg = std::string("Did you remember to calculate regions for frame ") + std::to_string(i) + "?";
throw std::out_of_range(msg);
}
regions1->Load();
std::cerr << "Loading " << std::to_string(regions1->RegionCount()) << " regions" << endl;
auto is_binary = regions1->IsBinary();
// Initialize the matching interface
const std::unique_ptr<openMVG::matching::RegionsMatcher> matcher =