Closed VittorioAccomazzi closed 3 years ago
the main responsible for this artefact seems the tau
values in the tensor shock filter which determines the area in which the filter has to be applied.
Here below it shows that it is applied to the LoG value, and determines when the delation or erosion has to take place.
let logVal = logImage.get(x,y)
let majMag = majVec[0] * majVec[0] + majVec[1]*majVec[1]
if( Math.abs(logVal)> tau && majMag > 0 ){
let min = Number.MAX_VALUE
let max = -min
for( let l=-radius; l<= radius; l++){
let xSample = x + majVec[0] * l
let ySample = y + majVec[1] * l
let val1 = this.Sample(inImage, xSample, ySample, minVec, 0.0 )
let val2 = this.Sample(inImage, xSample, ySample, minVec, 0.5 )
let val3 = this.Sample(inImage, xSample, ySample, minVec, -0.5)
max = Math.max(val1, val2, val3, max)
min = Math.min(val1, val2, val3, min)
}
the value seems to low and affect the area which are perceived by the human eye not to have boundaries, like the face below. On the left the tau
value of 10 on the right of 5:
and here below is an animation which switch between the same two settings:
In comparing the results of TensorSmoothing
vs TensorDirSmoothing
I don't see any real difference.
Increasing the number of iteration doesn't provide a real difference. Ot appears that the image reach a stable condition after 5 or 8 iterations. Right now the value is set to 6
version deployed
implemented a shock filter which seems to work correctly:
however when applied multiple time on the same image, it generates very strong artefact. So it is not use for the abstraction.
let [lImg, aImg, bImg ] = CanvasUtils.toLab(canvas)
let shkImg = ShockFilter.Run(lImg, 2, 0.0001, 4) as ImageFloat32
I don't see any further improvement option
The current implementation of the painter generates sometime sharp transaction on relative smooth areas of the image, for instance the face. This effectively creates artifacts in the image.