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 - willcodeforfoo

Pages: [1]
Python and Java API / Orthomosaic Coordinates to Camera X/Ys
« on: April 13, 2023, 11:37:57 PM »
Is it possible, using some Python, to map a point's coordinate from a generated orthomosaic to a list of cameras that point corresponds to as well as the projected X/Y position in each camera?

General / Placing Markers via Basemap
« on: March 20, 2023, 08:18:20 PM »
Is it possible to somehow use the basemap to create markers interactively? I have the center coordinates of photos which gets us close, but I'd like to refine the results by placing markers via a Bing or Google satellite in the basemap. I know they wouldn't be survey-grade, but we have some old photos where if we could just line up a couple roads on the basemap I think we could get better results.


Alexey, Thanks for the reply!

Ortho would be generated in geographic projection with WGS84 from DEM and I'm interested in the XY coordinates in the ortho, not really interested in Z.

Is it possible (maybe through pickPoint, camera.transform, etc.) to somehow determine which x, y coordinate in the orthomosaic corresponds to a given camera's x, y coordinate (if any?)


Bug Reports / Re: Shift of ortho image upon exporting
« on: May 27, 2022, 04:13:13 AM »
I've just started noticing the exact same issue with some historic aerials we are processing... GCPs are dead on in the ortho view but when exporting they shift. Our project is WGS 84, but exporting to MBTiles as EPSG:3857 and TIFFs as WGS84 and EPSG:3857 still have the same issue.

General / Re: Agisoft PhotoScan 1.4.0 pre-release
« on: December 11, 2017, 07:04:45 PM »
Is it possible to install this pre-release version alongside 1.3.*?

If so, how?

Edit: Going back through this thread, seems you just have to re-name your editing PhotoScan directory before installing.

Python and Java API / Re: Scripting Rectangle Mask
« on: August 31, 2016, 07:01:48 PM »
Alexey: Thanks for the quick response. This is exactly the approach I've taken, seems to work pretty well. Wasn't sure if maybe there was an easier way I was overlooking


Python and Java API / Scripting Rectangle Mask
« on: August 31, 2016, 06:14:05 PM »
I need to mask out the edges of all the cameras in a chunk... basically only selecting the middle and excluding a 500px or so border around the edges... I've created a PNG mask, but since the images can vary in size I was wondering if it's possible to select this rectangle programmatically in a Python script rather than importing masks? And if so, would be faster than importing the mask (seems to take ~2s per 100MB image).


Interesting! Didn't know that... I suppose it's a result of using the script you posted on

The script didn't work as posted so I modified it to what I thought was correct, but maybe I'm missing something that would cause each marker to only have a single projection?

Code: [Select]
#compatibility Agisoft PhotoScan Professional 1.2.1
#markers import script
#input file format:
#marker_label, camera_label, x-pixel, y_pixel,x-coord, y-coord, z-coord
#(TAB separator)

import PhotoScan

doc =
chunk = doc.chunk

path ="Specify input file with marker coordinates:")
print("Import started...")  #informational message
file = open(path, "rt") #input file

photos_total = len(chunk.cameras) #number of photos in chunk
markers_total = len(chunk.markers) #number of markers in chunk

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

while not eof:


sp_line = line.split(",", 6)   #splitting read line by four parts

y = float(sp_line[3]) #x- coordinate of the current projection in pixels
x = float(sp_line[2]) #y- coordinate of the current projection in pixels
x_coord = float(sp_line[4]) #x- coordinate of the marker
y_coord = float(sp_line[5]) #y- coordinate of the marker
z_coord = float(sp_line[6]) #x- coordinate of the marker

camera_label = sp_line[1] #camera label
marker_name = sp_line[0] #marker label

flag = 0
for camera in chunk.cameras:

if camera.label.upper() == camera_label.upper(): #searching for the image (comparing with all the photo paths in chunk)

for marker in chunk.markers: #searching for the marker (comparing with all the marker labels in chunk)
if marker.label == marker_name:
marker.projections[camera] = (x, y) #setting up marker projection of the correct photo)
flag = 1

if not flag: #adding new marker if no correspondence found
chunk.markers[-1].label = marker_name
chunk.markers[-1].projections[camera] = (x, y)  #setting up marker projection of the correct photo)
chunk.markers[-1].reference.location = PhotoScan.Vector([x_coord, y_coord, z_coord])

# if not marker.reference.location:
# marker


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

print("Script finished")  #information message


Thanks for the reply. Hitting Update then Build Orthomosaic still doesn't let me select geographic. If I select all the cameras then update they do show up, but I'd like to use the marker data rather than the camera data... as the camera data is quite inaccurate.

I haven't bothered much with altitudes and didn't seem to notice much of a difference in the output. I'm not necessarily interested in any DEM or models, just really stitching many photos together and georeferencing the result. But I can try adding that information if it'll increase the quality of matching.

Could I use the altitude from a tool like for the markers and then that number plus estimated flight altitude for the camera altitudes?


General / Geographic type not available in Build Orthomosaic Dialog
« on: April 09, 2016, 05:07:04 PM »
I'm attempting to generate a georeferenced orthomosaic of historic aerial photos, scanned from film. I have approximate center points of each file which I used for the align stage and GCP markers throughout the scene which I hoped would better align the output.

I was able to build a geographic orthomosaic before I introduced the GCP markers, now that option is disabled. Any idea why?


Python and Java API / Re: batch processing
« on: April 06, 2016, 04:53:43 PM »
Just adding more support to this. Being able to run headless or batches would be huge!


Feature Requests / Re: Import GCP per pixel
« on: December 29, 2015, 06:52:50 PM »
+1 for this. It's been awhile since it was posted, has it (or something like it, that is defining GCPs in relation to pixel coordinates of source images) become a feature?

Pages: [1]