-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support exporting image mask files #1244
base: master
Are you sure you want to change the base?
Conversation
Thx can you please use this guide: https://github.com/openMVG/openMVG/blob/master/CONTRIBUTING.md |
Support exporting image mask files
Added AR image listing
Please move your commit f86ff1f to another branch. |
auto maskFileName = srcImage + ".mask.png"; | ||
if (stlplus::is_file(maskFileName)) { | ||
Image<openMVG::image::RGBColor> maskRGB, maskRGB_ud; | ||
ReadImage(maskFileName.c_str(), &maskRGB); |
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.
Can we add the same logic as here: https://github.com/openMVG/openMVG/blob/develop/src/software/SfM/main_openMVG2openMVS.cpp#L162
Sorry I just pushed this safety check some days ago.
@@ -107,11 +107,20 @@ bool exportToOpenMVS( | |||
ReadImage(srcImage.c_str(), &imageRGB); | |||
UndistortImage(imageRGB, cam, imageRGB_ud, BLACK); | |||
WriteImage(image.name.c_str(), imageRGB_ud); | |||
// undistort mask and save it | |||
auto maskFileName = srcImage + ".mask.png"; |
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 std::string
Since the type is known and will not change I would prefer to use std::string there.
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.
".mask.png"
can be saved in a string and reused.
const std::string openmvs_mask_postfix = ".mask.png"
;
@@ -107,11 +107,20 @@ bool exportToOpenMVS( | |||
ReadImage(srcImage.c_str(), &imageRGB); | |||
UndistortImage(imageRGB, cam, imageRGB_ud, BLACK); | |||
WriteImage(image.name.c_str(), imageRGB_ud); | |||
// undistort mask and save it | |||
auto maskFileName = srcImage + ".mask.png"; | |||
if (stlplus::is_file(maskFileName)) { |
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.
OpenMVG is using braces on new lines.
{
}
Image<openMVG::image::RGBColor> maskRGB, maskRGB_ud; | ||
ReadImage(maskFileName.c_str(), &maskRGB); | ||
UndistortImage(maskRGB, cam, maskRGB_ud, BLACK); | ||
WriteImage((image.name + ".mask.png").c_str(), maskRGB_ud); |
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.
use the defined openmvs_mask_postfix
} | ||
else | ||
{ | ||
// just copy image | ||
stlplus::file_copy(srcImage, image.name); | ||
stlplus::file_copy(srcImage + ".mask.png", image.name + ".mask.png"); |
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.
Use the defined openmvs_mask_postfix
Export SfM cameras in IncrementalSfM
@@ -248,6 +248,10 @@ int main(int argc, char **argv) | |||
stlplus::create_filespec(sOutDir, "cloud_and_poses", ".ply"), | |||
ESfM_Data(ALL)); | |||
|
|||
Save(sfmEngine.Get_SfM_Data(), |
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.
Do you know that you can call the binary ConvertSfMData with -i SOMETHIG.bin -o SOMETHING_ELSE.json
for doing this?
@ZihaoTu If you want make a PR, please push one commit to the branch else I will have to cherry-pick to keep only the feature |
* Improve mse and rmse * Add some checks about camera type * Only support shared model
* Add new class sfm_data_PBA ---- pba_interface * remove .vs
Merge to oppen
export sfm_data_all.json instead of sfm_data.bin
Code formatting. Changed confusing variable names. Keep origin defaul…
Added select sfm and mask features for merging two sfm projects
Don't select initial pair by hand. Fix MaskFeatures bug
Fix mask features bug
Fix wrongly used command line parameter when using pba
Support different focal length
…_imagelisting support multi camera models
Match point without featmap
…oints provide_track_to_compute_3d_points
add sort_and_clean binaray to remove invalid view of sfm_data file
Added undistort software
Add TransformSfMData utility
Fix mirrored camera matrix in TransformSfMData
fix pose idx error if there are some missing extrinsics;
…uctureFromKnowPoses Add option to main compute structure from know poses
update build.md
update BUILD.md
No description provided.