Forum

Author Topic: Photos filtering distance limit  (Read 4870 times)

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Photos filtering distance limit
« on: April 03, 2017, 12:22:43 PM »
Hi !

( Monday is requests day !  ;) )

The "Filter photos by selection" tool is really useful and pleasant, for example, when we have to manually place markers.
But, as we work a lot with dataset of pictures taken with a 45° pitch (Camera fixed at the top of a pole), we often get markers virtually visible from 80% of the dataset.
For instance when we manage a survey in the street, the filter tool give us pictures very far from marker selected. So either It's impossible to see the marker because of a mask (Picture taken from another street), or the picture is so far from the point that we don't even have 1 pixel on the marked place.

The request should be then:
- May it be possible to add a pre-set parameter, a limit, after which pictures are removed by the filter even if they are pointed to the direction of the selected marker ?
This limit may be defined by:
- A distance: When pictures is farther than XXX m from the selected marker
- A GSD: When the GSD of a picture become greater than YYY cm at the distance of the selected marker. This option is directly linked to the distance between the Photo and the Marker but it could be more pleasant for everyday use.

Hope I've been quite clear in my suggestion  ;D

Regards
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Photos filtering distance limit
« Reply #1 on: April 03, 2017, 01:06:27 PM »
Hello Yoann,

I think this level of customization requires Python scripting, as there are a lot of factors that can be taken into consideration that cannot be implemented in GUI without overload of parameters and filtering options.

For example, the following code should leave in the Photos pane only cameras that are not farther than X meters (user input) from the first marker in the project:

Code: [Select]
import PhotoScan
chunk = PhotoScan.app.document.chunk

filtered = list()
marker = chunk.markers[0]
X = PhotoScan.app.getFloat("Input distance threshold:", 50)
scale = chunk.transform.scale

for  camera in chunk.cameras:
      distance = (marker.position - camera.center).norm() * scale
      if  distance < X:
            filtered.append(camera)

pane = PhotoScan.app.PhotosPane()
pane.setFilter(filtered)
Best regards,
Alexey Pasumansky,
Agisoft LLC

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Photos filtering distance limit
« Reply #2 on: April 03, 2017, 03:11:14 PM »
Hello Alexey,

Thanks for your help !
- I have some difficulties to understand how it could overload other parameters. It could be an add-on paramater, set at "0" by default (to be analyze as "no limit" as it is for "key point limit" in alignment tool)).
Then the user may define his own value depending on his usage.

About your code:
- I handled some difficulties to apply it because it crash if
     (1) the first marker is not define (in the case we imported a huge number of known point but only a few were marked in our model)
     (2) at least one picture is not define (Disabled camera)
I will try to add by myself  an if-loop for disabled camera and a manual selection of the referenced marker for filtering
- But my main problem is, since 1.3.0 update, photos don't center by themselves on a marker, even if it's been clicked in the reference pane. This "auto-centering" now only work after "filtering by marker". So I cannot get this "auto-centering" when filtering using Python scripting. May you have a piece of help about that ?
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

3DFranz

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Photos filtering distance limit
« Reply #3 on: April 13, 2017, 10:12:58 AM »
How do i have to correct this script, to run in with version 1.3.1 and Version 1.26?
Thx a lot for help

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Photos filtering distance limit
« Reply #4 on: April 13, 2017, 11:46:19 AM »
Hello 3DFranz,

PhotosPane class has been implemented in the version 1.3, so the script cannot be applied to the older versions.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Photos filtering distance limit
« Reply #5 on: April 18, 2017, 05:58:27 PM »
Hello Alexey,

Would it be possible to put back something which have been removed since 1.3 update ?

Actually, until 1.2.6, when we were scrolling pictures while a marker was selected in the reference pane, the view was centered on this marker when it was visible on the picture.
Since 1.3, centering on a define marker is only possible right after filtering pictures by marker.

I would like to get back this centering after manual filtering. A workmate of mine, who's working on 1.2.6 can do this... But, working on the lastest update, I can't... :-X

Regards
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

James

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: Photos filtering distance limit
« Reply #6 on: April 19, 2017, 07:28:13 PM »
Actually, until 1.2.6, when we were scrolling pictures while a marker was selected in the reference pane, the view was centered on this marker when it was visible on the picture.
Since 1.3, centering on a define marker is only possible right after filtering pictures by marker.

I added this to a bug report - http://www.agisoft.com/forum/index.php?topic=6912.msg33329#msg33329