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.


Topics - kBarra

Pages: [1]
1
Python and Java API / api differences
« on: July 15, 2015, 11:26:41 PM »
Hi again Alexey,

I have a few questions regarding the documentation, and the implementation of various functions.

Lets start with the removal of chunk.alignPhotos() and the creation of chunk.alignCameras(). I could not find anywhere in the docs, noting the change of the function name, the closest I could see was your note in 0.9 "Revised Chunk.alignPhotos() method" are these two functions indeed the same? If so, can you make this change clearer in the documentation?


Next, the varying ways in which arguments are passed in to seemingly similar functions(methods).

When calling chunk.matchPhotos() it is required to use the accuracy=PhotoScan.HighAccuracy yet, when calling PhotoScan.alignChunks() this is not required and one can simply pass in accuracy = 'high'.

I understand these methods are found in two separate classes, and that may be the sole reason for the difference, but by having two different "workflows" it makes the ability to code without having the api documentation open at all times, difficult. As without memorizing every function's arguments, I either have to guess as to what is expected, or look it up.

I will try to continue to post to this thread with things that I find odd, but so far, that is it.


thanks

2
Python and Java API / uugghhh adding a single camera and mask
« on: July 15, 2015, 10:34:22 AM »
I have been using photoscan 0.9 api up until now. I am finally making my way in to the upgraded, feature removed, api 1.0+. And boy oh boy is it painful, convoluted, and stripped of information.

Where do I even start? Adding photos I suppose... I do not want to use the command .addPhotos(). I want to add a single photo, get the object returned, do some stuff like label changing, and then add a mask. All I have been met with is frustration, and confusion. The docs have basically zero information...

why does this not work.

Code: [Select]
doc = PhotoScan.app.document
chunk = doc.chunks[0]
cam = chunk.addCamera()
cam.open( imagePath )
cam.label = "pleaseWork"

maskPhoto = PhotoScan.Mask()
maskPhoto.load( maskPath )

PhotoScan.utils.createDifferenceMask( cam.photo.image(), maskPhoto.image() , 12)


....


Why are things returning true or false, this information is useless, why have you switched to giving less information back to the user? Am I the only one complaining about this? Am I using this newer API just absolutely wrong? Why the convoluted, mask.load() but cam.open().... I apologize about bashing your code like this, but the previous implementation was leaps and bounds better, and more pythonic, in my opinion.

3
Python and Java API / document open command failure
« on: December 17, 2013, 09:54:04 AM »
Hi so I'm having a strange issue with opening a new document using python. The command says it succeeds but nothing opens in my scene

here is what is happening...

import os
path = "path_to_file.psz"
os.path.exists(path)
#returns true

new_doc = PhotoScan.Document()
new_doc.open(path)

#now photoscan starts to load the file, this take about 3-4 seconds
#after it finishes it returns True, but the file is empty. It gets stranger...

#I can query the chunks inside of the scene even though I see nothing
chunks = PhotoScan.Chunks(new_doc)
#returns "main_chunk", "main_chunk_1"

#I can even Duplicate the chunk.
mainChunk = chunks[0]
dupChunk = PhotoScan.Chunks(new_doc).add(mainChunk)
 
If I query the chunks again I will get 3 chunks, not just 2 like before. If I save out this file it has a size of 1KB. What could possibly be going on here? I am almost certain this was working before.

Any help is greatly appreciated



Pages: [1]