Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - b3059651

Pages: [1] 2
1
Python and Java API / Re: Export markers per image
« on: December 11, 2015, 05:44:51 PM »
Yes, of course it worked with the condition!

Thanks :)

2
Python and Java API / Re: Export markers per image
« on: December 11, 2015, 04:59:21 PM »
Thank you Alexey,

It is working with no errors this time, but I still get the markers outside of the frame with negative coords. It might be the older version. It is ok for me because I can just do an extra python script outside Agisoft to remove the ouside frame coordinates.

Thanks for your quick response.
:)

3
Python and Java API / Re: Export markers per image
« on: December 11, 2015, 04:12:11 PM »
Hello Alexey,

It pratially worked! Thanks for that. I get the markers with grey flags, but nbot inside the image frame and also I get an error in the end.
See attached image.

Regards,

4
Python and Java API / Re: Export markers per image
« on: December 11, 2015, 03:26:43 PM »
Hello Alexey,

Thank you for your quick reply.
The code you send me exports the markers but only if they have blue flags. Is it possible to export also the estmated pixel coords of the markers with grey flags too?

Regards,



5
Python and Java API / Re: Export markers per image
« on: December 11, 2015, 02:41:09 PM »
Hello!

Thank you for the reply!

To make it clearer I import the markers from the reference panel and then I want to export their estimated projections in pixel coordinates for every image automatically. I use the above script to do that but it doesn't do it automatically because some markers are not visible in every camera so I get pixel coordinates negative and larger than the width of the camera. To solve this issue for now I take the printed results from the console and process them externally in python to get only the markers with the pixel coordinates that are within the width and height of the camera (3648x2736, specifically) Is this possible to do it in python built-in python scripts so to save some time?
I know that the grey flags do not take part into the process, I am just using them for other purposes.
 

Thanks a lot.
:)

6
Python and Java API / Export markers per image
« on: December 10, 2015, 05:11:16 PM »
Hi all,

I am using educational version 1.1.6 and I am interested in exporting markers (many) per camera. Actually what I do is import markers through the reference panel and then I can see the grey flag on the images. Is it possible to export only the visible markers  of each image with their pixel position? So I can get in the end a txt file that contains:

camera_label, marker_label, x_pixels, y_pixels

I am attaching the photo for an example to understand what I want.
Until now I am trying to play with a python script where I read a txt with the 3D position X,Y,Z for all the markers and manually import the camera label and I get in the console the pixel coordinates. It works fine  but it also gives the pix coordinates of points that are not included in the specified camera. And I am wondering if there is any way to solve this automatically so I can get only the included markers as you can see in the attached picture.


Thanks a lot for any feedback!

The script I am  using is:

Code: [Select]
#markers import script
#input file format:
#camera_label marker_label x y z
#(TAB separator)

import PhotoScan

doc = PhotoScan.app.document
chunk = doc.chunk

path = PhotoScan.app.getOpenFileName("Specify input file with marker coordinates:")

print("Import started...")  #informational message

sth={}
file = open(path, "rt") #input file

eof = False
line = file.readline()
if len(line) == 0:
eof = True

while not eof:
   
#print(line)

sp_line = line.rsplit(",", 4)   #splitting read line by 5 parts

oid = sp_line[0]
z = float(sp_line[3])
y = float(sp_line[2]) #x- coordinate of the current projection in pixels
x = float(sp_line[1]) #y- coordinate of the current projection in pixels
camera_label = 82          #camera label1

photo_0 = chunk.cameras[int(camera_label)]
point3D = PhotoScan.Vector([x,y,z])
point_geocentric = chunk.crs.unproject(point3D)
point_internal = chunk.transform.matrix.inv().mulp(point_geocentric)

imgx, imgy = photo_0.project(point_internal)
print(str(oid),str(imgx),str(imgy))    

       


line = file.readline() #reading the line in input file
if not len(line):
eof = True
break # End of File


print("Script finished")  #information message
file.close()

7
Python and Java API / Accuracy of the estimated camera positions
« on: October 29, 2015, 10:09:04 PM »
Hi all,

I know that to estimate the precision of the camera positions after the Bundle Adjustment many parameters are involved and it is computationally expensive.
It would be ideal if this is possible to compute. Is this isavailable from the version 1.1.6, or are there any build-in functions in python to estimate this per each camera?

Thanks a lot in advance.
Regards,
Maria

8
Thank you so much!!

I will let you know how it works :)

9
Python and Java API / Reprojection error of sparse point cloud
« on: April 30, 2015, 10:20:33 PM »
Hi all,

It is great the support we get from this forum to solve issues. It seems that Agisoft provides fantastic results. :)

I would like to export the reprojection error of a sparse point cloud in order to perform accuracy assessment of my results.

This follows the same question from here: http://www.agisoft.com/forum/index.php?topic=3534.msg19362#msg19362

Please any feedback would be great!!!

Regards,
Maria

10
Hi all,

It would be nice if somebody can help with how to export the reprojection error for each tie point of the sparse point cloud.

Regards,
Maria

11
Hello Alexey,

Thank you for your reply. Yes I realised it after I posted the query.

Regards,
Maria

12
Hi all again,

I actually now realized that I can use the script as seen in a older thread http://www.agisoft.com/forum/index.php?topic=3411.msg17803#msg17803 in order to convert pixel coordinates to 3D coordinates. If I generate a mesh with high accuracy the resulting x, y, z, coordinates in the object space should be reliable. I would like some feedback on that, please.

Thanks a lot.

Maria

13
Hi all,

This is a very useful script. It is working nicely to mine. Though, I would like to ask how can this script be further developed so to compute the 3D coordinates from this image with the error in pixels? It seems that the new marker is imported in the reference marker panel but without x,y,z, in object space. Is this possible to extend this script?

Thanks a lot

Maria

14
Hi Alexey,

Yes, exactly this. With the coordinate system as set in the panel.




Thanks,
Regards,
Maria

15
Hi again,

I found this thread http://www.agisoft.com/forum/index.php?topic=3029.msg16118#msg16118.
Is it possible to have an example of the command to get the reprojection error from each point in the sparse point cloud?

Thanks a lot in advance
Regards,
Maria

Pages: [1] 2