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

Pages: [1] 2
1
Bug Reports / Re: installation problems on Debian 7.1
« on: September 13, 2016, 12:15:02 PM »
I think that my OS is 64 bit. How is possible to check?

2
Bug Reports / installation problems on Debian 7.1
« on: September 12, 2016, 06:42:33 PM »
I have tried to install photoscan pro on a debian 7.1 OS.
I have unpacked the downloaded archive in a folder. Trying to start PhotoScan by running photoscan.sh script from the program folder I cannot lunch the program, but this in the answer of the computer:

root@dimeg229:/home/cnc/photoscan-pro# ./photoscan.sh
/home/cnc/photoscan-pro/./photoscan: 1: /home/cnc/photoscan-pro/./photoscan: Syntax error: word unexpected (expecting ")")
root@dimeg229:/home/cnc/photoscan-pro#

How can I solve the problem?
Thank you for your answer.

3
Python and Java API / Re: more on Import and Export Cameras python commands
« on: September 10, 2014, 07:59:26 PM »
Now the command doc.activeChunk.ground_control.load(file, "csv") works; it was a problem related to the format of the .txt file, that needs TAB to separate different fields.

4
Python and Java API / saving file with scripts
« on: September 09, 2014, 09:10:15 AM »
Saving the .psz file in a python script with the commands:

path="C:/Users/Public/Documents/images"
file_name="Acquis_0"
file_n=path+"/"+file_name+".psz"       
doc.save(file_n, compression = 6, absolute_paths = False)        # Saving the project


in the main window of Photoscan the file remains “Untitled”, and if you wish to make any further modification interactively after the python running, you must then search the directory and give manually the file name that what was already specified as “file_n” in the python, to overwrite the same file .psz.
Is there any python command that updates the file name and the working directory of the interactive main photoscan window?



5
Python and Java API / Re: more on Import and Export Cameras python commands
« on: September 04, 2014, 12:23:16 AM »
Hello LMG,

I think this should be working as expected:

Code: [Select]
import PhotoScan

path = PhotoScan.app.getSaveFileName("Please specify export path and filename:")

file = open(path, "wt")
chunk = PhotoScan.app.document.activeChunk
if chunk.transform:
T = chunk.transform
else:
T = PhotoScan.Matrix().diag([1,1,1,1])
print("Script started")

for camera in chunk.cameras:
if camera.transform:

coords = T.mulp(camera.center)
file.write(camera.label + "\t{:.5f}".format(coords[0]) + "\t{:.5f}".format(coords[1]) + "\t{:.5f}".format(coords[2]) + "\n")

file.close()
print("Script finished")

Hello Alexey,
I cannot import the cameras coordinates. Could you write the equivalent code to import the c01_c04.txt file ?
Thank you

LMG

6
If the camera orientations are not utilized during the processing, of course it is not useful to export them.
Thank you very much.

7
Thank you Alexey.
I am going to try your script.
Reading your script, it seems to me that only camera positions will be exported. Is it possible to export also the orientations?

8
Hello Alexey,
Have you completed the code for exporting camera coordinates?
Bye

LMG

9
Hello Alexey,
Yes, I need to generate text file using estimated camera locations to be loaded in the new projects/chunks using ground_control.load option.
Thank you for the code that you will post later. I have this done this manually, editing the estimated camera location coordinates file, and I can assure that the  use of Ground Control pre-selection is reasonable also in a four camera case, because I need to reference the chunk using previously obtained coordinates.
Best regards
LMG

10
I am using a python procedure to export  4 pre-calibrated and aligned cameras in a file named c01_c04.xml, and their  spatial positions and orientations in another file named c01_c04.txt.
The spatial positions are calculated using targets having known coordinates.
I wish to use the same cameras for other projects, using the tool "Import Cameras" to import the c01_c04.xml file, and the "Ground control" Import to load the c01_c04.txt file, because I wish to align the photos using the ground control option.
Unfortunately the "ground_control.save" python command exports only the estimated camera positions, and if I try to use, as in the attached examples,  the  "ground_control.load" to import the saved positions, Photoscan does not read the values. To obtain the desired result, I am obliged to modify manually and externally the c01_c04.txt file to write the estimated positions and orientations as real ones.
Is there any possibility available to write the c01_c04.txt file saving only the positions and orientations of the cameras to be able to use them in other projects? May be it could be possible to use other python general commands to write in the correct form this file.
Please, Alexey, could you help me?
Thank you very much.

11
Python and Java API / Re: How to use createDifferenceMask command?
« on: April 26, 2014, 01:19:01 PM »
Thank you Alexey,
problem solved. I have added the line photo = PhotoScan.Photo()  prior to each photo.open() function, and now the script works well.
Bye

12
Python and Java API / Re: How to use createDifferenceMask command?
« on: April 25, 2014, 09:34:22 PM »
I have written 2 python scripts. The first one (prova_mask1.py) works with 1 camera and it works fine.
The second one (prova_mask4.py) works with 4 cameras, but in the chunk only last camera is included.
Alexey, Could you tell me where is the mistake in the scripts?
Thank you very much.

13
Python and Java API / How to use createDifferenceMask command?
« on: April 24, 2014, 06:57:51 PM »
I wish to make automatic masks using always the same background color (blue) positioned on the back of the subjects.

I have seen in the python api the command "createDifferenceMask", that could create a mask from a pair of images or an image and specified color.

Please, could you explain and/or give an example on the use of the following parameters:
• image (Image) – Image to be masked.
• background (Image or color tuple) – Background image or color value.
• tolerance (int) – Tolerance value.
• fit_colors (boolean) – Enables white balance correction.

Do I need to create a template image with having only the background ("blutemplate.ipg") and then subtract this image from the subject image ("subject.ipg")? How to write in a python api this task?

14
Python and Java API / Re: importCameras problems
« on: April 24, 2014, 06:46:30 PM »
I have moved chunk.importCameras(path_cam, "xml") at the end, and now it works. Thank you.
Bye

15
Python and Java API / importCameras problems
« on: April 22, 2014, 07:58:01 PM »
I am trying to import cameras using a python script.
The part of the code used in the script is this one:
path_cal="M:/D40"  #path for the calibration files
chunk = PhotoScan.Chunk()
starting_frame = iframe
chunk.label = "Frame_" + "{0:04d}".format(iframe)
path_cam=path_cal+"/c01_c04.xml"
chunk.importCameras(path_cam, "xml")


When I run the script, and the processing arrives to these lines, in the log on the console I have:
Loading project...
can't load project


and the cameras calibrations and positions are not imported.
How it is possible to solve this problem?

Pages: [1] 2