Hi,
is it currently possible to use images from multiple cameras at the same time? As I understand the code, there shouldn't be any problem with the current implementation of SfM process itself right?
As I see it the problem is that the SfMInit currently only allows to initialize the same settings for all the images in the folder. Is there any way to circumvent this with the current implementation or I should modify the initialization step? Is there anything that would need to be changed in order for this to work?
Thanks
Hi,
You can use many images from multiple cameras at the same time.
SfMInit will group images that share the same focal length.
So if you have many cameras with various focal: i.e only the 8mm and 16mm will be grouped together.
If you want to skip this grouping you can use the -g 0 option that will disable the grouping.
Hoping it answer to your question, else I let you provide more details.
PS: You can even use some camera that are existing in the database and some that does not exist.
If you use the incremental toolchain, the camera that have no intrinsic will be positionned by using 6pt DLT and so will be auto-calibrated regarding the other 3D images & structure.
Thanks for the answer @pmoulon however it does not yet completely solve my problem.
I have 3 different pre-calibrated cameras and I would like to introduce intrinsic parameters. I know I can do it for one cameras with "-k" switch in with openMVG_main_SfMInit_ImageListing. Is there a similar way already available for multiple cams?
Does your images group have a particular image pattern names => if the answer is yes, we can implement a regex in order to initialized various K matrices for each image.
Yes that would be a great solution!
Would you be ok to help on this?
Sure, I can have a go at it in the next days. What do you think the best approach would be. Let the user call the SfMInit multiple times and append the new added images together with the camera information? Or did you have in mind any other strategy on how to introduce multiple k values and regex strings simultaneously?
I think we can try to use a string parameter that would contains multiple regex expression along cammodel & its params informations.
i.e
-regex "regex;cam_model;params;regex;cam_model;params;..."
-regex "^._DEF._$;fisheye;focal;ppx;ppy;...."
If an image does not match a provided regex, we handle it in the classical way, else the regex rules take on and so we init the asked camera models and init it with the provided value.
Does it sound fine?
From an end user perspective, it sounds ok. Maybe we should take care to handle --regex "regex;cam_model;init_from_exif_and_camera_db" case.
If images exist in different directories, how can we use SfMInit in the case.
You can use the symbolic link trick.
You create a directory in which you have symbolic link towards all the images that are in various directory. So it will simulate an unique dir for OpenMVG and your images remains located where they are.
Note: Support for image in different directory images is already supported in the abstract view class, but not yet used. Here the reason=> image name is used as unique identifier KEY for feature&descriptor files. That means that if you support many directory you can have different images that will have the same KEY and this is a problem..
Thanks .
Hi,
sorry for being a bit inactive with this but as usual other things came up. Anyways, I started to look at this problem and as I saw that the regex is really supported only from the GCC 4.9. As currently OpenMVG requires GCC 4.7 should we use an external library for regular expressions or we can assume GCC >=4.9? Which would be the right way?
thanks
Hi @hcjghr
I think the most proper way is to make a functional test before and let cmake test if regex is supported or not by the compiler.
So we can implement the feature using c++11 regex and enable the regex code in OpenMVG according a preprocessor keywork.
We can check that regex is supported by the compiler and if the answer is yes define the HAVE_CXX11_REGEX compilation preprocessor.
see here https://github.com/openMVG/openMVG/blob/master/src/CMakeLists.txt#L110
What do you think about that plan?
PS: regex seems to be implemented in VS2015 too.
Any news or time on your side to take a look to this task?
Hi @pmoulon,
A while ago I have extended the SfMInit_ImageListing to include an option (-r) which takes the string in the form of: "{regex;cam_type;Kmatrix consisting of 9 elements separated by ;}[1,n]". I didn't include yet a way to initialize the distortion parameters.
the code is available in the develop_multicam branch
From our talk I havent added the check for the compilers support of regex as I was occupied by other things but I can hopefully get a bit of time to do it this week as it should be really quick.
Does it look like an ok solution?
Hi @pmoulon,
I've corrected a bit the way the regex string so we can have full camera initialization (including distortion values).
the command still takes the string with -r which should be in the form of: {regex;cam_type:f;ppx;ppy;k1;k2;...kn;}[1,n] - number of distortion parameters depends on the camera type
I've also added the checking that regex option is only available if C++11 compiler is available (if OPENMVG_USE_CXX11 is defined).
Does that seem like a good solution?
Hi @hcjghr I did not got the time to test your modification.
Your modification seems good
Most helpful comment
Does your images group have a particular image pattern names => if the answer is yes, we can implement a regex in order to initialized various K matrices for each image.