%dip_testobjectaddnoise   TestObject generation function.
%    out = dip_testobjectaddnoise(object, background, backvalue,...
%          gaussianNoise, poissonNoise, snr)
%
%   object
%      Image.
%   background
%      Image.
%   backvalue
%      Real number.
%   gaussianNoise
%      Real number.
%   poissonNoise
%      Real number.
%   snr
%      Real number.

% (C) Copyright 1999-2000               Pattern Recognition Group
%     All rights reserved               Faculty of Applied Physics
%                                       Delft University of Technology
%                                       Lorentzweg 1
%                                       2628 CJ Delft
%                                       The Netherlands
%
% Cris Luengo, February-May 1999.

%   DATATYPES:
%binary, integer, float
%FUNCTION
%This function adds a mixture of Gaussian and Poisson noise to a testobject at
%a specified signal-to-noise ratio. The SNR is defined as the average object
%energy divided by the average noise power.
%ARGUMENTS
%
%  DIPlib      SCIL-Image     Description
%  dip_Image object     IMAGE *object     Input Object Image
%  dip_Image noisy      IMAGE *noisy      Output Image
%  dip_Image background    IMAGE *background    Background Image
%  dip_float backvalue     double backvalue     Constant Background Value
%  dip_float gaussianNoise    double gaussianNoise    Relative Amount of Gaussian Noise
%  dip_float poissonNoise     double poissonNoise     Relative Amount of Poisson Noise
%  dip_float snr     double snr     Signal to Noise Ratio
%  dip_float *conversion (0)     double *conversion      Pointer to the Poisson Conversion Factor
%  dip_float *variance (0)    double *variance     Pointer to the Gaussian Variance
%  dip_Random *random            Pointer to a Random structure
%
%SEE ALSO
% TestObjectCreate , TestObjectModulate , TestObjectBlur
