gen_psf_motion — 生成(线性)运动模糊的脉冲响应。
gen_psf_motion 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. PSFwidth and PSFheight
define the width and height of the output image.
The blurring motion moves along an even. Angle fixes its
direction by specifying the angle between the motion direction and the
x-axis (anticlockwise, measured in degrees).
To specify different velocity behavior five PSF prototypes can be
generated. Type switches between the following prototypes:
reverse ramp (crude model for acceleration)
reverse trapezoid (crude model for high acceleration)
square pulse (exact model for constant velocity), this is default
forward trapezoid (crude model for deceleration)
forward ramp (crude model for high deceleration)
(default value is 3.)
The blurring affects all part of the image uniformly.
Blurring 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 Blurring is a negative number, an adequate
blurring in reverse direction is simulated. If Angle is a
negative number, it is interpreted clockwise. If Angle 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_motion 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_filter。So one can use
gen_psf_motion to generate an impulse response for
Wiener filtering a motion blurred image.
Psf (输出对象) image → object (real)
Impulse response of motion-blur.
PSFwidth (输入控制) integer → (integer)
Width of impulse response image.
默认值: 256
建议值: 128, 256, 512, 1024
值范围:
1
≤
PSFwidth
PSFheight (输入控制) integer → (integer)
Height of impulse response image.
默认值: 256
建议值: 128, 256, 512, 1024
值范围:
1
≤
PSFheight
Blurring (输入控制) real → (real)
Degree of motion-blur.
默认值: 20.0
建议值: 5.0, 10.0, 20.0, 30.0, 40.0
Angle (输入控制) integer → (integer)
Angle between direction of motion and x-axis (anticlockwise).
默认值: 0
建议值: 0, 45, 90, 180, 270
Type (输入控制) integer → (integer)
PSF prototype resp. type of motion.
默认值: 3
值列表: 1, 2, 3, 4, 5
gen_psf_motion 在所有参数正确时返回 2 ( H_MSG_TRUE )。
simulate_defocus,
gen_psf_defocus
simulate_motion,
wiener_filter,
wiener_filter_ni
simulate_motion,
simulate_defocus,
gen_psf_defocus,
wiener_filter,
wiener_filter_ni
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
基础