Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:viewer:actions:add_view [2023/02/13 09:27] pieter [Find Best Photo] |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Add View ====== | ||
- | |||
- | Click on the ' | ||
- | The available reality data will define the available Open View options.\\ | ||
- | The different View modes are described [[dev: | ||
- | |||
- | ===== Find Best Photo ====== | ||
- | |||
- | ==== Input Parameters ==== | ||
- | |||
- | FIXME Add find photo algorithm information | ||
- | |||
- | Inputs: | ||
- | * resources | ||
- | * focusPosition : The position we want to observe. | ||
- | * viewPosition : The position we are observing the photo position from. | ||
- | * minPhotos : The minimum amount of photos to find after applying the requireFocusVisible filter. Ignored if not positive. | ||
- | * relevantPhotosMax : The maximum number of relevant photos to return. | ||
- | * searchDistances2D : The array of search distances to use when finding a closest photo. | ||
- | * findCloserPhotoAlgorithm : The algorithm to sort results and find a closest photo. | ||
- | * PIXEL_DISTANCE : Identifies the technique to find a closest photo by projecting the search coordinate on the photo and then sorting by distance to the photo center. | ||
- | * SPATIAL_DISTANCE : Identifies the technique to find a closest photo by taking the 3d distance to the view position (fall back on focus position). | ||
- | * requireFocusVisible : For planars, only return photo' | ||
- | * isStreetlevel : We are searching on streetlevel? | ||
- | * If true the 'is focus visible?' | ||
- | * for each photo by looking at the angular distance between the photo heading (pan) and the heading defined by the vector from photo position to focus position. | ||
- | * This yields a better result for streetlevel planars (sphericals don't have a 'focus visible' | ||
- | * searchCenter : Identifies searching around the view position. | ||
- | * FOCUS : Identifies searching around the focus position and selecting the photo closest to the focus position. | ||
- | * FOCUS_AND_VIEW : Identifies searching around the focus position and selecting the photo closest to the view position if provided (focus position as fallback). | ||
- | * VIEW : Identifies searching around the view position and selecting the photo closest to the view position. | ||
- | |||
- | There are other input parameters, but they do not apply to how the algorithm functions. | ||
- | |||
- | Some constants : | ||
- | |||
- | * AerialDistances = '' | ||
- | * StreetlevelDistances = '' | ||
- | |||
- | Default parameter values : | ||
- | |||
- | ^ ^ Streetlevel Spherical ^ Streetlevel Planar ^ UAV Planar ^ Oblique Planar ^ | ||
- | | focusPosition | ||
- | | viewPosition | ||
- | | minPhotos | ||
- | | relevantPhotosMax | ||
- | | searchDistances2D | ||
- | | findCloserPhotoAlgorithm | SPATIAL_DISTANCE | ||
- | | requireFocusVisible | false | true | true | true | | ||
- | | isStreetlevel | ||
- | | searchCenter | ||
- | |||
- | < | ||
- | < | ||
- | |||
- | ==== Algorithm ==== | ||
- | |||
- | FindClosestPhoto | ||
- | |||
- | <code javascript> | ||
- | function(resource, | ||
- | { | ||
- | for(searchDistance in searchDistances2D) | ||
- | { | ||
- | let searchCenterPosition = (searchCenter = VIEW) ? viewPosition : focusPosition; | ||
- | let photoList = resource.findPhotosInCircle(searchCenterPosition, | ||
- | if (requireFocusVisible) | ||
- | { | ||
- | if (parameters.isStreetlevel) | ||
- | { | ||
- | photoList = keepPhotosWithProjectionInsidePan(photoList, | ||
- | } | ||
- | else | ||
- | { | ||
- | photoList = keepPhotosWithProjectionInsideMargin(photoList, | ||
- | } | ||
- | if (photoList.length< | ||
- | { | ||
- | photoList = keepPhotosWithProjectionInsideMargin(photoList, | ||
- | } | ||
- | } | ||
- | if (photoList.length< | ||
- | { | ||
- | continue; | ||
- | } | ||
- | photoList = sortPhotos(photoList, | ||
- | return { | ||
- | photo: photoList[0], | ||
- | relevantPhotos: | ||
- | } | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | <code javascript> | ||
- | function sortPhotos(photoList) | ||
- | { | ||
- | for(photo in photoList) | ||
- | { | ||
- | if (parameters.findCloserPhotoAlgorithm = PIXEL_DISTANCE) | ||
- | { | ||
- | photo.distance = getDistanceToProjectionCenter(photo, | ||
- | } | ||
- | if (parameters.findCloserPhotoAlgorithm | ||
- | { | ||
- | if (viewPosition!=null) | ||
- | { | ||
- | photo.distance = getDistanceToPosition(photo, | ||
- | } | ||
- | else | ||
- | { | ||
- | photo.distance = getDistanceToPosition(photo, | ||
- | } | ||
- | } | ||
- | } | ||
- | sortByDistance(photoList); | ||
- | return photoList; | ||
- | } | ||
- | </ | ||
- | | ||
- | |||
- | |||
- | |||
- | distanceToProjectionCenter(): | ||
Last modified:: 2023/02/13 09:27