Documentation ¶
Index ¶
- func CreateAlbedoMap(c *render3d.Camera, obj render3d.Object, width, height, bsdfSamples int) *image.RGBA
- func CreateAuxTensor(c *render3d.Camera, obj render3d.Object, img image.Image) *nn.Tensor
- func CreateAuxTensorImages(img, albedo, incidence image.Image) *nn.Tensor
- func CreateIncidenceMap(c *render3d.Camera, obj render3d.Object, width, height int) *image.Gray
- func PolishAux(t ModelType, auxImage *nn.Tensor) image.Image
- func PolishAuxPatches(t ModelType, auxImage *nn.Tensor, patchSize, border int) image.Image
- func PolishImage(t ModelType, img image.Image) image.Image
- func PolishImagePatches(t ModelType, img image.Image, patchSize, border int) image.Image
- func SaveFeatureMap(path string, img image.Image) error
- type ModelType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAlbedoMap ¶
func CreateAlbedoMap(c *render3d.Camera, obj render3d.Object, width, height, bsdfSamples int) *image.RGBA
CreateAlbedoMap creates a feature image where each pixel indicates the albedo of the surface intersected by the camera ray.
The bsdfSamples argument specifies how many times each BSDF is sampled to approximate the albedo. A higher value gives more accurate results for complex materials.
func CreateAuxTensor ¶
CreateAuxTensor creates a Tensor for a rendering with auxiliary feature channels.
This Tensor can then be passed to PolishAux.
The channels are ordered as follows:
- Red
- Green
- Blue
- Albedo red
- Albedo green
- Albedo blue
- Ray-surface cosine map
func CreateAuxTensorImages ¶
CreateAuxTensorImages creates an auxiliary Tensor using pre-constructed auxiliary images.
See CreateAuxTensor for details on the channel order.
func CreateIncidenceMap ¶
CreateIncidenceMap creates a feature image where each pixel indicates the dot product of the camera ray with the normal of the first ray collision.
func PolishAux ¶
PolishAux applies a denoising network to an image with auxiliary feature channels.
The Tensor may be created via CreateAuxTensor().
This should be used with a model that expects auxiliary features.
func PolishAuxPatches ¶
PolishAuxPatches is like PolishAux, but it applies the operation to patches of the image at a time to save memory.
See PolishImagePatches for more information.
func PolishImage ¶
PolishImage applies a denoising network to an image.
A model should be used which does not expect any extra feature channels besides RGB colors.
func PolishImagePatches ¶
PolishImagePatches is like PolishImage, but it applies the operation to patches of the image at a time to save memory.
It is useful for very large images, where a neural network forward pass is too costly.
The patchSize argument specifies how large the output patches should be (they are always square).
The border argument specifies how many extra pixels are included on the side of each patch before it is fed into the network. A value of -1 will use a reasonable default border. Larger border values ensure more accuracy at the cost of redundant computation, while lower values may cause checkerboarding artifacts.
Types ¶
type ModelType ¶
type ModelType int
const ( // ModelTypeBilateral uses a tuned bilateral filter to // denoise the image without a neural network. ModelTypeBilateral ModelType = iota // ModelTypeShallow is a small convolutional network // that operates only on the pixels of an RGB image. // // It is fast, but the smoothing is very primitive. ModelTypeShallow // ModelTypeDeep is a large convolutional network that // operates only on the pixels of an RGB image. // // It is slow and performs a great deal of smoothing. ModelTypeDeep // ModelTypeShallowAux is like ModelTypeShallow, but // the model expects albedo and ray incidence angles // as extra input channels. ModelTypeShallowAux // ModelTypeDeepAux is like ModelTypeDeep, but the // model expects albedo and ray incidence angles as // extra input channels. ModelTypeDeepAux )
func (ModelType) LCD ¶
LCD gets a factor which must divide the dimensions of images fed to this type of model.