Forum

Author Topic: Input our own markers and theirs coordinates  (Read 2380 times)

CindyFr

  • Newbie
  • *
  • Posts: 21
    • View Profile
Input our own markers and theirs coordinates
« on: June 07, 2018, 05:52:00 PM »
Hello,

I want to create my own markers by scpriting. So, I already have my model, I export it and I pick point by another program, and then, I want to return into PhotoScan to create markers with my coordinates (in local system).

When I do that, my markers are not at the good place, and I'm wondering why.

Can somebody help me please ?
Thank you :)

My code : (I've simplied some names, so they are now explicit)
Code: [Select]
app = PhotoScan.Application()
doc = app.document
os.chdir(pathProject)
doc.open(projectName)
chunk = doc.chunk
v = PhotoScan.Vector([myPoint[0], myPoint[1], myPoint[2]])
m = chunk.addMarker(v, visibility = True)
m.Reference.projection = v

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Re: Input our own markers and theirs coordinates
« Reply #1 on: June 08, 2018, 12:27:57 AM »
Hello CindyFr,

I think you should use m.reference.location = v in the last line of your code.
Best regards,
Alexey Pasumansky,
Agisoft LLC

CindyFr

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Input our own markers and theirs coordinates
« Reply #2 on: June 08, 2018, 09:33:04 AM »
Hello Alexey,
Thank you for your response.
When I use reference.location = v, I've got an error that says : " 'PhotoScan.Marker.Reference' object attribute 'location' is read-only ".

CindyFr

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Input our own markers and theirs coordinates
« Reply #3 on: June 08, 2018, 10:27:02 AM »
After some tests, it seems that there is some inconsistency :
Photoscan detects automatically one target on my project. When I read its coordinates, they are 4 times bigger than when I pick the target by another program.
But, when I use PhotoScan to pick point with the ruler tool, it gives me the coordinate of the target and it is the same that the one picked by my program, and not returned by PhotoScan.

print(target.position) ---> PhotoScan gives me : Vector([-5.663896887909959, -0.7403848828696588, -11.303984398252654])

picked by my program ---> Vector([-1.3575199675979093, -0.1761938076466322, -2.72407025591208])
picked with the ruler tool oh PhotoScan ---> Ruler coordinates:  -1.353966 X  -0.177330 Y  -2.702 m
« Last Edit: June 08, 2018, 10:29:36 AM by CindyFr »

CindyFr

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Input our own markers and theirs coordinates
« Reply #4 on: June 08, 2018, 11:08:10 AM »
Ok, It seems I've found my mistake :


Code: [Select]
v = PhotoScan.Vector([myPoint[0], myPoint[1], myPoint[2]])
m = chunk.addMarker()
m.reference.location = v

But the problem stays : if I want to use pickPoint(#vector3d#, #vector3d#) in order to do raytracing for picking point, the coordinates that I input with my two vectors seems to not be in the good system. And my picked point appears at the wrong place.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Re: Input our own markers and theirs coordinates
« Reply #5 on: June 12, 2018, 03:34:32 PM »
Hello CindyFr,

Is the problem with the coordinates solved in another thread (http://www.agisoft.com/forum/index.php?topic=9153)?
Best regards,
Alexey Pasumansky,
Agisoft LLC

CindyFr

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Input our own markers and theirs coordinates
« Reply #6 on: June 12, 2018, 06:12:13 PM »
Yes, the two topics are related. And the solution for the other one can works here, thank you.