Forum

Author Topic: GCPs loading error  (Read 5380 times)

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
GCPs loading error
« on: March 22, 2018, 12:46:01 PM »
Hello,

I'm trying to load reference data (GCPs) and i would like to create markers for missing entries. Additionally, i would like to specify coordinate system for input. Unfortunately, i receive the below error...

Code: [Select]
chunk.loadReference(tupla_zmiennych[3], PhotoScan.ReferenceFormatCSV, columns="nxyz", skip_rows=4, delimiter=",", crs=PhotoScan.CoordinateSystem("EPSG::2180"), create_markers=True)
I receive error:
TypeError: function takes at most 6 arguments (7 given)

When i deleted one argument ("crs") i receive this kind of error:

"TypeError: 'create_markers' is an invalid keyword argument for this function".

tupla_zmiennych[3] is a file directory and it works fine

Anyone could help me?

Best regards,
Adam



Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: GCPs loading error
« Reply #1 on: March 22, 2018, 01:12:00 PM »
Hello Adam,

Which version of PhotoScan Pro you are using?
Best regards,
Alexey Pasumansky,
Agisoft LLC

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: GCPs loading error
« Reply #2 on: March 22, 2018, 03:23:48 PM »
Thanks for response. I'm working on 1.3.3 version and i found out that some arguments are not available yet in this version. However i handle this with two-step approach: firstly creating markers and then importing coordinates from .csv.

I don't know why, but when i try to import EO for images (which are imported early) with the same code line:

Code: [Select]
chunk.loadReference(tupla_zmiennych[4], PhotoScan.ReferenceFormatCSV, columns="nxyz", skip_rows=2, delimiter=",")
i don't receive any error, but columns with exterior orientation parameters are still empty in the reference pane.

Any ideas?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: GCPs loading error
« Reply #3 on: March 22, 2018, 03:27:13 PM »
Hello Adam,

Do the camera labels in the Workspace pane correspond to the labels in the first column of the imported CSV file (including extensions)? Note that it's case sensitive operation.
Best regards,
Alexey Pasumansky,
Agisoft LLC

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: GCPs loading error
« Reply #4 on: March 22, 2018, 03:31:03 PM »
Yes, labels are correspond (i attached a print screen).

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: GCPs loading error
« Reply #5 on: March 22, 2018, 03:35:48 PM »
Ops, i solved the problem. I was trying to import EO before importing images :)

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: GCPs loading error
« Reply #6 on: March 22, 2018, 05:31:25 PM »
The next case to study...

I would like to detect markers (non coded crosses) automatically. This algorithm works pretty well for my dataset. In the next step i would like to perform joining detected markers with correspondend GCPs X,Y,Z coordinates without manually assignment.. 

My vision:
1) Extracting 2D image coordinates for detected markers (projection) for each photo
2) Extracting 2D image coordinates for grey flag of imported GCPs (reprojection) for each photo
3) For each photo, calculate difference between image coordinates for each pair of detected marker and GCP. In case of image coordinates set is similar (probably in some buffer) i will assign name of GCP to detected marker automatically.
4) Removing detected markers for whose i will could not find any correspoding GCP.

Do you think will it be workable?
« Last Edit: March 23, 2018, 12:29:00 PM by adam_s »

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: GCPs loading error
« Reply #7 on: March 23, 2018, 01:33:06 PM »
or i have a second vision:

Maybe it is possible to compare estimated 3D coordinates of detected markers with existing reference 3D coordinates of GCPs? Then i will impose some geometrical conditions to check which pair of points are correspondend :)

What do you think about it?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: GCPs loading error
« Reply #8 on: March 23, 2018, 02:04:51 PM »
Hello Adam,

For the purpose of loading CSV data for unsorted markers (usually non-coded targets) in the version 1.4 there's "ignore_labels" and "threshold" parameters for .loadReference() function. They are used to find the correspondence between the markers available in the project (with two or more projections on the aligned images) and the list from CSV file (so the relative positions of 3D markers and CSV points are compared - if the correspondences are found, the marker is renamed and corresponding coordinates are assigned).
Best regards,
Alexey Pasumansky,
Agisoft LLC

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: GCPs loading error
« Reply #9 on: March 23, 2018, 02:24:22 PM »
Hello Alexey,

Thanks for advice. I think that in your described case we will lost labels from csv (specific name of GCPs, provided by surveyors). Am i right? But i don't think that it will be a big problem, because i'm able to rename labels after the whole process.

How does the "threshold" parameter work in this case?

Best regards,
Adam

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: GCPs loading error
« Reply #10 on: March 23, 2018, 02:29:05 PM »
Hello Adam,

When the correspondence is detected between the marker in the project and CSV line, the marker instance in PhotoScan will be automatically renamed according to the CSV file.

Threshold defines the level of tolerance (in meters), as the two sets of points (from CSV and from PhotoScan) usually do not perfectly fit one each other.
Best regards,
Alexey Pasumansky,
Agisoft LLC

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: GCPs loading error
« Reply #11 on: March 23, 2018, 02:37:17 PM »
Quote
Threshold defines the level of tolerance (in meters), as the two sets of points (from CSV and from PhotoScan) usually do not perfectly fit one each other.

So... if they will fit perfectly, the threshold should be set as 100%. Could you provide a formula, describing this parameter (i mean what does "50% threshold" mean  for example? It could be challenging to set one constant value for each project. That's why i would like to connect threshold value with another project parameters such as EO accuracies, GCPs accuracies etc.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: GCPs loading error
« Reply #12 on: March 23, 2018, 02:47:48 PM »
Hello Adam,

Threshold is in meters. Basically speaking it defines the radius of searching for the corresponding instance.

I think, if the GCPs are quite far one from another, you can use several meters as tolerance.
Best regards,
Alexey Pasumansky,
Agisoft LLC

adam_s

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: GCPs loading error
« Reply #13 on: March 28, 2018, 09:55:55 AM »
So, my code looks like:

Code: [Select]
chunk.loadReference(tupla_zmiennych[3], PhotoScan.ReferenceFormatCSV, columns="nyxz", delimiter=",", create_markers=True, crs=PhotoScan.CoordinateSystem("EPSG::2180"), ignore_labels=True, threshold=5)

but any of detected marker didn't join correspondend coordinates of GCPs. All of GCPs from reference file were created.

And may i just add that i added one point with estimeted coordinates of detected marker to the reference list of GCPs to test this functionality. So i rule out the case of lack of correspondend coordinates between detecter markers and GCPs.

Best regards,
Adam





Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: GCPs loading error
« Reply #14 on: March 28, 2018, 11:34:37 AM »
Hello Adam,

If there are any issues with the "ignore_labels" feature, you can send the project file (in PSZ format) with the aligned cameras and detected target and the CSV file to import, so that we could reproduce the issue and see, if it can be fixed.
Best regards,
Alexey Pasumansky,
Agisoft LLC