Strawberry flowering phase spraying system and method

文档序号:1697499 发布日期:2019-12-13 浏览:22次 中文

阅读说明:本技术 一种草莓开花期喷施系统及方法 (Strawberry flowering phase spraying system and method ) 是由 崔明 陈仕雄 蒋其友 严方 于 2019-09-27 设计创作,主要内容包括:本发明公开了一种草莓开花期喷施系统及方法,所述喷施系统包括喷施装置、视觉检测装置和控制装置,喷施装置、视觉检测装置和控制装置固定在悬吊平台运动装置上;所述喷施方法包括:在离线状态下标定草莓开花状态类型参数;采集图像经校正后提取R颜色空间图像分量进行高斯滤波处理;利用改进K均值聚类分割算法对图像进行分割;利用形态学处理和连通区域面积特征分析方法提取草莓开花像素区域;计算草莓开花区域与总像素区域的像素比,并根据标定参数确定草莓开花期状态类型;根据草莓开花期状态类型确定喷施等级,自动调整单位面积喷施量。本发明喷施方法提高了草莓开花期施肥的精准性和可靠性,有利于提高草莓的产量和质量。(the invention discloses a spraying system and a spraying method for strawberries in a flowering period, wherein the spraying system comprises a spraying device, a visual detection device and a control device, and the spraying device, the visual detection device and the control device are fixed on a suspension platform movement device; the spraying method comprises the following steps: calibrating strawberry flowering state type parameters in an off-line state; after the collected image is corrected, extracting R color space image components and carrying out Gaussian filtering processing; segmenting the image by utilizing an improved K-means clustering segmentation algorithm; extracting a strawberry flowering pixel region by using a morphological processing and connected region area characteristic analysis method; calculating the pixel ratio of the strawberry flowering area to the total pixel area, and determining the type of the strawberry flowering period state according to the calibration parameters; and determining the spraying grade according to the type of the flowering phase state of the strawberries, and automatically adjusting the spraying amount per unit area. The spraying method improves the precision and the reliability of the strawberry fertilization in the flowering phase, and is beneficial to improving the yield and the quality of the strawberries.)

1. The utility model provides a strawberry flowering phase spraying system which characterized in that: the spraying device, the visual detection device and the control device are fixed on a suspension platform movement device, and the suspension platform movement device is fixed on a greenhouse support (5).

2. The strawberry flowering phase spray system of claim 1, wherein: spraying device includes fertilizer box (12), fertilizer box (12) are connected to transfer line (18) through delivery pump (22), the pressure regulation and control end and the controlling means of delivery pump (22) are connected, spray lance (16) is connected to transfer line (18) below, installation atomizer (17) on spray lance (16), install flow control valve (23) on transfer line (18) pipeline, the regulation and control end and the controlling means of flow control valve (23) are connected, transfer line (18) exit installation flow sensor (24), level sensor (20) are equipped with in fertilizer box (12), level sensor (20) output connection controlling means.

3. The strawberry flowering phase spray system of claim 1, wherein: the visual inspection apparatus includes a camera (15) and an image processing controller (21).

4. the strawberry flowering phase spray system of claim 1, wherein: suspend platform telecontrol equipment in midair includes gear (2), gear (2) and rack (1) meshing of fixing on greenhouse support (5), there are driving motor (3) and reduction gear (4) on gear (2), utilize drive shaft (6) control gear (2) to move at the uniform velocity according to appointed speed, support rail (9) are fixed on greenhouse support (5), install supporting roller (11) on support rail (9), supporting roller (11) are according to fixing guide arm (10) direction on greenhouse support (5) along support rail (9) motion, supporting platform (7) set up in guide arm (10) top, platform connecting seat (8) set up on supporting platform (7), drive shaft (6) are fixed in platform connecting seat (8).

5. a spraying method of a strawberry flowering phase spraying system is characterized in that: the method comprises the following steps:

a: calibrating parameters: acquiring a strawberry growth image, then carrying out image processing, carrying out comparison calibration on a processing result according to a manual judgment result, and writing calibration parameters into a controller;

b: starting the suspension platform movement device: the control device determines the running speed of the suspension platform moving device according to the camera parameters and the actual working distance, and the suspension platform moving device runs at a constant speed after the spraying system is started;

c: collecting an image: the control device controls the visual detection device to collect images according to a fixed time interval, transmits the images to the image processing controller (21) for data processing, and feeds back data processing results to the control device;

d: opening the spraying device: the control device compares the processing result with the previously calibrated parameters, determines the spraying amount in unit time, and controls the flow regulating valve (23) to spray accurately.

6. The spray method of claim 5, characterized in that: the specific method for calibrating the parameters in the step a is as follows: dividing the flowering condition of the strawberry into four types according to the number of flowers in unit area, taking the ratio of the area of flower pixels to the total area of image pixels as a calibration type judgment basis according to the approximate linear proportional relation between the number of flowers and the flower pixels, and processing the regional image by setting an image mask in the actual image processing process, wherein the specific image processing process is as follows:

a 1: collecting an image, carrying out image distortion correction, extracting R space color characteristic components of the image of the region of interest according to an image mask, and carrying out Gaussian filtering processing;

a 2: segmenting the image by utilizing an improved K-means clustering segmentation algorithm to form a segmentation area;

a 3: processing the segmented region by using a morphological processing algorithm;

a 4: analyzing and extracting a strawberry flowering region by using a connected region area characteristic method;

a 5: counting the total number of flower pixels in the region of interest of the image, and calculating the ratio of the total number of the flower pixels to the total number of the pixels in the region of interest;

a 6: and comparing the actual pixel ratio with the calibrated pixel ratio parameter to determine the type of the flowering state of the strawberry.

7. The spray method of claim 6, characterized in that: the algorithm of the step a2 adopts an improved K-means clustering segmentation algorithm, and the specific algorithm is as follows:

a 21: initialization:

Step 1: converting the sample image into a one-dimensional sample data set C with the size of N, wherein N is the number of sample image pixels, and overlapping is setthe clustering center when the generation operation times is I and the clustering type is j is Zj(I) Randomly selecting a sample object from the data set C as an initial clustering center Z1(1);

Step 2: calculate each sample xmShortest distance d (x) to existing cluster centerm) N, wherein x is 1,2mfor the mth sample in the data set, the probability p (x) that each sample object is selected as the next cluster center is calculatedm):

step 3: selecting the next clustering center according to a wheel disc method;

Step 4: repeating the steps of Step2 and Step3 until k objects are selected to form an initial clustering center Zj(1),j=1,2,3,...k;

a 22: and (3) iterative calculation: calculating each sample x in the sample data set C according to the similarity criterionmDistance D (x) from initial clusterm,Zj(I) n, j 1,2, 3.. k) and dividing each data object into cluster aggregation clusters S with the smallest distancejIn, the distance is expressed as:

In the formula xm∈Sj

a 23: updating a clustering center: calculating the mean value in each cluster set according to a cluster center updating formula to be used as a new cluster center of the set, updating to obtain a new cluster set center, and settingFor the mth element of the cluster j, the number of the elements of the cluster j is njThe cluster center update formula is:

a 24: termination conditions were as follows: and circularly updating the cluster centers until each cluster center is not changed any more or the sum of squared errors is locally minimum, wherein the calculation method of the clustering criterion function J comprises the following steps:

And the precision error is xi, if the absolute value of J (I +1) -J (I) | < xi, the algorithm is ended, the iteration is terminated, and otherwise, the iterative computation and the clustering center are repeatedly executed until the termination condition is met.

8. The spray method of claim 5, characterized in that: the spraying method in the step d comprises the following specific steps: comparing the actual pixel ratio with the calibration type pixel ratio, and judging the flowering state type of the strawberry by using the Euclidean geometric distance; the control device adopts a PWM intermittent spray flow debugging method to carry out spraying according to the spraying grade, under the fixed pressure, the output duty ratio of the main controller and the spraying amount are approximately in a linear relation, the spraying amount in unit area is related to the running speed and the working distance of the system, and at the standard speed VbAnd a standard height HbThen, the linear function relationship between the duty ratio τ and the spraying amount Q per unit area is τ ═ f (Q), and spraying is completed by a spraying device, as shown in the following formula:

τ(i)=(H(i)/Hb)*(Vi/Vb)*f(Q)

wherein τ (i) is the output duty cycle for strawberry blossom type i, HiFor the actual working height of the system, ViIs the actual operating speed of the system.

Technical Field

The invention relates to a spraying system and an image processing method, in particular to a spraying system and a method for strawberries in the flowering period.

background

In recent years, with the rapid development of the strawberry industry, the facility degree of the strawberry greenhouse is continuously improved, the strawberry industry is transformed from a scale expansion stage to a facility promotion stage, the strawberries cannot be fertilized during flowering, and when the condition of fertilizer shortage occurs, the cold resistance is reduced, the flower setting is less, the flower buds are weak, and the fruit setting rate is low; when the fertilizer is excessively applied, nutrient elements are unevenly distributed in the growth process of the strawberries, so that the fertilizer is excessively remained, therefore, the fertilizer application needs a reasonable standard during the flowering period of the strawberries, and the growth of the strawberries can be influenced by blind fertilizer application.

At present, the method of manual foliage spraying is mainly adopted for fertilizing the strawberries in the flowering period, the fertilizing method is high in labor cost and low in efficiency, the fertilizing amount cannot be adjusted according to different flowering conditions, the spraying accuracy is greatly influenced by artificial subjectivity, and the accurate fertilizing is carried out according to the actual conditions of the strawberries in the flowering period, so that the method becomes an important factor influencing the yield and the quality of the strawberries.

Disclosure of Invention

the purpose of the invention is as follows: in view of the above problems, the present invention aims to provide a strawberry flowering phase spraying system and method, which can detect the flowering phase state of strawberries in real time, adjust the fertilizer amount in real time at different flowering phases, and improve the fertilizer application accuracy and efficiency.

The technical scheme is as follows: the invention provides a spraying system for strawberries in a flowering period, which comprises a spraying device, a visual detection device and a control device, wherein the spraying device, the visual detection device and the control device are fixed on a suspension platform movement device, and the suspension platform movement device is fixed on a greenhouse bracket;

The suspended platform movement device: the uniform motion is realized by utilizing the mobile driving component;

The visual inspection device: the system is responsible for image acquisition and processing and uploads a processing result to the control device;

the control device: the system main controller is used for controlling the running state of the suspension platform movement device, triggering the camera to take a picture and controlling the spraying amount of the spraying device according to the detection result of the visual detection device.

Spraying device includes the fertilizer case, the fertilizer case is connected to the transfer line through the delivery pump, the pressure regulation and control end and the controlling means of transfer pump are connected, provide power for fertilizer case output fertilizer, the spray lance is connected to the transfer line below, install atomizer on the spray lance, install flow control valve on the transfer line pipeline, flow control valve's regulation and control end is connected with controlling means, be used for adjusting the rate of fertilizer application size, flow sensor is installed in the transfer line exit, be used for detecting the fertilizer flow and feed back to controlling means and realize flow real time control, level sensor is equipped with in the fertilizer case, level sensor output connection control device, realize the judgement and the early warning of volume information in the fertilizer case.

the visual detection device comprises a camera and an image processing controller, the camera is fixed on a lead screw, the lead screw is installed below a fertilizer box through a lead screw connecting seat, the camera is responsible for image acquisition, images are acquired and transmitted to the image processing controller, the image processing controller extracts blooming state parameters in an image area to be detected through an image processing algorithm and compares the blooming state parameters with sample calibration parameters, accurate judgment of the blooming period of the strawberries is achieved, and detection results are transmitted to the control device.

The suspension platform movement device comprises a gear, the gear is meshed with a rack fixed on the greenhouse support, a driving motor and a speed reducer are arranged on the gear, the gear is controlled by a driving shaft to run at a uniform speed according to a specified speed, a supporting track is fixed on the greenhouse support, supporting rollers are mounted on the supporting track and move along the supporting track according to the direction of a guide rod fixed on the greenhouse support, the supporting platform is arranged above the guide rod, a platform connecting seat is arranged on the supporting platform, and the driving shaft is fixed on the platform connecting seat.

The camera selection is based on: the camera parameters comprise resolution, lens focal length and photosensitive chip type, wherein the resolution and the lens focal length are main parameters, and the camera resolution selection is mainly judged according to detection precision delta, view field size W multiplied by H and detection speed, and the following formula is adopted:

RW=W/δ (1)

RH=H/δ (2)

In the formula, W and H are the horizontal and vertical physical dimensions of the visual field respectively, RW and RH are the horizontal and vertical resolutions of the camera respectively, and the actually selected resolution of the camera is larger than a theoretical value;

the focal length of the lens is selected mainly by considering the parameters of the focal length f of the camera, the size w multiplied by h of the photosensitive chip and the working distance L, and the parameters are expressed as follows:

f=wL/W (3)

wherein w and h are the chip lateral and longitudinal physical dimensions, respectively.

The spraying method based on the spraying system comprises the following steps:

a: calibrating parameters: acquiring a strawberry growth image, then carrying out image processing, comparing and calibrating a processing result and a manual judgment result, and writing calibration parameters into a controller;

b: starting the suspension platform movement device: the control device determines the running speed of the suspension platform moving device according to the camera parameters and the actual working distance, and the suspension platform moving device runs at a constant speed after the spraying system is started;

c: collecting an image: the control device controls the visual detection device to acquire images according to a fixed time interval, transmits the images to the image processing controller for data processing, and feeds back a data processing result to the control device;

d: opening the spraying device: the control device compares the processing result with the previously calibrated parameters, determines the spraying amount in unit time, and controls the flow regulating valve to spray accurately.

the specific method for calibrating the parameters in the step a is as follows: the method comprises the following steps of dividing the flowering condition of the strawberry into four types according to the number of flowers in unit area, taking the ratio of the area of the flower pixels to the total area of the image pixels as a calibration grade judgment basis according to the approximate linear proportional relation between the number of the flowers and the flower pixels, in order to avoid the edge blurring effect caused by camera distortion, slightly increasing the visual field of a camera to be larger than the width of an actual strawberry detection area, and keeping the redundant symmetry of the widths of the left end and the right end, in the actual image processing process, processing the area image by a method of setting an image mask, calibrating the camera before acquiring the image, and specifically processing the image as follows:

a 1: collecting an image, carrying out image distortion correction, extracting R space color characteristic components of the image of the region of interest according to an image mask, and carrying out Gaussian filtering processing;

a 2: segmenting the image by utilizing an improved K-means clustering segmentation algorithm to form a segmentation area;

a 3: processing the segmented region by using a morphological processing algorithm;

a 4: analyzing and extracting a strawberry flowering region by using a connected region area characteristic method;

a 5: counting the total number of flower pixels in the region of interest of the image, and calculating the ratio of the total number of the flower pixels to the total number of the pixels in the region of interest;

a 6: and comparing the actual pixel ratio with the calibrated pixel ratio parameter to determine the type of the flowering state of the strawberry.

The algorithm of the step a2 adopts an improved K-means clustering segmentation algorithm, and the specific algorithm is as follows:

a 21: initialization:

Step 1: converting the sample image into a one-dimensional sample data set C with the size of N, wherein N is the number of pixels of the sample image, and the clustering center when the iterative operation times is I and the clustering type is j is Zj(I) randomly selecting a sample object from the data set C as an initial clustering center Z1(1);

step 2: calculate each sample xmShortest distance d (x) to existing cluster centerm) N, wherein x is 1,2mFor the mth sample in the data set, the probability p (x) that each sample object is selected as the next cluster center is calculatedm):

step 3: selecting the next clustering center according to a wheel disc method;

Step 4: repeating the steps of Step2 and Step3 until k objects are selected to form an initial clustering center Zj(1),j=1,2,3,...k;

a 22: and (3) iterative calculation: calculating each sample data set C according to similarity criterionsample xmdistance D (x) from initial clusterm,Zj(I) N, j 1,2, 3.. k) and dividing each data object into cluster aggregation clusters S with the smallest distancejIn, the distance is expressed as:

in the formula xm∈Sj

a 23: updating a clustering center: calculating the mean value in each cluster set according to a cluster center updating formula to be used as a new cluster center of the set, updating to obtain a new cluster set center, and settingFor the elements of the cluster j, the number of the elements of the cluster j is njThe cluster center update formula is:

a 24: termination conditions were as follows: and circularly updating the cluster centers until each cluster center is not changed any more or the sum of squared errors is locally minimum, wherein the clustering criterion function calculation method comprises the following steps:

and the precision error is xi, if the absolute value of J (I +1) -J (I) | < xi, the algorithm is ended, the iteration is terminated, and otherwise, the iterative computation and the clustering center are repeatedly executed until the termination condition is met.

In the step a3, a morphological close operation is used for processing, where a denotes an image matrix and B denotes a structural element, and the morphological processing method is as follows:

In the step a4, the gray scales are matched, and the pixel satisfying 8 neighbors is determined asthe same region is filtered through the area characteristics of the connected region, the noise interference region is filtered, and the pixel area (S) is extracted according to the following formulaMin,SMa)xregion of range

Wherein SMinand SMaxLower and upper parameter limits for area pixels, respectively

The method for determining the running speed of the motion device of the suspension platform in the step b comprises the following steps: calculating the longitudinal physical size H and the running speed v of the actual visual field of the camera according to the focal length of the camera, the size of the photosensitive chip and the working distance, wherein the physical size H and the running speed v are respectively expressed as follows:

H=hL/f (10)

v=hL/fΔT (11)

In the formula, delta T is a photographing time interval of the camera, and delta T is larger than the processing time of a single image;

The camera is shot and is adopted soft trigger mode to control, and the interval time of shooing is delayed by software program and is controlled, and the camera is fixed on the slide bar, and the distance L of manual regulation camera and spray rod shows as:

L=H/2+vt (12)

Wherein t is the image acquisition and processing time.

the spraying method in the step d comprises the following specific steps: comparing the actual pixel ratio with the calibration type pixel ratio, and judging the flowering state type of the strawberry by using the Euclidean geometric distance; the control device adopts a PWM intermittent spray flow debugging method to carry out spraying according to the spraying grade, under the fixed pressure, the output duty ratio of the main controller and the spraying amount are approximately in a linear relation, the spraying amount in unit area is related to the running speed and the working distance of the system, and at the standard speed Vband a standard height HbThen, the linear function relationship between the duty ratio τ and the spraying amount Q per unit area is τ ═ f (Q), and spraying is completed by a spraying device, as shown in the following formula:

τ(i)=(Hi/Hb)*(Vi/Vb)*f(Q) (13)

Wherein τ (i) is the output duty cycle for strawberry blossom type i, HiFor the actual working height of the system, ViIs the actual operating speed of the system.

Has the advantages that: compared with the prior art, the invention has the following remarkable advantages:

1. The fertilizer is fully automatically detected and sprayed in the fertilizer applying process in the flowering period of the strawberries, and the corresponding fertilizer applying speed is set only by a controller, so that the labor intensity of fertilizer application is reduced;

2. the visual detection device is arranged to spray the specific state of the strawberry in the flowering phase in a targeted manner, so that the spraying efficiency and the spraying fineness of the strawberry in the flowering phase are improved;

3. by adopting a suspension moving mode, the complex terrain environment in the greenhouse can be overcome, and the system operation precision is improved; meanwhile, the system adopts a structural form that the device main body is separated from the greenhouse support, and the device main body is freely assembled and disassembled in different greenhouses with fixed supports, so that the cost of the equipment is reduced, and the popularization and the application of the system are facilitated.

Drawings

FIG. 1 is a block diagram of the overall structure of a spraying system for the flowering phase of strawberries according to the present invention;

FIG. 2 is a side block diagram of a detection and spray control cabinet structure;

FIG. 3 is a block diagram of the hardware structure of an accurate spraying system during the flowering phase of strawberries;

FIG. 4 is a flow chart of an image processing algorithm for the flowering period of strawberries;

FIG. 5 is an extracted R-channel image;

FIG. 6 is a result of improved K-means cluster segmentation;

FIG. 7 shows the results of morphological processing;

FIG. 8 is the result of the analysis processing of the bit connected region features.

Detailed Description

The invention is further described below with reference to the accompanying drawings.

Referring to fig. 1-2, the spraying system for strawberries in the flowering phase comprises a spraying device, a visual detection device and a control device, wherein the spraying device, the visual detection device and the control device are fixed on a suspension platform movement device, and the suspension platform movement device is fixed on a greenhouse bracket 5.

Spraying device includes can 12, can 12 is detecting and spraying switch board 19 in, can 12 is connected to transfer line 18 through delivery pump 22, the pressure regulation and control end and the controlling means of delivery pump 22 are connected, provide power for can 12 output fertilizer, transfer line 18 below is connected spray lance 16, install atomizer 17 on the spray lance 16, install flow control valve 23 on the 18 pipelines of transfer line, the regulation and control end and the controlling means of flow control valve 23 are connected, be used for adjusting the fertilization volume size, 18 exit installation flow sensor 24 of transfer line, be used for detecting fertilizer flow and feed back controlling means and realize flow real time control, level sensor 20 is equipped with in the can 12, level sensor 20 output connection controlling means, realize the judgement and the early warning of capacity information in can 12.

The visual detection device comprises a camera 15 and an image processing controller 21, the camera 15 is fixed on a lead screw 14, the lead screw 14 is installed below a fertilizer box 12 through a lead screw connecting seat 13, the camera 15 is responsible for image acquisition, acquired images are transmitted to the image processing controller 21, the image processing controller 21 extracts the flowering state in an image area to be detected through an algorithm, and the flowering state is compared with sample calibration parameters, so that accurate judgment of the flowering period of the strawberries is realized, and detection results are transmitted to the control device.

suspend platform telecontrol equipment in midair includes gear 2, gear 2 and the meshing of rack 1 of fixing on greenhouse support 5, there are driving motor 3 and reduction gear 4 on the gear 2, utilize drive shaft 6 control gear 2 to follow the uniform motion of assigned speed, support rail 9 is fixed on greenhouse support 5, install supporting roller 11 on the support rail 9, supporting roller 11 moves along support rail 9 according to fixing the guide arm 10 direction on greenhouse support 5, supporting platform 7 sets up in the guide arm 10 top, platform connecting seat 8 sets up on supporting platform 7, drive shaft 6 is fixed at platform connecting seat 8.

The drive motor 3 can select a 57BYG250 series hybrid stepping motor model as a power unit, a stepping motor drive chip selects THB6128, a pulse subdivision number is set through a dial switch and corresponding current control is selected, STM32 outputs a PWM control signal through push-pull, the control signal is output to the direction of a driver and a pulse signal receiving end through optical coupling isolation, the driver realizes the drive of the motor through a common anode or common cathode connection method, and stable start and stop of the motor are realized by adopting an S-shaped acceleration and deceleration algorithm.

As shown in FIG. 3, the main controller selects STM32F103ZET6, the flow sensor 24 is LWGY-15, and the output is connected to the A/D port of STM 32; the flow regulating valve 23 is a German BURKERT direct-acting electromagnetic proportional regulating valve 6021; the level sensor 20 was selected as a model of rainbow OHR-L2Y, with a two-wire output connected to the a/D port of STM 32.

The image processing controller 21 selects raspberry pi 3B +, the camera 15 adopts a USB high-definition camera OV7120, the resolution is 1920 × 1080, and the focal length is 2.9 mm; the raspberry pie can upload the collected images and the processing results to a cloud platform in real time through 4G wireless WIFI for displaying and data storage.

The control device is connected with the image processing controller 21, the stepping motor, the output pump pressure regulating end, the flow regulating valve control end, the flow sensor 24 and the liquid level sensor 20 and is a main controller of the system, and the STM32F103ZET6 controller is communicated with the image processing controller 21 by adopting a serial port protocol; STM32F103ZET6 controller links to each other with the touch-sensitive screen through RS485 communication mode, realizes the setting and the result display of parameter.

In order to correct the distortion of the camera 15, the camera 15 needs to be calibrated before acquiring an image, the calibration board adopts an 8 × 8 black and white checkerboard calibration board, and the calibration process adopts a Zhang friend calibration method in Opencv: firstly, acquiring calibration plate images at different positions, different angles and different postures by using a camera 15; then, calling findChessboardCorrers and cornerSubPix functions in Opencv respectively to obtain sub-pixel corner position information; finally, the calibration parameters of the camera 15 are obtained by using the calibretamera function. After the calibration of the camera 15 is finished, distortion correction is performed on the acquired image by using the undistort function.

Referring to the ideal flowering condition, the flowering state of the strawberry is divided into four types of a minimum, a minute, a normal and an excessive according to the pixel ratio, a calibration image is displayed through a liquid crystal screen, and the type of manual judgment is written into the image controller 21. The calibration process is started under the condition that each type of sample is not less than 3. According to the parameter ranges corresponding to the four types of strawberry flowering state types obtained through manual judgment, when the parameter ranges of different types are overlapped, the overlapped part refers to the type with a large spraying amount, and otherwise, the spraying type is calculated by utilizing the European geometric distance.

In order to avoid the edge blurring effect caused by the distortion of the camera 15, the field of view of the camera 15 should be slightly larger than the width of the actual strawberry detection area, and the width redundancy symmetry of the left end and the right end is maintained, and in the actual image processing, the image of the region of interest is processed by a method of setting an image mask.

the area range of the pixel area of the region of interest accounts for 3/4 of the total pixel range of the image and should not be less than 2/3; the size of the image mask is consistent with the size of the collected image, the gray value of the pixel of the interested area is set to be 1, and the gray value of other areas is set to be 0.

fig. 4 is a flowchart of an image processing algorithm in the flowering period of a strawberry, and the specific image processing process is as follows:

a 1: the image is acquired and subjected to image distortion correction, R space color feature components of the region-of-interest image are extracted according to the image mask, and gaussian filtering processing is performed, as shown in fig. 5.

Specifically, the gaussian template is represented by discretizing a two-dimensional gaussian function, and for a matrix M with a size of (2u +1) × (2u +1), the elements of the (a, b) positions are represented as:

where σ is the standard deviation of the gaussian function and the gaussian filter template size is 5 × 5.

a 2: the image is segmented by using an improved K-means clustering segmentation algorithm to form segmentation areas, the image segmentation result is shown in figure 6, and the specific clustering segmentation algorithm is as follows:

a 21: initialization:

Step 1: first, a sample graph is drawnConverting the image gray value into a one-dimensional sample data set C with the size of N, wherein the number of pixels of the N sample images is set as the clustering center Z when the iterative operation times is I and the clustering type is jj(I) Randomly selecting a sample object from the data set C as an initial clustering center Z1(1)。

step 2: calculate each sample xmShortest distance d (x) to existing cluster centerm) N, wherein x is 1,2mThe mth sample in the data set; then, the probability p (x) that each sample object is selected as the next cluster center is calculatedm):

step 3: selecting the next cluster center according to the roulette method

step 4: repeating the steps of Step2 and Step3 until k objects are selected to form an initial clustering center Zj(1),j=1,2,3,..k;

Specifically, the number k of cluster centers is 4.

a 22: and (3) iterative calculation: calculating each sample x in the sample data set C according to the similarity criterionmdistance D (x) from initial clusterm,Zj(I) N, j 1,2,3,. k., each data object is divided into cluster clusters S having the smallest distance, as shown in equation (5) belowjIn, then xm∈Sj:

a 23: updating a clustering center: calculating the mean value in each cluster set according to a cluster center updating formula to be used as a new cluster center of the set, updating to obtain a new cluster set center, and settingfor the elements of the cluster j, the number of the elements of the cluster j is njThe cluster center updating formula is shown as formula (6):

a 24: termination conditions were as follows: updating the cluster centers circularly until each cluster center is not changed or the sum of squared errors is minimum locally, and clustering by using a function JcThe calculation method comprises the following steps:

And the precision error is xi, if the absolute value of J (I +1) -J (I) | < xi, the algorithm is ended, the iteration is terminated, and otherwise, the iterative computation and the clustering center are repeatedly executed until the termination condition is met.

a 3: processing the segmented region by using a morphological processing algorithm, wherein A represents an image matrix, B represents a structural element, the morphological processing method is shown as the following formula, and the image processing result is shown in FIG. 7:

specifically, the clustering partition is opened by using a rectangular structural element with the size of 10 × 10.

a 4: analyzing and extracting a strawberry flowering region by using a connected region area characteristic method; pixels which have the same gray level and satisfy 8 adjacent pixels are judged as the same region, the noise interference region is filtered through the area characteristic of the connected region, and the pixel area (S) is extracted according to the following formulaMin,SMax) Of (2) aThe processing results are shown in fig. 8.

Wherein SMinAnd SMaxRespectively, a lower limit value and an upper limit value of the area pixel parameter.

In particular, according to single strawberry flowerpixel area SfSetting characteristic parameters of the area of the connected region, considering the condition that strawberry flowers have angle deviation and are adjacent to a plurality of flowers, setting the characteristic parameters as follows

SMin=0.2Sf (15)

SMax=5Sf (16)

a 5: counting the total number of flower pixels in the region of interest of the image, and calculating the ratio of the total number of the flower pixels to the total number of the pixels in the region of interest;

a 6: and comparing the actual pixel ratio with the calibrated pixel ratio parameter to determine the type of the flowering state of the strawberry.

And b, determining the system running speed by the control device according to the camera 15 parameters and the actual working distance, and controlling the motor to run at a constant speed after the suspension device is started.

specifically, the control device determines the running speed according to the parameters of the camera 15 and the actual working distance, and the specific method is as follows:

Calculating the actual view field size of the camera and the running speed v of the device according to the focal length of the camera 15, the size of the photosensitive chip and the working distance, wherein the expression is as follows:

H=hL/f (10)

v=hL/fΔT (11)

where Δ T is the time interval between the shots taken by the camera 15 and Δ T is greater than the processing time of a single image. .

Specifically, the camera 15 is controlled by soft triggering, the photographing interval is controlled by software program delay, the camera 15 is fixed on the nut seat of the screw 14, and the distance L between the camera 15 and the spray rod is manually adjusted, as shown in formula (12):

L=H/2+vt (12)

Wherein t is the image acquisition and processing time.

Specifically, the control device stm32f103zet6 outputs a PWM signal through a PA6 port, and is connected to the driver chip THB 6128.

d, starting the spraying system, controlling the visual collection device to collect images at fixed time intervals by the control device and transmitting the images to the image processing controller 21 for data processing; the image processing controller 21 compares the actual processing result with the pre-calibrated parameters, determines the spraying amount per unit time, and sprays according to the determined spraying amount per unit time.

Specifically, the spraying device comprises the following spraying specific method:

Comparing the actual pixel ratio with the calibration type pixel ratio, and judging the flowering state type of the strawberry by using the Euclidean geometric distance; the control device adopts a PWM intermittent spray flow debugging method to carry out spraying according to the spraying grade, under the fixed pressure, the output duty ratio of the main controller and the spraying amount are approximately in a linear relation, the spraying amount in unit area is related to the running speed and the working distance of the system, and at the standard speed Vband a standard height HbThen, the linear function relationship between the duty ratio τ and the spraying amount Q per unit area is τ ═ f (Q), and spraying is completed by a spraying device, as shown in the following formula:

τ(i)=(Hi/Hb)*(Vi/Vb)*f(Q) (13)

where τ (i) is the output duty cycle for strawberry flowering type i, Hiactual working height, V, of the system for strawberry flowering type iiIs the actual operating speed of the system.

specifically, four types of spraying amounts are set according to the type of the flowering state, the flow sensor 24 measures the actual flow and compares the actual flow with the target flow value, and the control device stm32f103zet6 adjusts the PWM signal through the PA7 port according to the comparison result and outputs the PWM signal to the flow regulating valve 23, so that the spraying amount is accurately controlled.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种马铃薯挖掘机

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!