constraints export

Is there a function for constraints export and import? Now the created model is very different from the actual size

Hi yeyuchuan 1,

to import constraints you can use the Distance Definitions button:

Where the txt file will look like this:

Constraint_name,Point_1,Point_2,Defined_distance

Example:

Exported,GCPb,GCPc,28.27051162719727

To export the distances you need to add this format into exported files or export it as report.

For report:

Add these lines into C:\Program Files\Capturing Reality\RealityCapture\report.xml

<!DOCTYPE html>
<html>

<head>
    <meta name=“GENERATOR” content=“Epic Games Slovakia s.r.o.” />
    <meta charset=“UTF-8”>
    <title>RealityCapture Selected Component Report</title>
    <!–[if IE]><meta http-equiv=“X-UA-Compatible” content=“IE=10”/><![endif]–>
    <style>
        $Include(“Reports\styles\style.css”)
        $Include(“Reports\styles\colors.css”)
        $Include(“Reports\styles\svg.css”)
    </style>
</head>
<body>

    
    </div>
    $EchoOff(
    $Declare( “constraintsInCurrentComponentCount”, 0 )
    $ExportDistanceConstraints(
    $If(InCurrentComponent==true,
    $Set( “constraintsInCurrentComponentCount”, constraintsInCurrentComponentCount + 1 )
    )
    )
    )
    $If(constraintsInCurrentComponentCount > 0,
    <div>
        <p class=“componentSubTitle”>$Localize(“ALL_SELECTED_CONSTRAINTS”, “All / Selected Constraints”)</p>
            <table class=“listTable”>
                <tr>
                    <th>$Localize(“NAME”, “Name”)</th>
                    <th>A</th>
                    <th>B</th>
                    <th>$Localize(“DEFINED_DISTANCE”, “Defined distance”)</th>
                    <th>$Localize(“CALCULATED_DISTANCE”, “Calculated distance”)</th>
                    <th>$Localize(“DISTANCE_ERROR”, “Distance error”)</th>
                </tr>

                $ExportDistanceConstraints(
                $If(InCurrentComponent==true,
                <tr>
                    <td>$(constraintName)</td>
                    <td>$(pointA)</td>
                    <td>$(pointB)</td>
                    <td>$(definedDistance:.3f) $(constraintCSUnitShort) <sub>+/- $(definedAccuracy:.3f)</sub></td>
                    <td>$(calculatedDistance:.3f) $(constraintCSUnitShort) </td>
                    <td>$(distanceError:.3f) $(constraintCSUnitShort)</td>
                </tr>
                )<!-- end of “$(InCurrentComponent)”==“$(true)” –>
                )<!-- end of ExportDistanceConstraints –>
            </table>
    </div>
    )<!-- end of constraintsInCurrentComponentCount > 0 –>
   
</body>
</html>

and attach that html file into C:\Program Files\Capturing Reality\RealityCapture\Reports

Then you will be able to export constraint’s distances.

 

What do you mean that model is very different? Is it a big model or a small one? You have error here max 4 cm. Did you realign the alignment or just updated after distance definition?

I am the result after the constraint distance, the model before the constraint is 30.00000m,

HI

 

I still have a problem. This happens after the folder photos I imported are aligned. The photos are in the same group and the results are different each time.

 

hi 

When I copy this section, access is denied, what should I do?

<format id="{2F99820A-23FB-43A5-977B-37F0BD473D00}" mask="*.html" descID="9365" desc="Selected Component Report_distance" writer="CapturingReality.Export.ReportWriter" supportsGeoref="0" requires="component">
    <hint strId="9365">Report which shows the distances in the table.</hint>
    <body>$Include("Reports\SelectedComponent_distance.html")</body>
  </format>

Yes, it is possible that the model is 30 m before using constraint as photogrammetry is basically without scale. How precise were measured the distances for your constraints? Are you using Align or Update when you set those constraints?

Each new alignment is slightly different. Are you using XMPs in your process?

Can you show me that access denied error? Did you created the html file? It should be named SelectedComponent_distance.html and should look like this: 

<!DOCTYPE html>
<html>

<head>
    <meta name=“GENERATOR” content=“Epic Games Slovakia s.r.o.” />
    <meta charset=“UTF-8”>
    <title>RealityCapture Selected Component Report</title>
    <!–[if IE]><meta http-equiv=“X-UA-Compatible” content=“IE=10”/><![endif]–>
    <style>
        $Include(“Reports\styles\style.css”)
        $Include(“Reports\styles\colors.css”)
        $Include(“Reports\styles\svg.css”)
    </style>
</head>
<body>

    
    </div>
    $EchoOff(
    $Declare( “constraintsInCurrentComponentCount”, 0 )
    $ExportDistanceConstraints(
    $If(InCurrentComponent==true,
    $Set( “constraintsInCurrentComponentCount”, constraintsInCurrentComponentCount + 1 )
    )
    )
    )
    $If(constraintsInCurrentComponentCount > 0,
    <div>
        <p class=“componentSubTitle”>$Localize(“ALL_SELECTED_CONSTRAINTS”, “All / Selected Constraints”)</p>
            <table class=“listTable”>
                <tr>
                    <th>$Localize(“NAME”, “Name”)</th>
                    <th>A</th>
                    <th>B</th>
                    <th>$Localize(“DEFINED_DISTANCE”, “Defined distance”)</th>
                    <th>$Localize(“CALCULATED_DISTANCE”, “Calculated distance”)</th>
                    <th>$Localize(“DISTANCE_ERROR”, “Distance error”)</th>
                </tr>

                $ExportDistanceConstraints(
                $If(InCurrentComponent==true,
                <tr>
                    <td>$(constraintName)</td>
                    <td>$(pointA)</td>
                    <td>$(pointB)</td>
                    <td>$(definedDistance:.3f) $(constraintCSUnitShort) <sub>+/- $(definedAccuracy:.3f)</sub></td>
                    <td>$(calculatedDistance:.3f) $(constraintCSUnitShort) </td>
                    <td>$(distanceError:.3f) $(constraintCSUnitShort)</td>
                </tr>
                )<!-- end of “$(InCurrentComponent)”==“$(true)” –>
                )<!-- end of ExportDistanceConstraints –>
            </table>
    </div>
    )<!-- end of constraintsInCurrentComponentCount > 0 –>
   
</body>
</html>

Try to copy that file to your desktop, add those lines, save it and then copy that report.xml back to RealityCapture folder.

 

hi

Ondrej Trhan CR

Thank you very much. The first step is already ok. The second step is not understood.

Here is to edit an html myself???

and create html file using these lines:

$EchoOff( $Declare( "constraintsInCurrentComponentCount", 0 ) $ExportDistanceConstraints( $If(InCurrentComponent==true, $Set( "constraintsInCurrentComponentCount", constraintsInCurrentComponentCount + 1 ) ) ) ) $If(constraintsInCurrentComponentCount > 0,

$Localize(“ALL_SELECTED_CONSTRAINTS”, “All / Selected Constraints”)

$ExportDistanceConstraints( $If(InCurrentComponent==true, ) )
$Localize(“NAME”, “Name”) A B $Localize(“DEFINED_DISTANCE”, “Defined distance”) $Localize(“CALCULATED_DISTANCE”, “Calculated distance”) $Localize(“DISTANCE_ERROR”, “Distance error”)
$(constraintName) $(pointA) $(pointB) $(definedDistance:.3f) $(constraintCSUnitShort) +/- $(definedAccuracy:.3f) $(calculatedDistance:.3f) $(constraintCSUnitShort) $(distanceError:.3f) $(constraintCSUnitShort)
)

and attach that html file into C:\Program Files\Capturing Reality\RealityCapture\Reports

Then you will be able to export constraint’s distances.

You need to create your own html file using that lines. It is better visible in my previous comment, where are all lines. Just copy those, paste it to Notepad or some other editor and save it as html. As I wrote, the name have to be SelectedComponent_distance.html.

If it won’t work for you I can send you already created html file.

See if I didn’t write it right?

I have done what you said, but the export is not successful.

Hi,

I sent you a mail with the file. You didn’t use everything what I sent you. Also, you need to have created constraints to export them. 

May I ask why you want to export those distances?

thanks

I need the actual size of the model and want to use the cli to unify our massive photo modeling

If you need it then you don’t need to export the distances. You need to import or define one. I saw that you have some points on the ground:

Do you know distances or coordinates of those points?

If so, just write the coordinates for each point and set them as ground control.

If you know just distances, then define a wanted distance between them and realign the project again:

Also check if you have set camera priors in the alignment settings. If it is set as yes, then set them to no after distance definition.

Did you see this tutorial (is from older release, but the principles are still the same: https://www.youtube.com/watch?v=5VyYLaNxHz0

hi

appears after import

How does look the file which you are trying to import?

The export is an html file. After I imported it, it became just like that.

To import distances/constraints it has to TXT file, not HTML.

As I wrote you in first response:

to import constraints you can use the Distance Definitions button:

Where the txt file will look like this:

Constraint_name,Point_1,Point_2,Defined_distance

Example:

Exported,GCPb,GCPc,28.27051162719727

 

Do you want me to create the txt text by myself, fill it in as you said?

If you want to use that file for distance definition, then you need to create it.

Do you have now one project or more? As you exported distances, are you trying give them back into the same project? It is not necessary… If you defined the distances already, then after new alignment they will be implemented to the model.