Greenhouse crop seedbed image splicing method and system and medium
By obtaining depth information and extracting features in greenhouse crop seedling beds and optimizing the homography matrix, the problem of image ghosting distortion and local alignment failure in greenhouse seedling bed image stitching is solved, and the quality and efficiency of image stitching are improved.
Patent Information
- Application Number
- CN202411246983.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-11-29
AI Technical Summary
The prior art can easily lead to image ghosting distortion and local alignment failure in greenhouse seedbed image stitching, which affects the overall stitching quality of the image.
Through monitoring equipment, the depth information of the greenhouse crop seedling bed image is obtained, the point features and line features of the seedling bed area are extracted, and the point features are matched using registration methods are used to estimate and optimize the homography matrix, solve the problem of misalignment of the image parts and improve image stitching quality.
It effectively solves the problem of missing calibration blocks caused by the misalignment of image parts, improves the overall stitching quality of the image, and significantly improves the stitching effect and efficiency.
Smart Images

Figure CN119048342A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method, system and medium for splicing images of greenhouse crop seedling beds. Background Art
[0002] Greenhouse seedling cultivation has the characteristics of high yield and high efficiency. In recent years, more and more companies have adopted a factory-based approach to plant seedling cultivation.
[0003] At present, some studies at home and abroad use image stitching to obtain high-resolution agricultural panoramic images. Yang et al. (Yang et al., 2011) proposed a bisector stitching algorithm based on the geometric features of the effective part of the image to be stitched, and successfully produced a remote sensing panoramic image with good visual effects. Li (Li et al., 2016) successfully detected the optimal stitching line of images taken from different perspectives by minimizing the energy of graph cuts, and realized the task of stitching multiple images of agricultural remote sensing images taken by drones. Cui et al. (Cui et al., 2021) proposed to use the geographic coordinates collected during the flight of drones to calculate the overlap rate between images, which is used as an important basis for alignment weights, and the spatial position constraints of the images are determined accordingly. Tong et al. (Tong et al., 2021) used the image matching method of block area matching to complete the image stitching of the inserted seedlings in the greenhouse seedling bed for further health information collection and position calculation. Zarei et al. (Zarei et al., 2022) proposed MegaStitch, which uses linear least squares with a small number of simple constraints to transform stitching into global minimization of reprojection errors, solving the problem of fast stitching of large farmland image collections. It can be seen that the current research on agricultural image stitching mainly focuses on drone remote sensing images of outdoor fields, but less on indoor greenhouse environments.
[0004] In the prior art, image stitching is performed by using GSP and GES-GSP image stitching models, which can easily lead to image ghosting and distortion, or deformation and missing of calibration blocks caused by local alignment failure. As an image stitching technology, AutoStitch technology mainly calculates image coordinate transformation parameters based on SIFT feature point matching and bundle adjustment, and finally obtains a panoramic image through multi-band fusion. However, deformation and missing of calibration blocks caused by local alignment failure can directly affect the overall image stitching quality. Summary of the invention
[0005] The present invention provides a greenhouse crop seedling bed image stitching method, system and medium, which are used to solve the above-mentioned problem existing in the prior art, that is, the problem that the prior art cannot improve the image stitching quality of the greenhouse seedling bed. The present invention provides a greenhouse crop seedling bed image stitching method, which includes:
[0006] The seedbed image of greenhouse crops is acquired through monitoring equipment to obtain depth information of the seedbed image;
[0007] According to the depth information of the seedbed image, the seedbed area is determined, and the point features and line features of the seedbed area are extracted;
[0008] According to the point features and line features of the seedbed area, the registration method is used to perform point feature matching on the seedbed image to determine the point feature matching pairs of the image;
[0009] According to the point feature matching pairs of the image, the homography matrix is estimated, the translation amount of the monitoring device is determined, and the parameters of the estimated homography matrix are corrected by the translation amount of the monitoring device to obtain the optimized homography matrix;
[0010] According to the optimized homography matrix, the stitched seedbed image is obtained by using the image stitching algorithm.
[0011] Optionally, acquiring the seedbed image of greenhouse crops through monitoring equipment to obtain depth information of the seedbed image specifically includes:
[0012] The seedbed images of greenhouse crops are obtained through monitoring equipment, and the depth information of the seedbed images is obtained using the DepthAnything model.
[0013] Optionally, the extracting of point features and line features of the seedbed area specifically includes:
[0014] The SuperPoint model was used to extract the point features of the seedbed area, and the LSD algorithm was used to extract the line features in the image.
[0015] Optionally, the step of performing point feature matching on the seedbed image using a registration method specifically includes:
[0016] The GlueStick local registration method based on point-line matching is used to perform point feature matching on overlapping seedbed images.
[0017] Optionally, the step of estimating a homography matrix based on point feature matching pairs of the image, determining a translation amount of the monitoring device, and correcting parameters of the estimated homography matrix based on the translation amount of the monitoring device to obtain an optimized homography matrix specifically includes:
[0018] The homography matrix H is obtained using the following formula:
[0019]
[0020] According to the homography matrix H, the translation of the monitoring device in the x and y directions is determined as t x and t y ; where tx =h 13 / h 11 , t y =h 23 / h 21 , t x and t y All are constants;
[0021] The random forest algorithm is used to x and t y Outlier detection is performed to correct the homography matrix. The optimized homography matrix is obtained by adopting the weighted average method. The specific formula is as follows:
[0022] H optimized =βH original +(1-β)H average
[0023] Among them, H original is the initial estimated homography matrix, H average is the average homography matrix, H optimized is the corrected homography matrix, and β is a constant.
[0024] The present invention provides a greenhouse crop seedling bed image splicing system, comprising:
[0025] An acquisition module is used to acquire the seedbed image of greenhouse crops through monitoring equipment to obtain depth information of the seedbed image;
[0026] An extraction module is used to determine the seedbed area according to the depth information of the seedbed image, and extract point features and line features of the seedbed area;
[0027] A matching module is used to perform point feature matching on the seedbed image according to the point features and line features of the seedbed area by using a registration method to determine a point feature matching pair of the image;
[0028] An optimization module is used to estimate the homography matrix according to the point feature matching pairs of the image, determine the translation amount of the monitoring device, and correct the parameters of the estimated homography matrix by the translation amount of the monitoring device to obtain an optimized homography matrix;
[0029] The stitching module is used to obtain the stitched seedbed image according to the optimized homography matrix and the image stitching algorithm.
[0030] The present invention provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned greenhouse crop seedling bed image stitching method is implemented.
[0031] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention provides a method for stitching images of greenhouse crop seedling beds, which obtains seedling bed images of greenhouse crops through monitoring equipment, obtains depth information of the seedling bed images, and then extracts point features and line features of the seedling bed area. Through the point features and line features of the seedling bed area, a registration method is used to perform point feature matching on the seedling bed image, determine the point feature matching pairs of the image, obtain the corresponding homography matrix, and optimize the parameters of the homography matrix, thereby effectively solving the problem of missing calibration blocks caused by partial misalignment of the image, and then combining the image stitching algorithm to obtain the stitched seedling bed image, thereby effectively improving the overall stitching quality of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0033] Figure 1 A flowchart of a greenhouse crop seedling bed image stitching method provided by an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of a glass greenhouse indoor scene and a track-type imaging device provided by an embodiment of the present invention;
[0035] Figure 3 A schematic diagram of point and line feature extraction for a greenhouse seedling bed scene provided by an embodiment of the present invention;
[0036] Figure 4 A schematic diagram comparing the image stitching results of different algorithms and the image stitching results of the present invention at a shooting height of 1.2 m for a seedbed image is provided for an embodiment of the present invention;
[0037] Figure 5 A visualization data graph of the RMSE evaluation index of different splicing methods provided in the embodiments of the present invention and the method proposed in the present invention;
[0038] Figure 6 A comparison chart of the splicing time between different splicing methods provided in the embodiments of the present invention and the method proposed in the present invention;
[0039] Figure 7 A schematic diagram of stitching results of an ablation experiment of an image stitching model provided in an embodiment of the present invention.
[0040] The above drawings have shown clear embodiments of the present invention, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] In factory-based seedling cultivation based on greenhouse facilities, obtaining high-quality panoramic images of greenhouse crop seedling beds with a wide field of view helps to timely monitor the overall growth of greenhouse crop seedlings on the seedling beds. However, the field of view of ordinary surveillance cameras is limited, and only partial images of the seedling bed area can be obtained; existing image stitching technologies, such as GSP technology, are prone to image ghosting and distortion, or deformation and loss of calibration blocks caused by local alignment failures, thus affecting the overall image stitching quality.
[0043] In view of the above problems, the present invention provides a method for stitching greenhouse crop seedling bed images. The method obtains the seedling bed image of the greenhouse crops, obtains the depth information of the seedling bed image, and then extracts the point features and line features of the seedling bed area. Through the point features and line features of the seedling bed area, a registration method is used to perform point feature matching on the seedling bed image, determine the point feature matching pairs of the image, and then obtain the corresponding homography matrix, and optimize the homography matrix parameters; according to the optimized homography matrix, the problem of partial misalignment of the image can be solved, and the overall image stitching quality can be improved.
[0044] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0045] This example uses the glass greenhouse strawberry seedling greenhouse located in Longdesheng Agricultural Technology Co., Ltd. in Yangling, Shaanxi Province as the research area to monitor the strawberry seedling shortage. Figure 1 is a flow chart of a greenhouse crop seedling bed image stitching method provided by an embodiment of the present invention, such as Figure 1 As shown, this embodiment shows a greenhouse crop seedling bed image stitching method, comprising:
[0046] S101: Acquire a seedbed image of greenhouse crops through a monitoring device to obtain depth information of the seedbed image.
[0047] like Figure 2As shown, the image of the strawberry seedling bed is collected by a track-type inspection machine installed above the seedling bed, equipped with a Hikvision camera MV-CA032-10GC, using wide-angle imaging.
[0048] Optionally, a DepthAnything model is used to obtain depth information of the ground and the strawberry seedling bed in the seedling bed image.
[0049] S102: Determine the seedbed area according to the depth information of the seedbed image, and extract point features and line features of the seedbed area.
[0050] Optionally, the SuperPoint model is used to extract the point features of the seedbed area, and the LSD algorithm is used to extract the line features in the image. The specific process is as follows:
[0051] First, the SuperPoint model is used to extract the feature points K of the input image I and its corresponding feature description vector D. The specific calculation formula is as follows:
[0052] K,D=SuperPoint(I)
[0053] Next, the LSD method is used to detect all line segments L in the image. The formula is as follows:
[0054] L=LSD(I)
[0055] In order to save computing resources and improve the accuracy of matching, the detected line segments and feature points are pruned and merged, and the distance threshold d is used to remove feature points close to the endpoints of the line segments. The specific calculation formula is as follows:
[0056]
[0057] The threshold d is used again to merge two line segments that are close to each other to form a more coherent structure. The specific calculation formula is as follows:
[0058]
[0059] like Figure 3 (a)- Figure 3 (b), where Figure 3 (a) is the extraction of feature points on the strawberry seedling bed. Compared with using all feature points in the image, only extracting feature points on the seedling bed can significantly reduce their number. Figure 3 (b) is the extraction of the straight line segment of the strawberry seedling bed. The endpoints marked in blue in the figure clearly show the starting point and end point of the extracted straight line segment.
[0060] In this step, the point features and line features of the seedbed area are extracted, so that the feature matching algorithm can effectively use the rich feature points and straight line information in the strawberry seedbed to align the image, thereby improving the accuracy of image stitching.
[0061] S103: performing point feature matching on the seedbed image using a registration method according to the point features and line features of the seedbed area, and determining point feature matching pairs of the image.
[0062] Optionally, a GlueStick local registration method based on point-line matching is used to perform point feature matching on overlapping seedbed images.
[0063] S104: Estimate a homography matrix based on the point feature matching pairs of the image, determine the translation amount of the monitoring device, and correct the parameters of the estimated homography matrix based on the translation amount of the monitoring device to obtain an optimized homography matrix.
[0064] Optionally, the homography matrix H is obtained using the following formula:
[0065]
[0066] According to the homography matrix H, the translation of the monitoring device in the x and y directions is determined as t x and t y ; where t x =h 13 / h 11 , t y =h 23 / h 21 , t x and t y All are constants;
[0067] The random forest algorithm is used to x and t y Outlier detection is performed to correct the homography matrix. The optimized homography matrix is obtained by adopting the weighted average method. The specific formula is as follows:
[0068] H optimized =βH original +(1-β)H average
[0069] Among them, H original is the initial estimated homography matrix, H average is the average homography matrix, H optimized is the corrected homography matrix, and β is a constant.
[0070] S105: Obtaining a stitched seedbed image according to the optimized homography matrix and using an image stitching algorithm.
[0071] Optionally, the images to be stitched are registered using the AutoStitch algorithm through an optimized homography matrix, and the registered images are fused using a multi-band fusion algorithm to obtain a panoramic image of the strawberry seedling bed.
[0072] like Figure 4 (a)- Figure 4 (d) shows the stitching result of 41 datasets collected at a shooting height of 1.2m and a step length of 0.5m. Although AutoStitch maintains a good performance overall, it has some problems in the locations where we place the calibration blocks (such as Figure 4 In the red box area shown in (a), the calibration block is deformed and missing due to local alignment failure; Figure 4 (b) and Figure 4 (c) are the stitching results of the seedbed images at a shooting height of 1.2m using the GSP and GES-GSP algorithms. It can be seen from the observation results that Figure 4 (b) and Figure 4 (c) of the present invention all show obvious ghosting distortion due to alignment failure, especially GSP, which even shows partial image distortion in the absence of structural protection. Figure 4 As shown in (d), not only can the image alignment be completed accurately, but the geometric structure of the image is also successfully maintained, and the overall naturalness is effectively protected. From the perspective of the length of the image, the method proposed in the present invention maintains the integrity of the strawberry seedling bed information and further improves the overall image stitching quality.
[0073] For example, the image pair mean alignment error RMSE is used as an objective evaluation indicator. RMSE is evaluated by calculating the root mean square of the Euclidean distance between the feature matching points of the original image after image transformation and the reference image, which can reflect the alignment accuracy in the stitching process. The smaller the RMSE, the higher the stitching quality.
[0074] The specific calculation formula of RMSE is:
[0075]
[0076] Among them, p i is the feature point of the original image, p i ' is the feature point corresponding to the reference image, and f represents the image transformation model of the original image.
[0077] Exemplarily, RMSE is used to evaluate the splicing results on the data set, such as Figure 5As shown in the figure, it can be seen that the RMSE evaluation index of the method proposed in the present invention on all data sets is lower than that of the other three representative stitching methods. The lower RMSE value reflects that the image matching pair has a smaller alignment error and distortion degree, and has a higher accuracy.
[0078] like Figure 6 As shown in FIG. 1 , it shows the time consumption of the AutoStitch, GSP and GES-GSP methods and the method proposed in the present invention when processing the same number and resolution of images. Figure 6 It can be seen that the method proposed in the present invention is significantly better than the AutoStitch, GSP and GES-GSP methods in terms of time efficiency, which shows that the method proposed in the present invention takes less time and is more efficient in image data processing.
[0079] like Figure 7 (a)- Figure 7 (c), where Figure 7 (a) is a schematic diagram of the stitching result based on the AutoStitch stitching algorithm. Figure 7 (b) is a schematic diagram of the AutoStitch stitching result based on seedbed area extraction and point-line feature matching. Figure 7 (c) is a schematic diagram of the stitching result of the method proposed in this embodiment. It can be seen that the present application effectively solves the accuracy of overall image alignment by using depth plane division and improving registration by point-line matching, and straightens the overall panoramic image of the strawberry seedling bed, combined with homography matrix optimization, which effectively solves the problem of partial misalignment of the image; in addition, Figure 7 (b) shows the missing of calibration blocks due to low alignment accuracy; in addition, the method proposed in this application also solves the problem of missing splicing of some seedling beds (the red frame area in the figure).
[0080] In this step, by using the homography matrix optimization method, the image transition at the stitching point can be made natural, thereby effectively avoiding the problem of squeezing and missing of part of the seedling rack due to alignment failure. At the same time, the time for image data processing is shortened, and the stitching effect and efficiency are effectively improved.
[0081] The present embodiment provides a greenhouse crop seedling bed image stitching method, which obtains the seedling bed image of the greenhouse crop through monitoring equipment, obtains the depth information of the seedling bed image, and then extracts the point features and line features of the seedling bed area. The seedling bed image is matched with the point features and line features of the seedling bed area by using a registration method, and the point feature matching pairs of the image are determined, and then the corresponding homography matrix is obtained, and the homography matrix parameters are optimized; according to the optimized homography matrix, the problem of partial misalignment of the image is solved, and the overall image stitching quality can be effectively improved.
[0082] The above is a greenhouse crop seedling bed image stitching method provided by one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding greenhouse crop seedling bed image stitching system, including:
[0083] An acquisition module is used to acquire the seedbed image of greenhouse crops through monitoring equipment to obtain depth information of the seedbed image;
[0084] An extraction module is used to determine the seedbed area according to the depth information of the seedbed image, and extract point features and line features of the seedbed area;
[0085] A matching module is used to perform point feature matching on the seedbed image according to the point features and line features of the seedbed area by using a registration method to determine a point feature matching pair of the image;
[0086] An optimization module is used to estimate the homography matrix according to the point feature matching pairs of the image, determine the translation amount of the monitoring device, and correct the parameters of the estimated homography matrix by the translation amount of the monitoring device to obtain an optimized homography matrix;
[0087] The stitching module is used to obtain the stitched seedbed image according to the optimized homography matrix and the image stitching algorithm.
[0088] The present invention also provides a computer-readable storage medium, which stores a computer program. The computer program can be used to execute the greenhouse crop seedling bed image stitching method provided above.
[0089] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0090] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.
Claims
1. A greenhouse crop seedling bed image stitching method, characterized in that: include: The seedbed image of greenhouse crops is acquired through monitoring equipment to obtain depth information of the seedbed image; According to the depth information of the seedbed image, the seedbed area is determined, and the point features and line features of the seedbed area are extracted; According to the point features and line features of the seedbed area, the registration method is used to perform point feature matching on the seedbed image to determine the point feature matching pairs of the image; According to the point feature matching pairs of the image, the homography matrix is estimated, the translation amount of the monitoring device is determined, and the parameters of the estimated homography matrix are corrected by the translation amount of the monitoring device to obtain the optimized homography matrix; According to the optimized homography matrix, the stitched seedbed image is obtained by using the image stitching algorithm.
2. The greenhouse crop seedling bed image stitching method according to claim 1, characterized in that: The step of acquiring the seedbed image of greenhouse crops through the monitoring device to obtain the depth information of the seedbed image specifically includes: The seedbed images of greenhouse crops are obtained through monitoring equipment, and the depth information of the seedbed images is obtained using the DepthAnything model.
3. The greenhouse crop seedling bed image stitching method according to claim 1, characterized in that: The step of extracting point features and line features of the seedbed area specifically includes: The SuperPoint model was used to extract the point features of the seedbed area, and the LSD algorithm was used to extract the line features in the image.
4. The greenhouse crop seedling bed image stitching method according to claim 1, characterized in that: The point feature matching of the seedbed image using the registration method specifically includes: The GlueStick local registration method based on point-line matching is used to perform point feature matching on overlapping seedbed images.
5. The greenhouse crop seedling bed image stitching method according to claim 1, characterized in that: The method estimates the homography matrix based on the point feature matching pairs of the image, determines the translation of the monitoring device, and corrects the parameters of the estimated homography matrix by the translation of the monitoring device to obtain the optimized homography matrix, specifically including: The homography matrix H is obtained using the following formula: According to the homography matrix H, the translation of the monitoring device in the x and y directions is determined as t x and t y ; where t x =h 13 / h 11 , t y =h 23 / h 21 , t x and t y All are constants; The random forest algorithm is used to x and t y Outlier detection is performed to correct the homography matrix. The optimized homography matrix is obtained by adopting the weighted average method. The specific formula is as follows: H optimized =βH original +(1-β)H average Among them, H original is the initial estimated homography matrix, H average is the average homography matrix, H optimized is the corrected homography matrix, and β is a constant.
6. A greenhouse crop seedling bed image stitching system, characterized in that: include: An acquisition module is used to acquire the seedbed image of greenhouse crops through monitoring equipment to obtain depth information of the seedbed image; An extraction module is used to determine the seedbed area according to the depth information of the seedbed image, and extract point features and line features of the seedbed area; A matching module is used to perform point feature matching on the seedbed image according to the point features and line features of the seedbed area by using a registration method to determine a point feature matching pair of the image; An optimization module is used to estimate the homography matrix according to the point feature matching pairs of the image, determine the translation amount of the monitoring device, and correct the parameters of the estimated homography matrix by the translation amount of the monitoring device to obtain an optimized homography matrix; The stitching module is used to obtain the stitched seedbed image according to the optimized homography matrix and the image stitching algorithm.
7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the greenhouse crop seedling bed image stitching method described in any one of claims 1 to 5 is implemented.
