Skip to content

Commit

Permalink
[View] getSensorsize method update to get correct sensorHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
demoulinv committed Aug 25, 2023
1 parent 68bf0a0 commit e6ffcd3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/aliceVision/sfmData/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ int View::getSensorSize(const std::vector<sensorDB::Datasheet>& sensorDatabase,

if (hasCameraMetadata)
{
const double imageRatio = static_cast<double>(getWidth()) / static_cast<double>(getHeight());

intrinsicInitMode = camera::EInitMode::UNKNOWN;
sensorDB::Datasheet datasheet;
if (sensorDB::getInfo(make, model, sensorDatabase, datasheet))
Expand Down Expand Up @@ -245,6 +247,7 @@ int View::getSensorSize(const std::vector<sensorDB::Datasheet>& sensorDatabase,
}

sensorWidth = datasheet._sensorWidth;
sensorHeight = (imageRatio > 1.0) ? sensorWidth / imageRatio : sensorWidth * imageRatio;
sensorWidthSource = ESensorWidthSource::FROM_DB;

if (focalLengthmm > 0.0)
Expand Down

0 comments on commit e6ffcd3

Please sign in to comment.