ClassesClassesClassesClasses | | | | Operators

gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion (Operator)

Name

gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion — Generate an impulse response of a (linearly) motion blurring.

Warning

gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion is obsolete and is only provided for reasons of backward compatibility.

Signature

gen_psf_motion( : Psf : PSFwidth, PSFheight, Blurring, Angle, Type : )

Herror gen_psf_motion(Hobject* Psf, const Hlong PSFwidth, const Hlong PSFheight, double Blurring, const Hlong Angle, const Hlong Type)

Herror T_gen_psf_motion(Hobject* Psf, const Htuple PSFwidth, const Htuple PSFheight, const Htuple Blurring, const Htuple Angle, const Htuple Type)

Herror gen_psf_motion(Hobject* Psf, const HTuple& PSFwidth, const HTuple& PSFheight, const HTuple& Blurring, const HTuple& Angle, const HTuple& Type)

HImage HImage::GenPsfMotion(const HTuple& PSFwidth, const HTuple& PSFheight, const HTuple& Blurring, const HTuple& Angle, const HTuple& Type)

void GenPsfMotion(HObject* Psf, const HTuple& PSFwidth, const HTuple& PSFheight, const HTuple& Blurring, const HTuple& Angle, const HTuple& Type)

void HImage::GenPsfMotion(Hlong PSFwidth, Hlong PSFheight, double Blurring, Hlong Angle, Hlong Type)

void HOperatorSetX.GenPsfMotion(
[out] IHUntypedObjectX*Psf, [in] VARIANT PSFwidth, [in] VARIANT PSFheight, [in] VARIANT Blurring, [in] VARIANT Angle, [in] VARIANT Type)

void HImageX.GenPsfMotion(
[in] Hlong PSFwidth, [in] Hlong PSFheight, [in] double Blurring, [in] Hlong Angle, [in] Hlong Type)

static void HOperatorSet.GenPsfMotion(out HObject psf, HTuple PSFwidth, HTuple PSFheight, HTuple blurring, HTuple angle, HTuple type)

void HImage.GenPsfMotion(int PSFwidth, int PSFheight, double blurring, int angle, int type)

Description

gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion generates an impulse response (spatial domain) of a blurring caused by a relative motion between the object and the camera during exposure. The generated impulse response is output into an image of HALCON image type 'real'. PSFwidthPSFwidthPSFwidthPSFwidthPSFwidthPSFwidth and PSFheightPSFheightPSFheightPSFheightPSFheightPSFheight define the width and height of the output image. The blurring motion moves along an even. AngleAngleAngleAngleAngleangle fixes its direction by specifying the angle between the motion direction and the x-axis (anticlockwise, measured in degrees). To specify different velocity behaviour five PSF prototypes can be generated. TypeTypeTypeTypeTypetype switches between the following prototypes:

  1. reverse ramp (crude model for acceleration)

  2. reverse trapezoid (crude model for high acceleration)

  3. square pulse (exact model for constant velocity), this is default

  4. forward trapezoid (crude model for deceleration)

  5. forward ramp (crude model for high deceleration)

(default value is 3.)

The blurring affects all part of the image uniformly. BlurringBlurringBlurringBlurringBlurringblurring controls the extent of blurring. It specifies the number of pixels (lying one after another) that are affetcetd by the blurring. This number is determined by velocity of the motion and exposure time. If BlurringBlurringBlurringBlurringBlurringblurring is a negative number, an adequate blurring in reverse direction is simulated. If AngleAngleAngleAngleAngleangle is a negative number, it is interpreted clockwise. If AngleAngleAngleAngleAngleangle exceeds 360 or falls below -360, it is transformed modulo(360) in an adequate number between [0..360] resp. [-360..0]. The result image of gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion 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:

This representation conforms to that of the impulse response parameter of the HALCON-operator wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter. So one can use gen_psf_motiongen_psf_motionGenPsfMotiongen_psf_motionGenPsfMotionGenPsfMotion to generate an impulse response for Wiener filtering a motion blurred image.

Parallelization

Parameters

PsfPsfPsfPsfPsfpsf (output_object)  image objectHImageHImageHImageHImageXHobject * (real)

Impulse response of motion-blur.

PSFwidthPSFwidthPSFwidthPSFwidthPSFwidthPSFwidth (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of impulse response image.

Default value: 256

Suggested values: 128, 256, 512, 1024

Typical range of values: 1 ≤ PSFwidth PSFwidth PSFwidth PSFwidth PSFwidth PSFwidth

PSFheightPSFheightPSFheightPSFheightPSFheightPSFheight (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of impulse response image.

Default value: 256

Suggested values: 128, 256, 512, 1024

Typical range of values: 1 ≤ PSFheight PSFheight PSFheight PSFheight PSFheight PSFheight

BlurringBlurringBlurringBlurringBlurringblurring (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Degree of motion-blur.

Default value: 20.0

Suggested values: 5.0, 10.0, 20.0, 30.0, 40.0

AngleAngleAngleAngleAngleangle (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Angle between direction of motion and x-axis (anticlockwise).

Default value: 0

Suggested values: 0, 45, 90, 180, 270

TypeTypeTypeTypeTypetype (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

PSF prototype resp. type of motion.

Default value: 3

List of values: 1, 2, 3, 4, 5

Result

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

Possible Predecessors

simulate_defocussimulate_defocusSimulateDefocussimulate_defocusSimulateDefocusSimulateDefocus, gen_psf_defocusgen_psf_defocusGenPsfDefocusgen_psf_defocusGenPsfDefocusGenPsfDefocus

Possible Successors

simulate_motionsimulate_motionSimulateMotionsimulate_motionSimulateMotionSimulateMotion, wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter, wiener_filter_niwiener_filter_niWienerFilterNiwiener_filter_niWienerFilterNiWienerFilterNi

See also

simulate_motionsimulate_motionSimulateMotionsimulate_motionSimulateMotionSimulateMotion, simulate_defocussimulate_defocusSimulateDefocussimulate_defocusSimulateDefocusSimulateDefocus, gen_psf_defocusgen_psf_defocusGenPsfDefocusgen_psf_defocusGenPsfDefocusGenPsfDefocus, wiener_filterwiener_filterWienerFilterwiener_filterWienerFilterWienerFilter, wiener_filter_niwiener_filter_niWienerFilterNiwiener_filter_niWienerFilterNiWienerFilterNi

References

Anil K. Jain:Fundamentals of Digital Image Processing, Prentice-Hall International Inc., Englewood Cliffs, New Jersey, 1989
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.
Kha-Chye Tan, Hock Lim, B. T. G. Tan:“Restoration of Real-World Motion-Blurred Images”;S. 291-299 in: CVGIP Graphical Models and Image Processing, Vol. 53, No. 3, May 1991

Module

Foundation


ClassesClassesClassesClasses | | | | Operators