use 0.75 percentille as choice for intensity cap
This commit is contained in:
parent
94844fad51
commit
5f2cd319a1
@ -12093,17 +12093,22 @@ Potree.Viewer = function(domElement, args){
|
||||
var attributes = pointcloud.pcoGeometry.root.geometry.attributes;
|
||||
if(attributes.intensity){
|
||||
var array = attributes.intensity.array;
|
||||
var max = 0;
|
||||
for(var j = 0; j < array.length; j++){
|
||||
max = Math.max(array[j]);
|
||||
}
|
||||
|
||||
if(max <= 1){
|
||||
// chose max value from the 0.75 percentile
|
||||
var ordered = [];
|
||||
for(var j = 0; j < array.length; j++){
|
||||
ordered.push(array[j]);
|
||||
}
|
||||
ordered.sort();
|
||||
var capIndex = parseInt((ordered.length - 1) * 0.75);
|
||||
var cap = ordered[capIndex];
|
||||
|
||||
if(cap <= 1){
|
||||
scope.intensityMax = 1;
|
||||
}else if(max <= 256){
|
||||
}else if(cap <= 256){
|
||||
scope.intensityMax = 255;
|
||||
}else{
|
||||
scope.intensityMax = max;
|
||||
scope.intensityMax = cap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
build/potree/potree.min.js
vendored
4
build/potree/potree.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1163,17 +1163,22 @@ Potree.Viewer = function(domElement, args){
|
||||
var attributes = pointcloud.pcoGeometry.root.geometry.attributes;
|
||||
if(attributes.intensity){
|
||||
var array = attributes.intensity.array;
|
||||
var max = 0;
|
||||
for(var j = 0; j < array.length; j++){
|
||||
max = Math.max(array[j]);
|
||||
}
|
||||
|
||||
if(max <= 1){
|
||||
// chose max value from the 0.75 percentile
|
||||
var ordered = [];
|
||||
for(var j = 0; j < array.length; j++){
|
||||
ordered.push(array[j]);
|
||||
}
|
||||
ordered.sort();
|
||||
var capIndex = parseInt((ordered.length - 1) * 0.75);
|
||||
var cap = ordered[capIndex];
|
||||
|
||||
if(cap <= 1){
|
||||
scope.intensityMax = 1;
|
||||
}else if(max <= 256){
|
||||
}else if(cap <= 256){
|
||||
scope.intensityMax = 255;
|
||||
}else{
|
||||
scope.intensityMax = max;
|
||||
scope.intensityMax = cap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user