-
-
Notifications
You must be signed in to change notification settings - Fork 827
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
New hdri stitching software #678
Conversation
All channels need to be set to zero including alpha for RGBA colors
src/aliceVision/image/io.cpp
Outdated
for(const std::string& format: supportedFormat) | ||
{ | ||
std::vector<std::string> extensions; | ||
std::string str = format.substr(format.find(":")+1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
@@ -93,7 +93,7 @@ float sigmoid(float x, float sigwidth, float sigMid) | |||
* @param[out] buffer - to store input metadata in output image | |||
* @param[out] imageAlpha - output RGBAf fisheye image correctly oriented | |||
*/ | |||
void setFisheyeImage(image::Image<image::RGBfColor>& imageIn, oiio::ImageBuf& buffer, image::Image<image::RGBAfColor>& imageAlpha) | |||
void setFisheyeImage(image::Image<image::RGBfColor>& imageIn, const float blurWidth_param, oiio::ImageBuf& buffer, image::Image<image::RGBAfColor>& imageAlpha) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const not necessary with primitive type
const float maxRadius = std::min(width, height) * 0.5 * 0.95; | ||
const float blurWidth = maxRadius * 0.2; | ||
const float blurMid = maxRadius * 0.95; | ||
const float maxRadius = std::min(width, height) * 0.5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.5f
@@ -188,7 +188,7 @@ void fisheyeToEquirectangular(image::Image<image::RGBAfColor>& imageIn, const in | |||
* @param[in] rotations - contains adjustment rotations on each image set by user | |||
* @param[out] outputFolder - output folder path to write panorama | |||
*/ | |||
void stitchPanorama(const std::vector<std::string>& imagePaths, const std::vector<oiio::ParamValueList>& metadatas, const std::array<std::vector<double>, 3> rotations, std::string& outputPath) | |||
void stitchPanorama(const std::vector<std::string>& imagePaths, const std::vector<oiio::ParamValueList>& metadatas, const float blurWidth, const std::array<std::vector<double>, 3> rotations, std::string& outputPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- no const for float
- missing & for
rotations
@@ -362,7 +370,11 @@ namespace aliceVision | |||
T( ( Z )( *this )( 3 ) * val ) ); | |||
} | |||
}; | |||
|
|||
/// Instantiation for unsigned char color component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using RGBAColor = Rgba<unsigned char>
{ | ||
imagePaths.push_back(path.string()); | ||
|
||
oiio::ParamValueList metadata = image::readImageMetadata(entry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
boost::smatch what; | ||
if(boost::regex_search(dateTime, what, dateTimeExp)) | ||
{ | ||
times.push_back(24.0 * std::stof(what["h"]) + 60.0 * std::stof(what["m"]) + std::stof(what["s"])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this part is repeated here and in the previous if branch, maybe consider to refactor it into a function. the only difference is that here you are doing something with a single file, in the previous one you are doing the exact same thing for each file in the directory
return EXIT_FAILURE; | ||
} | ||
|
||
int nbImages = imagePaths.size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto
|
||
// sort images according to their metadata "DateTime" | ||
std::sort(times_sorted.begin(), times_sorted.end()); | ||
for(int i=0; i<nbImages; ++i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::size_t i
std::vector<float>::iterator it = std::find(times.begin(), times.end(), times_sorted[i]); | ||
if(it != times.end()) | ||
{ | ||
std::size_t index = std::distance(times.begin(), it); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
…liceVisionPrivate into dev_hdri_stitching
In fact, it doesn't really make sense to add weighting in the BA context.
…onPrivate into dev_hdri_stitching
Also supports value 0 for automatic detection of the number of brackets.
…liceVisionPrivate into dev_hdri_stitching
…y and minor code simplification
Description
Stitch fisheye images into 360° panorama with simple geometric transformations, without undistortion or feature matching.
Features list