A fruit setting rate analysis system for Korean pine
By using stage judgment and personalized grayscale processing in the red pine fruit fruit fruit fruit analysis system, the problem of insufficient grayscale values between pine cones and pine needles in the young fruit fruit stage is solved, the accuracy of pine cones recognition is improved, and the solidification rate is ensured Accuracy of the analysis.
Patent Information
- Application Number
- CN202411376161.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-30
AI Technical Summary
In the prior art, in the analysis of the fruit rate of red pine, the difference in the grayscale values of the pine cones and pine needles in the young fruit stage is too small, resulting in a decrease in recognition accuracy, affecting the accuracy of the fruit rate analysis.
The stage judgment module is used to determine that the pine cones are in the young fruit or mature stage, and the images are processed using different grayscale formulas. By calculating the probability parameters of pixel points, the grayscale values of the pine cones and the pine needle area are increased. difference.
The accuracy of pine cone recognition is improved and more accurate results of solidification rate analysis are obtained.
Smart Images

Figure CN118887571B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of image recognition, and in particular to a red pine fruit setting rate analysis system. Background Art
[0002] In the process of analyzing the fruiting rate of Korean pine, it is usually necessary to obtain the number of pine cones. The traditional way to obtain the number of pine cones is to visually observe the number of pine cones by human eyes. However, this method has many defects. For example, the height of Korean pine is relatively high, and it is necessary to climb to a high place for visual inspection, which is quite dangerous. In addition, the efficiency of visual inspection by human eyes is relatively low.
[0003] With the development of drone technology, using drones to photograph the fruits of red pine, and then using image recognition to identify the number of pine cones in the captured images has become a way to significantly improve the efficiency of obtaining the number of pine cones.
[0004] However, the prior art usually uses a general image grayscale method to identify pine cones, and does not use different grayscale methods to optimize pine cones and pine needles respectively. In the young fruit stage of pine cones (i.e., the female flowers develop into young pine cones, at which time the pine cones are still small and green in color), the grayscale value difference between pine cones and pine needles after grayscale is too small, and pine needles are likely to affect the recognition accuracy of pine cones, that is, pixels around pine needles may be mistakenly considered as pixels belonging to pine cones, affecting the accuracy of pine cone detection. This will result in inaccurate statistical results of the number of pine cones, and inaccurate fruit set rate analysis results. Summary of the invention
[0005] The purpose of the present invention is to disclose a red pine fruit rate analysis system to solve the problem of how to improve the grayscale value difference between the pine cone area and the pine needle area after graying when using image recognition technology to obtain the number of pine cones, thereby improving the accuracy of pine cone recognition and obtaining more accurate fruit rate analysis results.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] The present invention provides a Korean pine fruiting rate analysis system, comprising an image processing device; the image processing device comprises a stage judgment module and a grayscale module;
[0008] The stage judgment module is used to judge the captured images containing pine cones and pine leaves to determine whether the pine cones are in the young fruit stage or the mature stage;
[0009] The grayscale module is used to grayscale the captured image according to the following rules:
[0010] If the pine cone is in the young fruit stage, the graying process includes:
[0011] The first step is to calculate the probability parameter of each pixel belonging to the area where the pine cone is located;
[0012] In the second step, each pixel in the captured image is processed as follows based on the probability parameter to obtain a grayscale image:
[0013] A preset first grayscale formula is used to grayscale the pixel points in the image to be analyzed whose probability parameters are greater than or equal to a set probability parameter threshold;
[0014] A preset second grayscale formula is used to grayscale the pixel points whose probability parameters are less than a set probability parameter threshold;
[0015] The weight of the green component in the second grayscale formula is less than the weight of the green component in the first grayscale formula; the green component is a component in the RGB color space;
[0016] If the pine cone is in a mature stage, a preset second grayscale formula is used to perform grayscale processing on each pixel in the captured image to obtain a grayscale image.
[0017] Preferably, the image processing device further comprises a noise reduction module, and the noise reduction module is used to perform noise reduction processing on each pixel point in the grayscale image respectively to obtain a grayscale image after noise reduction.
[0018] Preferably, the image processing device further comprises a recognition module, and the recognition module is used to recognize the denoised grayscale image and obtain the number of pine cones contained in the denoised grayscale image.
[0019] Preferably, it also includes a photographing device, which is used to photograph Korean pine to obtain multiple images containing pine cones and pine leaves, and there is an overlapping area between two images with adjacent shooting positions.
[0020] Preferably, it also includes a statistical analysis device;
[0021] The statistical analysis device is used to obtain the total number of pine cones based on the number of pine cones contained in each captured image.
[0022] Preferably, judging the captured image containing pine cones and pine leaves to determine whether the pine cones are in the young fruit stage or the mature stage includes:
[0023] Obtain an image pG corresponding to a green component of a captured image containing pine cones and pine leaves in an RGB color space;
[0024] Use the threshold segmentation algorithm to segment pG and obtain the segmentation threshold;
[0025] In pG, the pixel values of the pixels whose pixel values are greater than the segmentation threshold are updated to 255, and the pixel values of the pixels whose pixel values are less than or equal to the segmentation threshold are updated to 0, thereby obtaining the image cpG;
[0026] Get the connected domain consisting of pixels with a pixel value of 255 in cpG;
[0027] Determine whether there is a connected domain belonging to the pine cone. If so, it means that the pine cone is in the young fruit stage; if not, it means that the pine cone is in the mature stage.
[0028] Preferably, determining whether there is a connected domain belonging to the pine cone includes:
[0029] Obtain the ratio of the length and width of the minimum circumscribed rectangle of each connected domain respectively;
[0030] Get the number N of minimum bounding rectangles whose ratio is less than or equal to the set ratio threshold;
[0031] If N is greater than 0, it means that there is a connected domain belonging to the pine cone. If N is equal to 0, it means that there is no connected domain belonging to the pine cone.
[0032] Preferably, the calculation formula of the probability parameter is as follows:
[0033]
[0034] represents the probability parameter of pixel s, Represents the shape coefficient. If the ratio of the length and width of the minimum bounding rectangle of the connected domain where the pixel corresponding to the coordinate of s in cpG is located is less than or equal to the set ratio threshold, then The value of is 1. If the ratio of the length and width of the minimum bounding rectangle of the connected domain where the pixel corresponding to the coordinate of s in cpG is located is greater than the set ratio threshold, then The value of is 0; represents the minimum value of the distance between s and each coordinate in the set CNET in cpG; CNET is the set of all cluster centers of the connected domain whose ratio of the length and width of the minimum circumscribed rectangle in cpG is less than or equal to the set ratio threshold; represents the maximum distance between a pixel point in the captured image and the edge of the captured image; w1 and w2 represent the first calculation coefficient and the second calculation coefficient respectively.
[0035] Preferably, the first grayscale formula is as follows:
[0036]
[0037] Indicates that in the grayscale image GrayP1 calculated by the first grayscale formula The gray value of the pixel at , and Respectively expressed in pR, pG and pL, The grayscale value of the pixel at , pR, pG and pL respectively represent the images of the red component, green component and blue component of the captured image in the RGB color space, z1, z2a and z3 respectively represent the weight of the red component, the first weight of the green component and the weight of the blue component.
[0038] Preferably, the second grayscale formula is as follows:
[0039]
[0040] Indicates that in the grayscale image GrayP2 calculated by the second grayscale formula The gray value of the pixel at , and Respectively expressed in pR, pG and pL, The grayscale value of the pixel at , pR, pG and pL represent the images of the red component, green component and blue component of the captured image in the RGB color space, respectively, z1, z2b and z3 represent the weight of the red component, the second weight of the green component and the weight of the blue component, respectively; .
[0041] Beneficial effects:
[0042] Compared with the prior art, the present invention improves the existing graying method in the process of counting the number of pine cones by image recognition. For the young fruit stage, the colors of pine cones and pine needles are similar, which easily causes the problem of recognition error. In the process of graying, the present invention calculates the probability parameters of the pixel points belonging to the area where the pine cones are located, and then adopts different graying formulas for the pixel points of different probability parameters based on the probability parameter threshold. In particular, for the pixel points whose probability is greater than the probability parameter threshold, the present invention sets a larger value for the weight of the green component of its graying process, so that after graying, the gap between the pixel points in the pine cone area and the pixel points in the pine needle area increases, effectively improving the accuracy of the recognition result obtained by the subsequent pine cone recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0044] Figure 1 The present invention is a schematic diagram of a Korean pine fruit setting rate analysis system.
[0045] Figure 2 Another schematic diagram of a Korean pine fruit setting rate analysis system of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0047] like Figure 1 As shown, the present invention provides a Korean pine fruiting rate analysis system, including an image processing device; the image processing device includes a stage judgment module and a grayscale module;
[0048] The stage judgment module is used to judge the captured images containing pine cones and pine leaves to determine whether the pine cones are in the young fruit stage or the mature stage;
[0049] The grayscale module is used to grayscale the captured image according to the following rules:
[0050] If the pine cone is in the young fruit stage, the graying process includes:
[0051] The first step is to calculate the probability parameter of each pixel belonging to the area where the pine cone is located;
[0052] In the second step, each pixel in the captured image is processed as follows based on the probability parameter to obtain a grayscale image:
[0053] A preset first grayscale formula is used to grayscale the pixel points in the image to be analyzed whose probability parameters are greater than or equal to a set probability parameter threshold;
[0054] A preset second grayscale formula is used to grayscale the pixel points whose probability parameters are less than a set probability parameter threshold;
[0055] The weight of the green component in the second grayscale formula is less than the weight of the green component in the first grayscale formula; the green component is a component in the RGB color space;
[0056] If the pine cone is in a mature stage, a preset second grayscale formula is used to perform grayscale processing on each pixel in the captured image to obtain a grayscale image.
[0057] In the process of counting the number of pine cones by image recognition, the above scheme improves the existing graying method. For the young fruit stage, the colors of pine cones and pine needles are similar, which easily causes the problem of recognition error. In the process of graying, the present invention calculates the probability parameters of the pixel points belonging to the area where the pine cones are located, and then adopts different graying formulas for the pixel points of different probability parameters based on the probability parameter threshold. In particular, for the pixel points whose probability is greater than the probability parameter threshold, the present invention sets a larger value for the weight of the green component of its graying process, so that after graying, the gap between the pixel points in the pine cone area and the pixel points in the pine needle area increases, effectively improving the accuracy of the recognition result obtained by the subsequent pine cone recognition.
[0058] Preferably, if Figure 2 As shown, the image processing device also includes a noise reduction module, which is used to perform noise reduction processing on each pixel point in the grayscale image respectively to obtain a grayscale image after noise reduction.
[0059] The image quality can be improved by noise reduction processing, so that the recognition module can obtain more accurate recognition results when performing recognition.
[0060] Preferably, performing noise reduction processing on each pixel in the grayscale image to obtain a grayscale image after noise reduction includes:
[0061] Perform the following noise reduction process on each pixel in the grayscale image to obtain the grayscale image after noise reduction:
[0062] The first step is to use b to represent the pixel point that needs to be denoised, and store the pixel points of the 8-neighborhood of b into the set neb;
[0063] The second step is to obtain the image gradient values of the pixels in b and neb respectively;
[0064] The third step is to calculate the absolute value of the difference between the image gradient value of the pixel in neb and the image gradient value of b respectively;
[0065] The fourth step is to determine whether the two pixel points pa and pb corresponding to the two smallest absolute values form a symmetrical distribution with b as the center. If so, proceed to the fifth step; if not, proceed to the sixth step.
[0066] The fifth step is to use the following formula to obtain the gray value after b noise reduction:
[0067]
[0068] Indicates the gray value after b noise reduction, and represent the grayscale values obtained by denoising b using the first denoising algorithm and the second denoising algorithm, respectively. and Respectively and The weight of
[0069] The first noise reduction algorithm includes:
[0070] All the pixels in the square area with b as the center and side length bk are used as the first window for noise reduction, and the preset first type of noise reduction algorithm is used to perform noise reduction calculation on b in the first window to obtain ;
[0071] The second noise reduction algorithm includes:
[0072] The area where the pixel points whose distance from the straight line segment between pa and pb is less than the preset distance in the square area centered on b and with a side length of bk are located is used as the second window for noise reduction, and the preset second type of noise reduction algorithm is used to perform noise reduction calculation on b in the second window to obtain ;
[0073] Step 6: Use the first noise reduction algorithm to perform noise reduction on b to obtain the grayscale value of b.
[0074] Different from the existing noise reduction methods, the present invention does not use a single noise reduction algorithm to perform noise reduction, nor does it use different noise reduction algorithms to perform noise reduction in windows of the same size. Instead, it determines whether the two pixel points with the smallest difference in image gradient value with b in the 8-neighborhood are symmetrically distributed around the center of b, and decides to use one filtering algorithm or two filtering algorithms for filtering based on the judgment result, thereby improving the adaptability of the selection of the number of filtering algorithms, and a more reasonable number of filtering algorithms can be determined based on actual conditions.
[0075] In addition, when filtering by two filtering algorithms, the present invention does not use windows of the same size for both filtering algorithms to filter, because it is impossible to achieve the grayscale value after filtering of the pixel with a larger probability belonging to the edge area of pine needles or pine cones and the pixel with a smaller probability belonging to the edge area of pine needles or pine cones around to be clearly distinguished. And the present invention first obtains the image gradient value between b and the pixel with a smaller difference, and symmetrical distribution, thereby realizing the estimation of the trend of the edge of the image, after which the present invention uses the pixel whose distance from the straight line segment between pa and pb is less than the set distance as the pixel in the second window, when b is de-noised based on the pixel in the second window, there can be a greater probability to introduce more information belonging to the trend of the edge of the image to de-noise, thereby the grayscale value after the de-noising of b is clearly distinguished from the grayscale value around, and the edge trend of the image is enhanced, the definition of the edge of the image can be improved, and a grayscale image after de-noising of higher quality is obtained.
[0076] Preferably, the first noise reduction algorithm comprises a Gaussian filtering algorithm.
[0077] Preferably, a preset first type of noise reduction algorithm is used to perform noise reduction calculation on b in the first window, including:
[0078]
[0079] represents the gray value of b after the Gaussian filtering algorithm is used to perform noise reduction calculation on b in the first window, bkr represents the set of all pixels except b in the first filtering window, Represents the value corresponding to pixel i in the Gaussian kernel, Represents the grayscale value of pixel i.
[0080] Preferably, the preset distance is the length of 2 pixels.
[0081] Preferably, the second noise reduction algorithm comprises a bilateral filtering algorithm.
[0082] Preferably, a preset second type of noise reduction algorithm is used to perform noise reduction calculation on b in the second window, including:
[0083]
[0084] bks represents a set of pixel points in the area where the distance between the pixel points and the straight line segment between pa and pb is less than a preset distance. Represents the grayscale value of pixel b before noise reduction. represents the gray value of pixel j, and They represent the standard deviation of the Gaussian function in the spatial domain and the standard deviation of the Gaussian function in the pixel value domain, respectively. and They represent the horizontal and vertical coordinates of pixel j, and x and y represent the horizontal and vertical coordinates of pixel b, respectively.
[0085] Preferably, the value of bk is 7.
[0086] Preferably, and The weights are and .
[0087] Preferably, judging whether two pixel points pa and pb corresponding to the two smallest absolute values form a symmetrical distribution with b as the center includes:
[0088] Calculate the difference dlc between the average of the absolute values corresponding to the remaining pixels in neb except pa and pb and the average of the absolute values corresponding to pa and pb;
[0089] If dlc is less than the set image gradient value threshold, it means that pa and pb are not symmetrically distributed with b as the center;
[0090] If dlc is greater than the set gray value threshold, the following judgment is made:
[0091] Let x and y represent the horizontal and vertical coordinates of b respectively. If the relationship between the coordinates of pa and pb meets any of the following conditions, it means that pa and pb form a symmetrical distribution with b as the center:
[0092] Case 1: The coordinates of pa are (x-1, y+1), and the coordinates of pb are (x+1, y-1);
[0093] Case 2: The coordinates of pa are (x-1, y), and the coordinates of pb are (x+1, y);
[0094] Case 1: The coordinates of pa are (x-1, y-1), and the coordinates of pb are (x+1, y+1).
[0095] Preferably, the image gradient value threshold is set to one twentieth of the upper limit of the image gradient value of the pixel point in the grayscale image.
[0096] For example, if the Sobel operator is used to calculate the gradient, when the upper limit of the image gradient value is 1020, the image gradient value threshold is 51.
[0097] Preferably, the image processing device further comprises a recognition module, and the recognition module is used to recognize the denoised grayscale image and obtain the number of pine cones contained in the denoised grayscale image.
[0098] Specifically, the grayscale image is recognized to obtain the number of pine cones contained in the grayscale image, including:
[0099] The grayscale image is input into the pre-trained R-CNN model, and the R-CNN model returns the number and location of pine cones.
[0100] Furthermore, the CNN model can be used to replace the R-CNN model.
[0101] Preferably, it also includes a photographing device, which is used to photograph Korean pine to obtain multiple images containing pine cones and pine leaves, and there is an overlapping area between two images with adjacent shooting positions.
[0102] Specifically, the filming device is a drone. When filming the red pine with the drone, the drone is used to film the red pine at different filming heights. When filming at each filming height, the drone is used to film from different filming directions.
[0103] Adjacent shooting positions refer to adjacent shooting heights and the same shooting directions, or the same shooting heights and adjacent shooting directions.
[0104] There is an overlapping area between two images captured at two adjacent shooting heights in the same shooting direction, and there is an overlapping area between two images captured at the same shooting height in adjacent shooting directions.
[0105] Preferably, it also includes a statistical analysis device;
[0106] The statistical analysis device is used to obtain the total number of pine cones based on the number of pine cones contained in each captured image.
[0107] Specifically, the statistical analysis device can sum the number of pine cones in all captured images to obtain the total number of pine cones.
[0108] Furthermore, the statistical analysis device can also stitch the captured images into a stitched image, and then convert the positions of the pine cones in the captured images into positions in the stitched image, and then deduplicate the pine cones in the same position in the stitched image, and only retain one pine cone in each position, thereby further calibrating the number of pine cones.
[0109] Preferably, judging the captured image containing pine cones and pine leaves to determine whether the pine cones are in the young fruit stage or the mature stage includes:
[0110] Obtain an image pG corresponding to a green component of a captured image containing pine cones and pine leaves in an RGB color space;
[0111] Use the threshold segmentation algorithm to segment pG and obtain the segmentation threshold;
[0112] In pG, the pixel values of the pixels whose pixel values are greater than the segmentation threshold are updated to 255, and the pixel values of the pixels whose pixel values are less than or equal to the segmentation threshold are updated to 0, thereby obtaining the image cpG;
[0113] Get the connected domain consisting of pixels with a pixel value of 255 in cpG;
[0114] Determine whether there is a connected domain belonging to the pine cone. If so, it means that the pine cone is in the young fruit stage; if not, it means that the pine cone is in the mature stage.
[0115] Since the color of pine cones and pine leaves are close in color at the young fruit stage, the present invention realizes the preliminary division of the connected domain of pine cones and the connected domain of pine leaves by obtaining the connected domain and based on the shape of the connected domain. In this stage, it is not possible to accurately identify all the connected domains of pine cones, because when multiple pine leaves are continuously distributed, a connected domain with a shape similar to that of pine cones can also be formed. However, in the above steps, the present invention can identify the connected domains of most pine cones, and then the grayscale process of the pixels in these connected domains is specially processed, so that the grayscale difference of the pixels between the pine cone area and the pine leaf area can be improved, which is conducive to improving the quality of the recognition result output by the recognition module.
[0116] Young fruit stage:
[0117] The female flowers develop into young pine cones, which are still small and green in color with tightly closed scales. During this stage, the pine cones continue to develop and the ovules gradually form seeds.
[0118] Mature stage:
[0119] After one to two years of growth, the pine cone gradually matures. The mature pine cone increases in size, turns brown or brown in color, and the scales become hard. At this time, the pine cone begins to slowly open, exposing the seeds inside.
[0120] Preferably, determining whether there is a connected domain belonging to the pine cone includes:
[0121] Obtain the ratio of the length and width of the minimum circumscribed rectangle of each connected domain respectively;
[0122] Get the number N of minimum bounding rectangles whose ratio is less than or equal to the set ratio threshold;
[0123] If N is greater than 0, it means that there is a connected domain belonging to the pine cone. If N is equal to 0, it means that there is no connected domain belonging to the pine cone.
[0124] Since pine leaves have a distinctly elongated shape, the connected domain of pine leaves and pine needles can be effectively distinguished based on the ratio between the length and width of the minimum circumscribed rectangle.
[0125] Preferably, the ratio threshold is 10.
[0126] Preferably, the calculation formula of the probability parameter is as follows:
[0127]
[0128] represents the probability parameter of pixel s, Represents the shape coefficient. If the ratio of the length and width of the minimum bounding rectangle of the connected domain where the pixel corresponding to the coordinate of s in cpG is located is less than or equal to the set ratio threshold, then The value of is 1. If the ratio of the length and width of the minimum bounding rectangle of the connected domain where the pixel corresponding to the coordinate of s in cpG is located is greater than the set ratio threshold, then The value of is 0; represents the minimum value of the distance between s and each coordinate in the set CNET in cpG; CNET is the set of all cluster centers of the connected domain whose ratio of the length and width of the minimum circumscribed rectangle in cpG is less than or equal to the set ratio threshold; represents the maximum distance between a pixel point in the captured image and the edge of the captured image; w1 and w2 represent the first calculation coefficient and the second calculation coefficient respectively.
[0129] The probability coefficient of the present invention, in addition to considering the shape of the connected domain where s is located, is also considered from the distance between the coordinates of the center of the connected area belonging to the pine cone. If the ratio of the length and width of the connected domain where s is located is less than or equal to the set ratio threshold, it means that the probability that the area where s is located belongs to the connected domain of the pine cone is large. At this time, if the minimum distance between s and the coordinates in CNET is smaller, it means that the probability that s belongs to the connected domain of the pine cone is greater, and accordingly, the greater its probability parameter is, so that the pixel points belonging to the connected domain of the pine cone can be distinguished from the pixel points belonging to the connected domain of the pine leaf with a greater probability. By comprehensively considering the two factors of shape and distance, the effectiveness of the probability parameter is improved.
[0130] Preferably, the first calculation coefficient and the second calculation coefficient are respectively and .
[0131] Preferably, the probability parameter threshold is set to .
[0132] Preferably, the acquisition process of CNET is as follows:
[0133] First, obtain a set U1 of connected domains in which the ratio of the length and width of the minimum circumscribed rectangle in cpG is less than or equal to the set ratio threshold;
[0134] Then obtain the set U2 of coordinates of the centers of the connected domains in U1;
[0135] A graph-based clustering algorithm is used to calculate the coordinates in U2, and the coordinates of the centers of all clusters are stored in CNET.
[0136] Graph-based clustering algorithms, such as graph-based community discovery algorithms such as the Louvain method, discover community structures in the network by optimizing modularity, and do not need to pre-specify the number of clusters. In this way, the centers of clusters of adjacent pine cones can be obtained through clustering, and the pixels in the connected domain that are far from the centers of the pine cone clusters but have shapes similar to the pine cones can be grayed using the second graying formula, thereby reducing the probability of pixels belonging to the pine cone area being highlighted in the grayscale image.
[0137] Preferably, in cpG, the process of obtaining the minimum value of the distance between s and each coordinate in the set CNET is as follows:
[0138] Calculate the distance between s and each coordinate in CNET respectively;
[0139] All calculated distances are sorted in descending order, and the last distance is taken as the minimum distance between s and each coordinate in the set CNET.
[0140] In another embodiment, determining whether there is a connected domain belonging to a pine cone includes:
[0141] Get the area of each connected domain respectively;
[0142] Cluster the area of the connected domain and divide the area of the connected domain into two clusters;
[0143] Calculate the absolute value ABS of the difference between the average areas of the connected domains in the two clusters;
[0144] Use MAS to represent the larger of the two average areas. Is it greater than the set ratio? If so, it means there is a connected domain belonging to the pine cone.
[0145] Preferably, the set ratio value may be 0.2.
[0146] Preferably, the first grayscale formula is as follows:
[0147]
[0148] Indicates that in the grayscale image GrayP1 calculated by the first grayscale formula The gray value of the pixel at , and Respectively expressed in pR, pG and pL, The grayscale value of the pixel at , pR, pG and pL respectively represent the images of the red component, green component and blue component of the captured image in the RGB color space, z1, z2a and z3 respectively represent the weight of the red component, the first weight of the green component and the weight of the blue component.
[0149] Preferably, the second grayscale formula is as follows:
[0150]
[0151] Indicates that in the grayscale image GrayP2 calculated by the second grayscale formula The gray value of the pixel at , and Respectively expressed in pR, pG and pL, The grayscale value of the pixel at , pR, pG and pL represent the images of the red component, green component and blue component of the captured image in the RGB color space, respectively, z1, z2b and z3 represent the weight of the red component, the second weight of the green component and the weight of the blue component, respectively; .
[0152] Preferably, the values of z1 and z3 are 0.25 and 0.1 respectively; the values of z2a and z2b are 0.65 and 0.6 respectively.
[0153] Preferably, the values of z1 and z3 are 0.34 and 0.1 respectively; the values of z2a and z2b are 0.56 and 0.5 respectively.
[0154] In the present invention, the fruit setting rate may be the result of dividing the total number of pine cones by the total number of female cones.
[0155] It is obvious to those skilled in the art that the present invention is not limited to the details of the above-mentioned exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention; therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, and therefore it is intended to include all changes within the meaning and scope of the equivalent elements of the claims within the present invention, and any figure mark in the claims should not be regarded as limiting the claims involved.
[0156] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A Korean pine fruiting rate analysis system, It is characterized in that It includes an image processing device; the image processing device includes a stage judgment module and a grayscale module; The stage judgment module is used to judge the captured images containing pine cones and pine leaves to determine whether the pine cones are in the young fruit stage or the mature stage; The grayscale module is used to grayscale the captured image according to the following rules: If the pine cone is in the young fruit stage, the graying process includes: The first step is to calculate the probability parameter of each pixel belonging to the area where the pine cone is located; In the second step, each pixel in the captured image is processed as follows based on the probability parameter to obtain a grayscale image: A preset first grayscale formula is used to grayscale the pixel points in the image to be analyzed whose probability parameters are greater than or equal to a set probability parameter threshold; A preset second grayscale formula is used to grayscale the pixel points whose probability parameters are less than a set probability parameter threshold; The weight of the green component in the second grayscale formula is less than the weight of the green component in the first grayscale formula; the green component is a component in the RGB color space; If the pine cone is in the mature stage, a preset second grayscale formula is used to grayscale each pixel in the captured image to obtain a grayscale image; The first grayscale formula is as follows: GrayP1(x,y)=z1×pR(x,y)+z2a×pG(x,y)+z3×pL(x,y) GrayP1(x,y) represents the gray value of the pixel at (x,y) in the gray image GrayP1 calculated by the first graying formula, pR(x,y), pG(x,y) and pL(x,y) represent the gray value of the pixel at (x,y) in pR, pG and pL respectively, pR, pG and pL represent the images of the red component, green component and blue component of the captured image in the RGB color space respectively, z1, z2a and z3 represent the weight of the red component, the first weight of the green component and the weight of the blue component respectively; The second grayscale formula is as follows: GrayP2(x,y)=z1×pR(x,y)+z2b×pG(x,y)+z3×pL(x,y) GrayP2(x,y) represents the gray value of the pixel at (x,y) in the gray image GrayP2 calculated by the second grayscale formula, pR(x,y), pG(x,y) and pL(x,y) represent the gray value of the pixel at (x,y) in pR, pG and pL respectively, pR, pG and pL represent the images of the red component, green component and blue component of the captured image in the RGB color space respectively, z1, z2b and z3 represent the weight of the red component, the second weight of the green component and the weight of the blue component respectively; 2. A Korean pine fruit setting rate analysis system according to claim 1, It is characterized in that The image processing device also includes a noise reduction module, which is used to perform noise reduction processing on each pixel point in the grayscale image respectively to obtain a grayscale image after noise reduction.
3. A Korean pine fruit setting rate analysis system according to claim 2, It is characterized in that The image processing device also includes a recognition module, which is used to recognize the grayscale image after noise reduction and obtain the number of pine cones contained in the grayscale image after noise reduction.
4. A Korean pine fruit setting rate analysis system according to claim 3, It is characterized in that It also includes a shooting device, which is used to shoot Korean pine to obtain multiple images containing pine cones and pine leaves, and there is an overlapping area between two images with adjacent shooting positions.
5. A Korean pine fruit setting rate analysis system according to claim 4, It is characterized in that Also includes statistical analysis devices; The statistical analysis device is used to obtain the total number of pine cones based on the number of pine cones contained in each captured image.
6. A Korean pine fruit setting rate analysis system according to claim 1, It is characterized in that Judging the captured images containing pine cones and pine leaves to determine whether the pine cones are in the young fruit stage or the mature stage, including: Obtain an image pG corresponding to a green component of a captured image containing pine cones and pine leaves in an RGB color space; Use the threshold segmentation algorithm to segment pG and obtain the segmentation threshold; In pG, the pixel values of the pixels whose pixel values are greater than the segmentation threshold are updated to 255, and the pixel values of the pixels whose pixel values are less than or equal to the segmentation threshold are updated to 0, thereby obtaining the image cpG; Get the connected domain consisting of pixels with a pixel value of 255 in cpG; Determine whether there is a connected domain belonging to the pine cone. If so, it means that the pine cone is in the young fruit stage; if not, it means that the pine cone is in the mature stage.
7. A Korean pine fruit setting rate analysis system according to claim 6, It is characterized in that Determine whether there is a connected domain belonging to the pine cone, including: Obtain the ratio of the length and width of the minimum circumscribed rectangle of each connected domain respectively; Get the number N of minimum bounding rectangles whose ratio is less than or equal to the set ratio threshold; If N is greater than 0, it means that there is a connected domain belonging to the pine cone. If N is equal to 0, it means that there is no connected domain belonging to the pine cone.
8. A Korean pine fruit setting rate analysis system according to claim 7, It is characterized in that The calculation formula of the probability parameter is as follows: Provl s Represents the probability parameter of pixel s, typvl s Represents the shape coefficient. If the ratio of the length and width of the minimum bounding rectangle of the connected domain where the pixel corresponding to the coordinate of s in cpG is less than or equal to the set ratio threshold, then typvl s The value of typvl is 1. If the ratio of the length and width of the minimum bounding rectangle of the connected domain where the pixel corresponding to the coordinate of s in cpG is located is greater than the set ratio threshold, then typvl s The value of dtmid is 0; s Indicates the minimum distance between s and each coordinate in the set CNET in cpG; CNET is the set of all cluster centers of the connected domain whose ratio of the length and width of the minimum circumscribed rectangle in cpG is less than or equal to the set ratio threshold; dtmid max represents the maximum distance between a pixel point in the captured image and the edge of the captured image; w1 and w2 represent the first calculation coefficient and the second calculation coefficient respectively.
