Image recognition-based online detection system and method for rice fine processing quality
Patent Information
- Application Number
- CN202610765170.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-08-18
AI Technical Summary
[0003]然而,在实际铺样静置过程中,精加工后的米粒并不会以理想随机姿态分布
[0008]Based on the embodiments provided in this application, by identifying the landing posture and assessing the invisibility level of individual rice grains based on their contour and morphological features, it is possible to distinguish the sufficiency of the representation of the current visible surface of each rice grain relative to the overall processing state, thereby overcoming the systematic bias caused by the traditional method's assumption that the visible surface is representative under any posture. Furthermore, targeted flipping operations are performed on rice grains with an invisibility level higher than a preset threshold, and the first image region after flipping is acquired. Rice grains with low invisibility levels are directly used as visible detection grains, avoiding the processing redundancy caused by blindly flipping all rice grains while ensuring the active acquisition of potential defect-hidden surfaces. Based on this, the second image region of the rice grain to be flipped in the initial image is registered with the first image region after flipping. Defect features are extracted based on the registration result, enabling the defect information from different surfaces before and after flipping of the same rice grain to accurately correspond spatially, thereby obtaining a complete defect characterization. By combining the records of defects in rice grains from both the flipped and visible grains, the quality assessment results and process feedback information are determined. This eliminates the reliance on the randomness of rice grain drop posture for quality evaluation, instead basing it on the actual, observable distribution of defects on the complete surface. This significantly improves the ability of online detection to reflect the true processing quality and provides a reliable basis for accurate feedback on the processing technology.
Smart Images

Figure CN122597360A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, and more specifically, to an online detection system and method for rice refining quality based on image recognition. Background Technology
[0002] Quality inspection and evaluation of refined rice is a crucial link in grain processing, quality control, and commodity grading. Its results directly affect the appearance quality, perceived edible quality, market grading, and the optimization and control of milling process parameters by processing enterprises. Traditional inspection methods typically rely on manual sampling observation, experience-based judgment, and the determination of some physicochemical indicators. Although relatively mature operating procedures have been developed through long-term production practice, problems such as low inspection efficiency, high subjectivity, insufficient repeatability, and difficulty in adapting to continuous, large-scale production rhythms still exist. With the development of machine vision, image processing, and pattern recognition technologies, using image recognition methods to automatically detect the head rice rate, broken rice rate, color, chalkiness, foreign matter contamination, and apparent milling degree of rice has become an important research direction for improving the intelligent level of grain quality control. Most existing rice refined processing quality inspections are based on the assumption that the visible surface of the rice grains in the acquired images can adequately represent their overall processing state.
[0003] However, during the actual sample placement and settling process, the refined rice grains do not distribute in an ideal random posture. Due to the natural differences in curvature, thickness, contact area, and center of gravity between the ventral and dorsal sides of the rice grains, coupled with the effects of local bran residue, wax residue, surface roughness changes, and frictional characteristics after refinement, the rice grains exhibit a certain degree of posture selectivity after placement and settling. This results in the sensitive surface containing key defect information being more likely to face downwards, making the defects invisible and affecting the quality assessment results of refined rice.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides an online detection system and method for rice refining quality based on image recognition to solve the above-mentioned technical problems.
[0006] This application provides an online inspection system for the quality of refined rice processing based on image recognition, comprising: a feature extraction unit for acquiring an initial image of a rice grain sample placed on a detection plane and extracting the contour and morphological features of a single rice grain; a posture recognition unit for identifying the landing posture of each rice grain based on the contour and morphological features to assess the invisibility level of each rice grain; a flipping acquisition unit for marking rice grains with an invisibility level higher than a preset level threshold as rice grains to be flipped, performing a flipping operation on the rice grains to be flipped and acquiring a first image area after flipping; and marking rice grains with an invisibility level not exceeding the preset level threshold as visible detection rice grains; and a first defect feature. An extraction unit is used to segment a second image region corresponding to the rice grain to be turned from the initial image, register the second image region with the first image region, and extract the defect features of the rice grain to be turned based on the registration result to form a rice grain defect record; a second defect feature extraction unit is used to segment a third image region corresponding to the visible rice grain from the initial image, and extract the defect features of the visible rice grain based on the third image region to form a visible rice grain defect record; a judgment unit is used to determine the rice processing quality judgment result and process feedback information based on the rice grain defect record and the visible rice grain defect record.
[0007] This application provides an online detection method for the quality of refined rice processing based on image recognition, comprising: S1, acquiring an initial image of a rice grain sample placed on a detection plane, and extracting the contour and morphological features of individual rice grains; S2, identifying the landing posture of each rice grain based on the contour and morphological features to assess the invisibility level of each rice grain; S3, recording rice grains with an invisibility level higher than a preset level threshold as rice grains to be flipped, performing a flipping operation on the rice grains to be flipped and acquiring the first image area after flipping; recording rice grains with an invisibility level not exceeding the preset level threshold as visible detection rice grains; S4, S5. From the initial image, segment the second image region corresponding to the rice grain to be turned, register the second image region with the first image region, and extract the defect features of the rice grain to be turned based on the registration result to form a rice grain defect record; S6. From the initial image, segment the third image region corresponding to the visible rice grain, and extract the defect features of the visible rice grain based on the third image region to form a visible rice grain defect record; S7. Based on the rice grain defect record and the visible rice grain defect record, determine the rice processing quality judgment result and process feedback information.
[0008] Based on the embodiments provided in this application, by identifying the landing posture and assessing the invisibility level of individual rice grains based on their contour and morphological features, it is possible to distinguish the sufficiency of the representation of the current visible surface of each rice grain relative to the overall processing state, thereby overcoming the systematic bias caused by the traditional method's assumption that the visible surface is representative under any posture. Furthermore, targeted flipping operations are performed on rice grains with an invisibility level higher than a preset threshold, and the first image region after flipping is acquired. Rice grains with low invisibility levels are directly used as visible detection grains, avoiding the processing redundancy caused by blindly flipping all rice grains while ensuring the active acquisition of potential defect-hidden surfaces. Based on this, the second image region of the rice grain to be flipped in the initial image is registered with the first image region after flipping. Defect features are extracted based on the registration result, enabling the defect information from different surfaces before and after flipping of the same rice grain to accurately correspond spatially, thereby obtaining a complete defect characterization. By combining the records of defects in rice grains from both the flipped and visible grains, the quality assessment results and process feedback information are determined. This eliminates the reliance on the randomness of rice grain drop posture for quality evaluation, instead basing it on the actual, observable distribution of defects on the complete surface. This significantly improves the ability of online detection to reflect the true processing quality and provides a reliable basis for accurate feedback on the processing technology. Attached Figure Description
[0009] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a structural diagram of an optional online inspection system for rice refining quality based on image recognition, according to an embodiment of this application. Figure 2 This is a flowchart of an optional online detection method for rice refining quality based on image recognition, according to an embodiment of this application; Figure 3 This is a flowchart of another optional online detection method for rice refining quality based on image recognition, according to an embodiment of this application; Figure 4 This is a flowchart of another optional online detection method for rice refining quality based on image recognition, according to an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application.
[0010] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0012] When evaluating the quality of rice processing based on image recognition under static conditions, the processed rice grains, during the spreading and resting process, exhibit a "defect-sensitive surface preferentially facing downwards" orientation phenomenon due to differences in geometric curvature, center of gravity distribution, surface friction, and contact stability caused by localized bran / wax residues between the ventral and dorsal sides. This results in key processing defects such as bran residue in the ventral groove, residual germ, slight under-milling in the grooves, and early micro-cracks on the ventral side being systematically hidden in single-view static images. The specific technical problem to be solved is: how to identify and correct the invisible defect surface deviation caused by the orientation of rice grains, so that the rice processing quality evaluation results under static images are no longer distorted by the "defect surface facing downwards".
[0013] According to one aspect of the embodiments of this application, such as Figure 1 As shown, this application provides an online inspection system for the quality of rice refining based on image recognition, including: The feature extraction unit 101 is used to acquire an initial image of a rice grain sample placed on a detection plane and extract the contour and morphological features of a single rice grain. The posture recognition unit 102 is used to identify the landing posture of each grain of rice based on its contour and morphological features, so as to evaluate the invisibility level of each grain of rice. The flipping acquisition unit 103 is used to record rice grains with an invisible level higher than a preset level threshold as rice grains to be flipped, perform a flipping operation on the rice grains to be flipped and acquire the first image area after flipping; and record rice grains with an invisible level not exceeding the preset level threshold as visible detection rice grains. The first defect feature extraction unit 104 is used to segment the second image region corresponding to the rice grain to be turned from the initial image, register the second image region with the first image region, extract the defect features of the rice grain to be turned based on the registration result, and form a defect record of the rice grain to be turned. The second defect feature extraction unit 105 is used to segment the third image region corresponding to the visible rice grains from the initial image, extract the defect features of the visible rice grains based on the third image region, and form a visible rice grain defect record. The judgment unit 106 is used to determine the rice refining quality judgment result and process feedback information based on the rice grain defect record and the visible rice grain defect record.
[0014] According to another aspect of the embodiments of this application, such as Figure 2 As shown, an online detection method for rice refining quality based on image recognition is also provided, including: S1, Acquire the initial image of the rice grain sample placed on the detection plane, and extract the outline and morphological features of a single rice grain; S2, based on contour and morphological features, identifies the landing posture of each grain of rice in order to assess the level of invisibility of each grain of rice. S3, mark rice grains with an invisible level higher than the preset level threshold as rice grains to be flipped, perform a flipping operation on the rice grains to be flipped and collect the first image area after flipping; mark rice grains with an invisible level not exceeding the preset level threshold as visible detection rice grains; S4. Segment the second image region corresponding to the rice grain to be turned from the initial image, register the second image region with the first image region, extract the defect features of the rice grain to be turned based on the registration result, and form a defect record of the rice grain to be turned. S5, segment the third image region corresponding to the visible rice grains from the initial image, extract the defect features of the visible rice grains based on the third image region, and form a visible rice grain defect record; S6. Based on the records of defects in the turned-over rice grains and the records of defects in the visible rice grains, determine the results of the rice refining quality assessment and the process feedback information.
[0015] Further, S1, acquire an initial image of the rice grain sample placed on the detection plane, and extract the contour and morphological features of a single rice grain, including: Images of rice grain samples were acquired under at least two different illumination angles, and the images from each illumination angle were fused to obtain an initial image. Two-dimensional projected contours of individual rice grains are extracted based on the initial image segmentation, and the contour morphology parameters, contact shadow geometry parameters, and surface scattered light distribution parameters of each rice grain are measured as contour and morphological features.
[0016] In the online detection scenario of rice processing quality in this embodiment, after the rice grains are placed on the detection plane, the system controls the light source to collect images of the rice grain samples at at least two different illumination angles.
[0017] Specifically, the light source can be an LED surface light source or a point light source, arranged above the detection plane. The two illumination angles are set as follows: one is a low-angle oblique light (e.g., the angle between the center of the light source and the normal to the detection plane is approximately 45° to 60°), used to enhance the shadow characteristics of concave areas such as the ventral groove of the rice grain; the other is a high-angle, nearly vertical diffused light (e.g., the angle between the center of the light source and the normal to the detection plane is approximately 0° to 15°), used to uniformly illuminate the overall morphology of the back side of the rice grain. To ensure illumination uniformity, the illuminance deviation of the light source at both angles must not exceed the set range within the illumination area on the detection plane.
[0018] The fusion process employs a specific fusion strategy based on shadow separation, rather than a simple weighted average. Specifically, it extracts areas with strong shadow information (especially the shadows on both sides of the ventral groove and at the contact plane) from the low-angle oblique light image, and extracts the texture and boundary details of the rice grain surface from the high-angle diffuse light image. Then, the two are recombined pixel-level according to their respective spatial locations to generate an initial image that simultaneously preserves both shadow structure information and surface detail information.
[0019] From the fused initial image, a two-dimensional projected contour of each rice grain is extracted through threshold segmentation and connected component analysis. Based on this contour, the following three types of parameters are measured, which together constitute the contour and morphological features: Contour morphology parameters include the area of the rice grain's projection, the perimeter of the contour, the lengths of the major and minor axes of the smallest bounding rectangle, the aspect ratio, and roundness (the ratio of area to the square of the perimeter). These parameters are mainly used to describe the overall size and shape of the rice grain.
[0020] Contact shadow geometry parameters: In the initial image, areas where the rice grain is in close contact with the detection plane (especially the ventral side of the implantation site) will form a noticeable contact shadow. The system extracts this shadow region through adaptive threshold segmentation, and then calculates the area, centroid position, major axis direction, and boundary complexity (i.e., the concavity and convexity of the shadow contour) of the region. These parameters reflect the contact depth and shape characteristics between the bottom surface of the rice grain and the plane.
[0021] Surface scattered light distribution parameters: Under low-angle oblique light, the surface of rice grains (especially the back side) produces differentiated scattered light spots due to variations in bran powder, wax, or smoothness. The system identifies the locations of the maximum scattered light intensity (i.e., the extreme value region of scattered light intensity) and statistically analyzes the mean gray value, variance gray value, and surrounding gray value gradient distribution of this region. These parameters reflect the optical reflection characteristics of the rice grain surface material.
[0022] The above three types of parameters describe the complete state of each grain of rice from three dimensions: shape, contact shadow, and surface optical response.
[0023] Furthermore, S2 includes: For each grain of rice, perform the following operations: Based on the contour morphology parameters of the rice grain, the long axis direction of the rice grain is determined, and the contour of the rice grain is divided into a first side contour segment and a second side contour segment along the long axis direction. The first centroid position of the contact shadow region of the rice grain is determined based on the contact shadow geometry parameters of the rice grain, and the second centroid position of the extreme region of scattered light intensity of the rice grain is determined based on the surface scattered light distribution parameters of the rice grain. Determine whether the first and second centers of gravity are located on opposite sides of the major axis; When the first center of gravity and the second center of gravity are located on opposite sides of the major axis, the grain of rice is determined to be in a directional landing posture, and the contour segment on the side where the first center of gravity of the grain of rice is located is determined as the ventral groove side contour segment of the grain of rice. Calculate the ratio of the projection length of the contact shadow area of the rice grain onto the ventral groove side profile segment to the length of the ventral groove side profile segment, and assess the invisibility level of the rice grain based on the ratio; When the first center of gravity and the second center of gravity are not located on opposite sides of the major axis, the grain of rice is determined to be in a non-directional landing posture, and its invisibility level is set to zero.
[0024] In this application, after the rice grain is laid on the detection plane, its landing posture directly determines the visibility of the groove side (i.e., the defect-sensitive surface) in the initial image. For the directional landing posture, due to the smaller radius of curvature of the groove side, the center of gravity being biased towards the groove side, and the increase in the friction coefficient of the contact surface due to the trace amount of bran powder or wax remaining in the groove after finishing, the rice grain exhibits a stable state of "groove side preferentially facing down" after being left to stand. At this time, the groove side is in close contact with the detection plane, forming a clear contact shadow area; while the back side faces upward, strong specular scattering or diffuse reflection is generated under illumination, forming an extreme value area of scattered light intensity. Therefore, under the directional landing posture, the center of gravity of the contact shadow area and the center of gravity of the extreme value area of scattered light intensity must be located on opposite sides of the long axis of the rice grain.
[0025] Conversely, when the two centers of gravity are not located on opposite sides of the long axis, it indicates that the grain of rice has not formed a stable directional landing posture. Such non-directional landing postures mainly include the following situations: (1) Back-down posture, in which the back side contacts the detection plane to form a shadow, while the ventral side faces upward to produce scattering. Although the two centers of gravity still exist, their spatial distribution relationship is opposite to that of directional landing; (2) Side-standing posture, the grain of rice is close to the detection plane along the long axis direction. Neither the ventral side nor the back side is completely covered. The contact shadow is weak or distributed along the long axis direction. The scattering light intensity distribution also tends to be uniform, resulting in the two centers of gravity not being clearly located on opposite sides; (3) Other random tumbling postures, the grain of rice contacts the detection plane with its end or local corners, and the overall posture is unstable.
[0026] For the aforementioned non-directional landing posture, the groin side is not systematically covered under the detection plane, and it already has a sufficient visible proportion in the initial image to be directly used for defect detection and evaluation. Therefore, the invisibility level of this type of grain is set to zero, allowing it to directly enter the processing flow for visible grains without needing to perform a flipping operation. The core purpose of this judgment mechanism is to: by quickly filtering out grains already visible on the groin side, concentrate flipping detection resources on directionally landed grains that truly have systematically hidden defect surfaces, thereby significantly improving the processing efficiency of the online detection system while meeting detection accuracy requirements.
[0027] After obtaining the outline and morphological features of each grain of rice, the core task of step S2 is to determine the posture in which the grain of rice is attached, i.e. whether the ventral groove side is facing down and tightly attached to the detection plane, and based on this, to assess how much invisible information (mainly the real defects on the ventral groove side) the grain of rice has in the initial image.
[0028] For each grain of rice, its major axis direction is first determined based on the principal component direction of its smallest bounding rectangle or projected profile. Then, using this major axis as the dividing line, the projected profile of the rice grain is naturally divided into two lateral profile segments: the first lateral profile segment and the second lateral profile segment. These two segments roughly correspond to the ventral groove side and the dorsal side of the rice grain, respectively, but initially, it is not yet determined which side is the ventral groove side.
[0029] As before, two key locations have been extracted: the first centroid of the contact shadow region (from the contact shadow geometry parameters) and the second centroid of the region with extreme scattered light intensity (from the surface scattered light distribution parameters).
[0030] Determine whether the two centers of gravity are located on opposite sides of the major axis. If so, it indicates that the rice grain has landed with its ventral side down and its dorsal side up (a directional landing posture). The physical explanation is as follows: the ventral side casts a shadow upon contact with the plane (the first center of gravity is located below the ventral side), while the dorsal side generates a high-intensity scattered light at the smooth surface or where there is residue on the surface (the second center of gravity is located above the dorsal side). In this case, the system identifies the contour segment on the side where the first center of gravity is located as the ventral side contour segment.
[0031] If the two centers of gravity are located on the same side of the major axis or cannot be clearly separated, it is determined to be a non-directional landing posture. In this case, the grain may be lying on its side or upside down. In the initial image, the groin side is not covered, and most of the information is already visible. Therefore, the invisibility level of this grain is determined to be zero.
[0032] For rice grains with directional implantation, the invisibility level is directly related to the degree to which the groin side is covered by shadow. The system calculates the proportion of the projected length of the contact shadow area on the groin side contour segment (i.e., the coverage area of the shadow area projected along the normal or vertical direction of the groin side contour) to the entire length of the groin side contour segment. The higher this proportion, the deeper the groin side is, the more closely it fits the plane, and the less the groin side area is visible in the initial image, thus resulting in a higher invisibility level.
[0033] The accurate acquisition of the first and second centroid positions mentioned above depends on the decomposition of shadow information under multi-light conditions. Specifically: Under two different lighting angles (low-angle light and high-angle light), the boundary position and internal gray-scale distribution of the same shadow area are extracted respectively.
[0034] Displacement of the shadow boundary: When the illumination angle changes, the boundary of a true shadow created by geometric occlusion (i.e., the solid structure on the side of the rice grain's ventral groove pressing against the plane) will shift significantly with the direction of the light source; while the boundary of a false shadow created by abnormal surface reflectivity (such as that caused by residual rice husks or wax) will hardly move with the direction of the light source. The system separates the geometric occlusion component by calculating the positional offset of the same shadow boundary at two illumination angles. This component essentially reflects the true physical contact depth between the bottom surface of the ventral groove and the detection plane.
[0035] The correlation between grayscale distribution within shadows and illumination direction: Grayscale within shadows formed by geometric occlusion exhibits a regular overall change in brightness with varying illumination angles; however, in areas with reflectivity anomalies, the correlation between grayscale distribution and illumination direction is weaker. The system extracts the surface reflectance component by analyzing the sensitivity of the average grayscale of the shadow area to changes in illumination angle. This component reflects localized reflectivity anomalies caused by residual chaff or wax.
[0036] Finally, the first centroid of the contact shadow region is determined based on the spatial distribution of the geometric occlusion component (because it truly indicates the physical contact point between the rice grain and the plane), and the second centroid of the extreme scattered light intensity region is determined based on the spatial distribution of the surface reflection component (because it indicates the location of surface material anomalies). This separation ensures that the true contact centroid and the true extreme scattered light intensity centroid can still be accurately located even when structural shadows and material contamination exist simultaneously on the rice grain surface.
[0037] It should be noted that after obtaining the invisibility level of each rice grain, this level is compared with a preset level threshold. This threshold is a calibrable parameter, typically set between 0 and 1, where 0 indicates that the information on the groove side of the rice grain is completely visible, and 1 indicates that it is completely invisible. The value of the threshold directly determines the system's sensitivity to rice grains to be flipped. For example, when the production line requires a groove side defect detection rate of over 98%, the preset level threshold can be set to 0.3. At this time, any rice grain with an invisibility level higher than 0.3 (i.e., more than 30% of the information on the groove side is obscured) is identified as a rice grain to be flipped, and the system will perform a flipping operation to obtain a complete groove side image. This high-precision mode is suitable for online quality judgment in the processing of high-quality rice. In another scenario, if the production line operates at a high speed, it's necessary to minimize flipping actions to maintain the cycle time. In this case, the threshold can be set to 0.7. Only rice grains with an visibility level exceeding 0.7 (i.e., more than 70% occlusion on the groove side) are flipped. Other rice grains, even those with slight occlusion, are considered visible and the initial image is used directly. This high-speed mode is suitable for large-scale brown rice processing where efficiency is paramount and a small loss of groove information is acceptable. In practical applications, this threshold can be determined through standard sample calibration or adaptive adjustment. For example, using a batch of rice samples with known groove defect distributions, the optimal threshold can be selected by comparing the system's judgment results with the actual human values and then using ROC curves.
[0038] For grains whose invisibility level does not exceed a preset threshold, they are marked as visible detection grains. This means that the initial image already contains enough information for defect identification, and no further flipping is required. The corresponding third image region is directly segmented from the initial image for defect feature extraction. For grains whose invisibility level exceeds a preset threshold, they are marked as grains to be flipped. After the initial image acquisition is completed, the flipping mechanism above the detection plane (usually a transparent glass plate or conveyor belt) is activated. This mechanism can use a gentle rotating brush roller or a directional airflow nozzle.
[0039] Based on the coordinates of each grain of rice to be flipped in the initial image, the flipping mechanism applies mechanical or airflow action to the local area where the grain is located, causing it to tumble on the plane, thus flipping the previously downward-facing, obscured ventral side to the top. To improve efficiency, in practice, multiple grains of rice to be flipped are often flipped simultaneously within the same local area. After flipping, the system immediately acquires a second image of the corresponding area, called the first image area. This area contains a clear view of the grain of rice with its ventral side facing upward after flipping. Through image registration technology, the system can accurately establish the correspondence between the same grain of rice before and after flipping, ensuring that the back image (from the second image area segmented from the initial image) of each subsequent grain of rice to be flipped corresponds to the ventral side image (from the first image area).
[0040] For those rice grains already marked as visible detection grains, no further flipping is performed, avoiding unnecessary mechanical intervention and preventing potential damage from excessive rolling. At this point, all rice grains are divided into two complementary sets: visible detection grains utilize the initial image information directly, while grains awaiting flipping are supplemented by acquiring images of the ventral side after flipping to compensate for the information loss from the initial viewpoint.
[0041] Furthermore, based on the contact shadow geometry parameters of the rice grain, the first centroid position of the contact shadow region of the rice grain is determined, and based on the surface scattered light distribution parameters of the rice grain, the second centroid position of the extreme scattered light intensity region of the rice grain is determined, including: Under at least two different lighting angles, for each grain of rice, extract the position of the shadow boundary and the gray-scale distribution inside the shadow of the contact shadow area of that grain of rice at each lighting angle; Based on the displacement of the shadow boundary position under each illumination angle, the geometric occlusion component is determined. The geometric occlusion component represents the depth information of the contact shadow area of the rice grain formed by the physical contact between the ventral groove side and the detection plane. Based on the correlation between the gray distribution inside the shadow and the direction of illumination at each illumination angle, the surface reflection component is determined. The surface reflection component characterizes the abnormal reflectivity information of the contact shadow area of the rice grain caused by local residual chaff or wax. The first centroid position of the contact shadow region of the rice grain is determined based on the geometric occlusion component, and the second centroid position of the extreme region of scattered light intensity of the rice grain is determined based on the surface reflection component.
[0042] In one specific implementation, such as Figure 3 As shown, images of rice grain samples under at least two different illumination angles were acquired and fused to obtain an initial image. Based on the initial image, the two-dimensional projected contour of a single rice grain was extracted, and the contour morphology parameters, contact shadow geometry parameters, and surface scattered light distribution parameters of each rice grain were measured.
[0043] For each grain of rice, the major axis direction is determined based on its contour morphology parameters, and the contour is divided into a first side contour segment and a second side contour segment along the major axis direction. The first centroid position A of the contact shadow region is determined based on the contact shadow geometry parameters, and the second centroid position B of the extreme scattered light region is determined based on the surface scattered light distribution parameters. It is then determined whether the first centroid position A and the second centroid position B are located on opposite sides of the major axis. If so, the grain of rice is determined to be in an oriented landing posture (groin facing down), and the proportion of the projection length of the contact shadow region on the groin side contour segment to the length of the groin side contour segment is calculated. This proportion is directly determined as the invisibility level of the grain of rice. If centroid A and centroid B are not located on opposite sides of the major axis, the grain of rice is determined to be in a non-oriented landing posture, and its invisibility level is set to zero.
[0044] The invisibility level of each grain of rice is compared with a preset threshold. If the invisibility level is greater than the preset threshold, the grain of rice is marked as a grain to be flipped, and a flipping operation is performed on the grain of rice, and the first image region after flipping is captured. If the invisibility level does not exceed the preset threshold, the grain of rice is marked as a visible detection grain of rice, and the corresponding region in the initial image is directly used for subsequent defect feature extraction.
[0045] Furthermore, S4 includes: For each grain of rice to be turned over, multiple back-side sampling points are selected in the second image region along the long axis of the grain of rice to be turned over. The local curvature at each back-side sampling point is calculated based on the rate of change of the slope of the contour tangent at each back-side sampling point. The radius of curvature of the convex surface on the back side of the rice grain to be turned is fitted based on the local curvature at multiple back-side sampling points; Based on the pre-calibrated dorsal-ventral geometric correlation function, the theoretical depth of the ventral groove of the rice grain to be turned is calculated according to the radius of curvature. The dorsal-ventral geometric correlation function characterizes the mapping relationship between the dorsal radius of curvature and the ventral groove depth of the same variety of rice grain.
[0046] Furthermore, S4 also includes: For each grain of rice to be turned over, extract the left and right wall edge lines of the groove in the abdomen of that grain of rice in the first image area; Calculate the angle between the left and right side wall edge lines at the opening of the groin. The angle and the theoretical depth of the groin are jointly determined, including: When the included angle is less than the first preset included angle threshold and the theoretical depth of the ventral groove is greater than the first preset depth threshold, the ventral groove cross-section type of the rice grain to be turned is determined to be deep V-shaped. When the included angle is greater than the second preset included angle threshold and the theoretical depth of the ventral groove is less than the second preset depth threshold, the ventral groove cross-section type of the rice grain to be turned is determined to be shallow U-shaped. When the included angle is greater than or equal to the first preset included angle threshold and less than or equal to the second preset included angle threshold, and the theoretical depth of the ventral groove is greater than or equal to the second preset depth threshold and less than or equal to the first preset depth threshold, the ventral groove cross-section type of the rice grain to be turned is determined to be trapezoidal transition type.
[0047] Furthermore, S4 also includes: For each grain of rice to be turned over, a parameterized mapping matrix from the image plane to the unfolded plane is constructed based on the determined type of the abdominal groove cross-section. Using a parameterized mapping matrix, the pixel coordinates of each grain in the groove region of the rice grain to be turned over in the first image region are mapped to the unfolding plane to obtain the unfolded groove image. Identify pixel-missing areas in the unfolded abdominal groove image caused by self-occlusion at the bottom of the abdominal groove; For each missing location in the pixel missing region, the theoretical depth ratio of the missing location on the ventral groove cross section is determined according to the geometric structure corresponding to the determined ventral groove cross section type. Based on the theoretical depth ratio, the sidewall reference pixels at the same theoretical depth are determined among the visible pixels of the ventral groove sidewall on the left and right sides of the edge line. The brightness values of the sidewall reference pixels are extracted, and the brightness values are weighted and fused according to the theoretical depth ratio to obtain the compensation pixel values for the missing positions. Based on the unfolded ventral groove image and the compensated pixel values, the defect features of the rice grain to be turned over are extracted to form a defect record of the turned rice grain.
[0048] In one specific implementation, such as Figure 4 As shown, for each grain of rice to be turned over, the dorsal image region (second image region) is segmented from the initial image. Multiple dorsal sampling points are selected along the long axis of the grain, and the local curvature at each point is calculated. The radius of curvature R_b of the dorsal convex surface is then fitted. Then, the pre-calibrated dorsal-ventral geometric correlation function is called to calculate the theoretical depth D_t of the ventral groove of the grain of rice based on R_b.
[0049] Simultaneously, the first image region (with the groin side facing upward) acquired after flipping is segmented into the groin region, the left and right wall edge lines of the groin groove are extracted, and the tangent angle θ between the left and right wall edge lines at the opening of the groin is calculated.
[0050] The opening angle θ and the theoretical depth D_t of the groin are jointly determined to determine the groin cross-section type. The specific rules are as follows: if θ is very small (less than the first preset angle threshold) and D_t is very large (greater than the first preset depth threshold), it is determined to be a deep V-shape; if θ is very large (greater than the second preset angle threshold) and D_t is very small (less than the second preset depth threshold), it is determined to be a shallow U-shape; otherwise, it is determined to be a trapezoidal transition type.
[0051] Based on the determined cross-sectional type, different mapping strategies are used to unfold the abdominal groove region from the image plane to the unfolded plane: deep V-shaped: logarithmic polar coordinate mapping; shallow U-shaped: cylindrical projection mapping; trapezoidal transition type: a combination of affine stretching and logarithmic compression mapping.
[0052] After obtaining the unfolded groin image through mapping, the pixel-missing regions caused by self-occlusion at the bottom of the groin are identified. For each missing location, the theoretical depth ratio of that location on the groin cross-section is determined based on the geometry corresponding to the groin cross-section type. Using the same depth ratio p, corresponding sidewall reference pixels are interpolated and located on the left and right sidewall edges, and the brightness values of these two reference pixels are extracted. Then, the brightness values of the two reference pixels are fused using a weighted method based on the inverse of the horizontal distance. That is, the weighted average is calculated using the inverse of the horizontal distance between the missing location and the left and right sidewall reference pixels in the unfolded plane as the weight, and this average is used as the compensation pixel value for the missing location.
[0053] Based on the unfolded ventral groove image and the compensated pixel values, the defect features of the ventral groove side of the rice grain to be turned are extracted, forming a defect record of the turned rice grain and outputting it.
[0054] In processing each grain of rice to be turned over, a second image region with the back side facing upwards is first segmented from the initial image, and an image with the ventral groove facing upwards is obtained from the first image region acquired after turning over. Based on these two images, the following steps are performed sequentially: back curvature sampling and ventral groove theoretical depth inference, joint determination of ventral groove cross-section type, ventral groove region perspective unfolding and depth weighted compensation, ultimately forming a record of defects in the turned-over rice grain.
[0055] The image spatial resolution k (unit: pixels / mm) is pre-calibrated. This resolution is determined by placing a standard ruler within the field of view and is used as a constant throughout the detection process.
[0056] An adaptive curvature-based encryption strategy is employed along the long axis of the rice grain: Initial sampling points are selected at equal intervals along the long axis, and the local curvature at each point is calculated. Specifically, for each sampling point, a local tangent is constructed using its adjacent contour points. The difference in the direction angle between the two tangents (in radians) and the contour arc length between the sampling point and its adjacent point (in pixels) are recorded. The local curvature at the sampling point is obtained by dividing the two by 1 / pixel. If the difference in local curvature between two adjacent sampling points exceeds a set threshold, a new sampling point is interpolated between these two points, and the calculation is repeated until the difference in curvature between all adjacent sampling points does not exceed the threshold. The local curvature radius at each sampling point is taken as the reciprocal of the local curvature at that point, in pixels. The arithmetic mean of the local curvature radii of all sampling points is then used to obtain the curvature radius of the dorsal convex surface of the rice grain. (Unit: pixels).
[0057] Subsequently, using a pre-calibrated dorsal-ventral geometric correlation function, Converted to theoretical depth of the groin (Unit: pixels). The calibration method for this function is as follows: Select representative rice grain samples of the same variety and the same processing stage, and measure the image of each sample using the above-mentioned image method. The actual depth of the groin (unit: mm) is then physically measured using microscopic sectioning or 3D scanning, and the physical depth is multiplied by the resolution k to convert it to pixel units. A linear regression is then performed between the radius of curvature per pixel unit and the physical depth per pixel unit to obtain the following relationship:
[0058] in, The slope is dimensionless. This is the intercept (in pixels). This function is only applicable to the variety and processing stage used during calibration; when changing the variety, samples must be collected again and the above calibration steps must be repeated.
[0059] In the first image region after flipping, the abdominal groove region is first segmented, and then the edge lines of the left and right walls are extracted using a boundary tracking algorithm. At the opening of the abdominal groove, the tangent direction vectors of the edge lines of the two walls are calculated respectively, and the included angle θ (unit: degrees) is obtained by using the formula for the included angle between the two tangent direction vectors.
[0060] Four preset thresholds are defined: a first preset included angle threshold θ1, a second preset included angle threshold θ2, a first preset depth threshold D1, and a second preset depth threshold D2. The units for the first and second preset included angle thresholds are degrees, while the units for the first and second preset depth thresholds are pixels (derived by multiplying the physical depth threshold by the resolution k).
[0061] The specific values of each threshold need to be determined according to the variety and processing precision requirements. For example, the first preset included angle threshold θ1 can be 35° (applicable to conventional milling of japonica rice) or 40° (applicable to conventional milling of indica rice); the second preset included angle threshold θ2 can be 65° (applicable to conventional milling of japonica rice) or 70° (applicable to conventional milling of indica rice). The first preset depth threshold D1 can be k. 0.6mm (suitable for conventional grinding intensity) or k 0.5mm (suitable for light grinding intensity); the second preset depth threshold D2 can be taken as k. 0.2mm (suitable for conventional grinding intensity) or k 0.15mm (applicable to light grinding intensity). The above thresholds are determined based on the statistical distribution of standard samples, taking the median of the boundaries of each type of sample.
[0062] The complete process of joint determination is as follows: simultaneously compare θ with θ1, θ2, and... With D1 and D2. If θ is less than the first preset included angle threshold and If the depth is greater than the first preset depth threshold, it is determined to be a deep V-shape; otherwise, if θ is greater than the second preset included angle threshold and If the depth is less than the second preset threshold, it is judged as a shallow U-shape; otherwise, it is judged as a trapezoidal transition shape. The physical reason for the deep V-shape is that strong grinding sharpens the material at the bottom of the groove, forming a narrow and deep slit; the physical reason for the shallow U-shape is that light grinding or the original groove is shallow, retaining a wide and round shape.
[0063] Based on the determined cross-sectional type, a parametric mapping is constructed to map the pixel coordinates of the abdominal groove in the first image region to the unfolding plane. The unfolding plane is defined with the horizontal axis as the coordinates (in pixels) along the long axis of the grain and the vertical axis as the unfolding coordinates (in pixels) along the depth direction of the abdominal groove cross-section.
[0064] For deep V-shaped groins, a logarithmic polar coordinate transformation is used: with the midline of the groin bottom as the polar axis, the vertical distance from the current pixel position to the polar axis is h (unit: pixels, value range 0 to h). The width of the ventral groove opening is L (in pixels), and the reference depth is H0 (in pixels, taken as resolution k multiplied by 0.1 mm). The mapping formula is:
[0065] In this formula, the unit of the expanded coordinate v is pixels. For shallow U-shaped inverted ... (Unit: pixels), calculate the equivalent cylinder radius (Unit: pixels). This radius is determined by the geometric relationship between the opening width and depth, satisfying the constraint that the two ends of the opening and the deepest point at the bottom are concyclic. That is, the numerator is the sum of the square of half the opening width and the square of the theoretical depth of the ventral groove, and the denominator is twice the theoretical depth of the ventral groove. The mapping formula is:
[0066] Where h is the vertical distance from the current pixel position to the midline of the bottom of the groin (unit: pixels, value range: 0 to 1). When h equals 0, arccosine 1 equals 0, v equals 0, corresponding to the bottom of the groin; when h equals When, v equals Multiply by the inverse cosine (1 minus) Divide by This value is exactly equal to the arc length from the bottom to the opening, which is geometrically consistent.
[0067] For the trapezoidal transition type, a combined mapping of affine stretching and logarithmic compression is adopted: the vertical distance h (unit: pixels) from the current pixel position to the midline of the bottom of the ventral groove is used as the independent variable, and the expanded coordinates v (unit: pixels) are obtained by superimposing linear and nonlinear logarithmic terms. The coefficients of the linear terms are dimensionless, while the coefficients and internal scale parameters of the logarithmic terms are in pixels, ensuring that the sum of the two terms is in pixels. Each coefficient is determined by nonlinear least-squares fitting of the ideal expanded coordinates of the trapezoidal cross-section of the rice grain, with the opening width, bottom width, and depth as fitting constraints.
[0068] After obtaining the unfolded image of the abdominal groove through the above mapping, the system performs occlusion analysis based on the theoretical cross-sectional geometry: since the bottom of the abdominal groove is self-occluded by the two side walls, there must be pixel missing regions in the unfolded image. The method for identifying missing regions is as follows: on each fixed horizontal axis column, scan along the vertical axis direction. If there are consecutive positions where the pixel coordinates cannot obtain effective grayscale values from the original image through the above mapping formula, then these positions constitute the pixel missing regions of that column.
[0069] For any missing location within the missing region, its theoretical depth ratio p is defined as the vertical distance h (in pixels) from that location to the midline of the groin bottom, multiplied by the theoretical groin depth. The ratio (unit: pixels). Since both the numerator and denominator are in pixels, p is a dimensionless quantity. p = 0 corresponds to the bottom of the ventral groove, and p = 1 corresponds to the opening of the ventral groove. This ratio determines the relative depth of the missing location on the cross-section of the ventral groove.
[0070] On both the left and right sidewall edge lines, reference pixels for the sidewalls are determined according to the same theoretical depth ratio p. Specifically, on each edge line, each pixel has a known vertical depth coordinate (this coordinate is the vertical distance from the pixel to the midline of the ventral groove bottom, in pixels). Linear interpolation is performed according to the theoretical depth ratio p to find a vertical depth that is exactly equal to p multiplied by... The point is the sidewall reference pixel on the edge line. Extract the brightness values of these two sidewall reference pixels.
[0071] Then, a weighted fusion method based on the reciprocal of the horizontal distance is used to compensate for the missing positions. Specifically, in the unfolded plane, the missing position has explicit unfolded coordinates with both the left and right wall reference pixels. The absolute value of the coordinate difference between the missing position and the left wall reference pixel in the horizontal axis direction is calculated as the first horizontal distance, and the absolute value of the coordinate difference between the missing position and the right wall reference pixel in the horizontal axis direction is calculated as the second horizontal distance. Using the reciprocals of the two horizontal distances as weights, the brightness values of the two wall reference pixels are weighted and averaged to obtain the compensated brightness value. In this weighted fusion process, the horizontal distance is in pixels, and its reciprocal is in units of 1 / pixel. Multiplying this by the gray level yields gray level / pixel, which is then summed and divided by the sum of the reciprocals of the distances (in units of 1 / pixel). The final result is in units of gray level.
[0072] This compensation method is based entirely on the geometric model of the ventral groove cross-section and the true pixel brightness at the same theoretical depth on both side walls, rather than neighborhood color interpolation, thus avoiding the introduction of pseudo-defect patterns. After compensation, the system extracts defect features from the unfolded and compensated ventral groove image to form a record of the turned-over rice grain defect.
[0073] In S5, for visible rice grains whose invisibility level does not exceed the preset level threshold, there is no need to perform a flipping operation. Instead, the defect features are directly extracted based on the third image region corresponding to the rice grain in the initial image to form a visible rice grain defect record.
[0074] Based on the landing posture identified in S2, the visible surface type of the rice grain in the initial image is determined. Since the invisibility level of this rice grain is zero, its ventral groove side is sufficiently visible in the initial image; therefore, the third image region is the complete two-dimensional projection region of this rice grain in the initial image. Based on the single rice grain contour extracted in S1, the third image region corresponding to this rice grain is segmented from the initial image. This region contains all visible surface information of the rice grain in its initial posture.
[0075] Based on the landing posture determined in S2, the visible surface type of the visible rice grain is determined: when the rice grain is determined to be in a non-directional landing posture with its back side facing down, its ventral groove side is exposed upwards in the initial image, and the third image region mainly shows the ventral groove side features. At this time, the third image region is divided into multiple ventral groove partitions along the long axis, including the left wall region, bottom region, right wall region, and embryo end region, and process-sensitive defect indicators of the ventral groove side are extracted in each partition.
[0076] When a grain of rice is determined to be in a sideways posture or other random tumbling posture, both its ventral and dorsal sides are partially exposed in the initial image, and the third image region exhibits mixed perspective characteristics. At this point, based on the major axis direction and contour segmentation results identified in S2, the system divides the third image region into a ventral exposed area and a dorsal exposed area, extracting process-sensitive defect indicators from the corresponding surfaces of each exposed area. For locally compressed areas caused by perspective tilt, the system performs perspective correction based on contour geometry, restoring the scale of the compressed area pixels according to the cosine of the perspective tilt angle, ensuring that the scale of the defect features is consistent with the frontal view observation.
[0077] In the third image region, process-sensitive defect indicators are extracted for each partition or exposed area. For the exposed area on the ventral side, indicators such as residual bran coverage, under-rolling degree of the groove, length of ventral microcracks, and residual area of the embryo seat are extracted; for the exposed area on the dorsal side, indicators such as polishing degree, scratch density, and gloss uniformity are extracted.
[0078] The process-sensitive defect indicators extracted from each partition are summarized according to the partition weights to form a defect feature set for the visible detection of a rice grain. The partition weights are determined based on the proportion of the visible area of each partition in the third image region. Partitions with a larger visible area proportion are given higher weights, while partitions with a smaller visible area proportion or insufficient information due to viewing angle compression are given lower weights or marked as missing information.
[0079] The defect feature set of the visible rice grain is associated with the rice grain identifier to form a visible rice grain defect record. This record includes the defect type distribution of the rice grain, the severity score of each defect, the visible surface type identifier, and the completeness mark of the zoning information. For records where some areas are missing information due to viewing angle limitations, the type of missing area is noted in the information completeness mark to facilitate differential processing during sample-level statistical analysis.
[0080] It is evident that the core difference between rice grain defect records and flipped rice grain defect records lies in the completeness of the information source. Flipped rice grain defect records are based on the registration and fusion of the initial dorsal image and the ventral groove image after flipping, containing complete defect features of both sides of a single rice grain; while rice grain defect records are based only on single-view information in the initial image, and their ventral groove or dorsal side information depends on the initial landing posture of the rice grain.
[0081] In sample-level quality assessment, visible rice grain defect records are used to supplement the sample size of flipped rice grain defect records, improving the stability of defect type statistics. For visible rice grain defect records containing only single-view information, their weight in process attribution analysis is lower than that of flipped rice grain defect records, but they are treated equally with flipped rice grain defect records in the calculation of basic quality indicators such as head rice rate and broken rice rate.
[0082] Further, S6, based on the records of defects in the turned-over rice grains and the records of defects in the visible rice grains, determine the rice refining quality assessment results and process feedback information, including: For each grain of rice to be turned over, the defect features on the back side of the grain of rice to be turned over are extracted based on the second image region, and the back side of the grain of rice to be turned over is divided into multiple back side partitions along the long axis. Based on the unfolded ventral groove image and the compensated pixel value, the defect features of the ventral groove side of the rice grain to be turned are extracted, and the ventral groove side of the rice grain to be turned is divided into multiple ventral groove partitions. Process-sensitive defect indicators were extracted from each dorsal and ventral groove region to form a dorsal-ventral defect feature vector for the rice grain to be turned over. For each rice grain to be turned over, defect features on the dorsal side of the grain are extracted based on the second image region, and the dorsal side is divided into three regions along its long axis: the germ tip region, the middle section region, and the embryonic end region. The division is based on the geometric proportions along the long axis of the rice grain. The germ tip region is located at the end where the germ is located, accounting for approximately 15% to 20% of the total length of the dorsal side; the middle section region is located in the main body of the rice grain, accounting for approximately 60% to 70% of the total length of the dorsal side; and the embryonic end region is located at the end where the embryonic base is located, accounting for approximately 15% to 20% of the total length of the dorsal side. The boundary positions of each region are determined by proportional segmentation along the long axis.
[0083] Based on the unfolded ventral groove image and compensated pixel values, defect features of the rice grain's ventral groove side were extracted, and the ventral groove side was divided into four ventral groove regions: left wall region, bottom region, right wall region, and embryo end region. The left wall region and right wall region are the inclined wall areas on both sides of the ventral groove, the bottom region is the bottom region of the deepest part of the ventral groove, and the embryo end region is the end region where the ventral groove connects to the embryo. The geometric definition of each region is determined based on the depth coordinates and coordinates along the long axis in the unfolded ventral groove image: the left wall region and right wall region correspond to the wall areas on both sides with depth coordinates from 0 to 70% of the theoretical depth of the ventral groove, the bottom region corresponds to the bottom region with depth coordinates from 70% to 100% of the theoretical depth of the ventral groove, and the embryo end region corresponds to a specific interval at the end where the embryo is located along the long axis.
[0084] Process-sensitive defect indices were extracted for each dorsal and ventral groove region. The process-sensitive defect indices for the dorsal region included: polishability, quantified as the ratio of the mean grayscale value of the region's image to the mean grayscale value of a standard polishing reference; a ratio closer to 1 indicates a polishability closer to the standard state; scratch density, quantified as the number of linear defects per unit area in the region whose length exceeds a preset length threshold (which can be 3 or 5 pixels); and gloss uniformity, quantified as the standard deviation of the region's grayscale values; a smaller standard deviation indicates a more uniform gloss distribution.
[0085] The process-sensitive defect indicators for the abdominal groove zone include: residual bran coverage, quantified as the proportion of pixel area in the zone with a gray value lower than a preset residual bran gray value threshold to the total area of the zone. The preset residual bran gray value threshold can be gray level 60 or gray level 80; microcrack ratio, quantified as the proportion of the total area of crack-like connected regions in the zone to the total area of the zone. Cracks are determined based on connected regions with a length-to-width ratio greater than a preset aspect ratio threshold and a width less than a preset width threshold. The preset aspect ratio threshold can be 5 or 10, and the preset width threshold can be 2 or 3 pixels; under-rolling degree, quantified as the proportion of the area in the zone where the groove depth is less than 80% of the theoretical depth to the total area of the bottom zone.
[0086] The process-sensitive defect indices extracted from each of the above partitions are summarized separately according to the dorsal side indices and the ventral groove side indices, forming a dorsal-ventral defect feature vector for the rice grain to be turned. The dimension of this vector is the sum of the three dorsal side partitions multiplied by three indices plus the four ventral groove partitions multiplied by three indices, for a total of 21 components. The order of the components in the vector is: dorsal side first, then ventral groove side, with each side arranged in partition order, and each partition arranged in index order.
[0087] The back-side comprehensive quality index is calculated based on the back-side process-sensitive defect index in the back-side defect feature vector of all rice grains to be turned, and the ventral groove comprehensive quality index is calculated based on the ventral groove process-sensitive defect index in the back-side defect feature vector of all rice grains to be turned. The difference between the back-side comprehensive quality index and the ventral groove comprehensive quality index is calculated as the back-side comprehensive quality difference index. The comprehensive quality index of the back side and the comprehensive quality index of the ventral groove side are calculated based on the back-ventral defect feature vectors of all rice grains to be turned. The comprehensive quality index of the back side is the weighted average of the process-sensitive defect indicators of the back side of each rice grain to be turned after the defect severity score. Specifically, for the polishing index, when the ratio is greater than 1.2, it is rated as severely overpolished, with a score of -10; when the ratio is between 0.8 and 1.2, it is rated as normal, with a score of 0; when the ratio is less than 0.8, it is rated as underpolished, with a score of -5. For the scratch density index, when the number of scratches per unit area is greater than the preset scratch density threshold, it is rated as severely damaged, with a score of -15. The preset scratch density threshold can be 5 scratches per 100 square pixels or 10 scratches per 100 square pixels; when the number is between half of the preset scratch density threshold and the threshold, it is rated as slightly damaged, with a score of -5. For the gloss uniformity index, when the standard deviation is greater than the preset uniformity threshold, it is rated as gloss unevenness and the score is -5 points. The preset uniformity threshold can be gray level 15 or gray level 20.
[0088] The scores for each zone are weighted and averaged according to the zone area to obtain the single-grain backside quality score. The arithmetic mean of the backside quality scores of all rice grains to be turned is taken to obtain the overall backside quality index. A value of 0 indicates that the backside quality is fully up to standard, a negative value indicates that there is a defect, and the larger the absolute value of the negative value, the more serious the defect.
[0089] The calculation method for the comprehensive quality index on the ventral side is similar to that on the dorsal side, but the scoring criteria are different. For the residual chaff coverage rate, a coverage rate greater than the preset residual chaff coverage threshold is rated as severe residue, with a score of -20. The preset residual chaff coverage threshold can be 15% or 25%. A coverage rate between half and the preset residual chaff coverage threshold is rated as slight residue, with a score of -10. For the microcrack percentage, a percentage greater than the preset microcrack percentage threshold is rated as severe cracking, with a score of -25. The preset crack percentage threshold can be 5% or 10%. For the under-tillage degree, a degree greater than the preset under-tillage threshold is rated as severe under-tillage, with a score of -15. The preset under-tillage threshold can be 20% or 30%.
[0090] The scores for each groove zone are weighted and averaged according to the zone area to obtain the individual groove side quality score. The arithmetic mean of the groove side quality scores of all rice grains to be turned is taken to obtain the comprehensive groove side quality index.
[0091] The difference between the comprehensive quality index of the back side and the comprehensive quality index of the ventral groove side is calculated as the back-ventral comprehensive quality difference index. The physical meaning of this index is to quantify the degree of asymmetry in the process effects on the back side and the ventral groove side of the same batch of rice grains to be turned under the same milling conditions. When the index is 0, it indicates that the quality levels of both sides are comparable, and the process effects are symmetrical; when the index is positive, it indicates that the quality of the back side is better than that of the ventral groove side, and there are systematic defects on the ventral groove side; when the index is negative, it indicates that the quality of the ventral groove side is better than that of the back side, and there are systematic defects on the back side.
[0092] This index must be calculated based on the rice grains to be turned over because only rice grains to be turned over have both an initial image of the dorsal side and an image of the ventral side when turned over. The information sources from both sides are complete and consistent, making the statistical results comparable. It is evident that the detected rice grains only contain information from a single perspective. If this information is included in the index calculation, it will introduce information bias due to differences in perspective rather than process differences, thus compromising the index's accurate representation of process asymmetry.
[0093] Based on the back-ventral comprehensive quality difference index and the dominant defect types on the back and ventral groove sides of the rice grains to be turned, the back-ventral defect coupling mode is identified. Based on the matching results between the back-to-ventral defect coupling mode and the pre-stored process deviation mapping table, process feedback information is determined.
[0094] Furthermore, the dorsal-ventral defect coupling modes include: In the first coupling mode, the polishing degree of the back side of the rice grain to be turned is higher than the preset polishing degree threshold and the residual bran coverage rate on the ventral groove side is higher than the preset residual bran coverage threshold. The first coupling mode corresponds to the process deviation of large gap between the milling rollers. The preset polishing threshold is the boundary value for judging severe over-polishing in the back-side polishing index, such as 1.2 or 1.15, and is an adjustable parameter. In the second coupling mode, the back-side scratch density of the rice grains to be turned exceeds the preset scratch density threshold, and the proportion of microcracks on the ventral groove side exceeds the preset microcrack proportion threshold. This second coupling mode corresponds to a process deviation of excessively high milling chamber rotation speed. In the third coupling mode, the comprehensive quality index of the back side of the rice grain to be turned is in the preset qualified range and the under-rolling degree of the bottom of the ventral groove is higher than the preset under-rolling threshold. The third coupling mode corresponds to the process deviation of insufficient grinding time or low tumbling frequency. The preset acceptable range is the acceptable range of the backside comprehensive quality index, such as between -5 points and 0 points, or between 0 points and a certain positive value.
[0095] In the fourth coupling mode, the difference between the comprehensive quality index of the back side and the comprehensive quality index of the ventral groove side of the rice grain to be turned is less than a preset difference threshold. The fourth coupling mode corresponds to a symmetrical state of process action.
[0096] Based on the back-to-belly comprehensive quality difference index and the dominant defect types on the back and belly groove sides of the rice grains to be turned, the back-to-belly defect coupling mode is identified. The method for determining the dominant defect type is as follows: for each rice grain to be turned, the absolute values of the scores of the three process-sensitive defect indicators on the back side are compared, and the indicator with the largest absolute value (i.e., the most severe defect) is taken as the dominant defect type on the back side of that rice grain; similarly, the three indicators on the belly groove side are compared, and the indicator with the largest absolute value is taken as the dominant defect type on the belly groove side.
[0097] The dorsal-ventral defect coupling modes include the following four types: The first coupling mode is characterized by severe over-polishing of the back side and excessive residual bran coverage on the ventral groove side. The physical cause of this mode is the excessively large gap between the milling rollers: when the milling rollers come into contact with the rice grains, the convex back side preferentially contacts the milling roller surface and is fully ground or even over-polished; while the concave ventral groove cannot effectively contact the milling roller due to the excessively large gap, resulting in residual bran not being removed from the ventral groove, forming an asymmetrical phenomenon of excessive polishing of the back side and high residual bran in the ventral groove.
[0098] The second coupling mode is characterized by severely excessive scratch density on the back side and a severely excessive proportion of microcracks on the ventral groove side. The physical cause of this mode is the excessively high rotation speed in the whitening chamber: at high speeds, rice grains are subjected to violent tumbling and impacts within the whitening chamber, resulting in high-frequency mechanical friction between the back side and the milling roller or rice sieve, generating numerous scratches; simultaneously, the high-frequency impact force is transmitted along the thickness direction of the rice grain to the ventral groove side, inducing compressive microcracks in the stress concentration area of the ventral groove, forming a coupling characteristic where both sides are mechanically damaged but exhibit different forms.
[0099] The third coupling mode is characterized by a normal overall quality on the back side and severe under-grinding at the bottom of the abdominal groove. The physical cause of this mode is insufficient grinding time or low tumbling frequency: the back side has reached the polishing standard within a limited time, but the bottom of the abdominal groove is not fully exposed to the grinding surface due to insufficient tumbling of rice grains, resulting in the original groove shape being retained at the bottom of the abdominal groove, forming an asymmetric phenomenon where the back side is qualified but the abdominal groove is under-grinded.
[0100] The fourth coupling mode is defined as follows: the difference between the comprehensive quality index of the back side and the comprehensive quality index of the ventral groove side is less than a preset difference threshold, and the dominant defect types on both sides are the same or both are within the normal range. This mode indicates that the process is symmetrical, and the grinding energy is evenly distributed on both sides of the rice grain, representing an ideal processing state. The preset difference threshold can be set to 5 or 10 points; when the actual difference index is less than this threshold, it is determined to be a symmetrical process state.
[0101] The calibration method for each preset threshold is as follows: based on at least 100 known qualified samples and 100 known defective samples produced under standard process conditions, extract their dorsal-ventral defect feature vectors and calculate the comprehensive quality index, statistically analyze the distribution boundaries of each coupling mode in qualified and defective samples, and take the median of the boundaries as the preset threshold.
[0102] Furthermore, when determining the process feedback information based on the matching results between the back-to-belly defect coupling mode and the pre-stored process deviation mapping table, the process feedback confidence level is calculated. The process feedback confidence level is the proportion of the number of rice grains to be turned that conform to the back-to-belly defect coupling mode to the total number of rice grains to be turned. When the confidence level of the process feedback is lower than the preset lower limit, the process feedback information will be determined as a prompt to maintain the current process parameters and increase the cumulative number of tests; When the confidence level of the process feedback is higher than or equal to the preset lower limit, the specific process parameter adjustment amount is output according to the pre-stored process deviation mapping table.
[0103] The identified back-to-back defect coupling patterns are matched with a pre-stored process deviation mapping table to determine process feedback information. The pre-stored process deviation mapping table is a discrete table of pattern parameter correspondences. Each record in the table includes a coupling pattern identifier, the direction of process parameter adjustment, the adjustment amount, and applicable conditions. For example, the first coupling pattern corresponds to a reduction in the roller gap from 0.05mm to 0.1mm; the second coupling pattern corresponds to a reduction in the spindle speed from 50 rpm to 100 rpm; the third coupling pattern corresponds to an extension of the grinding time from 5 seconds to 10 seconds or an increase in the tumbling frequency from 10% to 20%; and the fourth coupling pattern corresponds to maintaining the current parameters.
[0104] When determining process feedback information, the system calculates the process feedback confidence level. The statistical meaning of this confidence level is: in the current inspection batch, the proportion of rice grains that match the identified back-to-bottom defect coupling pattern to the total number of rice grains to be turned. This is an empirical frequency, not a probability value predicted by the model, and directly reflects the actual degree of support for this coupling pattern in the current batch of samples.
[0105] The setting of the preset lower limit value needs to take into account the total number of rice grains to be flipped: when the total number of rice grains to be flipped is small, even a high proportion may lead to misjudgment due to sample randomness, so the preset lower limit value should be appropriately increased. For example, when the total number of rice grains to be flipped is 100, the preset lower limit value can be 60% or 70%; when the total number of rice grains to be flipped is 300, the preset lower limit value can be 50% or 60%. When the total number is less than 50 grains, the system will not output process adjustment suggestions by default, but will only prompt to increase the cumulative number of tests.
[0106] When the confidence level of the process feedback falls below a preset lower limit, the system will interpret the feedback as a prompt to maintain the current process parameters and increase the cumulative number of tests. This strategy aims to avoid making incorrect decisions when the process is unstable or the sample size is insufficient, and to improve statistical reliability by accumulating more samples before making process adjustments.
[0107] When the confidence level of the process feedback is higher than or equal to the preset lower limit, the system outputs the specific process parameter adjustment amount according to the pre-stored process deviation mapping table. After the adjustment amount is output, the system records the coupling pattern recognition result, confidence value, and adjustment parameters before this adjustment, which are used for the evaluation of the adjustment effect and the optimization of the mapping table in subsequent batches.
[0108] Furthermore, during multiple consecutive batches of testing, the actual depth of the bottom of the abdominal groove was observed in the unfolded images of the rice grains to be turned over in each batch. Calculate the batch-average deviation between the actual observed depth of the ventral groove bottom and the theoretical depth of the ventral groove; When the average deviation of a batch continues to exceed the preset deviation threshold in multiple batches, the calibration parameters of the back-ventral geometric correlation function are corrected. The revised calibration parameters will be used for calculating the theoretical depth of the groin in subsequent batches.
[0109] During multiple consecutive batches of testing, the actual depth of the bottom of the abdominal groove of each batch of rice grains to be turned was statistically analyzed in the unfolded abdominal groove image. The method for measuring the actual observed depth is as follows: in the unfolded abdominal groove image, the lowest pixel position of the bottom region of the abdominal groove is identified, and the depth coordinate value of this position in the unfolded coordinate system is read. This coordinate value is the actual observed depth.
[0110] The arithmetic mean of the differences between the actual observed depth and the theoretical depth of the ventral groove for all rice grains to be turned within each batch is calculated as the batch average deviation for that batch. This deviation reflects the systematic bias between the actual geometry of the ventral groove bottom and the inferred value of the dorsal-ventral geometric correlation function in the current batch.
[0111] When the average deviation of a batch continuously exceeds a preset deviation threshold across multiple consecutive batches, the system triggers a correction of the calibration parameters of the back-ventral geometric correlation function. The preset deviation threshold can be set to 2 pixels or 5 pixels. The logic for determining continuous exceedance is as follows: three consecutive batches exceed the preset deviation threshold, or four out of five consecutive batches exceed the preset deviation threshold.
[0112] The specific algorithm for correcting the calibration parameters is as follows: using the dorsal curvature radius and actual observed ventral groove depth of all rice grains to be turned in the most recent 5 batches as a new sample set, linear regression is performed again to fit the slope and intercept of the new dorsal-ventral geometric correlation function. The corrected calibration parameters are only used for calculating the theoretical ventral groove depth of subsequent batches and do not change the historical records of the processed batches.
[0113] To avoid drastic fluctuations in calibration parameters due to a single batch of abnormal data, the system sets correction frequency limits: at least two test batches must be spaced between two consecutive corrections, and the change in the newly fitted slope must not exceed 20% of the original slope, and the change in the intercept must not exceed 5 pixels. If the above stability control range is exceeded, the correction will be temporarily suspended, and only an anomaly marker will be recorded and a manual review will be requested.
[0114] It should be noted that the embodiments implemented in the online rice processing quality detection system based on image recognition in this application can be referenced in conjunction with the embodiments implemented in the online rice processing quality detection method based on image recognition, and will not be described in detail here.
[0115] In one embodiment, the system employs an image scanning acquisition method, equipped with a scanner, an arraying device, and a general-purpose computer. The arraying device evenly spreads a recommended sample weight of 12g of rice grains onto the detection plane, forming a single-layer rice grain array, with the sample weight per spread controlled within the range of 1000 to 1200 grains. The scanner scans the detection plane under at least two fixed illumination angles, obtaining raw scan images at each illumination angle. The general-purpose computer uses dedicated processing software to fuse the raw scan images from each illumination angle to obtain an initial image.
[0116] Dedicated processing software performs single-grain segmentation based on the initial image, extracting the contour and morphological features of each grain, identifying its attachment posture, and assessing its invisibility level. For grains with an invisibility level higher than a preset threshold, the software generates a flipping control command to drive the flipping mechanism to perform the flipping operation. The flipping mechanism is a miniature vacuum nozzle array, with each nozzle corresponding to the center of the back side of a grain to be flipped. The nozzle generates negative pressure to attract the grain and then rotates 180 degrees to release it, completing the flipping. The flipped grain is then laid back on the detection plane, and the scanner rescans it at the same illumination angle to obtain the first image area after flipping.
[0117] The specialized processing software registers the second image region corresponding to the rice grain to be flipped in the initial image with the first image region after flipping. Based on the registration result, it extracts the defect features of the rice grain to be flipped, forming a defect record of the flipped rice grain. For visible rice grains whose invisibility level does not exceed a preset level threshold, the specialized processing software directly segments a third image region from the initial image, extracts defect features, and forms a visible rice grain defect record.
[0118] Specialized processing software aggregates records of defects in both flipped and visible rice grains, calculating quality indicators such as head rice rate, broken rice rate, chalky grain rate, chalkiness, imperfect grain rate, and yellow grain rate. Specifically, head rice rate is the proportion of whole rice grains to the total number of rice grains; broken rice rate is the proportion of broken rice grains to the total number of rice grains; chalky grain rate is the proportion of rice grains containing chalky areas to the total number of rice grains; chalkiness is the proportion of the total area of chalky areas to the total projected area of all rice grains; imperfect grain rate is the proportion of rice grains containing defects but not broken rice to the total number of rice grains; and yellow grain rate is the proportion of yellow rice grains to the total number of rice grains. The calculation results of the above quality indicators are calibrated using standard calibration lines. The calibration method involves manually measuring the same sample using national standards GB1350, GB1354, and GB17891. The manual measurement results are then linearly regressed with the system calculation results to obtain calibration coefficients, which are then embedded into the calculation module of the specialized processing software.
[0119] The dedicated processing software runs on a general-purpose computer and adopts a multi-threaded parallel processing architecture. Each thread is responsible for the defect extraction calculation of a single grain of rice, and the number of threads is dynamically allocated according to the number of processor cores of the general-purpose computer.
[0120] The system features multiple cumulative testing, allowing for a maximum of nine consecutive tests. Each test involves a 12g sample, resulting in a total sample volume of approximately 108g for nine tests. After each test, dedicated processing software temporarily stores the quality index results in a cache on a general-purpose computer. When the cumulative testing count reaches a preset number, such as three or five, the software performs an arithmetic average of the results in the cache and outputs the final quality assessment result. The cumulative testing count is set by the operator within the dedicated processing software interface, ranging from one to nine times.
[0121] Specialized processing software generates original images and categorized images of the test samples. The categorized images are arranged in zones according to the defect type of the rice grains, including areas for intact rice grains, broken rice grains, chalky rice grains, imperfect rice grains, and yellow rice grains. The test results are stored as data files on the hard drive of a general-purpose computer, and a paper test report is output via a mini-printer. The test report includes the sample number, test date, cumulative number of tests, values of each quality indicator, national standard grade assessment results, thumbnails of the original images, and the categorized images.
[0122] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described image recognition-based online detection method for rice refining quality is also provided. This electronic device may be... Figure 5 The terminal device or server shown. This embodiment uses this electronic device as an example of a server. Figure 5 As shown, the electronic device includes a memory 402, a processor 404, and a transmission device 406. The memory 402 stores a computer program, and the processor 404 is configured to execute the steps of any of the above method embodiments through the computer program.
[0123] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0124] Optionally, the transmission device 406 is used to receive or send data via a network. Specific examples of the network described above may include wired and wireless networks. In one example, the transmission device 406 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 406 is a Radio Frequency (RF) module used to communicate with the Internet wirelessly. Furthermore, the electronic device also includes a display 408 and a connection bus 410, which connects the various module components within the electronic device.
[0125] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. An online detection system for rice finishing quality based on image recognition, characterized in that, include: The feature extraction unit is used to acquire the initial image of the rice grain sample placed on the detection plane and extract the contour and morphological features of a single rice grain. An attitude recognition unit is used to identify the landing attitude of each grain of rice based on the contour and morphological features, so as to evaluate the invisibility level of each grain of rice. The flipping acquisition unit is used to record rice grains with an invisible level higher than a preset level threshold as rice grains to be flipped, perform a flipping operation on the rice grains to be flipped, and acquire the first image area after flipping. Rice grains whose invisible level does not exceed the preset level threshold are recorded as visible detection rice grains; The first defect feature extraction unit is used to segment the second image region corresponding to the rice grain to be turned from the initial image, register the second image region with the first image region, extract the defect features of the rice grain to be turned based on the registration result, and form a defect record of the rice grain to be turned. The second defect feature extraction unit is used to segment the third image region corresponding to the visible rice grain from the initial image, extract the defect features of the visible rice grain based on the third image region, and form a visible rice grain defect record. The determination unit is used to determine the rice refining quality determination result and process feedback information based on the rice grain defect record and the visible rice grain defect record.
2. The method for online detection of rice finishing quality based on image recognition, characterized in that, include: S1, Acquire the initial image of the rice grain sample placed on the detection plane, and extract the outline and morphological features of a single rice grain; S2, Based on the contour and morphological features, identify the landing posture of each grain of rice to assess the invisibility level of each grain of rice. S3, mark rice grains with an invisible level higher than a preset level threshold as rice grains to be flipped, perform a flipping operation on the rice grains to be flipped and collect the first image area after flipping; Rice grains whose invisible level does not exceed the preset level threshold are recorded as visible detection rice grains; S4, the second image region corresponding to the rice grain to be turned is segmented from the initial image, the second image region is registered with the first image region, and the defect features of the rice grain to be turned are extracted based on the registration result to form a defect record of the rice grain to be turned. S5, Segment the third image region corresponding to the visible rice grain from the initial image, extract the defect features of the visible rice grain based on the third image region, and form a visible rice grain defect record; S6. Based on the records of defects in the turned-over rice grains and the records of defects in the visible rice grains, determine the quality judgment result of rice refining and the process feedback information.
3. The image recognition-based online detection method for rice finishing quality according to claim 2, characterized in that, S1 includes: Images of the rice grain sample were acquired under at least two different illumination angles, and the images under each illumination angle were fused to obtain the initial image. Based on the initial image segmentation, the two-dimensional projected contour of a single rice grain is extracted, and the contour morphology parameters, contact shadow geometric parameters, and surface scattered light distribution parameters of each rice grain are measured as the contour and morphological features.
4. The image recognition-based online detection method for rice finishing quality according to claim 3, wherein S2 include: For each grain of rice, perform the following operations: Based on the contour morphology parameters of the rice grain, the long axis direction of the rice grain is determined, and the contour of the rice grain is divided into a first side contour segment and a second side contour segment along the long axis direction. The first centroid position of the contact shadow region of the rice grain is determined based on the contact shadow geometry parameters of the rice grain, and the second centroid position of the extreme region of scattered light intensity of the rice grain is determined based on the surface scattered light distribution parameters of the rice grain. Determine whether the first center of gravity position and the second center of gravity position are located on both sides of the major axis; When the first center of gravity position and the second center of gravity position are respectively located on both sides of the long axis, the grain of rice is determined to be in a directional landing posture, and the contour segment on the side where the first center of gravity position of the grain of rice is located is determined as the ventral groove side contour segment of the grain of rice. Calculate the ratio of the projection length of the contact shadow area of the rice grain onto the ventral groove side profile segment to the length of the ventral groove side profile segment, and evaluate the invisibility level of the rice grain based on the ratio; When the first center of gravity position and the second center of gravity position are not located on opposite sides of the long axis, the grain of rice is determined to be in a non-directional landing posture, and the invisibility level of the grain of rice is determined to be zero.
5. The image recognition-based online detection method for rice finishing quality according to claim 4, characterized in that, The determination of the first centroid position of the contact shadow region of the rice grain based on the contact shadow geometry parameters of the rice grain, and the determination of the second centroid position of the extreme region of scattered light intensity of the rice grain based on the surface scattered light distribution parameters of the rice grain, includes: Under at least two different lighting angles, for each grain of rice, extract the position of the shadow boundary and the gray-scale distribution inside the shadow of the contact shadow area of that grain of rice at each lighting angle; Based on the displacement of the shadow boundary position under each illumination angle, the geometric occlusion component is determined. The geometric occlusion component represents the depth information of the contact shadow area of the rice grain formed by the physical contact between the ventral groove side and the detection plane. Based on the correlation between the gray-scale distribution inside the shadow and the direction of illumination at each illumination angle, the surface reflection component is determined. The surface reflection component characterizes the abnormal reflectivity information of the contact shadow area of the rice grain caused by local residual chaff or wax. The first centroid position of the contact shadow region of the rice grain is determined based on the geometric occlusion component, and the second centroid position of the extreme region of scattered light intensity of the rice grain is determined based on the surface reflection component.
6. The image recognition-based online detection method for rice finishing quality according to claim 2, characterized in that, S4 include: For each grain of rice to be turned over, multiple back-side sampling points are selected in the second image region along the long axis of the grain of rice to be turned over. The local curvature at each back-side sampling point is calculated based on the rate of change of the slope of the contour tangent at each back-side sampling point. The radius of curvature of the convex surface on the back side of the rice grain to be turned is fitted based on the local curvature at multiple back-side sampling points; Based on the pre-calibrated dorsal-ventral geometric correlation function, the theoretical depth of the ventral groove of the rice grain to be turned is calculated according to the radius of curvature. The dorsal-ventral geometric correlation function characterizes the mapping relationship between the dorsal radius of curvature and the ventral groove depth of the same variety of rice grain.
7. The image recognition-based online detection method for rice finishing quality according to claim 6, characterized in that, S4 also includes: For each grain of rice to be turned over, extract the left and right wall edge lines of the groove in the abdomen of that grain of rice in the first image area. Calculate the angle between the left side wall edge line and the right side wall edge line at the opening of the groin; The determination is made jointly by the included angle and the theoretical depth of the groin, including: When the included angle is less than the first preset included angle threshold and the theoretical depth of the abdominal groove is greater than the first preset depth threshold, the cross-sectional type of the abdominal groove of the rice grain to be turned is determined to be deep V-shaped. When the included angle is greater than the second preset included angle threshold and the theoretical depth of the ventral groove is less than the second preset depth threshold, the ventral groove cross-section type of the rice grain to be turned is determined to be shallow U-shaped. When the included angle is greater than or equal to the first preset included angle threshold and less than or equal to the second preset included angle threshold, and the theoretical depth of the abdominal groove is greater than or equal to the second preset depth threshold and less than or equal to the first preset depth threshold, the cross-sectional type of the abdominal groove of the rice grain to be turned is determined to be trapezoidal transition type.
8. The online detection method for rice refining quality based on image recognition according to claim 7, characterized in that, S4 also includes: For each grain of rice to be turned over, a parameterized mapping matrix from the image plane to the unfolded plane is constructed based on the determined type of the abdominal groove cross-section. Using the parameterized mapping matrix, the pixel coordinates of each grain in the groove region of the rice grain to be turned over in the first image region are mapped to the unfolding plane to obtain the unfolded groove image. Identify pixel-missing areas in the unfolded abdominal groove image caused by self-occlusion at the bottom of the abdominal groove; For each missing location in the pixel missing region, the theoretical depth ratio of the missing location on the groin section is determined according to the geometric structure corresponding to the determined groin section type. According to the theoretical depth ratio, a sidewall reference pixel at the same theoretical depth is determined among the visible pixels of the groin sidewall on the side where the left and right sidewall edges are located. The brightness value of the sidewall reference pixel is extracted, and the brightness value is weighted and fused according to the theoretical depth ratio to obtain the compensation pixel value of the missing location. Based on the unfolded ventral groove image and the compensated pixel values, the defect features of the rice grain to be turned over are extracted to form the defect record of the turned rice grain.
9. The online detection method for rice refining quality based on image recognition according to claim 2, characterized in that, S6 include: For each grain of rice to be turned over, the defect features on the back side of the grain of rice to be turned over are extracted based on the second image region, and the back side of the grain of rice to be turned over is divided into multiple back side partitions along the long axis. Based on the unfolded ventral groove image and the compensated pixel value, the defect features of the ventral groove side of the rice grain to be turned are extracted, and the ventral groove side of the rice grain to be turned is divided into multiple ventral groove partitions. Process-sensitive defect indicators were extracted from each dorsal and ventral groove region to form the dorsal-ventral defect feature vector of the rice grain to be turned.
10. The online detection method for rice refining quality based on image recognition according to claim 9, characterized in that, S6 also includes: The back-side comprehensive quality index is calculated based on the back-side process-sensitive defect index in the back-side defect feature vector of all rice grains to be turned, and the ventral groove comprehensive quality index is calculated based on the ventral groove process-sensitive defect index in the back-side defect feature vector of all rice grains to be turned. The difference between the back-side comprehensive quality index and the ventral groove comprehensive quality index is calculated as the back-side comprehensive quality difference index. Based on the back-ventral comprehensive quality difference index and the dominant defect types on the back and ventral groove sides of the rice grains to be turned, the back-ventral defect coupling mode is identified. The process feedback information is determined based on the matching result between the back-ventral defect coupling mode and the pre-stored process deviation mapping table.