Git Product home page Git Product logo

Comments (3)

Extraltodeus avatar Extraltodeus commented on June 14, 2024

Can't you already do a big part of that with the "Contrasts cut level" slider? Or at least most of it? The "Turn the depthmap into absolute black/white" checkbox also gives the possibility to have some clearer depth cut.

For your near cut idea, I guess that you mean that some value clearer than X should be pure white while the rest is put to scale from 0 to 255?

from depthmap2mask.

AugmentedRealityCat avatar AugmentedRealityCat commented on June 14, 2024

The Contrast Cut Level + Absolute B&W is similar, I agree, but it's not exactly the same as what I'm looking for as a user.
I see there is potential in having z-depth derived gradients in the mask itself - you demonstrated that very well in your examples. And this feature should be kept. And even expanded ! But it's different from what most compositing software users will be looking for.

Normally, much like when you draw a custom mask shape in mask mode in the WebUI, the mask you get is completely white in the areas you want to keep/change, and completely black for the opposite, and the the shades of grey are only used to feather and anti-alias the mask. This feathering on the edges is similar to the mask blur function of the WebUI by the way.

A precisely controlled black and white mask with feathered edges is what I'd like to do directly in the WebUI, instead of having to go to photoshop to adjust the levels to get the mask I need.

Imagine you have a person in front of a car, with a tree and hills in the background.

What I want to do is create a mask just for the car, which is in the middle of the scene. Right now it is only possible to have either just the person (the front ) or the person AND the car (the front + the middle) but not just the car (the middle but NOT the front).

My proposition is to do that with two parameters: the near cut and the far cut. This defines where the object I want in my mask begins and where it ends, according to its distance from the camera. That distance happens to be encoded as color, so we can use simple color adjustment processes to achieve the results we are looking for.

The far cut is in fact potentially the same thing as your Constrast Cut Level. It works on the dark side of brightness curve. The near cut would work in a similar fashion, but for the bright parts of the image, cutting them to black as well. And everything in between would be 100% white. With, eventually I hope, the possibility to feather the edges.

I believe you are using OpenCV for python since I got an error message mentioning it (something about a bad argument for cv2.cvtColor - I'll send bug report if I can manage to reproduce it). If that is the case, then I'm convinced that library must have the functions we need to adjust the depthmap colors to get what we need.

When the depthmap is generated, is the information stored in 8 bit per channel (like in standard jpg images) or are they in 16 or even 32 bit ? Is there some specification data about it ? I'm asking because this could make a big difference in the quality of the mask if we keep that more precise data format for our color adjustments.

from depthmap2mask.

phills11 avatar phills11 commented on June 14, 2024

I have a slightly different solution that also addresses the problem, see #26

I want better control of the mask, but entering a threshold value manually is very clunky. It's difficult to know what number is right. Is 100 too high? Is 150 too high? You have to use trial and error. To make it worse, you have to rerun the model every time, so it's not fast.

I think the better way to control the mask is to take advantage of the user mask. It can both be used to clip the mask area, and to automatically set the threshold value.

Ideally there'd be some way to mouse over the mask image and get the values directly, but even if you had that, entering the numbers manually is more work than just drawing a messy blob via the user mask pencil.

from depthmap2mask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.