Skip to content

gen_psf_defocusGenPsfDefocusGenPsfDefocusgen_psf_defocusgen_psf_defocus🔗

Short description🔗

gen_psf_defocusGenPsfDefocusGenPsfDefocusgen_psf_defocusgen_psf_defocus — Generate an impulse response of an uniform out-of-focus blurring.

Signature🔗

gen_psf_defocus( out image Psf, integer PSFwidth, integer PSFheight, real Blurring )void GenPsfDefocus( HObject* Psf, const HTuple& PSFwidth, const HTuple& PSFheight, const HTuple& Blurring )static void HOperatorSet.GenPsfDefocus( out HObject psf, HTuple PSFwidth, HTuple PSFheight, HTuple blurring )def gen_psf_defocus( psfwidth: int, psfheight: int, blurring: float ) -> HObject

Herror gen_psf_defocus( Hobject* Psf, const Hlong PSFwidth, const Hlong PSFheight, double Blurring )

Herror T_gen_psf_defocus( Hobject* Psf, const Htuple PSFwidth, const Htuple PSFheight, const Htuple Blurring )

void HImage::GenPsfDefocus( Hlong PSFwidth, Hlong PSFheight, double Blurring )

void HImage.GenPsfDefocus( int PSFwidth, int PSFheight, double blurring )

Description🔗

gen_psf_defocusGenPsfDefocus generates an impulse response (spatial domain) of an uniform out-of-focus blurring and writes it into an image of HALCON image type real. Blurringblurringblurring specifies the extent of blurring by defining the “blur radius” (out-of-focus blurring maps each image pixel on a small circle with a radius of Blurringblurringblurring - specified in “number of pixels”). If specified less than zero, the absolute value of Blurringblurringblurring is used. The result image of gen_psf_defocusGenPsfDefocus encloses an spatial domain impulse response of the specified blurring. Its representation presumes the origin in the upper left corner. This results in the following disposition of an NxM sized image:

  • first rectangle (“upper left”): (image coordinates \(xb = 0..(N/2)-1\), \(yb = 0..(M/2)-1)\)

    • conforms to the fourth quadrant of the Cartesian coordinate system, encloses values of the impulse response at position \(x = 0..N/2\) and \(y = 0..-M/2\)
  • second rectangle (“upper right”): (image coordinates \(xb = N/2..N-1\), \(yb = 0..(M/2)-1)\)

    • conforms to the third quadrant of the Cartesian coordinate system, encloses values of the impulse response at position \(x = -N/2..-1\) and \(y = -1..-M/2\)
  • third rectangle (“lower left”): (image coordinates \(xb = 0..(N/2)-1\), \(yb = M/2..M-1)\)

    • conforms to the first quadrant of the Cartesian coordinate system, encloses values of the impulse response at position \(x = 1..N/2\) and \(y = M/2..0\)
  • fourth rectangle (“lower right”): (image coordinates \(xb = N/2..N-1\), \(yb = M/2..M-1)\)

    • conforms to the second quadrant of the Cartesian coordinate system, encloses values of the impulse response at position \(x = -N/2..-1\) and \(y = M/2..1\)

This representation conforms to that of the impulse response parameter of the HALCON-operator wiener_filterWienerFilter. So one can use gen_psf_defocusGenPsfDefocus to generate an impulse response for Wiener filtering.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Psfpsfpsf (output_object) image → object (real)HObject (real)HImage (real)HObject (real)Hobject * (real)

Impulse response of uniform out-of-focus blurring.

PSFwidthPSFwidthpsfwidth (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of result image.

Default: 256256
Suggested values: 128, 256, 512, 1024128, 256, 512, 1024
Value range: 1 ≤ PSFwidth

PSFheightPSFheightpsfheight (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of result image.

Default: 256256
Suggested values: 128, 256, 512, 1024128, 256, 512, 1024
Value range: 1 ≤ PSFheight

Blurringblurringblurring (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Degree of Blurring.

Default: 5.05.0
Suggested values: 1.0, 5.0, 10.0, 15.0, 18.01.0, 5.0, 10.0, 15.0, 18.0

Result🔗

gen_psf_defocusGenPsfDefocus returns 2 (H_MSG_TRUE) if all parameters are correct.

Combinations with other operators🔗

Combinations

Possible predecessors

simulate_motionSimulateMotion, gen_psf_motionGenPsfMotion

Possible successors

simulate_defocusSimulateDefocus, wiener_filterWienerFilter, wiener_filter_niWienerFilterNi

See also

simulate_defocusSimulateDefocus, gen_psf_motionGenPsfMotion, simulate_motionSimulateMotion, wiener_filterWienerFilter, wiener_filter_niWienerFilterNi

References🔗

Reginald L. Lagendijk, Jan Biemond: Iterative Identification and Restoration of Images, Kluwer Academic Publishers Boston/Dordrecht/London, 1991

M. Lückenhaus:“Grundlagen des Wiener-Filters und seine Anwendung in der Bildanalyse”; Diplomarbeit; Technische Universität München, Institut für Informatik; Lehrstuhl Prof. Radig; 1995.

Module🔗

Foundation