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

Pages: [1]
1
Python and Java API / Re: uugghhh adding a single camera and mask
« on: July 17, 2015, 04:17:32 AM »
dude, awesome! Literally no way I would have been able to figure this out. For the sensor label, is it fine for all sensors to have the same name? Is that a preferred method?

Just to make sure I understand the (len(chunk.cameras) - 1) . It should be used like so?
Code: [Select]
chunk.cameras[ (len(chunk.cameras) - 1)  ]

2
Python and Java API / Re: api differences
« on: July 16, 2015, 09:33:10 PM »
sweet, glad to hear you guys are way ahead of me!

3
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

4
Python and Java API / Re: uugghhh adding a single camera and mask
« on: July 15, 2015, 10:30:15 PM »
Alexey, this is what I would like to avoid

Code: [Select]
chunk.addPhotos(["Volumes/PROJECTS/2015_0701_demoDay_mollyO/_AUTO/_output/FACE/no_camXML/t001/jpg/20150701_MAC2_internal_blendShapes_mollyO_Face_t001_2577.jpg"])
True

>>> chunk.cameras[-1]
<Camera '20150701_MAC2_internal_blendShapes_mollyO_Face_t001_2577.jpg'>

>>> chunk.addPhotos(["/Volumes/PROJECTS/2015_0701_demoDay_mollyO/_AUTO/_output/FACE/no_camXML/t001/jpg/20150701_MAC2_internal_blendShapes_mollyO_Face_t001_2480.jpg"])
True

>>> chunk.cameras[-1]
<Camera '20150701_MAC2_internal_blendShapes_mollyO_Face_t001_2577.jpg'>


chunk.cameras[-1] does not give me the last camera added, but the last camera in the alphabetized list that is returned by chunk.cameras[].


Yes, alphabetizing my list before i go into a loop and use addPhotos() with one image passed in is not hard, but it is trivial, harder to read, and not something that should have to be done.

Have you thought about adding an addPhoto() function that does the same as addPhotos() except it takes a filepath, not an array, and returns the camera-created/None, not True/False.



But I'm getting sidetracked, what is the workflow to add a single camera, attach a photo, set a mask, and create a difference mask in agisoft api 1.1+. After you outline this workflow can you please add it to your documentation for future users?

5
Python and Java API / Re: uugghhh adding a single camera and mask
« on: July 15, 2015, 08:25:33 PM »
1) Yes there is a chunk in my project.

2) I am trying to avoid having to use this code block after the addPhotos()
Code: [Select]
cam = chunk.cameras[-1]
as it is ugly, uninformative, unpythonic, and looks like it is prone to breaking.

3) so you are saying my code should look like
Code: [Select]
doc = PhotoScan.app.document
chunk = doc.chunks[0]
cam = chunk.addCamera()
cam.open( imagePath )
cam.label = "pleaseWork"

maskPhoto = PhotoScan.Images()
maskPhoto = maskPhoto.open( maskPath )

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


There is zero information about setImage in the documentation http://www.agisoft.com/pdf/photoscan_python_api_1_1_0.pdf can you please be more specific about how to use this command?

6
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.

7
Python and Java API / Re: Problems Import photos into chunks from script
« on: December 03, 2014, 12:37:42 AM »
Is this a bug?

Surely the API has not regressed so that I have to build the sensor and calibration data to add an image in a chunk. Where before only the image path was needed as long as the meta data was with the image.


tforward, would you mind going into more detail about how you got around this problem?

8
Python and Java API / Re: document open command failure
« on: December 17, 2013, 10:56:47 AM »
thanks Alexey, you're a lifesaver. Still trying to get use to the subtle differences between a few of these API calls.

9
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]