FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openMVS/scripts/python/MvsReadMVS.py at develop · WebODM/openMVS · GitHub
WebODM
/
openMVS
Public
forked from
cdcseacave/openMVS
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
openMVS
/
scripts
/
python
/
MvsReadMVS.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (29 loc) · 1.28 KB
Breadcrumbs
openMVS
/
scripts
/
python
/
MvsReadMVS.py
Copy path
File metadata and controls
37 lines (29 loc) · 1.28 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python3
# -*- encoding: utf-8 -*-
'''
Example usage of MvsUtils.py for reading MVS interface archive content.
usage: MvsReadMVS.py [-h] [--input INPUT] [--output OUTPUT]
'''
from
argparse
import
ArgumentParser
import
json
from
MvsUtils
import
loadMVSInterface
import
os
def
main
():
parser
=
ArgumentParser
()
parser
.
add_argument
(
'-i'
,
'--input'
,
type
=
str
,
required
=
True
,
help
=
'Path to the MVS interface archive'
)
parser
.
add_argument
(
'-o'
,
'--output'
,
type
=
str
,
required
=
True
,
help
=
'Path to the output json file'
)
args
=
parser
.
parse_args
()
mvs
=
loadMVSInterface
(
args
.
input
)
for
platform_index
in
range
(
len
(
mvs
[
'platforms'
])):
for
camera_index
in
range
(
len
(
mvs
[
'platforms'
][
platform_index
][
'cameras'
])):
camera
=
mvs
[
'platforms'
][
platform_index
][
'cameras'
][
camera_index
]
image_max
=
max
(
camera
[
'width'
],
camera
[
'height'
])
fx
=
camera
[
'K'
][
0
][
0
]
/
image_max
fy
=
camera
[
'K'
][
1
][
1
]
/
image_max
poses_size
=
len
(
camera
[
'poses'
])
print
(
'Camera model loaded: platform {}; camera {}; f {:.3f}x{:.3f}; poses {}'
.
format
(
platform_index
,
camera_index
,
fx
,
fy
,
poses_size
))
os
.
makedirs
(
os
.
path
.
dirname
(
args
.
output
),
exist_ok
=
True
)
with
open
(
args
.
output
,
'w'
)
as
file
:
json
.
dump
(
mvs
,
file
,
indent
=
2
)
if
__name__
==
'__main__'
:
main
()
Back
|
FazBrowse Home
|
New Git URL