uvgVPCCenc 1.1.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 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 the Tampere University or 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 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
28 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
31 ****************************************************************************/
32
33 #pragma once
34#include <fstream>
35#include <mutex>
36#include <string>
37#include <cstdint>
38#include <vector>
39#include <iostream>
40
59
61 /*--------- General ---------*/
62 // Number of points of the point cloud
64 // Number of voxels (1st voxelization)
66 /*--- Refine Segmentation ---*/
67 // Number of voxel for RS (2nd voxelization)
69 // Number of skipped voxel per iteration
70 std::vector<size_t> skippedVoxels;
71 // 1 : 15000
72 // 2 : 16000
73 // ...
74 // Classes histogram
75 std::vector<size_t> NoEdge;
76 std::vector<size_t> IndirectEdge;
77 std::vector<size_t> SingleEdge;
78 std::vector<size_t> MultiEdge;
79 // Number of score computed
80 std::vector<size_t> scoreComputations;
81 // Number of computation inside each vox class = number of voxel in which a score computation has been made
82 std::vector<size_t> NoEdge_R;
83 std::vector<size_t> IndirectEdge_R;
84 std::vector<size_t> SingleEdge_R;
85 std::vector<size_t> MultiEdge_R;
86 // Number of PPI changes (point's level)
87 std::vector<size_t> ppiChange;
88 // 1 : 150 000
89 // 2 : 120 000
90 // ...
91 /*--- Patch Segmentation ---*/
92 // Number of patches
94 // Number of lost points
95 size_t numberOfLostPoints; // due to oclusion
96};
97
99public:
100 std::vector<uvgVPCCencStats> stats_;
103 return instance;
104 }
105
106 void init(std::size_t nbFrames);
107
108 void collectData(size_t frameId, DataId id, size_t data);
109
110 // Export
111 void writeToFile(const std::string& filename, const size_t gofId) const;
112
113private:
114 StatsCollector() = default;
115};
116
117extern StatsCollector& stats;
Definition statsCollector.hpp:98
static StatsCollector & instance()
Definition statsCollector.hpp:101
void writeToFile(const std::string &filename, const size_t gofId) const
Definition statsCollector.cpp:108
std::vector< uvgVPCCencStats > stats_
Definition statsCollector.hpp:100
void collectData(size_t frameId, DataId id, size_t data)
Definition statsCollector.cpp:60
void init(std::size_t nbFrames)
Definition statsCollector.cpp:39
StatsCollector & stats
Definition statsCollector.cpp:212
DataId
Definition statsCollector.hpp:41
@ IndirectEdge_R
@ NumberOfPoints
@ NumberOfVoxelsRS
@ ScoreComputations
@ NumberOfLostPoints
@ SingleEdge_R
@ SkippedVoxels
@ NumberOfPatches
@ MultiEdge_R
@ IndirectEdge
@ SingleEdge
@ NumberOfVoxels
Definition statsCollector.hpp:60
std::vector< size_t > MultiEdge
Definition statsCollector.hpp:78
std::vector< size_t > IndirectEdge_R
Definition statsCollector.hpp:83
size_t numberOfVoxelsRS
Definition statsCollector.hpp:68
std::vector< size_t > NoEdge
Definition statsCollector.hpp:75
std::vector< size_t > SingleEdge_R
Definition statsCollector.hpp:84
size_t numberOfVoxels
Definition statsCollector.hpp:65
std::vector< size_t > SingleEdge
Definition statsCollector.hpp:77
std::vector< size_t > skippedVoxels
Definition statsCollector.hpp:70
size_t NumberOfPoints
Definition statsCollector.hpp:63
std::vector< size_t > scoreComputations
Definition statsCollector.hpp:80
size_t numberOfPatches
Definition statsCollector.hpp:93
std::vector< size_t > MultiEdge_R
Definition statsCollector.hpp:85
std::vector< size_t > IndirectEdge
Definition statsCollector.hpp:76
std::vector< size_t > NoEdge_R
Definition statsCollector.hpp:82
size_t numberOfLostPoints
Definition statsCollector.hpp:95
std::vector< size_t > ppiChange
Definition statsCollector.hpp:87
size_t gofId
Definition uvgvpcc.cpp:89