POV-Ray : Newsgroups : povray.binaries.images : Synthetic data sets for image analysis : Re: Synthetic data sets for image analysis Server Time
25 Apr 2024 02:41:09 EDT (-0400)
  Re: Synthetic data sets for image analysis  
From: Alain
Date: 27 Jan 2019 13:13:36
Message: <5c4df4d0$1@news.povray.org>
Le 19-01-27 à 01:43, BayashiPascal a écrit :
> Hi everyone,
> 
> I came up a few days ago with some (maybe?) unconventional way to use POV-Ray
> for my job and would like to introduce it here in case it would be of any
> interest to someone else.
> I was looking for data sets of images to test machine learning algorithms and
> couldn't find any one that fit my needs. Then I started thinking of how I could
> generate automatically my own data sets. Of course, speaking of synthesis
> picture, I immediately thought of POV-Ray, and it worked perfectly for me.
> The problem here is not that much the generation of the image itself, but the
> generation of its mask. For example, in the example pictures below, the target
> is the cube, so I needed to generate automatically the image of the cube *and*
> its duplicate where every pixels matching the cube are black and all the others
> are white. I found that I could achieve this using the two textures below, one
> for the target, and one for everything else.
> 
> #declare _texMaskTarget = texture {
>    pigment { color Black }
>    finish { ambient 0 }
> }
> #declare _texMaskNonTarget = texture {
>    pigment { color White }
>    finish { ambient 1 diffuse 100 }
> }
> 
> Crafting the scene to my needs, adding randomness on the desired variable
> components of the scene, using the clock variable as the seed for the random
> generator, wrapping that in a Python script which generates and executes an INI
> file including the directive Declare=Mask=0 to switch between the normal texture
> and the mask texture, and I had a very handy tool to generate in minutes a data
> set of hundred of samples crafted to match perfectly any needed test case.
> 
> If anyone has a better idea than my trick with the textures to generate the mask
> I would be glad to hear it.
> 
> For those interested, everything is available on GitHub here:
> https://github.com/BayashiPascal/SDSIA
> 
> 

You can also use the quality setting.
If you set the pigment of the box to rgb 0, the pigment of everything 
else to rgb 1, and use +q0 on the command line, you'll get the same 
result. The advantage is that it should be faster as no light are used.

When using +q0 the following happen :
ALL light are ignored.
EVERYTHING is rendered assuming full ambient only.
Diffuse is ignored.
There are no shadow.
Radiosity is disabled.
Reflections are ignored.

The quality setting can be set via an ini file or on the command line.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.