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 - ankit.chaurasia

Pages: [1]
1
Hi,

I wanted to enable GPU for build Mesh and build Texture. I have added the following line in my script. We have 2 GPUs currently in machine.
Code: [Select]
PhotoScan.app.gpu_mask = 3
It shows 99% GPU usage for a Align Photos and Build Dense Cloud  but 0% GPU usage for Build mesh and Build Texture.

Please do help me with this.

2
Python and Java API / Re: Build DEM with planar top XY
« on: August 25, 2017, 02:22:46 PM »
Hi,

I am trying to build DEM for images and marker file has been added in local coordinate system i.e EPSG::9001

I have to build DEM in planar topXY. I tried using Alexey Pasumansky code with modification for version Photoscan 1.3.2.
link to forum post: http://www.agisoft.com/forum/index.php?topic=1322.msg15758#msg15758
For DEM:

Code: [Select]
if not chunk.transform:
chunk.transform = PhotoScan.Matrix ([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])

proj = PhotoScan.Matrix ([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])  #Top XY

chunk.buildDem(source=PhotoScan.DenseCloudData , interpolation=EnabledInterpolation,projection=proj)

But i am getting this error:
Code: [Select]
TypeError: argument 3 must be PhotoScan.CoordinateSystem, not PhotoScan.Matrix
But documentation for photoscan api says:
Quote
buildDem(source=DenseCloudData, interpolation=EnabledInterpolation [ , projection ][ , region ][ ,
classes ][ , progress ] )
Build elevation model for the chunk.
Parameters
• source (PhotoScan.DataSource) – Selects between dense point cloud and sparse
point cloud. If not specified, uses dense cloud if available.
• interpolation (PhotoScan.Interpolation) – Interpolation mode.
• projection (Matrix or CoordinateSystem) – Sets output projection.
• region (tuple of 4 floats) – Region to be exported in the (x0, y0, x1, y1) for-
mat.
• classes (list of PhotoScan.PointClass) – List of dense point classes to be used
for surface extraction.
• progress (Callable[[float], None]) – Progress callback.

Please do help me with this.

3
Python and Java API / Build DEM with planar top XY
« on: August 25, 2017, 02:21:32 PM »
Hi,

I am trying to build DEM for images and marker file has been added in local coordinate system i.e EPSG::9001

I have to build DEM in planar topXY. I tried using Alexey Pasumansky code with modification for version Photoscan 1.3.2.
link to forum post: http://www.agisoft.com/forum/index.php?topic=1322.msg15758#msg15758
For DEM:

Code: [Select]
if not chunk.transform:
chunk.transform = PhotoScan.Matrix ([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])

proj = PhotoScan.Matrix ([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])  #Top XY

chunk.buildDem(source=PhotoScan.DenseCloudData , interpolation=EnabledInterpolation,projection=proj)

But i am getting this error:
Code: [Select]
TypeError: argument 3 must be PhotoScan.CoordinateSystem, not PhotoScan.Matrix
But documentation for photoscan api says:
Quote
buildDem(source=DenseCloudData, interpolation=EnabledInterpolation [ , projection ][ , region ][ ,
classes ][ , progress ] )
Build elevation model for the chunk.
Parameters
• source (PhotoScan.DataSource) – Selects between dense point cloud and sparse
point cloud. If not specified, uses dense cloud if available.
• interpolation (PhotoScan.Interpolation) – Interpolation mode.
• projection (Matrix or CoordinateSystem) – Sets output projection.
• region (tuple of 4 floats) – Region to be exported in the (x0, y0, x1, y1) for-
mat.
• classes (list of PhotoScan.PointClass) – List of dense point classes to be used
for surface extraction.
• progress (Callable[[float], None]) – Progress callback.

Please do help me with this.

4
Python and Java API / Build DEM with planar top XY
« on: August 25, 2017, 02:17:28 PM »
Hi,

I am trying to build DEM for images and marker file has been added in local coordinate system i.e EPSG::9001

I have to build DEM in planar topXY. I tried using Alexey Pasumansky code with modification for version Photoscan 1.3.2.
link to forum post: http://www.agisoft.com/forum/index.php?topic=1322.msg15758#msg15758
For DEM:

Code: [Select]
if not chunk.transform:
chunk.transform = PhotoScan.Matrix ([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])

proj = PhotoScan.Matrix ([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])  #Top XY

chunk.buildDem(source=PhotoScan.DenseCloudData , interpolation=EnabledInterpolation,projection=proj)

But i am getting this error:
Code: [Select]
TypeError: argument 3 must be PhotoScan.CoordinateSystem, not PhotoScan.Matrix
But documentation for photoscan api says:
Quote
buildDem(source=DenseCloudData, interpolation=EnabledInterpolation [ , projection ][ , region ][ ,
classes ][ , progress ] )
Build elevation model for the chunk.
Parameters
• source (PhotoScan.DataSource) – Selects between dense point cloud and sparse
point cloud. If not specified, uses dense cloud if available.
• interpolation (PhotoScan.Interpolation) – Interpolation mode.
• projection (Matrix or CoordinateSystem) – Sets output projection.
• region (tuple of 4 floats) – Region to be exported in the (x0, y0, x1, y1) for-
mat.
• classes (list of PhotoScan.PointClass) – List of dense point classes to be used
for surface extraction.
• progress (Callable[[float], None]) – Progress callback.

Please do help me with this.

5
Hey
Was new to photoscan python scripting. How do i get the marker error while adding marker on image through python script? Is there any such function in photoscan?

6
Hi

I am new to photoscan scripting. I had written the script to add markers from csv with #camera_label #marker_label  #px_x #px_y #world_x #world_y #altitude columns

Following is the code:
Code: [Select]
import csv
import PhotoScan

def read_marker(path_to_marker_file,chunk=None):
    marker_list = list(csv.DictReader(open(path_to_marker_file)))
    number_of_cameras = len(marker_list)
    j = 0
    while (j < number_of_cameras):
        title = list(marker_list[j].keys())
        camera_name = marker_list[j]["camera_label"]
        marker_name = marker_list[j]["marker_label"]
        x = float(marker_list[j]["px_x"])
        y = float(marker_list[j]["px_y"])
        cx = float(marker_list[j]["world_x"])
        cy = float(marker_list[j]["world_y"])
        cz = float(marker_list[j]["altitude"])
        photos_total = len(chunk.cameras)  # number of photos in chunk
        flag = 0

        for i in range(0, photos_total):
            if chunk.cameras[i].label == camera_name:
                for marker in chunk.markers:  # searching for the marker (comparing with all the marker labels in chunk)
                    if marker.label == marker_name:
                        marker.projections[chunk.cameras[i]] = (x, y)  # setting up marker projection of the correct photo)
                        flag = 1
                        break

                if not flag:
                    marker = chunk.addMarker()
                    marker.label = marker_name
                    marker.projections[chunk.cameras[i]] = (x, y)

                marker.reference.location = PhotoScan.Vector([cx, cy, cz])
                break

        chunk.updateTransform()
        j=j+1



if __name__=="__main__":
    doc = PhotoScan.app.document
    chunk = doc.chunk

    path = PhotoScan.app.getOpenFileName("Specify the path to the file:")
    read_marker(path,chunk)

So, I wanted to remove the markers in the image with projections less than 3 and error(pix) greater 0.5 by my script. If I do it manually, the processing time decreases drastically.

Please do help me with this scripting!

7
Thank you. It works!

8
I was trying to run Photoscan headless. I want to run that photoscan in other machine through ssh using:
Code: [Select]
ssh {host-ip address}
When I just use ssh login and try to run my script using:
Code: [Select]
photoscan -r {script-name}
I get this error:
QXcbConnection: Could not connect to display
Aborted (core dumped)



But when I run ssh -X to login,
Code: [Select]
ssh -X {host-ip address}
And if I run the photoscan script now
Code: [Select]
photoscan -r {script-name}, it runs completely fine.
But, wanted to run photoscan in ssh login only as most of the Virtual machines don't allow ssh -X
Please do help me out with this.

Pages: [1]