0
$\begingroup$

recently I fall in the world of blender and started working on creating syntethic data that needs to be segmented. My first approach was the following: an object (mesh) with index 0 index and objects above it with an index between 0 and 255 for each type of object. Using compositing I can pass the index as a scale of grey and generate a BW image I can use to do segmentation with openCV.

But I would like to do this in the same object. Imagine you have a mesh (a road) with a material called asphalt, which has lines and everything on it. enter image description here I would like to pass an index to these lines, so I can segment them too. Those are my tries:

  1. 1st idea is to give a material for lines, and another material for the road, so each of them has a material index and I can use compositing.

  2. Other idea is to consider them different objects and use the approach I already used for objects above the plane.

  3. Another way I'm not considering using texture index (from my knowledge, this doesn't exist)

  4. The other approach is using two objects (1 for lines, 1 for objects).

This is the actual material, where lines, asphalt and water puddles are mixed via mix nodes. Can you recommend me what is the best approach if you have previous experience?

Thanks in advance.

Which is the best

$\endgroup$
3
  • $\begingroup$ Maybe AOV outputs on the material?.. depends on your workflow, I guess, how much automation you need $\endgroup$
    – Robin Betts
    Commented Nov 21, 2023 at 12:16
  • $\begingroup$ Hi @RobinBetts, sorry for being so late answering, such a busy week at work. Didnt know about aov outputs, and they seem to work really nice, thanks! I assume that I can apply some math nodes before linking to aov output so each output has a grey value? Even if this doesnt work, you opened me a new path to work on, so thanks again! $\endgroup$
    – nosumable
    Commented Nov 27, 2023 at 14:47
  • $\begingroup$ AOV will accept anything you can pipe into it, AFAIK. Might do the trick. If you get something to work in your case, and have a moment, you'd be welcome to self-answer, else drop a line here. $\endgroup$
    – Robin Betts
    Commented Nov 27, 2023 at 16:24

0

You must log in to answer this question.