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
sets properties of the
denoising image datastore using name-value pairs. You can specify multiple
name-value pairs. Enclose each argument name in quotes.dnimds
= denoisingImageSource(imds
,Name,Value
)
Examples
Create Denoising Image Datastore Using denoisingImageSource
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
imds
— Image datastore
ImageDatastore
object
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.
PatchSize
— Patch size
50
(default) | scalar | 2-element vector
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 squareWhen
"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
PatchesPerImage
— Number of random patches per image
512
(default) | positive integer
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
GaussianNoiseLevel
— Gaussian noise standard deviation
0.1
(default) | scalar | 2-element vector
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
ChannelFormat
— Channel format
"Grayscale"
(default) | "RGB"
Channel format, specified as "Grayscale"
or
"RGB"
. This argument sets the ChannelFormat
property of the returned
denoising image datastore, dnimds
.
Data Types: char
BackgroundExecution
— Preprocess training patches in parallel
false
(default) | true
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
dnimds
— Denoising image datastore
denoisingImageDatastore
object
Denoising image datastore, returned as an denoisingImageDatastore
object.
Version History
Introduced in R2017bR2018a: 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.
R2018a: denoisingImageSource
function will be removed
The denoisingImageSource
function will be removed in a future
release. Create a denoisingImageDatastore
using the denoisingImageDatastore
function instead.
To update your code, change instances of the function name
denoisingImageSource
to
denoisingImageDatastore
. You do not need to change the input
arguments.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)