Main Content

denoisingImageSource

(To be removed) Create denoising image datastore

denoisingImageSource will be removed in a future release. Use denoisingImageDatastore instead. For more information, see Compatibility Considerations.

Description

dnimds = denoisingImageSource(imds) creates a denoising image datastore, dnimds, that generates pairs of randomly cropped pristine and noisy image patches from images in image datastore imds.

example

dnimds = denoisingImageSource(imds,Name,Value) sets properties of the denoising image datastore using name-value pairs. You can specify multiple name-value pairs. Enclose each argument name in quotes.

Examples

collapse all

Create an image datastore. This datastore contains color JPG images.

setDir = fullfile(toolboxdir("images"),"imdata");
imds = imageDatastore(setDir,"FileExtensions",[".jpg"]);

Create a denoisingImageDatastore object using the denoisingImageSource function. The image datastore creates many patches from each image in the datastore, and adds Gaussian noise to the patches. Set the optional PatchesPerImage, PatchSize, GaussianNoiseLevel, and ChannelFormat properties of the denoisingImageDatastore using name-value pairs.

dnimds = denoisingImageSource(imds, ...
    "PatchesPerImage",512, ...
    "PatchSize",50, ...
    "GaussianNoiseLevel",[0.01 0.1], ...
    "ChannelFormat","RGB")
dnimds = 
  denoisingImageDatastore with properties:

         PatchesPerImage: 512
               PatchSize: [50 50 3]
      GaussianNoiseLevel: [0.0100 0.1000]
           ChannelFormat: 'rgb'
           MiniBatchSize: 128
         NumObservations: 18944
    DispatchInBackground: 0

Input Arguments

collapse all

Image datastore, specified as an ImageDatastore object.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: "PatchSize",48 creates a denoising image datastore that has a square patch size of 48 pixels.

Patch size, specified as a scalar or 2-element vector with positive integer values. This argument sets the first two elements of the PatchSize property of the returned denoising image datastore, dnimds.

  • When "PatchSize" is a scalar, the patches are square

  • When "PatchSize" is a 2-element vector of the form [r c], the first element specifies the number of rows in the patch, and the second element specifies the number of columns

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Number of random patches per image, specified as a positive integer. This argument sets the PatchesPerImage property of the returned denoising image datastore, dnimds.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Gaussian noise standard deviation as a fraction of the image class maximum, specified as a scalar or 2-element vector with values in the range [0, 1]. This argument sets the GaussianNoiseLevel property of the returned denoising image datastore, dnimds.

  • If GaussianNoiseLevel is a scalar, then the standard deviation of the added zero-mean Gaussian white noise is identical for all image patches.

  • If GaussianNoiseLevel is a 2-element vector, then it specifies a range of standard deviations [stdmin stdmax]. The standard deviation of the added zero-mean Gaussian white noise is unique for each image patch, and is randomly sampled from a uniform distribution with the range [stdmin stdmax].

Data Types: single | double

Channel format, specified as "Grayscale" or "RGB". This argument sets the ChannelFormat property of the returned denoising image datastore, dnimds.

Data Types: char

Preprocess training patches in parallel, specified as true or false. This argument sets the DispatchInBackground property of the returned denoising image datastore, dnimds. If BackgroundExecution is true and you have Parallel Computing Toolbox™, then the denoising image datastore asynchronously reads patches, adds noise, and queues patch pairs.

Data Types: char

Output Arguments

collapse all

Denoising image datastore, returned as an denoisingImageDatastore object.

Version History

Introduced in R2017b

expand all

R2018a: denoisingImageSource object is removed

In R2017b, you could create a denoisingImageSource object for training deep learning networks. Starting in R2018a, the denoisingImageSource object has been removed. Use a denoisingImageDatastore object instead.

A denoisingImageDatastore has additional properties and methods to assist with data preprocessing. Unlike denoisingImageSource, which could be used for training only, you can use a denoisingImageDatastore for both training and prediction.

To create a denoisingImageDatastore object, you can use either the denoisingImageDatastore function (recommended) or the denoisingImageSource function.