uvgVPCCenc 1.2.0
uvgVPCCenc is an open-source real-time V-PCC encoder library written in C++ from scratch.
Loading...
Searching...
No Matches
statsCollector.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 * This file is part of uvgVPCCenc V-PCC encoder.
3 *
4 * Copyright (c) 2024-present, Tampere University, ITU/ISO/IEC, project contributors
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without modification,
8 * are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
9 *
10 * * Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above copyright notice, this
14 * list of conditions and the following disclaimer in the documentation and/or
15 * other materials provided with the distribution.
16 *
17 * * Neither the name of Tampere University, ITU/ISO/IEC nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
29 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
32 ****************************************************************************/
33
34 #pragma once
35#include <fstream>
36#include <mutex>
37#include <string>
38#include <cstdint>
39#include <vector>
40#include <iostream>
41
60
62 bool hasBeenInitialized = false;
63 /*--------- General ---------*/
64 // Number of points of the point cloud
66 // Number of voxels (1st voxelization)
68 /*--- Refine Segmentation ---*/
69 // Number of voxel for RS (2nd voxelization)
71 // Number of skipped voxel per iteration
72 std::vector<size_t> skippedVoxels;
73 // 1 : 15000
74 // 2 : 16000
75 // ...
76 // Classes histogram
77 std::vector<size_t> NoEdge;
78 std::vector<size_t> IndirectEdge;
79 std::vector<size_t> SingleEdge;
80 std::vector<size_t> MultiEdge;
81 // Number of score computed
82 std::vector<size_t> scoreComputations;
83 // Number of computation inside each vox class = number of voxel in which a score computation has been made
84 std::vector<size_t> NoEdge_R;
85 std::vector<size_t> IndirectEdge_R;
86 std::vector<size_t> SingleEdge_R;
87 std::vector<size_t> MultiEdge_R;
88 // Number of PPI changes (point's level)
89 std::vector<size_t> ppiChange;
90 // 1 : 150 000
91 // 2 : 120 000
92 // ...
93 /*--- Patch Segmentation ---*/
94 // Number of patches
96 // Number of lost points
97 size_t numberOfLostPoints; // due to oclusion
98};
99
101public:
102 std::vector<uvgVPCCencStats> stats_;
105 return instance;
106 }
107
108 void init(std::size_t nbFrames);
109
110 void collectData(size_t frameId, DataId id, size_t data);
111
112 // Export
113 void writeToFile(const std::string& filename, const size_t gofId) const;
114
115private:
116 StatsCollector() = default;
117};
118
119extern StatsCollector& stats;
Definition statsCollector.hpp:100
static StatsCollector & instance()
Definition statsCollector.hpp:103
void writeToFile(const std::string &filename, const size_t gofId) const
Definition statsCollector.cpp:122
std::vector< uvgVPCCencStats > stats_
Definition statsCollector.hpp:102
void collectData(size_t frameId, DataId id, size_t data)
Definition statsCollector.cpp:74
void init(std::size_t nbFrames)
Definition statsCollector.cpp:40
StatsCollector & stats
Definition statsCollector.cpp:226
DataId
Definition statsCollector.hpp:42
@ IndirectEdge_R
@ NumberOfPoints
@ NumberOfVoxelsRS
@ ScoreComputations
@ NumberOfLostPoints
@ SingleEdge_R
@ SkippedVoxels
@ NumberOfPatches
@ MultiEdge_R
@ IndirectEdge
@ SingleEdge
@ NumberOfVoxels
Definition statsCollector.hpp:61
std::vector< size_t > MultiEdge
Definition statsCollector.hpp:80
std::vector< size_t > IndirectEdge_R
Definition statsCollector.hpp:85
size_t numberOfVoxelsRS
Definition statsCollector.hpp:70
std::vector< size_t > NoEdge
Definition statsCollector.hpp:77
std::vector< size_t > SingleEdge_R
Definition statsCollector.hpp:86
size_t numberOfVoxels
Definition statsCollector.hpp:67
std::vector< size_t > SingleEdge
Definition statsCollector.hpp:79
std::vector< size_t > skippedVoxels
Definition statsCollector.hpp:72
size_t NumberOfPoints
Definition statsCollector.hpp:65
std::vector< size_t > scoreComputations
Definition statsCollector.hpp:82
size_t numberOfPatches
Definition statsCollector.hpp:95
std::vector< size_t > MultiEdge_R
Definition statsCollector.hpp:87
std::vector< size_t > IndirectEdge
Definition statsCollector.hpp:78
std::vector< size_t > NoEdge_R
Definition statsCollector.hpp:84
bool hasBeenInitialized
Definition statsCollector.hpp:62
size_t numberOfLostPoints
Definition statsCollector.hpp:97
std::vector< size_t > ppiChange
Definition statsCollector.hpp:89
size_t gofId
Definition uvgvpccenc.cpp:94