(三维重建学习)已有位姿放入colmap和3D Gaussian Splatting训练

news2024/11/18 17:38:21

这里写目录标题

  • 一、colmap解算数据放入高斯
    • 1. 将稀疏重建的文件放入高斯
    • 2. 将稠密重建的文件放入高斯
  • 二、vkitti数据放入高斯

一、colmap解算数据放入高斯

运行Colmap.bat文件之后,进行稀疏重建和稠密重建之后可以得到如下文件结构。
在这里插入图片描述

1. 将稀疏重建的文件放入高斯

按照以下文件结构将colmap中的数据放入高斯中,就可以执行 python train.py -s data/data_blender_60 -m data/data_blender_60/output
在这里插入图片描述

2. 将稠密重建的文件放入高斯

按照以下文件结构将colmap中的数据放入高斯中,
在这里插入图片描述
此时若直接运行train文件会有如下报错:
在这里插入图片描述
意思是没有获取到cameras,点开sparse/0中的cameras文件,发现全是null,此时,**先删除sparse/0中的cameras.bin和images.bin,再将distorted/sparse/0中的cameras.bin和images.bin文件复制到sparse/0中。**实在不行也可以在colmap中重新导出一下模型。

就可以执行 python train.py -s data/data_blender_60 -m data/data_blender_60/output

二、vkitti数据放入高斯

vkitti数据数据格式如下:
在这里插入图片描述
colmap数据数据格式如下(外参数据一定要空一行否则后续不会执行):
在这里插入图片描述
最后我的colmap中目录结构如下:
在这里插入图片描述
先自行创建以下几个文件夹:执行command.bat

@echo off
if not exist created\sparse\model (
    mkdir created\sparse\model
    echo Created directory: created\sparse\model
)
if not exist triangulated\sparse\model (
    mkdir triangulated\sparse\model
    echo Created directory: triangulated\sparse\model
)
if not exist mapper\sparse\model (
    mkdir mapper\sparse\model
    echo Created directory: mapper\sparse\model
)

接下来开始操作:

写了一个程序进行格式转换:vkitti_to_colmap_cameras.py

import numpy as np
from scipy.spatial.transform import Rotation

index = 339 #要转换的图片张数


def cameras(input_path, output_path):
    # 定义一个字典用于存储提取的数据
    data_dict = {'frame': [], 'cameraID': [], 'PARAMS': []}

    # 打开文件并读取内容
    with open(input_path, 'r') as file:
        lines = file.readlines()[1:]
        # # 删除 camera=1的行
        # lines = [line for index, line in enumerate(lines) if index % 2 == 0]

    # 遍历每一行数据
    for line in lines:
        # 分割每一行数据
        elements = line.split()

        # 提取frame和cameraID
        frame = int(elements[0])
        cameraID = int(elements[1])

        if cameraID == 1:
            continue

        # 提取PARAMS
        PARAMS = elements[2:6]

        # 将提取的数据存入字典
        data_dict['frame'].append(frame)
        data_dict['cameraID'].append(frame + 1)
        data_dict['PARAMS'].append(PARAMS)

    width = 1242
    height = 375
    # 将处理后的内容写回文件
    # 打开文件以写入数据
    with open(output_path, 'w') as output_file:
        # 写入文件头部信息
        output_file.write(
            "# Camera list with one line of data per camera:\n# CAMERA_ID, MODEL, WIDTH, HEIGHT, PARAMS[fx,fy,cx,cy]\n# Number of cameras: 1\n")

        # 遍历每个数据点
        for i in range(len(data_dict['frame'])):
            # 获取相应的数据
            if data_dict['frame'][i] > index - 1:
                break
            cameraID = data_dict['cameraID'][i]
            PARAMS = data_dict['PARAMS'][i]

            fx, fy, cx, cy = PARAMS

            # 写入数据到文件
            output_file.write(
                f"{cameraID} PINHOLE {width} {height} {fx} {fy} {cx} {cy}\n")


def images(input_path, output_path):
    # 定义一个字典用于存储提取的数据
    data_dict = {'frame': [], 'cameraID': [], 'quaternions': []}

    # 打开文件并读取内容
    with open(input_path, 'r') as file:
        lines = file.readlines()[1:]

    # 遍历每一行数据
    for line in lines:
        # 分割每一行数据
        elements = line.split()

        # 提取frame和cameraID
        frame = int(elements[0])
        cameraID = int(elements[1])

        if cameraID == 1:
            continue

        # 提取旋转矩阵部分
        rotation_matrix = np.array([[float(elements[i]) for i in range(2, 11, 4)],
                                    [float(elements[i]) for i in range(3, 12, 4)],
                                    [float(elements[i]) for i in range(4, 13, 4)]])

        # 将旋转矩阵转换为四元数
        rotation = Rotation.from_matrix(rotation_matrix)
        quaternion = rotation.as_quat()

        # 将提取的数据存入字典
        data_dict['frame'].append(frame)
        data_dict['cameraID'].append(frame + 1)
        data_dict['quaternions'].append(quaternion)

    # 打开文件以写入数据
    with open(output_path, 'w') as output_file:
        # 写入文件头部信息
        output_file.write(
            "# Image list with two lines of data per image:\n# IMAGE_ID, QW, QX, QY, QZ, TX, TY, TZ, CAMERA_ID, NAME\n# POINTS2D[] as (X, Y, POINT3D_ID)\n# Number of images: 339, mean observations per image: 1\n")

        # 遍历每个数据点
        for i in range(len(data_dict['frame'])):
            # 获取相应的数据
            if data_dict['frame'][i] > index - 1:
                break

            frame = data_dict['frame'][i]

            cameraID = data_dict['cameraID'][i]
            quaternion = data_dict['quaternions'][i]

            # 将四元数和平移向量分开
            qw, qx, qy, qz = quaternion
            tx, ty, tz = [float(elem) for elem in lines[i].split()[11:14]]

            # 写入数据到文件
            output_file.write(
                f"{frame + 1} {qw} {qx} {qy} {qz} {tx} {ty} {tz} {cameraID} rgb_{frame:05d}.jpg\n\n")


if __name__ == '__main__':
    input_path = "./intrinsic.txt"
    output_path = "./cameras.txt"
    cameras(input_path, output_path)
    input_path = "./extrinsic.txt"
    output_path = "./images.txt"
    images(input_path, output_path)

我的同学写了一个创建数据库的代码 ,这将cameras.txt和images.txt文件中的数据都放入database.db中:create_colmap_database.py

# Copyright (c) 2023, ETH Zurich and UNC Chapel Hill.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#
#     * Neither the name of ETH Zurich and UNC Chapel Hill nor the names of
#       its contributors may be used to endorse or promote products derived
#       from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.


# This script is based on an original implementation by True Price.

import sys
import sqlite3
import numpy as np

IS_PYTHON3 = sys.version_info[0] >= 3

MAX_IMAGE_ID = 2 ** 31 - 1

CREATE_CAMERAS_TABLE = """CREATE TABLE IF NOT EXISTS cameras (
    camera_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    model INTEGER NOT NULL,
    width INTEGER NOT NULL,
    height INTEGER NOT NULL,
    params BLOB,
    prior_focal_length INTEGER NOT NULL)"""

CREATE_DESCRIPTORS_TABLE = """CREATE TABLE IF NOT EXISTS descriptors (
    image_id INTEGER PRIMARY KEY NOT NULL,
    rows INTEGER NOT NULL,
    cols INTEGER NOT NULL,
    data BLOB,
    FOREIGN KEY(image_id) REFERENCES images(image_id) ON DELETE CASCADE)"""

CREATE_IMAGES_TABLE = """CREATE TABLE IF NOT EXISTS images (
    image_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    name TEXT NOT NULL UNIQUE,
    camera_id INTEGER NOT NULL,
    prior_qw REAL,
    prior_qx REAL,
    prior_qy REAL,
    prior_qz REAL,
    prior_tx REAL,
    prior_ty REAL,
    prior_tz REAL,
    CONSTRAINT image_id_check CHECK(image_id >= 0 and image_id < {}),
    FOREIGN KEY(camera_id) REFERENCES cameras(camera_id))
""".format(
    MAX_IMAGE_ID
)

CREATE_TWO_VIEW_GEOMETRIES_TABLE = """
CREATE TABLE IF NOT EXISTS two_view_geometries (
    pair_id INTEGER PRIMARY KEY NOT NULL,
    rows INTEGER NOT NULL,
    cols INTEGER NOT NULL,
    data BLOB,
    config INTEGER NOT NULL,
    F BLOB,
    E BLOB,
    H BLOB,
    qvec BLOB,
    tvec BLOB)
"""

CREATE_KEYPOINTS_TABLE = """CREATE TABLE IF NOT EXISTS keypoints (
    image_id INTEGER PRIMARY KEY NOT NULL,
    rows INTEGER NOT NULL,
    cols INTEGER NOT NULL,
    data BLOB,
    FOREIGN KEY(image_id) REFERENCES images(image_id) ON DELETE CASCADE)
"""

CREATE_MATCHES_TABLE = """CREATE TABLE IF NOT EXISTS matches (
    pair_id INTEGER PRIMARY KEY NOT NULL,
    rows INTEGER NOT NULL,
    cols INTEGER NOT NULL,
    data BLOB)"""

CREATE_NAME_INDEX = (
    "CREATE UNIQUE INDEX IF NOT EXISTS index_name ON images(name)"
)

CREATE_ALL = "; ".join(
    [
        CREATE_CAMERAS_TABLE,
        CREATE_IMAGES_TABLE,
        CREATE_KEYPOINTS_TABLE,
        CREATE_DESCRIPTORS_TABLE,
        CREATE_MATCHES_TABLE,
        CREATE_TWO_VIEW_GEOMETRIES_TABLE,
        CREATE_NAME_INDEX,
    ]
)


def image_ids_to_pair_id(image_id1, image_id2):
    if image_id1 > image_id2:
        image_id1, image_id2 = image_id2, image_id1
    return image_id1 * MAX_IMAGE_ID + image_id2


def pair_id_to_image_ids(pair_id):
    image_id2 = pair_id % MAX_IMAGE_ID
    image_id1 = (pair_id - image_id2) / MAX_IMAGE_ID
    return image_id1, image_id2


def array_to_blob(array):
    if IS_PYTHON3:
        return array.tobytes()
    else:
        return np.getbuffer(array)


def blob_to_array(blob, dtype, shape=(-1,)):
    if IS_PYTHON3:
        return np.fromstring(blob, dtype=dtype).reshape(*shape)
    else:
        return np.frombuffer(blob, dtype=dtype).reshape(*shape)


class COLMAPDatabase(sqlite3.Connection):
    @staticmethod
    def connect(database_path):
        return sqlite3.connect(database_path, factory=COLMAPDatabase)

    def __init__(self, *args, **kwargs):
        super(COLMAPDatabase, self).__init__(*args, **kwargs)

        self.create_tables = lambda: self.executescript(CREATE_ALL)
        self.create_cameras_table = lambda: self.executescript(
            CREATE_CAMERAS_TABLE
        )
        self.create_descriptors_table = lambda: self.executescript(
            CREATE_DESCRIPTORS_TABLE
        )
        self.create_images_table = lambda: self.executescript(
            CREATE_IMAGES_TABLE
        )
        self.create_two_view_geometries_table = lambda: self.executescript(
            CREATE_TWO_VIEW_GEOMETRIES_TABLE
        )
        self.create_keypoints_table = lambda: self.executescript(
            CREATE_KEYPOINTS_TABLE
        )
        self.create_matches_table = lambda: self.executescript(
            CREATE_MATCHES_TABLE
        )
        self.create_name_index = lambda: self.executescript(CREATE_NAME_INDEX)

    def add_camera(
            self,
            model,
            width,
            height,
            params,
            prior_focal_length=False,
            camera_id=None,
    ):
        params = np.asarray(params, np.float64)
        cursor = self.execute(
            "INSERT INTO cameras VALUES (?, ?, ?, ?, ?, ?)",
            (
                camera_id,
                model,
                width,
                height,
                array_to_blob(params),
                prior_focal_length,
            ),
        )
        return cursor.lastrowid

    def add_image(
            self,
            name,
            camera_id,
            prior_q=np.full(4, np.NaN),
            prior_t=np.full(3, np.NaN),
            image_id=None,
    ):
        cursor = self.execute(
            "INSERT INTO images VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
            (
                image_id,
                name,
                camera_id,
                prior_q[0],
                prior_q[1],
                prior_q[2],
                prior_q[3],
                prior_t[0],
                prior_t[1],
                prior_t[2],
            ),
        )
        return cursor.lastrowid

    def add_keypoints(self, image_id, keypoints):
        assert len(keypoints.shape) == 2
        assert keypoints.shape[1] in [2, 4, 6]

        keypoints = np.asarray(keypoints, np.float32)
        self.execute(
            "INSERT INTO keypoints VALUES (?, ?, ?, ?)",
            (image_id,) + keypoints.shape + (array_to_blob(keypoints),),
        )

    def add_descriptors(self, image_id, descriptors):
        descriptors = np.ascontiguousarray(descriptors, np.uint8)
        self.execute(
            "INSERT INTO descriptors VALUES (?, ?, ?, ?)",
            (image_id,) + descriptors.shape + (array_to_blob(descriptors),),
        )

    def add_matches(self, image_id1, image_id2, matches):
        assert len(matches.shape) == 2
        assert matches.shape[1] == 2

        if image_id1 > image_id2:
            matches = matches[:, ::-1]

        pair_id = image_ids_to_pair_id(image_id1, image_id2)
        matches = np.asarray(matches, np.uint32)
        self.execute(
            "INSERT INTO matches VALUES (?, ?, ?, ?)",
            (pair_id,) + matches.shape + (array_to_blob(matches),),
        )

    def add_two_view_geometry(
            self,
            image_id1,
            image_id2,
            matches,
            F=np.eye(3),
            E=np.eye(3),
            H=np.eye(3),
            qvec=np.array([1.0, 0.0, 0.0, 0.0]),
            tvec=np.zeros(3),
            config=2,
    ):
        assert len(matches.shape) == 2
        assert matches.shape[1] == 2

        if image_id1 > image_id2:
            matches = matches[:, ::-1]

        pair_id = image_ids_to_pair_id(image_id1, image_id2)
        matches = np.asarray(matches, np.uint32)
        F = np.asarray(F, dtype=np.float64)
        E = np.asarray(E, dtype=np.float64)
        H = np.asarray(H, dtype=np.float64)
        qvec = np.asarray(qvec, dtype=np.float64)
        tvec = np.asarray(tvec, dtype=np.float64)
        self.execute(
            "INSERT INTO two_view_geometries VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
            (pair_id,)
            + matches.shape
            + (
                array_to_blob(matches),
                config,
                array_to_blob(F),
                array_to_blob(E),
                array_to_blob(H),
                array_to_blob(qvec),
                array_to_blob(tvec),
            ),
        )


def example_usage():
    import os
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument("--database_path", default="database.db")
    args = parser.parse_args()

    if os.path.exists(args.database_path):
        print("ERROR: database path already exists -- will not modify it.")
        return

    # Open the database.

    db = COLMAPDatabase.connect(args.database_path)

    # For convenience, try creating all the tables upfront.

    db.create_tables()

    # Create dummy cameras.

    model1, width1, height1, params1 = (
        0,
        1024,
        768,
        np.array((1024.0, 512.0, 384.0)),
    )
    model2, width2, height2, params2 = (
        2,
        1024,
        768,
        np.array((1024.0, 512.0, 384.0, 0.1)),
    )

    camera_id1 = db.add_camera(model1, width1, height1, params1)
    camera_id2 = db.add_camera(model2, width2, height2, params2)

    # Create dummy images.

    image_id1 = db.add_image("image1.png", camera_id1)
    image_id2 = db.add_image("image2.png", camera_id1)
    image_id3 = db.add_image("image3.png", camera_id2)
    image_id4 = db.add_image("image4.png", camera_id2)

    # Create dummy keypoints.
    #
    # Note that COLMAP supports:
    #      - 2D keypoints: (x, y)
    #      - 4D keypoints: (x, y, theta, scale)
    #      - 6D affine keypoints: (x, y, a_11, a_12, a_21, a_22)

    num_keypoints = 1000
    keypoints1 = np.random.rand(num_keypoints, 2) * (width1, height1)
    keypoints2 = np.random.rand(num_keypoints, 2) * (width1, height1)
    keypoints3 = np.random.rand(num_keypoints, 2) * (width2, height2)
    keypoints4 = np.random.rand(num_keypoints, 2) * (width2, height2)

    db.add_keypoints(image_id1, keypoints1)
    db.add_keypoints(image_id2, keypoints2)
    db.add_keypoints(image_id3, keypoints3)
    db.add_keypoints(image_id4, keypoints4)

    # Create dummy matches.

    M = 50
    matches12 = np.random.randint(num_keypoints, size=(M, 2))
    matches23 = np.random.randint(num_keypoints, size=(M, 2))
    matches34 = np.random.randint(num_keypoints, size=(M, 2))

    db.add_matches(image_id1, image_id2, matches12)
    db.add_matches(image_id2, image_id3, matches23)
    db.add_matches(image_id3, image_id4, matches34)

    # Commit the data to the file.

    db.commit()

    # Read and check cameras.

    rows = db.execute("SELECT * FROM cameras")

    camera_id, model, width, height, params, prior = next(rows)
    params = blob_to_array(params, np.float64)
    assert camera_id == camera_id1
    assert model == model1 and width == width1 and height == height1
    assert np.allclose(params, params1)

    camera_id, model, width, height, params, prior = next(rows)
    params = blob_to_array(params, np.float64)
    assert camera_id == camera_id2
    assert model == model2 and width == width2 and height == height2
    assert np.allclose(params, params2)

    # Read and check keypoints.

    keypoints = dict(
        (image_id, blob_to_array(data, np.float32, (-1, 2)))
        for image_id, data in db.execute("SELECT image_id, data FROM keypoints")
    )

    assert np.allclose(keypoints[image_id1], keypoints1)
    assert np.allclose(keypoints[image_id2], keypoints2)
    assert np.allclose(keypoints[image_id3], keypoints3)
    assert np.allclose(keypoints[image_id4], keypoints4)

    # Read and check matches.

    pair_ids = [
        image_ids_to_pair_id(*pair)
        for pair in (
            (image_id1, image_id2),
            (image_id2, image_id3),
            (image_id3, image_id4),
        )
    ]

    matches = dict(
        (pair_id_to_image_ids(pair_id), blob_to_array(data, np.uint32, (-1, 2)))
        for pair_id, data in db.execute("SELECT pair_id, data FROM matches")
    )

    assert np.all(matches[(image_id1, image_id2)] == matches12)
    assert np.all(matches[(image_id2, image_id3)] == matches23)
    assert np.all(matches[(image_id3, image_id4)] == matches34)

    # Clean up.

    db.close()

    if os.path.exists(args.database_path):
        os.remove(args.database_path)


def create_database():
    import os
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument("--database_path", default="database.db")
    args = parser.parse_args()

    # if os.path.exists(args.database_path):
    #     print("ERROR: database path already exists -- will not modify it.")
    #     return
    if os.path.exists(args.database_path):
        os.remove(args.database_path)

    # if not os.path.exists("distorted"):
    #     os.mkdir("distorted")

    # Open the database.

    db = COLMAPDatabase.connect(args.database_path)

    # For convenience, try creating all the tables upfront.

    db.create_tables()

    # Create dummy cameras.
    camModelDict = {'SIMPLE_PINHOLE': 0,
                    'PINHOLE': 1,
                    'SIMPLE_RADIAL': 2,
                    'RADIAL': 3,
                    'OPENCV': 4,
                    'FULL_OPENCV': 5,
                    'SIMPLE_RADIAL_FISHEYE': 6,
                    'RADIAL_FISHEYE': 7,
                    'OPENCV_FISHEYE': 8,
                    'FOV': 9,
                    'THIN_PRISM_FISHEYE': 10}

    with open("created/sparse/model/cameras.txt", "r") as cameras_file:
        cameras_instinct = cameras_file.read().replace("\n", "")
        pass
    cameras_instinct = cameras_instinct.split(" ")
    # print(cameras_instinct)
    model1 = camModelDict[cameras_instinct[1]]
    width1, height1 = int(cameras_instinct[2]), int(cameras_instinct[3])
    params1 = np.array([float(param) for param in cameras_instinct[4:]])
    # print(model1,width1,height1,params1)
    camera_id1 = db.add_camera(model1, width1, height1, params1)
    # print(camera_id1)

    # 图片
    with open("created/sparse/model/images.txt", "r") as images_file:
        images_list = images_file.readlines()
        pass
    for images_info in images_list:
        if images_info == "\n":
            continue
        images_info = images_info.replace("\n", "").split(" ")
        # print(images_info)
        idx = int(images_info[0])
        image_name = images_info[-1]
        # images_info[1]-[4]  QW, QX, QY, QZ
        image_q = np.array([float(q_i) for q_i in images_info[1:5]])
        # images_info[5]-[7] TX, TY, TZ
        image_t = np.array([float(t_i) for t_i in images_info[5:8]])

        image_id_from_db = db.add_image(image_name, camera_id1, prior_q=image_q, prior_t=image_t)
        if idx != image_id_from_db:
            print(f"{idx}!={image_id_from_db}")
        pass

    db.commit()
    db.close()


if __name__ == "__main__":
    # example_usage()
    create_database()

运行之后,你可以在colmap中新建项目,导入刚才的database.db文件,查看数据是否被加载进入:
在这里插入图片描述
执行:

colmap feature_extractor --database_path database.db --image_path images
colmap exhaustive_matcher --database_path database.db
colmap point_triangulator --database_path database.db --image_path images --input_path created\sparse\model --output_path triangulated\sparse\model
# 或者
colmap mapper --database_path database.db --image_path images --input_path created\sparse\model --output_path mapper\sparse\model

由于我的程序并没有给我 dense/stereo/ 目录下的 patch-match.cfg 等等,于是我自建:
执行程序:generate_fusion&patch_match.py

import numpy as np
import os


def main(folder_path):
    # 获取文件夹中所有文件名
    file_names = os.listdir(folder_path)

    # 写入文件名到txt文件
    output_file_path = 'patch-match.cfg'
    with open(output_file_path, 'w') as file:
        for file_name in file_names:
            file.write(f"{file_name}\n__auto__, 20\n")

    output_file_path = 'fusion.cfg'
    with open(output_file_path, 'w') as file:
        for file_name in file_names:
            file.write(f"{file_name}\n")


if __name__ == '__main__':
    folder_path = "images"
    main(folder_path)

将数据移入高斯(我用的三角测量的):
在这里插入图片描述
就可以在高斯中执行就 python train.py -s data/data_scene18 -m data/data_scene18 /output
但在可视化的时候老是会崩,而且colmap中进行系数重建和稠密重建的效果也不好。中间肯定还是有步骤出错了。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1541493.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

稀碎从零算法笔记Day23-LeetCode:二叉树的最大深度

题型&#xff1a;链表、二叉树的遍历 链接&#xff1a;104. 二叉树的最大深度 - 力扣&#xff08;LeetCode&#xff09; 来源&#xff1a;LeetCode 题目描述 给定一个二叉树 root &#xff0c;返回其最大深度。 二叉树的 最大深度 是指从根节点到最远叶子节点的最长路径上…

JAVA面向对象编程 JAVA语言入门基础

类与对象的概念 类 (Class) 和对象 (Object) 是面向对象程序设计方法中最核心的概念。 类是对某一类事物的描述(共性)&#xff0c;是抽象的、概念上的定义&#xff1b;而对象则是实际存在的属该类事物的具体的个体&#xff08;个性&#xff09;&#xff0c;因而也称为实例(In…

《边缘计算:连接未来的智慧之桥》

随着物联网、5G等技术的快速发展&#xff0c;边缘计算作为一种新兴的计算模式&#xff0c;正逐渐引起人们的广泛关注。边缘计算通过将数据处理和存储功能放置在距离数据产生源头更近的位置&#xff0c;实现了更快速、更可靠的数据处理和交换&#xff0c;为各行各业带来了前所未…

JS13-事件的绑定和事件对象Event

绑定事件的两种方式/DOM事件的级别 DOM0的写法&#xff1a;onclick element.onclick function () {}举例&#xff1a; <body> <button>点我</button> <script>var btn document.getElementsByTagName("button")[0];//这种事件绑定的方式…

SAP BAS开发Fiori项目中的各种文件详解(manifest.json, package.json, ui5.yaml, i18n等)

1. 背景 在SAP BAS中新建好一个Fiori项目后&#xff0c;系统会自动生成一系列的文件&#xff0c;例如package.json, ui5.yaml, manifest.json, i18n等。对于不熟悉web应用程序开发的同学&#xff0c;这些文件理解起来会很困惑。 在这篇文章中&#xff0c;我会详细介绍这些文件…

图论基础|841.钥匙和房间、463. 岛屿的周长

目录 841.钥匙和房间 思路&#xff1a;本题是一个有向图搜索全路径的问题。 只能用深搜&#xff08;DFS&#xff09;或者广搜&#xff08;BFS&#xff09;来搜。 463. 岛屿的周长 841.钥匙和房间 力扣题目链接 (opens new window) 有 N 个房间&#xff0c;开始时你位于 0…

部署mysql,前端,后端

部署mysql docker pull mysql 从镜像源中拉取镜像。 创建mysql容器 docker run -d \--name mysql_container \-p 3306:3306 \-e TZAsia/Shanghai \-e MYSQL_ROOT_PASSWORD123 \--restartalways \-v /opt/mysql:/var/lib/mysql \mysql -d后台运行&#xff0c;--name指定容器…

SpringBoot2.x 整合SpringDocJavadocknife4j实现无注解零入侵式接口文档

说明 基于 javadoc 无注解零入侵生成规范的 openapi 结构体。 文档工具使用 由于框架采用 openapi 行业规范 故市面上大部分的框架均支持 可自行选择 例如: apifox apipost postman torna knife4j 等 根据对应工具的文档接入即可 Swagger升级SpringDoc指南 常见功能如下 其他…

蓝桥杯day12刷题日记

P8720 [蓝桥杯 2020 省 B2] 平面切分 思路&#xff1a;首先借用dalao的图解释一下&#xff0c;又多出一条与当前平面任意一条直线都不重合线时&#xff0c;多了的平面是交点数1&#xff0c;所以用双层循环每次往里面加一条直线&#xff0c;计算交点 #include <iostream>…

Unity学习笔记 6.2D换帧动画

下载源码 UnityPackage 目录 1.导入图片 1.1. 图片的叠放顺序 2.图片切片 3.用动画控制器让马&#x1f40e;动起来 1.导入图片 直接拖拽进场景 检查 Texture Type&#xff08;纹理类型&#xff09;是否为 Sprite 创建2D精灵对象&#xff0c;拖拽图片到Sprite&#xff08…

【spring】@DependsOn注解学习

DependsOn介绍 DependsOn 是 Spring 框架中的一个注解&#xff0c;用于指定一个 bean 的依赖关系。当 Spring 容器初始化 bean 时&#xff0c;它会按照一定的顺序进行初始化。如果一个 bean 依赖于其他 bean&#xff0c;那么这个 bean 的初始化应该在依赖的 bean 之后进行。 …

2024年noc指导教师认证测评参考试题题目3-4合集

[noc指导教师认证] 测评参考试题 说明:NOC教师指导认证考试题目是从题库里抽题,因此每位老师每次考试题目都不一样以下题目为测试考试时收集到的一些题目,作为辅助提供给各位老师,老师们可以记住题目及答案的具体内容 (选项顺序会变),以免考试时遇到。2024年的做的题目有的…

MISC:zip压缩包伪加密破解及其结构解析

一.前言 遇到zip压缩包是被加密的&#xff0c;但加密有时侯是伪加密&#xff0c;需要我们进行破解。 二.压缩包解析 1. 压缩源文件数据区 zip文件头标记 文件头&#xff1a;504B0304 解压文件所需的pkware版本 全局方式位标记 如果四位中的第二位为奇数则表示有加密&#xff…

Elasticsearch:将 ILM 管理的数据流迁移到数据流生命周期

警告&#xff1a;此功能处于技术预览阶段&#xff0c;可能会在未来版本中更改或删除。 Elastic 将努力解决任何问题&#xff0c;但技术预览版中的功能不受官方 GA 功能的支持 SLA 的约束。目前的最新版本为 8.12。 在本教程中&#xff0c;我们将了解如何将现有数据流&#xff0…

【Linux 进程概念】

【Linux 进程概念】 冯诺依曼体系结构冯诺依曼结构简要解释&#xff1a;你用QQ和朋友聊天时数据的流动过程 操作系统(OperatorSystem)概念设计OS的目的定位操作系统的上下层都分别是什么如何理解“管理"总结 进程基本概念描述进程-PCBtask_ struct内容 组织进程查看进程通…

JS精度计算的几种解决方法,1、转换成整数计算后再转换成小数,2、toFixed,3、math.js,4、bignumber.js,5、big.js

提示&#xff1a;学习express&#xff0c;搭建管理系统 文章目录 前言一、转换成整数计算后再转换成小数二、toFixed三、math.js四、bignumber.js五、big.js总结 前言 原始计算 let aNum 6.6 0.3;let bNum 6.6 - 0.2;let cNum 6.6 * 0.3;let dNum 6.6 / 0.2;console.log(…

Web框架开发-Ajax

一、 Ajax准备知识:json 1、json(Javascript Obiect Notation,JS对象标记)是一种轻量级的数据交换格式 1 2 它基于 ECMAScript (w3c制定的js规范)的一个子集,采用完全独立于编程语言的文本格式来存储和表示数据。 简洁和清晰的层次结构使得 JSON 成为理想的数据交换语言。…

手撕算法-删除有序数组中的重复项 II

描述 例如&#xff1a;输入&#xff1a;nums [1,1,1,2,2,3]输出&#xff1a;5, nums [1,1,2,2,3]解释&#xff1a;函数应返回新长度 length 5, 并且原数组的前五个元素被修改为 1, 1, 2, 2, 3。 不需要考虑数组中超出新长度后面的元素。 分析 双指针, fast, slow。nums[…

Redis高阶使用消息队列分布式锁排行榜等

一、前言 在大多数传统的web系统中&#xff0c;使用Redis一般都是作为缓存使用&#xff0c;在大数据查询时作为缓解性能的一种解决方案。博主的的系统中使用Redis也主要使用到缓存的作用&#xff0c;还有做了注册中心&#xff0c;分布式事务。其他的强大的功能&#xff0c;没有…