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

Pages: [1] 2
1
Is there a way to set blockh and blockw to some default value that ensures the orthophoto is not divided into blocks? I want to ask the user if the orthophoto should be blocked or not.

Code: [Select]
chunk.exportOrthomosaic(path, format=fmat, projection = proj, blockw = blockSize, blockh = blockSize, tiff_compression = compression, tiff_big = bigTiff):
I know I can just use an if-sentence and have to versions of exportOrthomosaic with and without blockh and blockw, but I also have an if-sentence for the format, and I might get more, so I would like to avoid a whole tree of if-sentences with all combinations of possibilities.

Any help is much appreciated  :)

2
Python and Java API / Re: Use the "Convert" command
« on: May 26, 2016, 11:55:46 AM »
If I use it to go from utm32 (EPSG::32632) to ETRS89+DVR90height (EPSG::4098) I keep getting an error:
"error return without exception set"

3
Python and Java API / Re: Export crs to EPSG
« on: May 24, 2016, 12:20:29 PM »
That totally worked, thank you so much!

4
Python and Java API / Export crs to EPSG
« on: May 23, 2016, 01:40:27 PM »
Is there any way to get the EPSG from the project crs?

I tried to use
Code: [Select]
repr(chunk.crs) but it only returns:

<CoordinateSystem 'WGS 84 / UTM zone 32N (EPSG::32632)'>

which is very descriptive, but I just want the "32632"

Can anyone help?

5
Python and Java API / QtWebKit
« on: April 07, 2016, 12:48:51 PM »
Hey,

I would like to be able to use QWebView to open a url inside PS, but QtWebKit is not included in the python libraries. Is there any way to add QtWebKit or to add PyQt4 (which has QtWebKit) or something?

6
Python and Java API / Re: Changing image paths
« on: March 17, 2016, 02:06:16 PM »
Thanks Alexey,

Adding and removing a marker worked!!

7
Python and Java API / Re: Changing image paths
« on: March 17, 2016, 01:37:19 PM »

If I check the image path by right-clicking the image and clicking "show details" right after I run the script, it says:
E:/Miriam/Projects/testProjectI/Images/DSC_1410.JPG
which is what I want.
If I close the file, open it and do the same, it says:
E:/Miriam/Projects/testProjectB/Images/DSC_1410.JPG
which is what it was before...

8
Python and Java API / Re: Changing image paths
« on: March 17, 2016, 01:25:18 PM »
I get
Code: [Select]
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1410.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1411.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1412.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1413.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1414.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1487.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1488.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1489.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1490.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1491.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1492.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1493.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1494.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1495.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1496.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1569.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1570.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1571.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1572.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1573.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1574.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1575.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1576.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1577.JPG
2016-03-17 09:40:31 copyIm: E:/Miriam/Projects/testProjectI/Images/DSC_1578.JPG

Which are the right paths

9
Python and Java API / Changing image paths
« on: March 17, 2016, 12:22:07 PM »
Hey,

I'm trying to copy the image files to a new location and then change the paths in PS to reference the new location and then save the project. The images are copied correctly, and the image paths are changed, but if I close the project and open it again the image paths have changed back to what they were before. It seems like it doesn't save it properly.
If I save it under a different name the new image paths are saved like they are supposed to, but I can't seem to overwrite the old project...

The code where I copy the images:
Code: [Select]
for i in range(len(chunk.cameras)):
imPath = projectDir+'/Images/'+os.path.basename(chunk.cameras[i].photo.path)
shutil.copy(chunk.cameras[i].photo.path, imPath) # copying the image
chunk.cameras[i].photo.path = imPath # setting the new image path
print('copyIm: '+chunk.cameras[i].photo.path)

The code where I save:
Code: [Select]
if not(doc.save(projectPath + "%03d" % projectIncrement + '.psx')):
app.messageBox('Saving project failed!')
print('hej1')
print("%03d" % projectIncrement)
print('--- Saving project to: ' + projectPath + "%03d" % projectIncrement + '.psx')


The output after the save:
Code: [Select]
2016-03-17 09:40:31 Saving project...
2016-03-17 09:40:31 saved project in 0.007 sec
2016-03-17 09:40:32 Finished processing in 0.007 sec (exit code 1)
2016-03-17 09:40:32 hej1
2016-03-17 09:40:32 003
2016-03-17 09:40:32 --- Saving project to: E:/Miriam/Projects/testProjectI/testProjectI003.psx

(The project name is correct, but it still doesn't seem to work)


Any help would be appreciated!

10
Python and Java API / Web requests
« on: March 10, 2016, 01:31:03 PM »
Hey

I need to post a json file to a server, and according to http://stackoverflow.com/questions/9733638/post-json-using-python-requests it should be possible using:

>>> import requests
>>> r = requests.post('http://httpbin.org/post', json={"key": "value"})

However, PhotoScan doesn't know the module "requests".
Is there any way to add the module or is there another one  that can do the same thing?

Help is much appreciated!

11
Python and Java API / Re: Set log file in Python script
« on: February 26, 2016, 03:26:44 PM »
You can write the console output to a txt file. See this topic:
http://www.agisoft.com/forum/index.php?topic=5024.0

12
Python and Java API / Re: Logfile
« on: February 26, 2016, 03:25:07 PM »
Thanks, Alexey, it was just what I needed!

13
Python and Java API / Logfile
« on: February 26, 2016, 01:17:12 PM »
Hi,

I'd like to know if it is possible to set the logfile from python.

The logfile can be set in preferences, but I would like a different logfile for each project so I don't get anything mixed up.

Does anyone know how I can set it from python???


14
Python and Java API / Re: matchPhotos - Not enough cameras
« on: February 26, 2016, 01:11:46 PM »
Thanks,

It seems like I got my chunks mixed up...

15
Python and Java API / exportOrthomosaic default parameters
« on: February 18, 2016, 01:31:28 PM »
Hi,

I would like to know how I can get the default parameters of e.g. exportOrthomosaic.

Specifically I would like to know the default region and dx/dy chosen if I don't specify them.

Pages: [1] 2