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] |
dev:viewer:actions:add_view [2023/02/14 14:21] jeroen removed |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Add View ====== | + | ====== Add, Move, Change View ====== |
+ | |||
+ | ===== View Modes ===== | ||
+ | |||
+ | The available View Modes depend on the loaded Resources: | ||
+ | |||
+ | * 3D View | ||
+ | * Streetlevel Spherical View | ||
+ | * Streetlevel Planar View | ||
+ | * Aerial Planar View | ||
+ | * Aerial Oblique Planar View | ||
+ | |||
+ | ===== Add View ====== | ||
Click on the ' | Click on the ' | ||
Line 5: | Line 17: | ||
The different View modes are described [[dev: | The different View modes are described [[dev: | ||
- | ===== Find Best Photo ====== | + | ===== Move View ===== |
+ | |||
+ | Move an existing View to a new location | ||
- | ==== Input Parameters ==== | + | Hover over the ID of the View on top, click ' |
- | FIXME Add find photo algorithm information | + | To move all views at once, hold Shift in move mode and choose a new location. While holding Shift, ' |
- | Inputs: | + | ===== Switch View Mode ===== |
- | * 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. | + | Change |
- | Some constants : | + | Hover over the eye-icon on top of the view to open the 'View Mode Fly-out' |
- | * AerialDistances | + | ===== Focus other Views ===== |
- | * StreetlevelDistances | + | |
- | Default parameter values : | ||
- | ^ ^ Streetlevel Spherical ^ Streetlevel Planar ^ UAV Planar ^ Oblique Planar ^ | + | ===== Search & Open best photo ===== |
- | | focusPosition | + | |
- | | viewPosition | + | |
- | | minPhotos | + | |
- | | relevantPhotosMax | + | |
- | | searchDistances2D | + | |
- | | findCloserPhotoAlgorithm | SPATIAL_DISTANCE | + | |
- | | requireFocusVisible | false | true | true | true | | + | |
- | | isStreetlevel | + | |
- | | searchCenter | + | |
- | < | + | Add, Move and Focus Views trigger the request to Search and Open the "best" image. |
- | <sup>2</ | + | Depending on the use case and data-type other methods or configurations can be used. \\ |
+ | Anyway, the action consists of 2 consecutive steps | ||
+ | | ||
+ | | ||
- | ==== Algorithm | + | ==== Get Candidates |
- | FindClosestPhoto | + | Find relevant photos around the requested Focus Coordinate. \\ |
+ | Any photo becomes a candidate if | ||
+ | * Focus Coordinate is nearby the Photo Coordinate (Search Radius) | ||
+ | * Focus Coordinate is in the field of View of the Photo. | ||
- | <code javascript> | + | Searching |
- | function(resource, | + | |
- | { | + | * the maximum search radius |
- | | + | |
- | { | + | |
- | 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> | + | ==== Sort Photos ==== |
- | function sortPhotos(photoList) | + | |
- | { | + | |
- | for(photo in photoList) | + | |
- | { | + | |
- | if (parameters.findCloserPhotoAlgorithm | + | |
- | { | + | |
- | photo.distance | + | |
- | } | + | |
- | if (parameters.findCloserPhotoAlgorithm | + | |
- | { | + | |
- | if (viewPosition!=null) | + | |
- | { | + | |
- | photo.distance | + | |
- | } | + | |
- | else | + | |
- | { | + | |
- | photo.distance | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | sortByDistance(photoList); | + | |
- | return photoList; | + | |
- | } | + | |
- | </ | + | |
- | | + | |
+ | Sort candidates by relevance, to get the best image and order alternative images. \\ | ||
+ | The best image has the smallest value for the selected option | ||
+ | Options: | ||
+ | * By Direction offset \\ Offset between the Candidate Direction (Candidate to Focus Coordinate) and Request Direction (3D View Position to Focus Coordinate). | ||
+ | * By Pixel offset \\ Pixel offset of the Focus Coordinate projected on the Candidate Image to the Candidate Image Center. | ||
+ | * By Spatial distance \\ Spatial distance of the Focus Coordinate to the Candidate Coordinate. | ||
- | distanceToProjectionCenter(): | ||