Просмотр исходного кода

Change resolutions xs+, sm, sm+

customisations
alemart 11 месяцев назад
Родитель
Сommit
52b221dcbe

+ 1
- 1
docs/api/camera-source.md Просмотреть файл

13
 **Arguments**
13
 **Arguments**
14
 
14
 
15
 * `settings: object, optional`. An object with the following keys (all are optional):
15
 * `settings: object, optional`. An object with the following keys (all are optional):
16
-    * `resolution: Resolution`. The desired [resolution](resolution.md) of the video. The higher the resolution, the longer it takes for the video to be uploaded to the GPU, which impacts performance. The lower the resolution, the less accurate the tracking will be. Suggested values: `"md+"`, `"md"`, `"sm+"`.
16
+    * `resolution: Resolution`. The desired [resolution](resolution.md) of the video. The higher the resolution, the longer it takes for the video to be uploaded to the GPU, which impacts performance. The lower the resolution, the less accurate the tracking will be. Suggested values: `"md+"`, `"md"`, `"sm+"`, `"sm"`.
17
     * `aspectRatio: number`. A hint specifying the preferred aspect ratio of the video.
17
     * `aspectRatio: number`. A hint specifying the preferred aspect ratio of the video.
18
     * `constraints: MediaTrackConstraints`. Additional video constraints that will be passed to `navigator.mediaDevices.getUserMedia()`.
18
     * `constraints: MediaTrackConstraints`. Additional video constraints that will be passed to `navigator.mediaDevices.getUserMedia()`.
19
 
19
 

+ 7
- 7
docs/api/resolution.md Просмотреть файл

1
 # Resolution
1
 # Resolution
2
 
2
 
3
-A `Resolution` is a setting defined by a string. It is mapped to a size measured in pixels according to special rules. You may use it, for example, to change the resolution of a video captured by a webcam, to adjust the resolution of a video when it is processed by a tracker, or to set the resolution of the virtual scene when it is rendered.
3
+A `Resolution` is a setting defined by a string. It is mapped to a size measured in pixels according to special rules. You may use it, for example, to change the resolution of a video captured by a webcam, to adjust the resolution of a video when it is processed by a tracker, or to set the rendering resolution of a virtual scene.
4
 
4
 
5
 The table below shows examples of how resolution strings are converted to pixels:
5
 The table below shows examples of how resolution strings are converted to pixels:
6
 
6
 
7
-| Resolution | 16:9 landscape | 16:10 landscape | 4:3 landscape | Notes |
8
-| ---------- | -------------- | --------------- | ------------- | ----- |
7
+| Resolution | 16:9 | 16:10 | 4:3 | Notes |
8
+| ---------- | ---- | ----- | --- | ----- |
9
 | `"xs"` | 214x120 | 192x120 | 160x120 | |
9
 | `"xs"` | 214x120 | 192x120 | 160x120 | |
10
-| `"xs+"` | 284x160 | 256x160 | 214x160 | |
11
-| `"sm"` | 356x200 | 320x200 | 266x200 | |
12
-| `"sm+"` | 426x240 | 384x240 | 320x240 | 240p |
10
+| `"xs+"` | 256x144 | 230x144 | 192x144 | 144p |
11
+| `"sm"` | 426x240 | 384x240 | 320x240 | 240p |
12
+| `"sm+"` | 512x288 | 460x288 | 384x288 | |
13
 | `"md"` | 568x320 | 512x320 | 426x320 | |
13
 | `"md"` | 568x320 | 512x320 | 426x320 | |
14
 | `"md+"` | 640x360 | 576x360 | 480x360 | 360p |
14
 | `"md+"` | 640x360 | 576x360 | 480x360 | 360p |
15
 | `"lg"` | 854x480 | 768x480 | 640x480 | 480p |
15
 | `"lg"` | 854x480 | 768x480 | 640x480 | 480p |
17
 | `"xl"` | 1280x720 | 1152x720 | 960x720 | 720p |
17
 | `"xl"` | 1280x720 | 1152x720 | 960x720 | 720p |
18
 | `"xl+"` | 1366x768 | 1228x768 | 1024x768 | |
18
 | `"xl+"` | 1366x768 | 1228x768 | 1024x768 | |
19
 | `"xxl"` | 1600x900 | 1440x900 | 1200x900 | |
19
 | `"xxl"` | 1600x900 | 1440x900 | 1200x900 | |
20
-| `"xxl+"` | 1706x960 | 1536x960 | 1280x960 | 960p |
20
+| `"xxl+"` | 1706x960 | 1536x960 | 1280x960 | |

+ 1
- 1
plugins/aframe-with-encantar.js Просмотреть файл

742
     schema: {
742
     schema: {
743
 
743
 
744
         /** resolution of the tracker: "xs" | "xs+" | "sm" | "sm+" | "md" | "md+" | "lg" | "lg+" | "xl" | "xl+" | "xxl" | "xxl+" */
744
         /** resolution of the tracker: "xs" | "xs+" | "sm" | "sm+" | "md" | "md+" | "lg" | "lg+" | "xl" | "xl+" | "xxl" | "xxl+" */
745
-        'resolution': { type: 'string', default: 'sm+' },
745
+        'resolution': { type: 'string', default: 'sm' },
746
 
746
 
747
     },
747
     },
748
 
748
 

+ 1
- 1
src/sources/camera-source.ts Просмотреть файл

46
 
46
 
47
 /** Default options for camera sources */
47
 /** Default options for camera sources */
48
 const DEFAULT_CAMERA_OPTIONS: Readonly<Required<CameraSourceOptions>> = {
48
 const DEFAULT_CAMERA_OPTIONS: Readonly<Required<CameraSourceOptions>> = {
49
-    resolution: 'md', //'sm+',
49
+    resolution: 'md',
50
     aspectRatio: 16/9,
50
     aspectRatio: 16/9,
51
     constraints: { facingMode: 'environment' },
51
     constraints: { facingMode: 'environment' },
52
 };
52
 };

+ 1
- 1
src/trackers/image-tracker/settings.ts Просмотреть файл

21
  */
21
  */
22
 
22
 
23
 /** Default tracking resolution */
23
 /** Default tracking resolution */
24
-export const DEFAULT_TRACKING_RESOLUTION = 'sm+';
24
+export const DEFAULT_TRACKING_RESOLUTION = 'sm';
25
 
25
 
26
 /** Maximum number of keypoints to be stored for each reference image when in the training state */
26
 /** Maximum number of keypoints to be stored for each reference image when in the training state */
27
 export const TRAIN_MAX_KEYPOINTS = 1024; //512;
27
 export const TRAIN_MAX_KEYPOINTS = 1024; //512;

+ 5
- 4
src/utils/resolution.ts Просмотреть файл

30
 /** Reference heights when in landscape mode, measured in pixels */
30
 /** Reference heights when in landscape mode, measured in pixels */
31
 const REFERENCE_HEIGHT: { readonly [R in Resolution]: number } = {
31
 const REFERENCE_HEIGHT: { readonly [R in Resolution]: number } = {
32
     'xs' : 120,
32
     'xs' : 120,
33
-    'xs+': 160,
34
-    'sm' : 200,
35
-    'sm+': 240,
33
+    'xs+': 144,
34
+    'sm' : 240,
35
+    'sm+': 288,
36
     'md' : 320,
36
     'md' : 320,
37
     'md+': 360,
37
     'md+': 360,
38
     'lg' : 480,
38
     'lg' : 480,
39
     'lg+': 600,
39
     'lg+': 600,
40
-    'xl' : 720, // should we define an alias, "hd"?
40
+    'xl' : 720,
41
     'xl+': 768,
41
     'xl+': 768,
42
     'xxl': 900,
42
     'xxl': 900,
43
     'xxl+':960,
43
     'xxl+':960,
44
     //'ul-': 1024,
44
     //'ul-': 1024,
45
     //'ul': 1080, // what should we call this? xxxl? ul? (ultra large?)
45
     //'ul': 1080, // what should we call this? xxxl? ul? (ultra large?)
46
     //'ul+': 1200,
46
     //'ul+': 1200,
47
+    // instead of defining xxxl, what if we accept custom resolution names such as "720p" and "1080p"?
47
 };
48
 };
48
 
49
 
49
 /**
50
 /**

Загрузка…
Отмена
Сохранить