Overcome fruit internal quality information collecting method and the device of size and attitude impact
Technical field
The present invention relates to information collecting method and device that a kind of fruit internal quality detects, especially relate to a kind of fruit internal quality information collecting method and device that overcomes size and attitude impact.
Background technology
Classification is that agricultural product are adopted one of important means that rear commercialization processes, and to strengthening agricultural product commodity market competitive power, that increases economic efficiency is significant.
It is the basis of classification that the index of quality detects.In quality of agricultural product index context of detection, machine vision technique has been applied to the detection quality of agricultural product index of external sort.And near-infrared spectrum technique has also obtained application in the detection of Internal quality index.
Utilize the fruit spectral signature to detect the fruit internal quality index method and can be divided into reflectometry and transmission beam method.
Reflectometry: detect light by pick-up unit to detecting the fruit emission during detection, pick-up unit, at homonymy detection of reflected light, obtains fruit internal quality information by analysis.
Transmission beam method: detect light by pick-up unit to detecting the fruit emission during detection, pick-up unit detects transmitted ray at opposite side, by analysis, obtains fruit internal quality information.
These methods generally adopt the spectral information of the device triggering collection fruit such as scrambler, optoelectronic switch, when the detected object change in size is larger, and the consistance that these class methods can not guarantee to detect position and detect radiation direction, thus introduce error.
Summary of the invention
The object of the present invention is to provide a kind of fruit internal quality information collecting method and device that overcomes size and attitude impact, adopt size, attitude and the position of form center of machine vision method analyzing and testing object, control corresponding topworks and adapt to detected object, the consistance that guarantees to detect position and detect radiation direction.
The technical solution adopted for the present invention to solve the technical problems is:
One, a kind of signal pickup assembly for the fruit internal quality detection:
The present invention includes computing machine, a plurality of pallets that detected object is housed, video camera, lifting electric displacement platform, the rotation electric displacement platform, lifting electric displacement platform controller, rotation electric displacement platform controller, detection light source and detecting device, scrambler, driving wheel, contrast formula optoelectronic switch, belt and follower; Strap lug is on driving wheel and follower, and scrambler is connected with driving wheel, and contrast formula optoelectronic switch is arranged on the belt both sides, and lifting electric displacement platform and detection light source and detecting device are suspended on the belt top; The pallet of a plurality of drum-shapeds is placed on respectively on belt, and detected object is placed on pallet; Video camera is connected with computing machine with contrast formula optoelectronic switch respectively by cable, and the lifting electric displacement platform is connected with computing machine with rotation electric displacement platform controller by lifting electric displacement platform controller respectively with the rotation electric displacement platform, and scrambler connects on computers; The rotation electric displacement platform is arranged on lifting electric displacement platform below, and detection light source and detecting device are arranged on rotation electric displacement platform turning axle, and detection light source is connected on computers with detecting device.
Two, a kind of signal acquisition method for the fruit internal quality detection:
Driving wheel of the present invention externally power is rotated in a clockwise direction under driving, and drives the scrambler running, and drives follower by belt and rotate together, and the pallet drive detected object that is placed on belt moves right together; When the pallet that is placed with detected object arrives the position at contrast formula optoelectronic switch place, contrast formula optoelectronic switch produces trigger pulse, trigger the video camera photographic images, the image input computing machine that video camera will be taken, after computing machine is processed by image, control lifting electric displacement platform and rotation electric displacement platform to control the attitude of detection light source and detecting device, complete the spectra collection of detected object.
It is as follows with the method for the attitude of rotation electric displacement platform that described computing machine carries out after image is processed controlling the lifting electric displacement platform:
Rotation center take the rotation electric displacement platform is set up rectangular coordinate system XOY as initial point, take the belt movement direction as X-axis, its long measure is pressed the resolution setting of video camera;
If the recurrent interval of scrambler, corresponding belt moving interval was S;
Record detection light source and detecting device initial center height H
D0With detection light source and detecting device axis L and the initial angle of X-axis be θ
D0
The center of recording video camera is (x
C, y
C);
The image that video camera is taken after binary segmentation, filtering and rim detection, obtains the border of detected object (4), adopts the Minimum Enclosing Rectangle method method to calculate transverse diameter and vertical footpath to frontier point, and when obtaining minimum boundary rectangle, writes down the anglec of rotation; Concrete grammar is as follows:
The definition self-defined structure is used for the storage data boundary:
Set up the dynamic array Edge of an EdgeNode type, its length equals the number N E of the frontier point of detected object (4), and the frontier point of detected object (4) is all put into array Edge;
1) calculate the position of form center (x of detected object 4
F, y
F):
2) frontier point of detected object is all deducted the position of form center (x of detected object
F, y
F), with the position of form center (x of detected object
F, y
F) add the center (x of video camera
C, y
C) after obtain (x
F+ x
C, y
F+ y
C), become the coordinate (x of detected object in rectangular coordinate system XOY
FT, y
FT);
3) defining variable XLeft, XRight, YTop, YBottom, MinSita; Defining variable MinArea, and initialize is the maximal value that computing machine can represent; XLeft is set respectively, XRight, YTop, YBottom are 1 ,-1,1 ,-1;
4) according to certain angle intervals θ
j, to by formula (2) calculating of a point in data boundary Edge, obtain rotating rear new coordinate points:
In formula:
x
i, y
iAny horizontal ordinate and ordinate of certain in-data boundary Edge, i=1,2 ..., EdgeTotal
x′
i, y '
iCertain in-data boundary Edge is postrotational horizontal ordinate and ordinate a bit
θ
j-the anglec of rotation, j=1,2 ..., MR, MR are number of revolutions,
5) with x '
i, y '
iWith XLeft, XRight, YTop, YBottom compares respectively, if x '
iGreater than XRight, with x '
iValue be stored in the XRight variable, if x '
iLess than XLeft, with x '
iValue be stored in the XLeft variable; If y '
iGreater than YTop, with y '
iValue be stored in the YTop variable, if y '
iLess than YBottom, with y '
iValue be stored in the YBottom variable;
6) take off some repeating step 4 at data boundary Edge) and step 5), until the every bit in data boundary Edge is all completed;
7) area calculates and compares:
D1=YTop-YBottom;
D2=XRight-XLef;
AreaCurrent=D1*D2;
if(AreaCurrent<MinArea)
8) j is changed from 1 to MR pointwise, to change angle intervals θ
j, repeating step 4)~7); After complete, DShort is the transverse diameter of detected object, and DLong is the vertical footpath of detected object, and MinSita is detected object minor axis and X-axis angle theta
F
The detection light source that detected object is corresponding and detector centre height H
D
The internal diameter of d-pallet 2
Calculate lifting electric displacement platform (5) lifting value Δ H:
ΔH=H
D-H
D0 (4)
The detection light source that the current detection object is corresponding and detecting device axis L and X-axis angle theta
D:
θ
D=θ
F (5)
Calculate the anglec of rotation Δ θ of rotation electric displacement platform:
Δθ=θ
D-θ
D0 (6)
Calculate the required trigger pulse quantity P of the detected object centre of form and detection light source and detecting device axis L conllinear:
In computer-internal, an impulse meter PC is set, its initial value equals P, afterwards, the every collection 1 width image of computing machine, the value of impulse meter PC subtracts 1;
In the time of in detected object enters into detection light source and detecting device turning circle radius region, computing machine is controlled the lifting electric displacement platform by lifting electric displacement platform controller and rotation electric displacement platform controller and is rotated electric displacement platform lifting Δ H and rotation Δ θ respectively;
Impulse meter PC value reduces at 0 o'clock, and computer starting detection light source and detecting device gather spectroscopic data; Then computing machine is controlled the lifting electric displacement platform and rotates electric displacement platform and get back to initial position by lifting electric displacement platform controller and rotation electric displacement platform controller again.
The useful effect that the present invention has is:
Adopt machine vision method to detect size, attitude and the position of form center of detected object, control corresponding lifting electric displacement platform and rotation electric displacement platform arrival appropriate location, when arriving detection light source and detecting device axis, detected object gathers spectroscopic data, guarantee the consistance of spectra collection position, improved accuracy of detection.
Description of drawings
Fig. 1 is apparatus structure principle schematic of the present invention.
Fig. 2 is the vertical view of Fig. 1.
Fig. 3 is the side view of detecting device with respect to Fig. 1.
Fig. 4 is the vertical view of pallet with respect to Fig. 1.
Fig. 5 is the side view of Fig. 4.
Fig. 6 implements illustration.
In figure: 1, computing machine, 2, pallet, 3, video camera, 4, detected object, 5, the lifting electric displacement platform, 6, the rotation electric displacement platform, 7, lifting electric displacement platform controller, 8, rotation electric displacement platform controller, 9, detection light source and detecting device, 10, scrambler, 11, driving wheel, 12, contrast formula optoelectronic switch, 13, belt, 14, follower.
Embodiment
The present invention is further described below in conjunction with drawings and embodiments.
As shown in Figure 1 and Figure 2, the present invention includes computing machine 1, a plurality of pallets 2 that detected object 4 is housed, VT-EXGC1400D type video camera 3, TSMV60-1S type lifting electric displacement platform 5, RSA60 type rotation electric displacement platform 6, SC300-1A type lifting electric displacement platform controller 7, SC300-1A type rotation electric displacement platform controller 8, the detection light source of LHT75 type light source and USB4000 type spectral composition and detecting device 9, HMA-6G5F1000BM type scrambler 10, driving wheel 11, E3F-DS30C4 type contrast formula optoelectronic switch 12, belt 13 and follower 14; Belt 13 is looped around on driving wheel 11 and follower 14, and scrambler 10 is connected with driving wheel 11, and contrast formula optoelectronic switch 12 is arranged on belt 13 both sides, and lifting electric displacement platform 5 and detection light source and detecting device 9 are suspended on belt 13 tops; The pallet 2 of a plurality of drum-shapeds is placed on respectively on belt 13, and detected object 4 is placed on pallet 2; Video camera 3 is connected with computing machine 1 with contrast formula optoelectronic switch 12 respectively by cable, and lifting electric displacement platform 5 is connected with computing machine 1 with rotation electric displacement platform controller 8 by lifting electric displacement platform controller 7 respectively with rotation electric displacement platform 6, and scrambler 10 is connected on computing machine 1; Rotation electric displacement platform 6 is arranged on lifting electric displacement platform 5 belows, and detection light source and detecting device 9 are arranged on rotation electric displacement platform 6 turning axles, and detection light source and detecting device 9 are connected on computing machine 1.
As shown in Figure 3, rotation electric displacement platform 6 is arranged on lifting electric displacement platform 5 belows, and detection light source and detecting device 9 are arranged on rotation electric displacement platform 6 turning axles.
As shown in Figure 4 and Figure 5, pallet 2 is drum-shaped structure.
The collect fruit method of spectral information of the present invention is as follows:
As shown in Figure 1, driving wheel 11 externally is rotated in a clockwise direction under the power drive, drives scrambler 10 runnings, and by belt 13 drive followers 14, rotates together, is placed on drive detected object 4 on the pallet 2 on belt 13 and moves right together.When pallet 2 arrives the position at contrast formula optoelectronic switch 12 places, contrast formula optoelectronic switch 12 produces trigger pulse, trigger video camera 3 photographic images, the image input computing machine 1 that video camera 3 will be taken, after computing machine 1 is processed by image, control lifting electric displacement platform 5 and rotation electric displacement platform 6 to control the attitude of detection light source and detecting device 9, complete the spectra collection of detected object 4.
It is as follows with the method for the attitude of rotation electric displacement platform 6 that computing machine 1 carries out after image is processed controlling lifting electric displacement platform 5:
As shown in Figure 6, take the rotation center of rotation electric displacement platform 6 as initial point, take belt 13 direction of motion as X-axis, set up rectangular coordinate system XOY, its long measure is pressed the resolution setting of video camera 3.
If the recurrent interval of scrambler 10, corresponding belt 13 moving intervals were S.
Record detection light source and detecting device 9 initial center height H
D0With detection light source and detecting device 9 axis L and the initial angle of X-axis be θ
D0.
The center of recording video camera 3 is (x
C, y
C).
The image that video camera 3 is taken after binary segmentation, filtering and rim detection, obtains the border of detected object 4, adopts Minimum Enclosing Rectangle method (MER) method to calculate transverse diameter and vertical footpath to frontier point, and when obtaining minimum boundary rectangle, writes down the anglec of rotation.Concrete grammar is as follows:
When the following description detection method, all take the C language as example.
The definition self-defined structure is used for the storage data boundary:
Set up the dynamic array Edge of an EdgeNode type, its length equals the number N E of the frontier point of detected object 4, and the frontier point of detected object 4 is all put into array Edge.
1. calculate the position of form center (x of detected object 4
F, y
F):
2. the frontier point of detected object 4 is all deducted the position of form center (x of detected object 4
F, y
F), with the position of form center (x of detected object 4
F, y
F) add the center (x of video camera 3
C, y
C) after obtain (x
F+ x
C, y
F+ y
C), become the coordinate (x of detected object 4 in rectangular coordinate system XOY
FT, y
FT).
3. defining variable XLeft, XRight, YTop, YBottom, MinSita.Defining variable MinArea, and initialize is the maximal value that computing machine can represent; XLeft is set respectively, XRight, YTop, YBottom are 1 ,-1,1 ,-1;
4. according to certain angle intervals θ
j, to by formula (2) calculating of a point in data boundary Edge, obtain rotating rear new coordinate points:
In formula:
x
i, y
iAny horizontal ordinate and ordinate of certain in-data boundary Edge, i=1,2 ..., EdgeTotal
x′
i, y '
iCertain in-data boundary Edge is postrotational horizontal ordinate and ordinate a bit
θ
j-the anglec of rotation, j=1,2 ..., MR, MR are number of revolutions,
5. with x '
i, y '
iWith XLeft, XRight, YTop, YBottom compares respectively, if x '
iGreater than XRight, with x '
iValue be stored in the XRight variable, if x '
iLess than XLeft, with x '
iValue be stored in the XLeft variable.If y '
iGreater than YTop, with y '
iValue be stored in the YTop variable, if y '
iLess than YBottom, with y '
iValue be stored in the YBottom variable;
6. take off a bit at data boundary Edge, repeat 4. and 5., until the every bit in data boundary Edge is all completed;
7. area calculates and compares:
D1=YTop-YBottom;
D2=XRight-XLef;
AreaCurrent=D1*D2;
if(AreaCurrent<MinArea)
8. j is changed from 1 to MR pointwise, to change angle intervals θ
j, repeat 4.~7..After complete, DShort is the transverse diameter of detected object 4, and DLong is the vertical footpath of detected object 4, and MinSita is detected object 4 minor axises and X-axis angle theta
F.
The detection light source of detected object 4 correspondences and detecting device 9 centre-height H
Di
The internal diameter of d-pallet 2
Calculate lifting electric displacement platform 5 lifting value Δ H:
ΔH=H
D-H
D0 (4)
The detection light source of current detection object 4 correspondences and detecting device 9 axis L and X-axis angle theta
D:
θ
D=θ
F (5)
Calculate the anglec of rotation Δ θ of rotation electric displacement platform 6:
Δθ=θ
D-θ
D0 (6)
Calculate the required trigger pulse quantity P of detected object 4 centres of form and detection light source and detecting device 9 axis L conllinear:
In computer-internal, an impulse meter PC is set, its initial value equals P, afterwards, the every collection 1 width image of computing machine, the value of impulse meter PC subtracts 1.
As shown in Figure 6, in the time of in detected object 4 enters into detection light source and detecting device 9 turning circle radius region, computing machine is controlled lifting electric displacement platform 5 by lifting electric displacement platform controller 7 and rotation electric displacement platform controller 8 and is rotated electric displacement platform 6 lifting Δ H and rotation Δ θ respectively.
Impulse meter PC value reduces at 0 o'clock, and computer starting detection light source and detecting device 9 gather spectroscopic data.Then computing machine is controlled lifting electric displacement platform 5 and rotates electric displacement platform 6 and get back to initial position by lifting electric displacement platform controller 7 and rotation electric displacement platform controller 8 again.