Skip to content

Commit

Permalink
fix crash from issue
Browse files Browse the repository at this point in the history
  • Loading branch information
darglein committed Jan 4, 2022
1 parent fbb17d8 commit 1b20452
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/apps/adop_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,20 @@ void ADOPViewer::Recording(ImageInfo& fd)

if (record_neural)
{
SAIGA_ASSERT(neural_renderer);
auto frame = neural_renderer->DownloadRender();
frame.save(out_dir + "/neural/" + frame_name);
}
if (record_debug)
{
SAIGA_ASSERT(neural_renderer);
auto frame = neural_renderer->DownloadColor();
frame.save(out_dir + "/debug/" + frame_name);
}

if (record_gt)
{
SAIGA_ASSERT(neural_renderer);
TemplatedImage<ucvec4> frame = neural_renderer->DownloadGt();

if (downscale_gt)
Expand Down Expand Up @@ -512,6 +515,7 @@ void ADOPViewer::Recording(ImageInfo& fd)

if (!is_recording && ImGui::Button("start recording"))
{
SAIGA_ASSERT(neural_renderer);
neural_renderer->current_best_gt = -1;
is_recording = true;
traj = camera_spline.Trajectory();
Expand Down
3 changes: 1 addition & 2 deletions src/apps/colmap2adop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ std::vector<float> ExposureValuesFromImages(std::vector<std::string> files, std:
else
{
double EV_log2 =
log2((info.FNumber * info.FNumber) / info.ExposureTime) + log2(info.ISOSpeedRatings / 100.0);
log2((info.FNumber * info.FNumber) / info.ExposureTime) + log2(info.ISOSpeedRatings / 100.0) - info.ExposureBiasValue;
exposures.push_back(EV_log2);
SAIGA_ASSERT(info.ExposureBiasValue == 0);
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/lib/opengl/RealTimeRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class RealTimeRenderer
{
if (use_gl_tonemapping)
{
SAIGA_ASSERT(output_texture_ldr);
TemplatedImage<ucvec4> tmp(output_texture_ldr->getHeight(), output_texture_ldr->getWidth());

output_texture_ldr->bind();
Expand All @@ -130,6 +131,7 @@ class RealTimeRenderer
}
else
{
SAIGA_ASSERT(output_texture);
TemplatedImage<ucvec4> tmp(output_texture->getHeight(), output_texture->getWidth());

output_texture->bind();
Expand All @@ -143,6 +145,7 @@ class RealTimeRenderer

TemplatedImage<ucvec4> DownloadColor()
{
SAIGA_ASSERT(output_color);
TemplatedImage<ucvec4> tmp(output_color->getHeight(), output_color->getWidth());

output_color->bind();
Expand All @@ -154,6 +157,7 @@ class RealTimeRenderer

TemplatedImage<ucvec4> DownloadGt()
{
SAIGA_ASSERT(best_gt_texture);
TemplatedImage<ucvec4> tmp(best_gt_texture->getHeight(), best_gt_texture->getWidth());

best_gt_texture->bind();
Expand Down

0 comments on commit 1b20452

Please sign in to comment.