Commit fe39e49d authored by Arash Vosoughi's avatar Arash Vosoughi Committed by David Flynn
Browse files

recolour/m49407: improve point cloud recolouring

This commit implements the recolouring method described in m47800, which
notably uses a distance-weighted average rather than the previous
unweighted average.
parent 1105149f
......@@ -282,3 +282,57 @@ Only applies when `attribute=colour`.
### `--aps_slice_qp_deltas_present_flag=0|1`
Enables signalling of per-slice QP values.
Attribute recolouring (encoder only)
------------------------------------
The following options configure the recolouring module, used when resampling
a point cloud, or if the geometry coding process invents new points.
### `--searchRange=INT-VALUE`
Attribute space search range for optimal attribute transfer.
### `--numNeighboursFwd=INT-VALUE`
Number of source points used at the neighborhood of a target point to create
the forward points list.
### `--numNeighboursBwd=INT-VALUE`
Number of target points used at the neighborhood of a source point to create
the backward points list.
### `--useDistWeightedAvgFwd=0|1`
Use distance-weighted average for forward list.
### `--useDistWeightedAvgBwd=0|1`
Use distance-weighted average for backward list.
### `--skipAvgIfIdenticalSourcePointPresentFwd=0|1`
Do not use forward points list if an identical source point exists.
### `--skipAvgIfIdenticalSourcePointPresentBwd=0|1`
Do not use backward points list if an identical source point exists.
### `--distOffsetFwd=REAL-VALUE`
Distance offset to avoid infinite weight when distance between a forward
list point and the target is zero.
### `--distOffsetBwd=REAL-VALUE`
Distance offset to avoid infinite weight when distance between a backward
list point and target is zero.
### `--maxGeometryDist2Fwd=REAL-VALUE`
Maximum allowed squared distance of a source point from target to get into
the forward list.
### `--maxGeometryDist2Bwd=REAL-VALUE`
Maximum allowed squared distance of a source point from target to get into
the backward list.
### `--maxAttributeDist2Fwd=REAL-VALUE`
Maximum allowed squared attribute value difference of a source point for
inclusion in the forward list.
### `--maxAttributeDist2Bwd=REAL-VALUE`
Maximum allowed squared attribute value difference of a source point for
inclusion in the backward list.
This diff is collapsed.
......@@ -43,6 +43,7 @@
#include "PayloadBuffer.h"
#include "PCCMath.h"
#include "PCCPointSet.h"
#include "PCCPointSetProcessing.h"
#include "hls.h"
namespace pcc {
......@@ -85,6 +86,9 @@ struct EncoderParams {
// Depth of octree used by PartitionMethod::kOctreeUniform
int partitionOctreeDepth;
// attribute recolouring parameters
RecolourParams recolour;
};
//============================================================================
......
......@@ -458,6 +458,63 @@ ParseParameters(int argc, char* argv[], Parameters& params)
("aps_slice_qp_deltas_present_flag",
params_attr.aps.aps_slice_qp_deltas_present_flag, false,
"Enable signalling of per-slice QP values")
// This section is just dedicated to attribute recolouring (encoder only).
// parameters are common to all attributes.
(po::Section("Recolouring"))
("recolourSearchRange",
params.encoder.recolour.searchRange, 8,
"")
("recolourNumNeighboursFwd",
params.encoder.recolour.numNeighboursFwd, 8,
"")
("recolourNumNeighboursBwd",
params.encoder.recolour.numNeighboursBwd, 1,
"")
("recolourUseDistWeightedAvgFwd",
params.encoder.recolour.useDistWeightedAvgFwd, true,
"")
("recolourUseDistWeightedAvgBwd",
params.encoder.recolour.useDistWeightedAvgBwd, true,
"")
("recolourSkipAvgIfIdenticalSourcePointPresentFwd",
params.encoder.recolour.skipAvgIfIdenticalSourcePointPresentFwd, true,
"")
("recolourSkipAvgIfIdenticalSourcePointPresentBwd",
params.encoder.recolour.skipAvgIfIdenticalSourcePointPresentBwd, false,
"")
("recolourDistOffsetFwd",
params.encoder.recolour.distOffsetFwd, 4.,
"")
("recolourDistOffsetBwd",
params.encoder.recolour.distOffsetBwd, 4.,
"")
("recolourMaxGeometryDist2Fwd",
params.encoder.recolour.maxGeometryDist2Fwd, 1000.,
"")
("recolourMaxGeometryDist2Bwd",
params.encoder.recolour.maxGeometryDist2Bwd, 1000.,
"")
("recolourMaxAttributeDist2Fwd",
params.encoder.recolour.maxAttributeDist2Fwd, 1000.,
"")
("recolourMaxAttributeDist2Bwd",
params.encoder.recolour.maxAttributeDist2Bwd, 1000.,
"")
;
/* clang-format on */
......@@ -641,6 +698,7 @@ ParseParameters(int argc, char* argv[], Parameters& params)
} else {
po::dumpCfg(cout, opts, "Encoder", 4);
po::dumpCfg(cout, opts, "Geometry", 4);
po::dumpCfg(cout, opts, "Recolouring", 4);
for (const auto& it : params.encoder.attributeIdxMap) {
// NB: when dumping the config, opts references params_attr
......
......@@ -266,7 +266,7 @@ PCCTMC3Encoder3::compressPartition(
if (recolourNeeded) {
recolour(
inputPointCloud, _sps->seq_source_geom_scale_factor,
params->recolour, inputPointCloud, _sps->seq_source_geom_scale_factor,
_sps->seq_bounding_box_xyz0, _sliceOrigin, &pointCloud);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment