Forum

Author Topic: open directory of photos from predefined path  (Read 4896 times)

Aleksei

  • Newbie
  • *
  • Posts: 9
    • View Profile
open directory of photos from predefined path
« on: July 07, 2014, 10:48:15 PM »
Code: [Select]
importpath1 = glob.glob(importpath1)
listlen1 = len(importpath1)
x = 0
while (x < listlen1):
cam = PhotoScan.Camera()
cam.open(importpath1[x])
pic = doc.chunks.add()
doc.activeChunk.cameras.add(cam)
print("FILE LOADED: " + importpath1[x])
x = x + 1
print("PROGRESS: Asset photos imported!")
Error: Executes print command for every photo, but does not load the name of the .jpg (just loads blank).

Thanks for the help.
« Last Edit: July 08, 2014, 05:28:40 AM by Aleksei »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14843
    • View Profile
Re: open directory of photos from predefined path
« Reply #1 on: July 08, 2014, 09:48:32 AM »
Hello Aleksei,

And what path is assigned to importpath1 variable?

Please also provide the output of the console pane.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Aleksei

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: open directory of photos from predefined path
« Reply #2 on: July 08, 2014, 09:15:26 PM »
Hello Alexey,

importpath1 has a path that leads to a directory  filled with geotagged photos.



This is the total output.

As an aside, can you tell me what is wrong with my processing steps?

Code: [Select]
chunk = PhotoScan.Chunk()
chunk.matchPhotos(accuracy=align_accuracy, preselection="ground control")
chunk.alignPhotos()
chunk.buildDenseCloud(quality=cloud_quality)
chunk.buildModel(surface="height field", source="dense", interpolation="enabled", faces="medium")
chunk.buildTexture(mapping=texture_mapping, blending=texture_blending, color_correction=False, size=texture_resx, count=1)

Log:
Code: [Select]
Stuff Imported!
System Variables Assigned!
User Variables Assigned!
Initialization Complete!
------------------------
FEEDBACK: Block 1 Begins
PROGRESS: Existing environment has been cleared!
PROGRESS: New environment has been created!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4060_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4061_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4062_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4063_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4064_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4065_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4066_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4067_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4068_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4069_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4070_geotag.JPG
PROGRESS: Asset photo imported!
FILE LOADED: C:\Program Files\Agisoft\Projects\Python Testing\photos\IMG_4071_geotag.JPG
PROGRESS: Asset photo imported!
FEEDBACK: Number of photos imported -  12
Detecting points...
photo 1: 39967 points
photo 2: 39972 points
photo 3: 39947 points
photo 4: 39995 points
photo 5: 39946 points
photo 6: 39958 points
photo 7: 39955 points
photo 8: 39962 points
photo 9: 39956 points
photo 10: 39996 points
photo 11: 39979 points
photo 12: 39987 points
points detected in 25.441 sec
Selecting pairs...
103593 matches found in 2.45 sec
66 of 66 pairs selected in 0.043 sec
Matching points...
1362253 matches found in 57.978 sec
setting point indices... 70202 done in 0.02 sec
removed 10803 multiple projections
removed 18 points
generated 70184 tie points, 4.47289 average projections
finished matching in 86.011 sec
Finished processing in 86.026 sec (exit code 1)
Optimizing point cloud...
weights: 0.4 cameras, 800 markers, 4000 scalebars, 40 projections
not enough data for optimization
finished SBA in 0 seconds
Finished processing in 0.001 sec (exit code 1)
initializing...
selected 0 cameras from 0 in 0.001 sec
Loading photos...
Reconstructing depth...
finished depth reconstruction in 0 seconds
Device 1 performance: 0 million samples/sec (CPU)
Generating dense point cloud...
selected 0 cameras in 0.006 sec
Finished processing in 0.023 sec (exit code 0)
Generating mesh...
Finished processing in 0.001 sec (exit code 0)
Finished processing in 0 sec (exit code 0)
PROGRESS: Photo processing complete!
Saving project...
saved project in 0.327 sec
Finished processing in 0.327 sec (exit code 1)
PROGRESS: Save complete! Saved to C:\Program Files\Agisoft\Projects\Python Testing\test.psz
Export complete
>>>

The variables are set to standard presets, and PhotoScan "processes" the photos, but I can't see any processing in the document afterwards.

I know that there is enough data because when processing via the GUI I can create a model.

Thanks.

« Last Edit: July 08, 2014, 10:41:06 PM by Aleksei »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14843
    • View Profile
Re: open directory of photos from predefined path
« Reply #3 on: July 09, 2014, 12:02:18 AM »
Hello Aleksei,

If you wish to see the processing results in the opened document, you need to add chunk to the PhotoScan.app.document, as in the code sample you are using PhotoScan.Chunk class variable that is not connected with opened project.
Best regards,
Alexey Pasumansky,
Agisoft LLC