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

Pages: [1]
1
Python and Java API / Re: batch processing aerial imagery
« on: December 20, 2016, 07:54:20 PM »
Hi Alexey,

Thank you, I resolved the image loading issue. One final question, 

Code: [Select]
chunk.loadReference()
Does it load the Yaw, Pitch, Roll by default when executed, or do they have to be loaded with "columns"?

Thanks a lot

2
Python and Java API / Re: batch processing aerial imagery
« on: December 20, 2016, 04:55:34 PM »
Hi Alexey,

Thanks for all the help, I updated agisoft and edited the code, the calibration is fixed. It works!

A side question, is there a easy way to load all ".tiff" imagery into agisoft from a folder?

In this discussion, they add .tiff based on changes of x of the file's name.
http://www.agisoft.com/forum/index.php?topic=5706.0

Code: [Select]
startphoto=1700
endphoto=1750

for x in range(startphoto, endphoto + 1):
     chunk.addPhotos(['/Volumes/arc_01/FIELD_DATA/SFM/EOSS/PHOTOS_EOSS_20160330/106D800E/TIFF/DSC_%s.tiff' % x])
     chunk.importMasks(path='/Volumes/arc_01/FIELD_DATA/SFM/EOSS/PHOTOS_EOSS_20160330/106D800E/TIFF/DSC_%s_mask.png' % x,method='file',operation='union',tolerance=10)

The name's doesn't matter in my case, I need all the .tiff loaded disregard of filename. Changing the imagery location to "*.tiff" doesn't seem to work. 



3
Python and Java API / Re: batch processing aerial imagery
« on: December 19, 2016, 08:17:32 PM »
Hi Alexey,

I have been reading and trying out things, but I could not get the script calibrated. When I run the script and make "Generate Report" its says Focus length and pixel size are unknown. It is a really simple script and I just can't figure out where it goes wrong. I need the camera calibrated because the height of the pointcloud and photo "altitude" is now randomly (I think) generated and not referenced. It is way off.

The script is still the same, i have removed the long file locations. I uploaded the calibration file as well.

Code: [Select]
import PhotoScan

app = PhotoScan.Application()
doc = PhotoScan.app.document

# Define: Camera calib file
CalibFile = "calibration_2.xml"

# Define: Orientation file
OrientationFile = "reference.txt"

CoordinateSystem = PhotoScan.CoordinateSystem("EPSG::28992")

chunk = doc.addChunk()
chunk.label = "New_Chunk"
chunk.crs = CoordinateSystem

#create a list of photos to add to the chunk
AerialImageFiles = ["photos_here.tiff"]

#add photos to chunk
chunk.addPhotos(AerialImageFiles)

cam = chunk.cameras[0]#PhotoScan.Camera()
cam.open(AerialImageFiles[0])

sensor = chunk.addSensor()
sensor.label = "MyCamera"
sensor.pixel_height = 0.006
sensor.pixel_width = 0.006
sensor.focal_length = 100.5
sensor.height = 11310
sensor.width = 17310


sensor.user_calib = PhotoScan.Calibration()
c = PhotoScan.Calibration()
c.load(CalibFile)
sensor.user_calib = c
sensor.fixed  = True

chunk.loadReference(OrientationFile, format="csv", delimiter="\t")

print(sensor.user_calib.fx)
print(sensor.user_calib.fy)
print(sensor.user_calib.cx)
print(sensor.user_calib.cy)
print(sensor.pixel_height)
print(sensor.pixel_width)
print(sensor.focal_length)
print(sensor.fixed)



#align
chunk.matchPhotos(accuracy=PhotoScan.HighAccuracy, keypoint_limit=80000, tiepoint_limit=80000, preselection=PhotoScan.ReferencePreselection)
chunk.alignCameras()

chunk.buildDenseCloud(quality=PhotoScan.LowQuality)


The pointcloud is generated, everything works, but the focal length/pixel size has to be loaded for Agisoft to give the correct z cooridnates for entire  point cloud.

Is there something I am missing?

4
Python and Java API / Re: batch processing aerial imagery
« on: December 15, 2016, 10:13:45 PM »
Hi Alexy,

I have 2 final questions.

- I printed all the calibration variables and they are all imported into Agisoft, but when I print (sensor.user_calib.width) or (sensor.user_calib.height) it gives the value zero. Is this the wrong command to print them, or I am doing something wrong again?

- I need photo alignment based on "Reference". The script uses preselection=PhotoScan.GenericPreselection). Do i need to change this line to Reference, or is this the function on align the photos on references?

Thanks a lot.


5
Python and Java API / Re: batch processing aerial imagery
« on: December 14, 2016, 10:18:51 PM »
Hi Alexy,

Thanks again, when I print the "sensor.pixel_height" and "sensor.pixel_height" it gives the correct values. Printing the sensor.user_calib gives a long number that changes each time the script is run: 0x0000000011AE3990.

So it does load the pixel sizes at least. When I go to the Camera Calibration window after I have run the script, it does not show the updated calibration values from the script. Maybe that is the reason I thought the script wasn't working.

Just to be sure, is it possible to print the values of the .xml file in the console? Since they are not defined as variables in the script itself.

Thanks a lot!

6
Python and Java API / Re: batch processing aerial imagery
« on: December 14, 2016, 09:13:09 PM »
Hi Alexy,

Thank you for the quick reply.

When I import the .xml file through the Camera Calibration window, there is no problem.
If this script works but not in my case, does it mean my calibration values are not correct?




7
Python and Java API / Re: batch processing aerial imagery
« on: December 14, 2016, 08:11:14 PM »
Hi,

I have the same task as ptr, processing over 700 aerial images. Ptr's script works, but somehow it does not load the camera calibration .xml file and the pixel_height and pixel_width. Is there maybe  something still wrong with the script? Or am I doing something wrong.

I use the exact same script as posted here, the .xml file I made by adding the camera calibration details manually in agisoft and then saving them as .xml.


hope someone can help

8
Bug Reports / RD/NAP coordination error
« on: February 08, 2016, 01:58:52 AM »
Hello,
 
I have multiple images of an landscape with their coordinates. The coordinates are recorded in the RD/NAP coordination System.

When I import the coordinates into Agisoft and select the RD/NAP coordination system, Agisoft gives the following error:

"Unsupported vertical datum"

Is this is an Error in Agisoft and is there a way to fix it?

Thanks for the help

Pages: [1]