A method for detecting the processing precision of rice, an electronic device, and a storage medium
The rice processing accuracy is directly calculated through image segmentation technology of unstained rice, which solves the time-consuming and inaccurate problems of the dyeing steps in traditional methods, and achieves efficient and automated detection results.
Patent Information
- Application Number
- CN202510131413.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-02-06
AI Technical Summary
The traditional rice processing accuracy measurement method requires dyeing steps, which takes a long time and errors can easily lead to wrong results, and is poor in representation.
By obtaining the outer surface image of unstained rice, the seed coat, endosperm and the complete rice area are segmented using the image segmentation algorithm, and its area is calculated to determine the rice processing accuracy.
The rice processing accuracy detection can be achieved without dyeing, avoiding the time-consuming and safety risks of the dyeing steps, improving detection efficiency and automation, and improving calculation accuracy through multi-angle identification and repeated area removal.
Smart Images

Figure CN119579590B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of image processing, and in particular, to a method for detecting the processing precision of rice, an electronic device, and a storage medium. Background Art
[0002] In the traditional method for measuring the processing precision of rice based on visual imaging, usually, taking advantage of the different affinities of different structures such as the seed coat and endosperm of rice for the stain, after staining the rice, an image after staining is obtained through an imaging device such as a scanner, and the areas of different color patches are calculated, so as to calculate the percentage of the skin retention degree. Among them, the steps of staining and air-drying need to be completed manually, which takes a long time and is prone to incorrect results due to operation errors. The stain, as a consumable, needs to be purchased repeatedly, and long-term contact with the stain may cause harm to the operator. In addition, due to the limitation of the staining step, the general sample is about ten grams, and the representativeness is poor.
[0003] Therefore, there is an urgent need to propose a method for detecting the processing precision of rice without staining. Summary of the Invention
[0004] Embodiments of the present invention provide a method for detecting the processing precision of rice, an electronic device, and a storage medium to solve the above technical problems.
[0005] In a first aspect, embodiments of the present invention provide a method for detecting the processing precision of rice, including:
[0006] Obtaining an outer surface image of unstained rice, where the outer surface image includes a front image and / or other surface images;
[0007] Using an image segmentation algorithm to segment the seed coat region, endosperm region, and complete rice region in the outer surface image;
[0008] Determining the processing precision of rice by using the areas of the seed coat region, endosperm region, and complete rice region, where the processing precision is the skin retention degree.
[0009] In a second aspect, embodiments of the present invention provide an electronic device, where the electronic device includes:
[0010] One or more processors;
[0011] A memory for storing one or more programs,
[0012] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for detecting the processing precision of rice according to any embodiment.
[0013] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the rice processing precision detection method described in any of the embodiments.
[0014] In summary, the embodiments of the present invention provide a rice processing precision detection method, an electronic device, and a storage medium. Without dyeing, the processing precision of rice can be obtained directly through image acquisition and analysis calculation, avoiding the time-consuming and continuous dyeing steps and the safety risks to operators, and improving the detection efficiency and automation degree. Among them, when calculating the surface area of rice in this embodiment, image acquisition and surface area calculation are extended from the upper and lower surfaces of traditional rice to the side parts, multi-angle recognition and splicing are performed, and the overlapping areas between images are removed, improving the calculation accuracy of the processing precision of sample rice. In particular, in this embodiment, the overlapping areas between adjacent images are identified through texture feature matching, and a relatively accurate overlapping area mask is obtained through elliptical boundary fitting, improving the accuracy and speed of processing precision detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0016] Figure 1 is a flowchart of a rice processing precision detection method provided by an embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of image acquisition and image splicing provided by an embodiment of the present invention;
[0018] Figure 3 is a schematic diagram of the arrangement of rice provided by an embodiment of the present invention;
[0019] Figure 4 is a schematic diagram of texture feature matching provided by an embodiment of the present invention;
[0020] Figure 5 is a schematic diagram of determining the overlapping area provided by an embodiment of the present invention;
[0021] Figure 6 is another schematic diagram of determining the overlapping area provided by an embodiment of the present invention;
[0022] Figure 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be described clearly and completely below. Obviously, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope protected by the present invention.
[0024] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0025] In the description of the present invention, it should also be noted that unless otherwise clearly specified and defined, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0026] Figure 1 is a flowchart of a method for detecting the processing precision of rice provided by an embodiment of the present invention. This method is executed by an electronic device, such as Figure 1 shown, and this method specifically includes:
[0027] S110. Obtain an outer surface image of the undyed rice, where the outer surface image includes a front image and / or other surface images.
[0028] In this step, images of the same grain of rice at different angles are taken after the rice is milled, serving as the data source for the entire method. Optionally, the images at different angles at least include two upper and lower front images when the rice is placed flat, which are respectively called the upper surface image and the lower surface image, and these two images cover most of the surface area of the rice.
[0029] Optionally, in order to more comprehensively cover the surface area of the same grain of rice, in addition to obtaining the upper surface image and the lower surface image of the rice in this step, at least one side image of the rice can also be obtained. Schematically, Figure 2Disclosed is an image acquisition device for multi-angle photographing of rice, which acquires the outer surface image of rice through the combination of multiple light sources and multiple imaging devices. Specifically, through the upper and lower cameras of the glass plate and the transmission light camera, etc., the images of rice are taken from different angles. The taken images can be the upper surface image and the lower surface image, or the upper surface image, the lower surface image and the side image, so as to capture as much as possible the overall outer surface condition of the rice. Optionally, the imaging devices include scanners, RGB cameras, near-infrared cameras, spectral cameras, X-ray imaging, etc., and the light source modes can include backlight, diffuse reflection, light sources with fixed wavelengths, etc.
[0030] Further, only one grain of rice can be placed on the glass plate at a time for multi-angle photographing of this grain of rice; or a row of rice can be placed on the glass plate at a time, and the length directions of each grain of rice are arranged along the same straight line. As Figure 3 shown, then the images of all the rice are taken from four angles: top view, bottom view, left side and right side, and the images of each angle are sequentially divided into the upper surface image, the lower surface image and two side images of each grain of rice. In subsequent operations, multiple images of the same grain of rice will be processed. Of course, multiple grains of rice can also be arranged on the glass plate in other ways, as long as the grains of rice do not block each other in the photographed images of each angle, and the multi-angle images of the same grain of rice can be recognized.
[0031] Of course, any one image or any combination of multiple images can also be selected from the above different angle images for subsequent operations, and the specific value of the rice processing precision (i.e., the degree of skin retention) can be finally calculated, which all belong to the protection scope of this embodiment.
[0032] S120: Stitch the outer surface images of the same grain of rice at different angles into one image.
[0033] Taking Figure 2 as an example, in the case of obtaining the upper surface image, the lower surface image and two side images of the rice, a multi-view image as shown in Figure 2 can be stitched.
[0034] S130: Use an image segmentation algorithm to segment the seed coat area, endosperm area and complete rice area in the stitched image.
[0035] This step divides the seed coat, endosperm and overall contour of the rice respectively. According to different division methods, this embodiment provides the following two optional implementation manners:
[0036] The first optional implementation method is to use a deep learning-based image segmentation algorithm (such as the Unet model) to process the stitched image obtained in the previous step. By segmenting the seed coat area and the endosperm area, a mask image P1 of the endosperm area and a mask image P2 of the seed coat area are obtained respectively; by segmenting the rice in the background, a mask image P3 of the whole rice is obtained.
[0037] Optionally, a multi-scale and multi-model integration method can be used to segment the seed coat, endosperm and the whole rice, aiming to enhance the accuracy of small-area seed coat segmentation through a multi-scale training method and improve the accuracy of calculating the areas of the seed coat, endosperm and the whole rice through a multi-model integration method. Specifically, the specific process of using the Unet model to implement image segmentation is prior art. This model can finally output a pixel-level image segmentation result of the same size as the input image, and each pixel position shows the area to which the pixel belongs. In this step, multiple Unet models can be integrated, such as constructing two Unet models: First, collect multiple stitched images as training samples, and calibrate the rice area and the background area in each sample. Use the sample set to train a Unet model U1 for segmenting rice and the background; use the trained model to process the stitched image obtained in the previous step, and the background area S_background and the rice area S_all can be segmented. Similarly, calibrate the seed coat area, endosperm area and background area in each sample, and a Unet model U2 for segmenting the seed coat S_pi and the endosperm S_pei can be trained; use the trained model to process the stitched image obtained in the previous step, and the seed coat area and the endosperm area can be segmented. Considering the difficulty of the task, U1 segments rice and the background, and the difference between the background and rice is large, while U2 segments the seed coat and endosperm areas, and the image features of the two are less different. Therefore, the accuracy rate of the segmentation task of U1 will be higher than that of U2. Therefore, methods such as S_pi’=S_pi∪(S_all-S_pei) can be used to smooth or fill the segmented seed coat area to improve the segmentation accuracy. At the same time, through experiments, randomly scale the input image, such as adjusting the size to 0.5-1.5 times the original, to enhance the learning ability of the model for small damaged rice and small seed coat residue areas.
[0038] The second alternative implementation method uses color or grayscale thresholds in the image to achieve image segmentation. Specifically, according to the color range of the testa and endosperm on the surface of unstained rice calibrated through experiments, the threshold range can be divided through various color models such as RGB / HSV, and a color range template is set. Specifically, in the HSV model, the color range of the imaged endosperm is greater than [H: 100, S: 150, V: 100] and less than [H: 140, S: 220, V: 200], where H, S, and V represent hue, saturation, and brightness respectively. In stained rice, generally the testa turns close to blue after being stained, and its color threshold range is relatively fixed; while for unstained rice, the colors of the testa and endosperm are complex depending on the rice variety and processing technology such as the polishing time. It is difficult to accurately determine the color threshold range only relying on rules. For example, it is brown when unhulled, turquoise when slightly hulled with a short polishing time, and milky white granules when polished for a long time. Therefore, this embodiment uses a color threshold adaptive method for multi-parameter fusion of rice to perform threshold segmentation of the colors of the rice testa and endosperm. By collecting and calibrating different varieties of unstained rice and different processing technology parameters, the color threshold range of the rice testa is automatically identified, improving the recognition accuracy and the degree of automation. The specific process is as follows:
[0039] 1. Rice information input: It is divided into multi-surface image input and processing technology parameter information input. Among them, the multi-surface image information is the image information collected by the imaging device, and the processing technology parameters are the information such as the polishing time t1, the polishing gap m1, and the usage time t2 of the grinding disc collected through the control host of the processing device. The above parameters are used to express the processing technology, that is, the remaining degree of the testa.
[0040] 2. Rice variety recognition: By establishing an image classification model for different varieties of rice, the rice varieties are classified to obtain the rice variety information C and the confidence level p1. Among them, the image classification model can be a deep neural network classification model such as resnet50, and the deep network output F1 and the shallow network output F2 of the deep neural network classification model are extracted as the image information, aiming to obtain the image expressions of the deep and shallow layers of the image.
[0041] 3. Adaptive threshold range output: The input information for this step includes image information F1, F2, variety information C, polishing time t1, polishing nip m1, and grinding disc usage time t2. The output includes the color threshold range y = [H1, S1, V1, H2, S2, V2] of the seed coat, where H1 and H2 respectively represent the upper and lower threshold values of hue, S1 and S2 respectively represent the upper and lower threshold values of saturation, and V1 and V2 respectively represent the upper and lower threshold values of brightness. Preprocess the input data such as stretching it into a one-dimensional vector and normalizing it, and use a model such as a multi-layer neural network for modeling to establish the function f(F1, F2, C, p1, t1, m1, t2) = y.
[0042] S140. Determine the rice processing precision using the areas of the seed coat region, endosperm region, and whole rice region, where the processing precision is the degree of skin retention.
[0043] Specifically, if the image obtained in S110 includes only one image or only a front image, then there are no overlapping regions between the images, and the rice processing precision can be directly calculated based on the areas of the seed coat region, endosperm region, and whole rice region. Exemplarily, if only the upper surface image and the lower surface image are obtained in S110, then the rice processing precision is , where S(P 1 ), S(P 2 ), and S(P 3 ) are the areas of the endosperm region, seed coat region, and whole rice region respectively, which can be determined from the mask images P1, P2, and P3 respectively.
[0044] If there are at least two images among the multiple images obtained in S110 that may include overlapping regions, then it is necessary to first determine the overlapping regions and calculate the rice processing precision after removing the overlapping regions. The following uses the example of obtaining the upper surface image, lower surface image, and side image in S110 to illustrate this process.
[0045] Specifically, considering that the outer surface images of the rice collected by the upper and lower cameras generally overlap with the side image, it is necessary to remove the overlapping regions when calculating the surface area to avoid double counting. First, it is necessary to identify the overlapping regions between the side image and the upper and lower surface images. According to different identification methods, the following two alternative implementation methods are provided in this embodiment:
[0046] The first alternative implementation method is to determine the overlapping region based on the surface texture feature. The following takes the example of determining the overlapping region between the side image and the upper surface image to illustrate the specific steps of this method:
[0047] Step 1. Use a corner detection algorithm to extract the feature points with matching texture structures between the upper surface image and the side image. Optionally,Figure 4 For example, use a corner detection algorithm such as SURF to extract the detection sub - features of the upper image (i.e., the upper - surface image) and the side images. After screening, generate descriptors, and match all the feature points in the upper image, side image 1, and side image 2. Remove the wrongly - matched points and retain the successfully - matched feature points. Figure 4 In the figure, mark the feature points with circles and mark the matching relationship between the feature points with connecting lines between the two images. Then the matching - relationship index in the figure can be expressed as "upper - side 1{S11, S12, S13}" and "upper - side 2{S21, S22}". These successfully - matched feature points have the same texture features and can be considered to correspond to the same position on the rice surface, which is a point in the repeated area between the upper - surface image and the side images.
[0048] Step 2: Perform contour detection on the upper - surface image and the side images respectively, and fit the rice contours of the two images into two ellipses. Specifically, considering that rice is generally long - grain - shaped, an ellipse - fitting method can be used to fit the contour boundary, and calculate the inclination angle of the rice in the image coordinate system through the major axis of the ellipse, that is, the angle between the major axis of the ellipse in the image and the vertical direction. Taking Figure 2 as an example, calculate the inclination angle A_up of the major axis of the ellipse of the upper - surface image, the inclination angle A_down of the major axis of the ellipse of the lower - surface image, the inclination angle A_ce1 of the major axis of the ellipse of side 1, and the inclination angle A_ce2 of the major axis of the ellipse of side 2 respectively.
[0049] Step 3: For a certain side image, determine the ellipse boundary on the side image that is closer to the front - side of the rice shown in the front image, and fit another ellipse with the smallest area that can cover all the matching feature points between the matching feature points and the ellipse boundary. This ellipse has the same major - axis length and consistent inclination trend as the ellipse of the rice contour in the side image. For the convenience of distinction and description, in this embodiment, the ellipse constructed in Step 2 to represent the rice contour is called the first ellipse, and the ellipse used to cover all the matching feature points in this step is called the second ellipse.
[0050] In a specific embodiment, the second ellipse can be constructed in the following way: First, on the ellipse boundary of the first ellipse closer to the front - side of the rice, determine the boundary points that have the same coordinates as each matching feature point in the first ellipse along the minor - axis direction of the first ellipse. Specifically, taking Figure 4 the upper - surface image and the image of side 2 in Figure 5the solid ellipse in it, and traverse the matching relationship index table "{upper - side 2{S21, S22}}" obtained in Step 1 to determine the following: The matching feature point corresponding to relationship S21 is A, and the boundary point on the right - hand ellipse boundary that has the same coordinate as point A along the minor axis direction of the first ellipse is C; The matching feature point corresponding to relationship S22 is B, and the boundary point on the right - hand ellipse boundary that has the same coordinate as point B along the minor axis direction of the first ellipse is D.
[0051] Then, for each pair of matching feature points and boundary points with the same coordinate along the minor axis direction of the first ellipse, calculate their center points respectively, and take the center point farthest from the front of the rice as the basis for determining the center point of the second ellipse. Take Figure 5 as an example, take min((X_s21 + X_b1) / 2, (X_s22 + X_b2) / 2), where X_s21 is the coordinate of point A along the minor axis direction of the ellipse, X_s22 is the coordinate of point B along the minor axis direction of the ellipse, and X_b1 and X_b2 are the coordinates of points C and D along the minor axis direction of the ellipse respectively. min((X_s21 + X_b1) / 2, (X_s22 + X_b2) / 2) is actually the coordinate of the mid - point F of points B and D along the minor axis direction of the ellipse.
[0052] Finally, take the straight line passing through the farthest center point and parallel to the major axis of the ellipse as the major axis direction, and take the minor axis straight line of the first ellipse as the minor axis direction, and fit a second ellipse that has the same major axis length as the first ellipse and has the matching feature point corresponding to the farthest center point as the boundary point. Take Figure 5 as an example, take the straight line passing through point F and parallel to the major axis of the first ellipse as the major axis direction, take the minor axis straight line of the first ellipse as the minor axis direction, take the intersection point G of the two straight lines as the center, and fit an ellipse that has the same major axis as the first ellipse on the side and has point B as the boundary point, as shown by the dashed ellipse in Figure 5 The coordinate of point F along the minor axis direction of the ellipse is the coordinate of the ellipse center along the minor axis direction. This dashed ellipse can not only cover all the areas between the feature points and the right - hand ellipse boundary, but also keep the area to be the smallest.
[0053] It is worth noting that although in the Figure 5 example, the first ellipse in the side image does not show obvious inclination, the above - mentioned method is also applicable to the case where the first ellipse is inclined, such as the Figure 6 example given, it can be seen that in this case the above - mentioned method can still ensure that the finally fitted second ellipse has the same inclination trend as the first ellipse.
[0054] Furthermore, after generating the ellipse, rule judgment can be carried out, such as the area needs to be less than the contour area of the elliptical rice grain (i.e., the first ellipse), etc.
[0055] Step 4: Take the second ellipse as the overlapping area between the upper surface image and a certain side surface image.
[0056] Taking a certain side surface image and the upper surface image as examples above, the overlapping area between the two images is determined; performing similar operations on each side surface image can obtain the overlapping area between each side surface image and the upper surface image. Performing similar operations separately on each side surface image and the lower surface image can determine the overlapping area between each side surface image and the lower surface image.
[0057] The second optional implementation manner is to use an image segmentation algorithm based on deep learning to process any two images, and segment the overlapping area and non-overlapping area between the two images. Specifically, first take the spliced image of two rice surface images with overlapping areas as samples, and calibrate the overlapping area, non-overlapping area, and background area therein; train a Unet model with these samples, and use the trained model to process the spliced image of a certain side surface image and the upper surface image, then the overlapping area mask of the two images can be obtained.
[0058] After all the overlapping areas are determined, for the parts of the seed coat area, endosperm area, and whole rice area determined in S130 that intersect with the overlapping area, the rice processing accuracy is determined using the area of the remaining part. In a specific implementation manner, taking Figure 2 as an example, denote the union of the overlapping areas of side 1 with the upper and lower surface images as S_ce1, and denote the union of the overlapping areas of side 2 with the upper and lower surface images as S_ce2.
[0059] For the side surface image part in the seed coat area mask map P2, extract the parts that intersect with the overlapping areas S_ce1 and S_ce2, and retain the parts of all front images (including the upper surface image and the lower surface image) in P2 to obtain the final seed coat area mask map Pf2.
[0060] Similarly, for the side surface image part in the endosperm area mask map P1, extract the parts that intersect with the overlapping areas S_ce1 and S_ce2, and retain the parts of all front images in P1 to obtain the final endosperm area mask map Pf1.
[0061] Similarly, for the side surface image part in the mask map P3 of the whole rice, extract the parts that intersect with the overlapping areas S_ce1 and S_ce2, and retain the parts of all front images in P3 to obtain the final endosperm area mask map Pf3.
[0062] Then, the final processing accuracy is . Further, before calculating the processing accuracy, a self-checking link can be added to check and Whether the absolute value of the subtraction exceeds the safety threshold s (s > 0). If so , it is considered that there may be a large deviation in the above calculation. At this time, it is necessary to check whether the image acquisition device and the sample are normal and re-detect to improve the accuracy and stability of the processing accuracy calculation.
[0063] In summary, this embodiment provides a method for detecting the processing accuracy of rice. Without staining, the processing accuracy of rice can be obtained directly through image acquisition and analysis calculation, avoiding the time-consuming and continuous staining steps and the safety risks to operators, and improving the detection efficiency and automation degree. Among them, when calculating the surface area of rice in this embodiment, the image acquisition and surface area calculation are extended from the traditional upper and lower surfaces of rice to the side parts, and multi-angle recognition and stitching are performed, and the overlapping areas between images are removed, improving the calculation accuracy of the processing accuracy of the sample rice. In particular, this embodiment identifies the overlapping areas between adjacent images through texture feature matching, and obtains a relatively accurate overlapping area mask through elliptical boundary fitting, improving the accuracy and speed of the processing accuracy detection.
[0064] Figure 7 The following is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 7 shown, the device includes a processor 60, a memory 61, an input device 62, and an output device 63; the number of processors 60 in the device can be one or more, Figure 7 taking one processor 60 as an example; the processor 60, the memory 61, the input device 62, and the output device 63 in the device can be connected through a bus or other means, Figure 7 taking the connection through the bus as an example.
[0065] The memory 61, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the method for detecting the processing accuracy of rice in the embodiment of the present invention. The processor 60 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 61, that is, implements the above method for detecting the processing accuracy of rice.
[0066] The memory 61 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 61 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 61 may further include a memory remotely provided with respect to the processor 60, and these remote memories may be connected to the device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0067] The input device 62 may be used to receive input digital or character information, and generate key signal inputs related to user settings and function controls of the device. The output device 63 may include display devices such as a display screen.
[0068] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the rice processing precision detection method of any embodiment.
[0069] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program may be used by or in combination with an instruction execution system, apparatus, or device.
[0070] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
[0071] The program code contained on a computer-readable medium can be transmitted with any suitable medium, including but not limited to wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the above.
[0072] The computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as C language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features. And these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.
Claims
1. A rice processing precision detection method, characterized in that, include: Acquire an outer surface image of undyed rice, wherein the outer surface image includes a front image and other surface images, wherein the front image includes an upper surface image and / or a lower surface image, and the other surface images include a side image; Using an image segmentation algorithm, segmenting the seed coat region, the endosperm region and the complete rice region in the outer surface image; Using a feature point detection algorithm, feature points matching the texture structure between the front image and the side image are extracted, and these successfully matched feature points are points in the repeated area between the front image and the side image; contour detection is performed on the front image and the side image respectively, and the rice contours of the two images are respectively fitted into two first ellipses; For the first ellipse of the side image, on the ellipse boundary closer to the front side of the rice shown in the front image, determine the boundary points with the same coordinates as the matching feature points along the minor axis direction of the first ellipse; Determine the center point of each pair of matching feature points and boundary points with the same coordinates along the minor axis direction of the first ellipse, and take the center point farthest from the front side of the rice; Taking the straight line passing through the farthest center point and parallel to the long axis of the ellipse as the long axis direction and the short axis straight line of the first ellipse as the short axis direction, fit a second ellipse having the same long axis length as the first ellipse and taking the matching feature points corresponding to the farthest center point as boundary points; taking the second ellipse as the overlapping area of the front image and the side image; The portions of the seed coat region, the endosperm region and the intact rice region that intersect with the repeated region are removed, and the rice processing accuracy is determined using the area of the remaining portion, wherein the processing accuracy is the degree of peel retention.
2. The method according to claim 1, characterized in that The step of segmenting the seed coat region, the endosperm region and the complete rice region in the outer surface image by using an image segmentation algorithm comprises: Based on the color threshold range of different areas, or using an image segmentation algorithm based on deep learning, the seed coat area, endosperm area and complete rice area in the outer surface image are segmented.
3. The method according to claim 2, characterized in that Before segmenting the seed coat region, the endosperm region and the complete rice region in the outer surface image based on the color threshold ranges of different regions, the method further includes: By collecting and calibrating different varieties of undyed rice and different processing parameters, the color threshold range of rice seed coat can be automatically identified.
4. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the rice processing accuracy detection method described in any one of claims 1-3.
5. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the rice processing accuracy detection method described in any one of claims 1-3 is implemented.
Citation Information
Patent Citations
Three-dimensional portrait photograph system and realizing method thereof
CN101082765A
Rice processing precision detection method and device, electronic equipment and medium
CN114881984A
Ploughing plot boundary identification method and system based on remote sensing data
CN118196502A
Rice precision detection device
CN207600960U