SBGlobBascule : Différence entre versions

De MicMac
Aller à : navigation, rechercher
(Modifications syntaxe d'appel + Ajout paragraphe : "Scaling a model with only a scale information")
 
(9 révisions intermédiaires par 3 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
 +
[[Image:picto-liste.png|25px]] [[Command|List of commands]]
 
==Description==
 
==Description==
SBGlobBascule is a tool for ”scene based global” bascule, it is used when no absolute information
+
SBGlobBascule is a tool for ”scene based global” bascule, it is used when no absolute information is available but the user still wishes to give some physical meaning to the orientation.
is available but the user still wishes to give some physical meaning to the orientation.
+
 
*SBGlobBascule use a selected number of images, on which the user has created mask, these mask must define part of the image belonging to the plane.
 
*SBGlobBascule use a selected number of images, on which the user has created mask, these mask must define part of the image belonging to the plane.
 
*SBGlobBascule select the tie points belonging to the mask, and compute by least square fitting an estimation of this plane.
 
*SBGlobBascule select the tie points belonging to the mask, and compute by least square fitting an estimation of this plane.
Ligne 10 : Ligne 10 :
 
===Syntax===
 
===Syntax===
 
The syntax is  
 
The syntax is  
<code>mm3d SBGlobBascule -help</code> <br>
+
<pre>mm3d SBGlobBascule FullName OrientationIn Images_measures_xml_file OrientationOut NamedArgs </pre>  
<br>
+
The meaning of the arguments are:
+
*first arg, is the pattern defining the image we want to use;
+
*second arg Mur defines the input orientation;
+
*third arg MesureBasc.xml is a file that contains image measurement for defining orientation;
+
*fourth arg Basc defines the output orientation;
+
*optional args PostPlan= MasqPlan means that if image is IMGP4171.JPG (or IMGP4171.CR2 or...), then the associated mask IMGP4171 MasqPlan.tif
+
*if there are several masks it will use all them for fitting the plane (which can be useful with wide dataset when high accuracy is required); of course if there are no existing mask an error will occur;
+
*optional args DistFS=0.6 is used to fix the scale;
+
Open the file MesureBasc.xml, you will see that it contains measurement of points in image. Although the syntax should be quite obvious, it is described in section 6.4.4.1. To create a file like MesureBasc.xml user can of course do it with a text editor, alternatively he can, on Linux, use the interactive tool SaisieBasc described in 8.4.4. Once created, the following information will be looked for by SBGlobBascule in this file :
+
*measurement of points named Line1 and Line2; they will fix orientation in the plane by imposing that line Line1-Line2 is parallel to Ox;
+
*these points need only to be measured in one image, as they are assumed to be in the plane computed on the mask; is they have been measured several time, a warning will occur;
+
*optional a point Origine to fix the origin of the repair;
+
*optionally two point Ech1 and Ech2 to fix the scale, each point must be entered in two image, so that a 3d position can be computed; when DistFS is entered, new coordinate system is computed with the constraint that the distant between the 3d position of Ech1 and Ech2 is equal to DistFS; if DistFS is entered and Ech1 and Ech2 do not exist in at least two images, an error occurs;
+
  
 
===Help===  
 
===Help===  
Mandatory unnamed args :  
+
You can access to the help by typing : <code>mm3d SBGlobBascule -help</code>
*<span style="font-family:times roman;">''string :: {Full Name (Dir+Pat)}''</span style>
+
 
*<span style="font-family:times roman;">''string :: {Orientation path}''</span style>
+
<pre>
*<span style="font-family:times roman;">''string :: {Ply file}''</span style>
+
Mandatory unnamed args :
Named args :
+
  * string :: {Full name (Dir+Pat)}
*<span style="font-family:times roman;">''[Name=Out] string :: {Textured mesh name (def=plyName+ _textured.ply)}''</span style>
+
  * string :: {Orientation in}
*<span style="font-family:times roman;">''[Name=Bin] bool :: {Write binary ply (def=true)}''</span style>
+
  * string :: {Images measures xml file}
*<span style="font-family:times roman;">''[Name=Optim] bool :: {Graph-cut optimization (def=false)}''</span style>
+
  * string :: {Out : orientation }
*<span style="font-family:times roman;">''[Name=Lambda] REAL :: {Lambda (def=0.01)}''</span style>
+
Named args :
*<span style="font-family:times roman;">''[Name=Iter] INT :: {Optimization iteration number (def=2)}''</span style>
+
  * [Name=ExpTxt] bool
*<span style="font-family:times roman;">''[Name=Filter] bool :: {Remove border faces (def=false)}''</span style>
+
  * [Name=PostPlan] string :: {Set NONE if no plane}
*<span style="font-family:times roman;">''[Name=Texture] string :: {Texture name (def=plyName + _UVtexture.jpg)}''</span style>
+
  * [Name=DistFS] REAL :: {Distance between Ech1 and Ech2 to fix scale (if not given no scaling)}
*<span style="font-family:times roman;">''[Name=Sz] INT :: {Texture max size (def=4096)}''</span style>
+
  * [Name=Rep] string :: {Target coordinate system (Def = ki, ie normal is vertical)}
*<span style="font-family:times roman;">''[Name=Scale] INT :: {Z-buffer downscale factor (def=2)}''</span style>
+
  * [Name=CPI] bool :: {Calibration Per Image (Def=false)}
*<span style="font-family:times roman;">''[Name=QUAL] INT :: {jpeg compression quality (def=70)}''</span style>
+
</pre>
*<span style="font-family:times roman;">''[Name=Angle] REAL :: {Threshold angle, in degree, between triangle normal and image viewing direction (def=90)}''</span style>
+
 
*<span style="font-family:times roman;">''[Name=Mode] string :: {Mode (def = Pack)}''</span style>
+
===Study case: scaling a model with only a scale information===
*<span style="font-family:times roman;">''[Name=Crit] string :: {Texture choosing criterion (def = Angle)}''</span style>
+
In the case where you would like to scale a model having only a scale information (like a scale bar for example), you can use <code>SBGlobBascule</code> to generate a new orientation folder with a scale factor applied to the input orientation.
 +
 
 +
First, you have to generate a xml file containing the position of the points Ech1 and Ech2 (using <code>[[SaisieBasc]]</code> for instance), and then call <code>SBGlobBascule</code> by setting optional arguments <code>PostPlan=NONE</code> and <code>DistFS</code> to the distance between Ech1 and Ech2.
 +
 
 +
The use of <code>PostPlan=NONE</code> will prevent you from entering a mask defining a plan.
 +
 
  
 
===Example===
 
===Example===
With the dataset of street Saint Martin, an example of use is : <br>
+
With the dataset of street Saint Martin, an example of use is :  
<code>SBGlobBascule "IMGP41((6[7-9])|([7-8][0-9])).JPG" Mur MesureBasc.xml LocBasc PostPlan=_MasqPlan DistFS=1.2</code>
+
<pre>mm3d SBGlobBascule "IMGP41((6[7-9])|([7-8][0-9])).JPG" Mur MesureBasc.xml LocBasc PostPlan=_MasqPlan DistFS=1.2</pre>
 +
 
 +
The meaning of the arguments are:
 +
* First arg is the pattern defining the image we want to use;
 +
* Second arg (Mur) defines the input orientation;
 +
* Third arg (MesureBasc.xml) is a file that contains image measurement for defining orientation;
 +
* Fourth arg (Basc) defines the output orientation;
 +
* Optional arg PostPlan= MasqPlan means that if image is IMGP4171.JPG (or IMGP4171.CR2 or...), then the associated mask IMGP4171 MasqPlan.tif
 +
* If there are several masks it will use all them for fitting the plane (which can be useful with wide dataset when high accuracy is required); of course if there are no existing mask an error will occur;
 +
* Optional arg DistFS=0.6 is used to fix the scale;
 +
 
 +
Open the file MesureBasc.xml, you will see that it contains measurement of points in image. Although the syntax should be quite obvious, it is described in section 6.4.4.1. To create a file like MesureBasc.xml user can of course do it with a text editor, alternatively he can, on Linux, use the interactive tool [[SaisieBasc]] described in 8.4.4. Once created, the following information will be looked for by SBGlobBascule in this file :
 +
* Measurement of points named Line1 and Line2; they will fix orientation in the plane by imposing that line Line1-Line2 is parallel to Ox;
 +
* These points need only to be measured in one image, as they are assumed to be in the plane computed on the mask; is they have been measured several time, a warning will occur;
 +
* Optional a point Origine to fix the origin of the repair;
 +
* Optionally two point Ech1 and Ech2 to fix the scale, each point must be entered in at least two images, so that a 3d position can be computed; when DistFS is entered, new coordinate system is computed with the constraint that the distant between the 3d position of Ech1 and Ech2 is equal to DistFS; if DistFS is entered and Ech1 and Ech2 do not exist in at least two images, an error occurs;

Version actuelle en date du 31 juillet 2018 à 15:21

Picto-liste.png List of commands

Description

SBGlobBascule is a tool for ”scene based global” bascule, it is used when no absolute information is available but the user still wishes to give some physical meaning to the orientation.

  • SBGlobBascule use a selected number of images, on which the user has created mask, these mask must define part of the image belonging to the plane.
  • SBGlobBascule select the tie points belonging to the mask, and compute by least square fitting an estimation of this plane.
  • finally bascule SBGlobBascule compute the rotation that transform current coordinates in a new system where the fitted plane correspond to the plane Z = 0.
  • SBGlobBascule fix also the orientation inside the plane.
  • optionally SBGlobBascule can fix the the global scale.

Syntax

The syntax is

mm3d SBGlobBascule FullName OrientationIn Images_measures_xml_file OrientationOut NamedArgs 

Help

You can access to the help by typing : mm3d SBGlobBascule -help

Mandatory unnamed args :
  * string :: {Full name (Dir+Pat)}
  * string :: {Orientation in}
  * string :: {Images measures xml file}
  * string :: {Out : orientation }
Named args :
  * [Name=ExpTxt] bool
  * [Name=PostPlan] string :: {Set NONE if no plane}
  * [Name=DistFS] REAL :: {Distance between Ech1 and Ech2 to fix scale (if not given no scaling)}
  * [Name=Rep] string :: {Target coordinate system (Def = ki, ie normal is vertical)}
  * [Name=CPI] bool :: {Calibration Per Image (Def=false)}

Study case: scaling a model with only a scale information

In the case where you would like to scale a model having only a scale information (like a scale bar for example), you can use SBGlobBascule to generate a new orientation folder with a scale factor applied to the input orientation.

First, you have to generate a xml file containing the position of the points Ech1 and Ech2 (using SaisieBasc for instance), and then call SBGlobBascule by setting optional arguments PostPlan=NONE and DistFS to the distance between Ech1 and Ech2.

The use of PostPlan=NONE will prevent you from entering a mask defining a plan.


Example

With the dataset of street Saint Martin, an example of use is :

mm3d SBGlobBascule "IMGP41((6[7-9])|([7-8][0-9])).JPG" Mur MesureBasc.xml LocBasc PostPlan=_MasqPlan DistFS=1.2

The meaning of the arguments are:

  • First arg is the pattern defining the image we want to use;
  • Second arg (Mur) defines the input orientation;
  • Third arg (MesureBasc.xml) is a file that contains image measurement for defining orientation;
  • Fourth arg (Basc) defines the output orientation;
  • Optional arg PostPlan= MasqPlan means that if image is IMGP4171.JPG (or IMGP4171.CR2 or...), then the associated mask IMGP4171 MasqPlan.tif
  • If there are several masks it will use all them for fitting the plane (which can be useful with wide dataset when high accuracy is required); of course if there are no existing mask an error will occur;
  • Optional arg DistFS=0.6 is used to fix the scale;

Open the file MesureBasc.xml, you will see that it contains measurement of points in image. Although the syntax should be quite obvious, it is described in section 6.4.4.1. To create a file like MesureBasc.xml user can of course do it with a text editor, alternatively he can, on Linux, use the interactive tool SaisieBasc described in 8.4.4. Once created, the following information will be looked for by SBGlobBascule in this file :

  • Measurement of points named Line1 and Line2; they will fix orientation in the plane by imposing that line Line1-Line2 is parallel to Ox;
  • These points need only to be measured in one image, as they are assumed to be in the plane computed on the mask; is they have been measured several time, a warning will occur;
  • Optional a point Origine to fix the origin of the repair;
  • Optionally two point Ech1 and Ech2 to fix the scale, each point must be entered in at least two images, so that a 3d position can be computed; when DistFS is entered, new coordinate system is computed with the constraint that the distant between the 3d position of Ech1 and Ech2 is equal to DistFS; if DistFS is entered and Ech1 and Ech2 do not exist in at least two images, an error occurs;