Forum

Author Topic: Extract cameras that have the specific coordinates in it  (Read 4778 times)

koriel-angelswing

  • Newbie
  • *
  • Posts: 22
    • View Profile
Extract cameras that have the specific coordinates in it
« on: May 13, 2020, 10:54:42 AM »
Hi Agisoft Team, thank you always for replying very kind.

I want to export cameras list which have the specific coordinates in them before adding a marker.

The result I want is cameras list and image's (x, y) point that represents the specified coordinates in each camera.

This is because I want to check the area to make it easier to find the location to which I add a marker.

neavrys

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Extract cameras that have the specific coordinates in it
« Reply #1 on: May 13, 2020, 10:52:04 PM »
I don't know if a function is already build for this in the API. But, in the GUI there is one.

On the model or DEM view, right click where you want  "Filter photos by Point", you get a filtered listing the photos view, control a to select all.

Then create a list from the images that are selected.


« Last Edit: May 13, 2020, 11:08:02 PM by neavrys »

koriel-angelswing

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Extract cameras that have the specific coordinates in it
« Reply #2 on: May 14, 2020, 08:25:19 AM »
I don't know if a function is already build for this in the API. But, in the GUI there is one.

On the model or DEM view, right click where you want  "Filter photos by Point", you get a filtered listing the photos view, control a to select all.

Then create a list from the images that are selected.

Thank you for replying but this forum is regarding Python and Java API :) I know that feature is in GUI but I am wondering how to port that feature to the python scripts.

koriel-angelswing

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Extract cameras that have the specific coordinates in it
« Reply #3 on: May 19, 2020, 08:36:01 AM »
Replying myself. I did some tricks. This method is adding two temporal markers to calculate image's local x, y responding to the CRS coordinate.

```
            chunk = doc.chunk

            chunk.addMarker()
            chunk.markers[-1].reference.location = CoordinateSystem.transform((longitude, latitude, altitude), crs, chunk.crs)
           
            chunk.addMarker(chunk.markers[-1].position)

            projections = chunk.markers[-1].projections

            candidates = {}
            for projection in projections.items():
                candidates[projection[0].label] = [projection[1].coord.x, projection[1].coord.y]
```

From this code, you can get like this:

"<image-name>": [
  image's x pixel,
  image's y pixel
]

"candidates":{
      "0021_0021_100_0001_0021":[
         205.0494384765625,
         207.9481964111328
      ],
      "0022_0022_100_0001_0022":[
         76.4704818725586,
         1245.6832275390625
      ],
      "0023_0023_100_0001_0023":[
         63.91649627685547,
         2422.911865234375
      ],
      "0024_0024_100_0001_0024":[
         140.0779266357422,
         3388.39013671875
      ],
      "0026_0026_100_0001_0026":[
         1339.7071533203125,
         52.32271194458008
      ],
      "0027_0027_100_0001_0027":[
         1617.157958984375,
         227.45326232910156
      ],
      "0028_0028_100_0001_0028":[
         3934.880859375,
         1629.427001953125
      ],
      "0029_0029_100_0001_0029":[
         3871.526611328125,
         2937.04345703125
      ],
      "0055_0055_100_0001_0055":[
         3610.4873046875,
         163.33616638183594
      ],
      "0056_0056_100_0001_0056":[
         3580.642333984375,
         1402.5489501953125
      ],
      "0057_0057_100_0001_0057":[
         3508.6845703125,
         2743.943603515625
      ],
      "0058_0058_100_0001_0058":[
         3243.973388671875,
         3243.9130859375
      ],
      "0059_0059_100_0001_0059":[
         1663.4317626953125,
         3028.37158203125
      ],
      "0062_0062_100_0001_0062":[
         265.071044921875,
         1801.63330078125
      ],
      "0063_0063_100_0001_0063":[
         303.8362731933594,
         2870.15771484375
      ]
   }
« Last Edit: May 21, 2020, 05:54:49 AM by koriel-angelswing »