Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposure and format adjustment #1414

Merged
merged 6 commits into from
Jun 2, 2023
Merged

Conversation

demoulinv
Copy link
Contributor

@demoulinv demoulinv commented Apr 14, 2023

Description

Add option for setting maximum width and height in imageProcessing.
Use libRaw settings for automatic and manual exposure adjustment when reading raw images. Add relying options in imageProcessing.

@@ -423,12 +427,24 @@ void processImage(image::Image<image::RGBAfColor>& image, const ProcessingParams
}
}

if (pParams.scaleFactor != 1.0f)
if ((pParams.scaleFactor != 1.0f) || (pParams.maxWidth != 0) || (pParams.maxHeight != 0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to compute a scaleFactor based on pParams.scaleFactor, pParams.maxWidth, pParams.maxHeight.
And keep this if to check if this new scaleFactor is not 1.
As currently, if pParams.scaleFactor is one and maxWidth/Height are not 0 but a large value, it could introduce image duplications.

@@ -423,12 +427,24 @@ void processImage(image::Image<image::RGBAfColor>& image, const ProcessingParams
}
}

if (pParams.scaleFactor != 1.0f)
if ((pParams.scaleFactor != 1.0f) || (pParams.maxWidth != 0) || (pParams.maxHeight != 0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to compute a scaleFactor based on pParams.scaleFactor, pParams.maxWidth, pParams.maxHeight.
And keep this if to check if this new scaleFactor is not 1.
As currently, if pParams.scaleFactor is one and maxWidth/Height are not 0 but a large value, it could introduce image duplications.

{
nw = (unsigned int)(floor(float(nw) * (float(pParams.maxHeight) / float(nh))));
nh = pParams.maxHeight;
}
Copy link
Member

@fabiencastan fabiencastan Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nw and nh could be equal to width/height..

@mugulmd mugulmd force-pushed the dev/adjustExposureAndFormat branch from a328d78 to 38ff06e Compare June 2, 2023 14:43
@mugulmd mugulmd merged commit 9b05a87 into develop Jun 2, 2023
@mugulmd mugulmd deleted the dev/adjustExposureAndFormat branch June 2, 2023 15:46
@@ -1089,7 +1089,7 @@ int aliceVision_main(int argc, char * argv[])

if (pParams.exposureAdjust != 0.0)
{
exposureAdjustment *= std::powf(static_cast<float>(2.0), pParams.exposureAdjust);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a missing include to , isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants