Программы на C++. Форум разработчиков
Anonymous
Проблема с указателем изображения за пределами границ
Сообщение
Anonymous » 22 ноя 2025, 15:49
Я столкнулся с некоторыми проблемами при ручном воспроизведении кода FAST-LIVO2.
Исходный код выглядит следующим образом:
Код: Выделить всё
void VIOManager::updateState(cv::Mat img, int level)
{
if (total_points == 0) return;
StatesGroup old_state = (*state);
VectorXd z;
MatrixXd H_sub;
bool EKF_end = false;
float last_error = std::numeric_limits::max();
const int H_DIM = total_points * patch_size_total;
z.resize(H_DIM);
z.setZero();
H_sub.resize(H_DIM, 7);
H_sub.setZero();
for (int iteration = 0; iteration < max_iterations; iteration++)
{
double t1 = omp_get_wtime();
M3D Rwi(state->rot_end);
V3D Pwi(state->pos_end);
Rcw = Rci * Rwi.transpose();
Pcw = -Rci * Rwi.transpose() * Pwi + Pci;
Jdp_dt = Rci * Rwi.transpose();
float error = 0.0;
int n_meas = 0;
// int max_threads = omp_get_max_threads();
// int desired_threads = std::min(max_threads, total_points);
// omp_set_num_threads(desired_threads);
// std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79827317/image-pointer-out-of-bounds-issue[/url]
1763815741
Anonymous
Я столкнулся с некоторыми проблемами при ручном воспроизведении кода FAST-LIVO2. Исходный код выглядит следующим образом: [code]void VIOManager::updateState(cv::Mat img, int level) { if (total_points == 0) return; StatesGroup old_state = (*state); VectorXd z; MatrixXd H_sub; bool EKF_end = false; float last_error = std::numeric_limits::max(); const int H_DIM = total_points * patch_size_total; z.resize(H_DIM); z.setZero(); H_sub.resize(H_DIM, 7); H_sub.setZero(); for (int iteration = 0; iteration < max_iterations; iteration++) { double t1 = omp_get_wtime(); M3D Rwi(state->rot_end); V3D Pwi(state->pos_end); Rcw = Rci * Rwi.transpose(); Pcw = -Rci * Rwi.transpose() * Pwi + Pci; Jdp_dt = Rci * Rwi.transpose(); float error = 0.0; int n_meas = 0; // int max_threads = omp_get_max_threads(); // int desired_threads = std::min(max_threads, total_points); // omp_set_num_threads(desired_threads); // std::cout Подробнее здесь: [url]https://stackoverflow.com/questions/79827317/image-pointer-out-of-bounds-issue[/url]