depthmap2mask
depthmap2mask copied to clipboard
Feature request: Mask depth control
- What should the feature do?
With this new feature it should be possible to determine at which depth the image should be masked, and at which depth it should be visible.
- How should that feature be controlled
We will call the portion of the image we want to keep visible a slice. The user should have control over where to cut the scene to obtain the slice he wants to keep.
- What are the parameters we need to apply that control as a user
The first parameter would be the near cut
distance. This would determine how far from the camera the image slice begins to be visible. Everything closer to the camera than the near cut
distance would be cut out.
The second parameter would be the far cut
distance. This would determine at which distance the visible slice of our image should be cut again, and everything further away simply becomes invisible.
- How should those parameters be presented to the user?
Since we already have a depthmap to deal with, it is logical to use it as a reference.
It uses a 8 bit channel (values of 0 to 255) to determine distance.
A distance of 0 should be the closest to the camera.
A distance of 255 should be infinity - basically everything further away than the furthest distance measured.
This means that for both near cut
and far cut
the user must provide a value between 0 and 255.
Logically, the far cut
value should always be higher than the near cut
.
- How should those parameters be used by the system to obtain the desired results?
We will transform the near cut
and far cut
parameters into control parameters for a color adjustments procedure
First we will invert the depthmap colors - This is just to make it easier to understand with black=0=close and white=255=far.
Then we will make all the pixels that are darker than the near cut
distance value completely black. This cuts the near part.
Then we will make all the pixels that are brighter than the far cut
distance value completely black as well. This cuts the far part.
Then we will make all the pixels that are brighter than the near cut
value but lower than the far cut
completely white. This makes the slice we have just cut out completely opaque.
- How can we make this even better
Feathered distance
: this would soften the cut. It would act like a blurred mask, but blurred in z-space, all by adjusting the masks colors. The parameter would be controlled as a 0-255 distance, but would be limited to a certain maximal value that make sense.
Keep semi transparent
: this checkbox would allow the user to keep the sliced portion in greyscale instead of forcing it to be opaque
Semi-transparency normalization
: This checkbox sub-parameter would only be used if keep semi-transparent
is selected. This would normalize the greyscale gradient that has remained visible after the slicing procedure by making the darkest grey almost black, and the lightest grey almost white, and spreading all other greyscale values in between evenly.
Let me know if you'd like examples based on pictures - I'm doing this process manually right now so I am very familiar with it.