Eggshell surface character nondestructive testing device and method
By designing a non-destructive detection device for the surface trait of the rotating gimbal and adaptive exposure algorithm, multi-angle detection of the color, spots, sand skin and dark spots of the egg shells of the poultry egg shell is realized, solving the problem of incomplete detection in the prior art, and improving the detection accuracy and efficiency.
Patent Information
- Application Number
- CN202510783370.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-12
AI Technical Summary
The prior art lacks systematic methods and integrated devices to comprehensively and comprehensively detect the color, spots, sand skin and dark spots of egg shells, and the detection results are not accurate.
A non-destructive detection device for surface traits of eggshells is designed, including a rotating gimbal, a transmission platform, an image collector and annular reflective light source. Through multi-angle image acquisition and adaptive exposure algorithm, combined with multiple detection models, the transmission and reflection type detection of eggshells is realized.
It improves the accuracy and efficiency of detection, avoids the incompleteness and inaccuracy of detection caused by single-sided images, and realizes a comprehensive and comprehensive inspection of different varieties, shell colors and large eggs.
Smart Images

Figure CN120275338A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural product detection, and particularly to a non-destructive detection device and method for the surface traits of eggshells. Background Art
[0002] The detection of the quality of poultry eggshells plays a key role in enhancing the commercial value of poultry eggs and ensuring their safety, and can effectively screen out high-quality egg products to meet the needs of consumers for high-quality egg products. Taking eggs as an example, the demands for egg colors vary in different regions. Poultry eggs with uniform colors are more popular among consumers. Eggshell spots, sandiness, and dark spots can also significantly affect consumers' purchasing decisions.
[0003] Spotted eggs are mainly characterized by the appearance of abnormal color spots (such as brown or white) on the eggshell surface. The reasons for their occurrence are: abnormal calcium deposition process in the uterus of laying hens, such as salpingitis, and abnormal eggshell pigment precipitation caused by unbalanced diet nutrition. Sand eggs are mainly characterized by small and protruding calcium lumps on the eggshell surface. For example, abnormal deposition of calcium secreted by the uterus part. The reasons for their occurrence are: insufficient nutrition of laying hens, excessive calcium, salpingitis, or infectious bronchitis. Dark-spotted eggs are mainly characterized by uneven eggshell thickness and uneven distribution of organic matter on the eggshell, resulting in clear spots that can be seen under light irradiation. The reasons for their occurrence are: insufficient secretion of shell membrane protein, mycotoxins, environmental stress, or too long storage time. Therefore, it is of great significance to achieve non-destructive detection of these eggshell abnormalities.
[0004] Currently, the detection methods for the surface traits of eggshells mainly include manual measurement and visual inspection. The qualitative analysis of eggshell color is to directly observe the eggshell color with the human eye and make a visual comparison with a standard color card. For eggshell surface spots and dark spots, the artificial sensory discrimination method is usually adopted, and different grades are divided by artificially defining the parameters for grading spots, sandiness, and dark spots. The egg shape index is also usually measured with a vernier caliper;
[0005] Currently, there are also many studies on the application of vision technology in the detection of the surface traits of eggshells of egg products, but there is no systematic method and integrated device that can comprehensively and integrally detect the egg shape index, eggshell color, spots, sandiness, and dark spots of egg products, and the accuracy of the detection results is not high. Summary of the Invention
[0006] Aiming at the problems existing in the prior art, the present invention provides a non-destructive detection device and method for the surface traits of eggshells.
[0007] The present invention provides a non-destructive detection device for the surface properties of eggshells, comprising: a processing module and a detection device body; the detection device body includes a detection dark box, a rotating cloud platform arranged at the bottom of the detection dark box, a transmission platform arranged on the rotating cloud platform, an image acquisition device arranged on the inner side of the detection dark box flush with the egg to be detected, and an annular reflection light source surrounding the image acquisition device; the transmission platform is provided with an opening at the top for placing the egg to be detected, and a transmission light source for emitting light beams to the egg to be detected through the opening inside, and performs a uniform step rotation four times a week under the drive of the rotating cloud platform; the processing module obtains transmission images at four rotation angles collected with the transmission light source turned on through the image acquisition device, and determines the detection result of the eggshell transmission type detection according to the transmission images, and obtains reflection images at four rotation angles with the annular reflection light source turned on through the image acquisition device, and determines the detection result of the reflection type detection according to the reflection images.
[0008] According to a non-destructive detection device for the surface properties of eggshells provided by the present invention, the transmission type detection includes dark spot detection, and the reflection type detection includes one or more of spot detection, sand skin detection, color detection, and egg shape index detection.
[0009] According to a non-destructive detection device for the surface properties of eggshells provided by the present invention, it further includes an exposure processing module for continuously adjusting the exposure value by using an adaptive exposure algorithm until the exposure value adjustment termination condition is reached, and using the adjusted exposure value for the image acquisition device to obtain transmission images or reflection images. The adaptive exposure algorithm includes: Obtain a sample graph of the egg to be detected, extract the central rectangular area of the egg area in the sample graph as the region of interest ROI; use the Sobel operator to calculate the gradient of the region of interest, and determine the gradient mean according to the gradient of the ROI; calculate the brightness of the ROI, and calculate the brightness error according to the brightness of the ROI; adjust the exposure value according to the gradient mean and the brightness error; Among them, the exposure value adjustment termination conditions include: when the absolute value of the brightness error of consecutive multiple frames of images is less than or equal to the first preset threshold, and the consecutive multiple frame volatility of the ROI gradient mean is less than the second preset threshold, terminate the exposure value adjustment; or, when the exposure value reaches the boundary of the hardware support range, terminate the exposure value adjustment, and terminate the exposure value adjustment when the exposure value adjustment in a single adjustment period is greater than the preset number of times.
[0010] According to a non-destructive detection device for the surface properties of eggshells provided by the present invention, the determination of the gradient mean according to the gradient of the ROI includes: ; where I(x,y) is the gray value of the image at the coordinate (x,y), and They are gradients in the horizontal or vertical directions respectively, and N is the total number of ROI pixels; The calculating of the brightness error based on the brightness of the ROI includes: ; Among them, is the brightness error, is the normalized brightness of the i-th pixel within the ROI, is the target brightness; The adjusting of the exposure value according to the gradient mean and the brightness error includes: Set the initial exposure value to 0, and calculate the exposure value increment to be applied according to the following formula: ; Among them, is the normalized gradient mean of the ROI, α is the maximum single-step adjustment amplitude, k is the gradient sensitivity coefficient, and β is the brightness error suppression factor.
[0011] According to a non-destructive detection device for eggshell surface traits provided by the present invention, it further includes a control module, which is used to control different rotation angles of the rotating pan-tilt, respectively control the opening and closing of the transmission light source and the annular reflection light source according to different detection types, and control the image acquisition device to collect images at the current angle respectively when the transmission light source or the annular reflection light source is turned on, so as to obtain corresponding transmission images and reflection images; among them, when collecting the transmission image, turn on the transmission light source and turn off the annular reflection light source, and when collecting the reflection image, turn on the annular reflection light source and turn off the transmission light source.
[0012] According to a non-destructive detection device for eggshell surface traits provided by the present invention, the processing module includes: a first trait detection unit, which is used to input four reflection images into a trained first detection model respectively, output the detection results of spot detection and sand skin detection corresponding to each reflection image, and determine the comprehensive spot and sand skin type according to the detection results of the four images; a second trait detection unit, which is used to input four transmission images into a trained second detection model respectively, output the detection results of dark spot detection corresponding to each image, and determine the comprehensive dark spot type according to the dark spot detection results of the four images, and a third trait detection unit, which is used to input four reflection images into a trained third detection model respectively, output the eggshell color corresponding to each reflection image, and comprehensively determine the eggshell color according to the color detection results of the four images; among them, the first detection model is obtained after training with the traits of multiple normal, spotted and sand-skin eggs as labels and the corresponding reflection images as input data, the second detection model is obtained after training with the traits of multiple normal and dark-spot eggs as labels and the transmission images as input data, and the third detection model is obtained after training with the reflection images of multiple different shell colors as input data.
[0013] According to a non-destructive detection device for eggshell surface traits provided by the present invention, the processing module further includes a spot grade detection unit, and the spot grade detection unit is configured to: when the spot sandpaper trait type is spots, input four reflection images into a trained fourth detection model respectively, and output the spot areas of each reflection image; determine the comprehensive spot score grade according to the ratio of the spot area of the four reflection images to the egg product area.
[0014] According to a non-destructive detection device for eggshell surface traits provided by the present invention, the processing module further includes an egg shape index detection unit, which is configured to: obtain the average value of the number of long-axis pixel points of the detected egg product according to the front image and the back image in the four reflection images, and obtain the average value of the number of short-axis pixel points of the detected egg product according to the big-end image and the small-end image in the reflection images; input the average values of the number of long-axis and short-axis pixel points into the linear fitting models of the long axis and short axis of the egg product respectively, obtain the sizes of the long axis and short axis correspondingly, and determine the egg shape index according to the sizes of the long axis and short axis.
[0015] According to a non-destructive detection device for eggshell surface traits provided by the present invention, it further includes a display screen for displaying the trait detection results, and an interaction module for receiving the selection results of the eggshell transmission type detection and / or reflection type detection input by the user.
[0016] The present invention also provides a non-destructive detection method for eggshell surface traits based on the above device, including: after receiving a start instruction, controlling the rotating cloud platform to perform a uniform step rotation four times a week, and before each rotation, corresponding to the execution requirements of the current reflection type detection and transmission type detection, turning on and off the annular reflection light source and the transmission light source, and after turning on the corresponding light source, controlling the image acquisition instrument to acquire the corresponding transmission image and reflection image; determining the detection result of the eggshell transmission type detection according to the transmission image, and determining the detection result of the reflection type detection according to the reflection image; wherein, when acquiring the transmission image, the transmission light source is turned on and the annular reflection light source is turned off, and when acquiring the reflection image, the annular reflection light source is turned on and the transmission light source is turned off.
[0017] The non-destructive detection device and method for eggshell surface traits provided by the present invention, through the mutual cooperation between the rotating cloud platform and the transmission platform, enable the image acquisition instrument to simultaneously acquire the reflection or transmission images of the egg product at multiple rotation angles. The reflection and transmission images at multiple rotation angles can comprehensively reflect the overall surface characteristics of the detected egg product. Through these images, various eggshell surface trait characteristics can be conveniently obtained, improving the detection accuracy without incurring additional space and time costs, and avoiding the problems of incomplete, inaccurate, and imprecise detection caused by single-sided images in the current machine vision technology for detecting eggshell surface traits. On the other hand, the device can switch between the transmission light source and the annular reflection light source to simultaneously achieve transmission detection and reflection detection without incurring additional space and time costs, further improving the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0019] Figure 1 is the front view of the overall structure of the non-destructive detection device for eggshell surface traits provided by the present invention;
[0020] Figure 2 is the perspective view of the non-destructive detection device for eggshell surface traits provided by the present invention;
[0021] Figure 3 is the side sectional view of the main body of the non-destructive detection device for eggshell surface traits provided by the present invention;
[0022] Figure 4a is one of the shooting effect diagrams of the adaptive exposure algorithm provided by the present invention;
[0023] Figure 4b is the second shooting effect diagram of the adaptive exposure algorithm provided by the present invention;
[0024] Figure 4c is the third shooting effect diagram of the adaptive exposure algorithm provided by the present invention;
[0025] Figure 4d is the fourth shooting effect diagram of the adaptive exposure algorithm provided by the present invention;
[0026] Figure 5a is the schematic diagram of the fitting curve of the short axis provided by the present invention;
[0027] Figure 5bIt is a schematic diagram of the fitting curve of the major axis provided by the present invention;
[0028] Figure 6 It is a schematic diagram of the fitting effect of the final egg shape index provided by the present invention;
[0029] Figure 7 It is a quantitative measurement diagram of eggshell spots provided by the present invention;
[0030] Figure 8 It is a quantitative measurement diagram of dark spots on the eggshell provided by the present invention.
[0031] Explanation of reference numerals: 1 - detection dark box; 2 - transmission platform; 3 - rotating cloud platform; 4 - control box; 5 - annular reflection light source; 6 - image acquisition device; 7 - display screen; 8 - transmission platform cover; 9 - transmission light source; 10 - transmission platform box; 11 - transmission light source support; 12 - inner ring of the first connecting plate of the rotating cloud platform; 13 - inner ring of the second connecting plate of the rotating cloud platform; 14 - motor coupling; 15 - 42-step motor; 16 - base of the rotating cloud platform; 17 - cloud platform support column; 18 - third connecting plate of the rotating cloud platform; 19 - second connecting plate of the rotating cloud platform; 20 - rotating bearing; 21 - first connecting plate of the rotating cloud platform; 22 - annular buffer pad; 23 - top plate of the rotating cloud platform, 24 - display screen support. Detailed implementation manners
[0032] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.
[0033] The following combines Figures 1 - 8 to describe the non-destructive detection device and method for the surface properties of an eggshell of the present invention. Figure 1 It is a front view of the overall structure of the non-destructive detection device for the surface properties of an eggshell provided by the present invention, Figure 2 It is an oblique view of the non-destructive detection device for the surface properties of an eggshell provided by the present invention, Figure 3 It is a side-sectional view of the main body of the non-destructive detection device for the surface properties of an eggshell provided by the present invention. As shown in the figure, the non-destructive detection device for the surface properties of an eggshell provided by the present invention includes: Processing module and the main body of the detection device; the main body of the detection device includes a detection dark box 1, a rotating cloud platform 3 arranged at the bottom of the detection dark box 1, a transmission platform 2 arranged on the rotating cloud platform 3, an image acquisition device 6 arranged on the inner side of the detection dark box 1 and flush with the detected egg product, and an annular reflection light source 5 surrounding the image acquisition device 6; the transmission platform 2 is provided with an opening at the top for placing the detected egg product, and a transmission light source for emitting a light beam to the detected egg product through the opening inside, and performs a uniform step rotation four times a week under the drive of the rotating cloud platform 3; the processing module obtains transmission images at four rotation angles collected with the transmission light source 9 turned on through the image acquisition device 6, and determines the detection result of the eggshell transmission type detection according to the transmission images, and obtains reflection images at four rotation angles with the annular reflection light source 5 turned on through the image acquisition device 6, and determines the detection result of the reflection type detection according to the reflection images.
[0034] The rotating cloud platform 3 can be composed of a motor bracket and a 42-step motor as the driving part, and is fixed to the bottom of the detection dark box 1 through bolts and nuts. The transmission platform 2 performs a uniform step rotation of 90° four times under the drive of the rotating cloud platform 3 to complete a 360° overall rotation. Small holes are opened on the transmission dark box, which are not only for placing the detected egg product, but also for forming a transmission channel. The remotely controlled transmission light source 9 is located inside the transmission platform 2 and emits a light beam to the detected egg product. The transmission light source 9 is turned on remotely when the transmission type detection needs to be completed.
[0035] The image acquisition device 6 is arranged on the side of the detection dark box 1 and flush with the detected egg product, and is used to collect images at four rotation angles during the rotation of the detected egg product with the transmission platform 2, that is, including four pictures of the front, big head, back, and small head of the detected egg product, and sends the four-angle images to the processing module. The annular reflection light source 5 is sleeved on the image acquisition device 6 and is also located on the side of the detection dark box 1 for irradiating the surface of the detected egg product.
[0036] Due to the individual differences and anisotropy of the detected egg products themselves, there are differences in the eggshell thickness and eggshell color among different detected egg products. Therefore, a suitable adaptive exposure algorithm can be used to solve the problems of overexposure and underexposure of the images caused by the egg product differences. After receiving the start command, the image acquisition device 6 can first call the adaptive exposure algorithm to determine the image acquisition parameters. After confirmation, an image of the front of the egg product at 0° is taken with these parameters, then the motor is controlled to drive the transmission platform 2 to rotate 90°, and an image of the big head of the egg product at 90° is taken again. Rotate 90° again, take an image of the back of the egg product at 180°, rotate 90° again, take an image of the small head of the egg product at 270°, and finally rotate 90° to complete a 360° rotation in one week, and the detection of one egg product ends.
[0037] During the image shooting process, when the transmission light source 9 is turned off and the annular reflection light source 5 is turned on, the reflection image of the egg product is taken. When the transmission light source 9 is turned on and the annular reflection light source 5 is turned off, the transmission image of the egg product is taken.
[0038] Among them, both the annular reflection light source 5 and the transmission light source 9 are selected as LED light sources. After the annular reflection light source 5 is turned on and the egg to be measured is placed at the preset position, rotation can be achieved at the center of the field of view of the image acquisition device 6.
[0039] The image acquisition device 6 is arranged on the left side inside the detection dark box 1 and can capture and obtain reflection images or transmission images in real time. Further, the image acquisition device 6 captures and obtains reflection or transmission images of the egg at different times, and these different times reflect different angles of the egg. Based on the images at different angles, the comprehensive morphological characteristic parameters of the entire surface of the egg can be accurately extracted.
[0040] The processing module is used to process the images of different angles of the detected egg under transmitted light and reflected light respectively. Each angle corresponds to an area, and transmission type detection and reflection type detection are performed.
[0041] In some embodiments, the transmission type detection includes dark spot detection, and the reflection type detection includes one or more of spot detection, rough shell detection, egg shape index detection, and eggshell color detection. For example, when performing egg shape index detection, first extract four-angle pictures of the detected egg. Among them, the front and back pictures can obtain the long axis information of the detected egg, and the big end and small end pictures obtain the short axis information of the detected egg. Then, the egg shape index is determined based on the long axis information and the short axis information.
[0042] The non-destructive detection device for the surface traits of the eggshell of the present invention, through the mutual cooperation between the rotating cloud platform 3 and the transmission platform, enables the image acquisition device to simultaneously collect reflection or transmission images of the detected egg at multiple rotation angles. The reflection and transmission images at multiple rotation angles can comprehensively reflect the overall surface characteristics of the detected egg. Through these images, various eggshell surface trait characteristics can be obtained conveniently, improving the detection accuracy without incurring additional space costs and time costs, and avoiding the problems of incomplete, inaccurate, and imprecise detection due to single-sided images in the current machine vision technology for detecting the surface traits of the eggshell of eggs. On the other hand, by switching between the transmission light source and the annular reflection light source, the device can simultaneously perform transmission detection and reflection detection without incurring additional space costs and time costs, further improving the detection efficiency.
[0043] The device can realize the portability of the eggshell surface trait detection equipment for eggs, and can comprehensively detect eggs of different varieties, different shell colors, and different sizes.
[0044] Optionally, the transmission platform 2 includes a transmission platform cover 8, a transmission light source 9, a transmission platform box 10, and a transmission light source support 11; the rotating pan-tilt 3 includes a motor coupling 14, a 42-step motor 15, a rotating pan-tilt base 16, a rotating pan-tilt top plate 23, an annular cushion 22, a first rotating pan-tilt connecting plate 21, a rotating bearing 20, a second rotating pan-tilt connecting plate 19, a third rotating pan-tilt connecting plate 18, a pan-tilt support column 17, an inner ring of the first rotating pan-tilt connecting plate 12, and an inner ring of the second rotating pan-tilt connecting plate 13.
[0045] The transmission platform 2 is fixed on the rotating pan-tilt top plate 23, and the annular cushion 22 is placed between the rotating pan-tilt top plate 23 and the first rotating pan-tilt connecting plate 21 to reduce the friction of rotation; the rotating bearing 20 is placed between the inner ring of the first rotating pan-tilt connecting plate 12 and the inner ring of the second rotating pan-tilt connecting plate 13; the inner ring of the first rotating pan-tilt connecting plate 12 and the inner ring of the second rotating pan-tilt connecting plate 13 are respectively placed between the first rotating pan-tilt connecting plate 21 and the second rotating pan-tilt connecting plate 19. One end of the motor coupling 14 is fixed to the inner ring of the second rotating pan-tilt connecting plate 13, and the other end is connected to the 42-step motor 15; the third rotating pan-tilt connecting plate 18 is fixed on the 42-step motor 15, and the rotating pan-tilt base 16 is fixed to the bottom of the detection dark box 1.
[0046] Due to the action of the motor coupling 14, the 42-step motor 15 drives the inner ring of the second rotating pan-tilt connecting plate 13 to rotate, thereby driving the rotating bearing 20 to rotate, and then driving the inner ring of the first rotating pan-tilt connecting plate 12 and the rotating pan-tilt top plate 23 to achieve overall rotation.
[0047] In some embodiments, an exposure processing module is further included, which is used to continuously adjust the exposure value by using an adaptive exposure algorithm until the exposure value adjustment termination condition is reached, and use the adjusted exposure value for the image acquisition device to obtain a transmission image or a reflection image. The adaptive exposure algorithm includes: obtaining a sample pattern of the detected egg product, extracting the central rectangular area of the egg product area in the sample pattern as the region of interest ROI; using the Sobel operator to calculate the gradient of the ROI, and determining the gradient mean according to the gradient of the ROI; calculating the brightness of the ROI, and calculating the brightness error according to the brightness of the ROI; adjusting the exposure value according to the gradient mean and the brightness error; the exposure value adjustment termination condition includes: when the absolute value of the brightness error of consecutive multiple frames of images is less than or equal to the first preset threshold, and the consecutive multiple frame volatility of the ROI gradient mean is less than the second preset threshold, terminate the exposure value adjustment; or, when the exposure value reaches the boundary of the hardware support range, terminate the exposure value adjustment, and terminate the exposure value adjustment when the exposure value adjustment in a single adjustment period is greater than the preset number of times.
[0048] Among them, multiple consecutive frames can be set to 3 frames, the first preset threshold can be set to 5%, the second preset threshold can be set to 8%, and the preset number of times can be set to 8 times. The exposure value can be restricted within the hardware support range of [-8, 8], and the optimal exposure parameters are applied to the image acquisition device.
[0049] When performing trait detection, the image acquisition device (an industrial camera can be used) and the light source are relatively close to the sample. Although common low-cost industrial cameras currently have an automatic exposure function, for the application scenario of the present invention, the egg product area captured by the image acquisition device only occupies a small central part of the entire picture, and the industrial camera and the light source used during trait detection are relatively close to the sample. Therefore, the automatic exposure algorithm of ordinary industrial cameras adjusts according to the brightness of the entire image. In the captured pictures, only the egg product area is under light conditions, and other areas (such as the black light-absorbing paper part on the inner wall of the dark box) are almost entirely pixels close to black. Therefore, the automatic exposure function of ordinary cameras often causes overexposure or underexposure of the egg product area during experiments.
[0050] To ensure clear reflection images and projection graphics are captured, the present device adopts an adaptive exposure method before capturing the graphics. The present invention considers that overexposure of the egg product area usually occurs in the middle of the egg product area. Therefore, the central rectangular area of the egg product area in the picture is selected as the region of interest (ROI), and the exposure parameters are adjusted based on the brightness and gradient mean of this region. This adaptive exposure algorithm adjusts through both the brightness and gradient dimensions to ensure that the image is neither too dark nor too overexposed, while maximizing the retention of image details. This adaptive exposure algorithm effectively solves the problems of overexposure and underexposure of the image caused by different eggshell colors and thicknesses. At the same time, this algorithm does not require re-tuning of parameters every time a new sample is captured. Especially when capturing reflection images, it is mainly affected by the eggshell color. Therefore, for eggs of the same color, only one adaptive exposure adjustment is required after the camera is turned on, and the subsequent eggs of the same batch and the same color can apply this exposure parameter. For transmission image capture, although both the color and thickness of the eggshell affect the image effect, experiments have found that only in the case of individual eggshells being too thick or too thin, the influence of thickness is relatively large. Even so, the eggshell color is still the dominant factor. Therefore, when capturing eggs of the same color, the same exposure parameters can also be used to avoid re-adjusting each time.
[0051] In some embodiments, determining the gradient mean according to the gradient of the ROI includes: ; where I(x,y) is the grayscale value of the image at the coordinate (x,y), and are the gradients in the horizontal or vertical direction respectively, and N is the total number of pixels in the ROI; The luminance error calculation based on the ROI luminance includes: ; wherein, is the luminance error, is the normalized luminance of the i-th pixel within the ROI, is the target luminance (which can be set to 0.5, corresponding to 128 gray levels); The adjustment of the exposure value according to the gradient mean and the luminance error includes: Set the initial exposure value to 0, and calculate the exposure value increment to be applied according to the following formula: ; wherein, is the normalized gradient mean of the ROI, α is the maximum single-step adjustment amplitude, which can be taken as 3.0, k is the gradient sensitivity coefficient, which can be taken as 8.0; β is the luminance error suppression factor, which can be taken as 30.0.
[0052] In some embodiments, the device further includes a display screen for displaying the results of the trait detection. The display screen can be a display screen that analyzes the reflection image or the transmission image according to the processing module and displays the results on the display screen 7, thereby realizing the intuitive output of the detection results of the surface traits of the eggshell.
[0053] In some embodiments, it further includes a control module for controlling different rotation angles of the rotating cloud platform 3, respectively controlling the opening and closing of the transmission light source 9 and the annular reflection light source 5 according to different detection types, and controlling the image acquisition device 6 to collect images at the current angle respectively when the transmission light source 9 or the annular reflection light source 5 is turned on, so as to obtain corresponding transmission images and reflection images; wherein, the detection types include transmission type detection and / or reflection type detection. When collecting transmission images, turn on the transmission light source 9 and turn off the annular reflection light source. When collecting reflection images, turn on the annular reflection light source 5 and turn off the transmission light source 9.
[0054] As Figures 1 - 3 shown, the control module is arranged in the control box 4. The detection device body is composed of a detection dark box 1, a transmission platform 2, a rotating cloud platform 3, a control box 4, an annular reflection light source 5, an image acquisition device 6 and a display screen 7. The control box 4 and the detection dark box 1 are fixedly connected. The processing module in the control box 4 is connected to the display screen 7, and the display screen 7 is fixed on the display screen support 24.
[0055] A control module can be set to control the rotation of the stepper motor. For example, using a Raspberry Pi 4B, it can also control the opening and closing of the annular reflection light source and the transmission light source 9 while controlling the rotation of the stepper motor, and control the image acquisition device 6 to acquire images. Specifically, the control module controls the stepper motor to rotate 90° each time. If both reflection type detection and transmission type detection are performed simultaneously, after each rotation, it controls to turn on the annular reflection light source and turn off the transmission light source 9, and controls the image acquisition device 6 to acquire reflection images. Then it controls to turn off the annular reflection light source and turn on the transmission light source 9, and controls the image acquisition device 6 to acquire transmission images. Then it enters the next rotation and also acquires images at the current angle.
[0056] Specifically, at a certain starting moment of 0°, an image of the front of the egg product at 0° is taken. Then it controls the motor to drive the transmission platform 2 to rotate 90°. An image of the large end of the egg product at 90° is taken again. It rotates 90° again, takes an image of the back of the egg product at 180°. It rotates 90° again, takes an image of the small end of the egg product at 270°. Finally, it rotates 90° to complete a full rotation of 360°. The detection of one egg product ends, and finally the overall images of the egg product at four angles are obtained.
[0057] In some embodiments, it further includes an interaction module. The interaction module is used to receive the selection results of the eggshell transmission type detection and / or reflection type detection input by the user. Among them, the interaction module can be implemented through buttons or a display screen with a touch function. For example, the above display screen 7 uses a display touch screen with a touch function. The user can select eggshell transmission type detection, reflection type detection, or select both transmission type detection and reflection type detection through the interaction module.
[0058] In some embodiments, the processing module includes: a first trait detection unit, which is used to input four reflection images into a trained first detection model respectively, output the spot detection and sand skin detection results corresponding to each reflection image, and determine the comprehensive spot and sand skin type according to the detection results of the four images; a second trait detection unit, which is used to input four transmission images into a trained second detection model respectively, output the dark spot detection results corresponding to each image, and determine the comprehensive dark spot type according to the dark spot detection results of the four images; a third trait detection unit, which is used to input four reflection images into a trained third detection model respectively, output the eggshell color corresponding to each reflection image, and comprehensively determine the eggshell color according to the color detection results of the four images. Among them, the first detection model is obtained after training with the traits of multiple normal, spotted and sand-skin eggs as labels and the corresponding reflection images as input data. The second detection model is obtained after training with the traits of multiple normal and dark-spot eggs as labels and transmission images as input data. The third detection model is obtained after training with reflection images of various different shell colors as input data.
[0059] Among them, the first detection model, the second detection model, and the third detection model can adopt the current classification models based on lightweight convolutional neural networks, but the training data are different, so as to perform different classification detection tasks. In the present invention, images from four angles are collected. For transmission detection or reflection detection, the images from the four angles can be respectively input into the corresponding detection models to obtain four detection results, and the comprehensive detection result is determined according to the four detection results. For example, if the images from two angles are confirmed as dark spot eggs, then the comprehensive dark spot type is determined as dark spot eggs, or as long as the image from one angle is confirmed as a dark spot egg, then the comprehensive dark spot type is determined as dark spot eggs.
[0060] In some embodiments, the processing module further includes a spot grade detection unit, and the spot grade detection unit is configured to: when the spot sand skin trait type is spot eggs, input the four reflection images into the trained fourth detection model respectively, and output the spot regions of each reflection image; determine the comprehensive spot score grade according to the ratio of the spot region areas of the four reflection images to the egg region area.
[0061] When it is necessary to complete the detection of eggshell sand skin spots, according to the reflection images of four different regions, the ratio of the area of the spots to the area of the whole egg is extracted to obtain the comprehensive score grade of the eggshell spots. The fourth detection model can adopt the current object recognition network based on convolutional neural networks, such as YOLO, SSD networks, etc. After identifying multiple bounding boxes of spots, calculate the area of the spots and the area of the whole egg according to the pixels, and finally calculate the ratio of the spot region area to the egg region area, and then determine the comprehensive spot score grade; for more convenient and fast calculation, the fourth detection model can also adopt an image processing segmentation algorithm, such as the K-Means image segmentation algorithm. Since there are obvious differences between the spot and dark spot regions and other regions of the collected images, defining an appropriate K value can achieve the segmentation of the foreground and the background. Calculate the area of the spots and the area of the whole egg according to the spot pixels in the segmented image, and finally calculate the ratio of the spot region area to the egg region area, and then determine the comprehensive spot score grade.
[0062] In some embodiments, the processing module further includes an egg shape index detection unit, configured to: obtain the average value of the number of long axis pixel points of the detected egg according to the front image and the back image in the four reflection images, and obtain the average value of the number of short axis pixel points of the detected egg according to the big head image and the small head image in the reflection images; respectively input the average values of the number of long and short axis pixel points into the linear fitting models of the long axis and short axis of the egg, and correspondingly obtain the sizes of the long and short axes, and determine the egg shape index according to the sizes of the long and short axes. When it is determined as spot eggs, further calculate the ratio of the area of the eggshell spots in the image to the area of the whole egg image to obtain the comprehensive score grade of the eggshell spots.
[0063] Among them, the processing module can use a Raspberry Pi 4B development board with an ARM Cortex-A72 processor and 8GB of memory. It is suitable for the operation and control of stepper motors and cameras. At the same time, it has a good system that facilitates the development and design of a control interface and connects to the display screen 5 to complete the control of the host computer. It has the functions of small size, easy installation and carrying, and having a power-on and detection button.
[0064] The detection dark box 1 can be made of aluminum alloy, and a large amount of black light-absorbing paper is laid on the inner wall to prevent the reflection of the dark box wall surface and provide a good dark environment for detection. The image acquisition device 6 body and the annular reflection light source 5 are fixedly connected to the left inner surface, and a display screen bracket is fixedly installed on the upper outer surface to facilitate the placement of the display screen 7.
[0065] The image acquisition device 6 can use a USB industrial camera, which is a wide-angle low-focal-length distortion-free camera and can take clear images of eggs at close range. The annular reflection light source 5 is an LED positive white light with an inner diameter of 61, which can be perfectly sleeved on the image acquisition device 6. The transmission light source 9 uses 3W of positive white light and can be controlled by a remote control switch.
[0066] The specific operation process can be as follows:
[0067] Press the power-on button of the Raspberry Pi 4B development board, initialize the system, open the host computer software interface on the display screen 7, and at the same time turn on the annular reflection light source 5.
[0068] After placing the egg to be detected in the platform cover, close the dark box door, click the detection button on the host computer software interface, control the rotation of the motor while taking an image of the egg. The motor rotates 90° each time and then delays for 1s briefly for the image acquisition device 6 to take a picture. Finally, a total of four reflected images of the egg at different angles are taken.
[0069] The processing module processes the four original reflected images obtained to complete the detection of the egg shape index, eggshell spots, and eggshell sand skin. The detection of each trait includes: first, according to the front and back of the egg, obtain the average value of the number of long-axis pixel points of the detected egg, and according to the big end and small end of the egg, obtain the average value of the number of short-axis pixel points of the detected egg. Then, perform linear fitting with the actually measured long axis and short axis of the egg to obtain the linear fitting model of the long axis and short axis of the egg. Divide the calculated long axis by the short axis to finally obtain the egg shape index of the egg. According to the egg shape index, complete the grading of the egg size; use the trained classification model to discriminate the eggshell color of the images taken in four different regions; use the trained classification model to discriminate normal eggs, spotted eggs, and sand-pitted eggs in the images taken in four different regions, and calculate the ratio of the area of the eggshell spots in the image judged as a spotted egg to the area of the entire egg to obtain the comprehensive scoring grade of the eggshell spots. Finally, display the detection results on the host computer software interface.
[0070] It should be noted that for the detection of eggshell dark spots, the detection process is the same as above, but the annular reflection light source 5 needs to be turned off and the transmission light source 9 needs to be turned on by remote control. The processing module completes the detection of eggshell dark spots for the four acquired original transmission images, extracts the area ratio of the dark spots to the area of the entire egg product based on the transmission images of four different regions, and obtains the comprehensive scoring grade of the eggshell dark spots.
[0071] To further describe the solution of the present invention, the following is illustrated by an example:
[0072] The experimental egg products include a total of 349 white-shelled, pink-shelled, brown-shelled, and blue-shelled eggs. During detection, the image information of the egg products is first collected in the designed test device. Figures 4a - 4d Shows the comparison of the pictures taken of different colors and different thicknesses without using the adaptive exposure algorithm and the pictures after using it. Among them, Figure 4a and Figure 4b are the reflection comparison pictures, Figure 4c and Figure 4d are the transmission comparison pictures. It can be seen from the clarity and presentation of the images that the adaptive exposure algorithm can well solve the problems of overexposure and underexposure caused by the differences in eggshell color and thickness in a small dark box.
[0073] Figure 5a and Figure 5b are the fitting curves of the short axis and long axis of the egg products provided by the present invention. Since 4 pictures of each egg product are taken at different angles, the short-axis pixel points of the images of the big end and small end of the egg product are extracted respectively and the average value is taken as the average short-axis pixel point, and the long-axis pixel points of the front and back of the egg product are obtained and the average value is taken as the average long-axis pixel point. It is found through experiments that the fitting effect of the average pixel points of the long and short axes is better than that of a single picture. Figure 6 Is the fitting effect of the final egg shape index. Finally, the egg products are classified into round (egg shape index < 1.3), normal (1.3 < egg shape index < 1.35), and flat eggs (egg shape index > 1.3) according to the egg shape index. Among them, the egg shape index calculation formula is long axis / short axis.
[0074] Figure 7 Is the quantitative measurement diagram of the eggshell spots of the present invention. The trained classification model is used to discriminate normal egg products, spotted egg products, and sandy egg products from the images of four different regions, and the area ratio of the eggshell spots of the images discriminated as spotted egg products to the area of the entire egg product is calculated. Finally, the overall spot rate of the egg products is calculated by combining the results of the four pictures.
[0075] Figure 8 Is the quantitative measurement diagram of the eggshell dark spots of the present invention. The area ratio of the eggshell dark spots of each picture to the area of the entire egg product can be calculated, and finally the overall dark spot rate of the egg products is calculated by combining the results of the four pictures.
[0076] The non-destructive detection method for the surface characteristics of eggshells provided by the present invention will be described below. The non-destructive detection method for the surface characteristics of eggshells described below can be correspondingly referred to the non-destructive detection device for the surface characteristics of eggshells described above.
[0077] The present invention also provides a non-destructive detection method for the surface characteristics of eggshells, and the non-destructive detection method for the surface characteristics of eggshells includes:
[0078] After receiving the start instruction, control the rotating pan-tilt to perform a uniform step rotation four times a week, and after each rotation, according to the execution requirements of the current reflection type detection and transmission type detection, correspondingly turn on and off the annular reflection light source and the transmission light source, and after turning on the corresponding light source, control the image acquisition device to acquire the corresponding transmission image and reflection image;
[0079] Determine the detection result of the eggshell transmission type detection according to the transmission image, and determine the detection result of the reflection type detection according to the reflection image;
[0080] Among them, when acquiring the transmission image, turn on the transmission light source and turn off the annular reflection light source, and when acquiring the reflection image, turn on the annular reflection light source and turn off the transmission light source.
[0081] The method embodiments provided by the embodiments of the present invention are implemented based on the above-mentioned device embodiments. For the specific process and detailed content, please refer to the above-mentioned device embodiments, and will not be elaborated here.
[0082] The non-destructive method for the surface characteristics of eggshells provided by the embodiments of the present invention has the same implementation principle and the same technical effects as the foregoing embodiments of the non-destructive detection device for the surface characteristics of eggshells. For a brief description, for the parts not mentioned in the embodiments of the non-destructive method for the surface characteristics of eggshells, reference can be made to the corresponding content in the foregoing embodiments of the non-destructive detection device for the surface characteristics of eggshells.
[0083] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement without creative labor.
[0084] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.
[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of the present invention.
Claims
1. A nondestructive detection device for the surface properties of eggshells, characterized in that, Comprising: A processing module and a detection device body; The detection device body includes a detection dark box, a rotating cloud platform arranged at the bottom of the detection dark box, a transmission platform arranged on the rotating cloud platform, an image acquisition device arranged on the inner side of the detection dark box flush with the detection egg, and an annular reflection light source surrounding the image acquisition device; The transmission platform is provided with an opening at the top for placing the detection egg, and a transmission light source for emitting light beams to the detection egg through the opening inside, and performs a uniform step rotation four times a week driven by the rotating cloud platform; The processing module obtains transmission images at four rotation angles collected with the transmission light source turned on through the image acquisition device, and determines the detection result of the eggshell transmission type detection according to the transmission images, and obtains reflection images at four rotation angles with the annular reflection light source turned on through the image acquisition device, and determines the detection result of the reflection type detection according to the reflection images.
2. The non-destructive detection device for the surface properties of an eggshell according to claim 1, wherein The transmission type detection includes dark spot detection, and the reflection type detection includes one or more of spot detection, sand skin detection, color detection, and egg shape index detection.
3. The non-destructive detection device for the surface properties of eggshells according to claim 1, wherein It further includes a control module for controlling different rotation angles of the rotating cloud platform, respectively controlling the opening and closing of the transmission light source and the annular reflection light source according to different detection types, and controlling the image acquisition device to respectively collect images at the current angle when the transmission light source or the annular reflection light source is turned on, so as to obtain the corresponding transmission images and reflection images; Among them, when collecting transmission images, the transmission light source is turned on and the annular reflection light source is turned off, and when collecting reflection images, the annular reflection light source is turned on and the transmission light source is turned off.
4. The non-destructive detection device for the surface properties of eggshells according to claim 1, characterized in that, It further includes an exposure processing module for continuously adjusting the exposure value using an adaptive exposure algorithm until the exposure value adjustment termination condition is reached, and using the adjusted exposure value for the image acquisition device to obtain transmission images or reflection images. The adaptive exposure algorithm includes: Obtain a sample graph of the detection egg, and extract the central rectangular area of the egg area in the sample graph as the region of interest ROI; Use the Sobel operator to calculate the gradient of the ROI and determine the gradient mean according to the gradient of the ROI; Calculate the brightness of the ROI and calculate the brightness error according to the brightness of the ROI; Adjust the exposure value according to the gradient mean and the brightness error; Among them, the exposure value adjustment termination condition includes: When the absolute value of the brightness error of consecutive multiple frames of images is less than or equal to a first preset threshold, and the consecutive multiple frame volatility of the ROI gradient mean is less than a second preset threshold, terminate the exposure value adjustment; Or, when the exposure value reaches the boundary of the hardware support range, terminate the exposure value adjustment, and when the exposure value adjustment in a single adjustment cycle is greater than the preset number of times, terminate the exposure value adjustment.
5. The non-destructive detection device for the surface traits of an eggshell according to claim 4, characterized in that: The determining the gradient mean according to the gradient of the ROI includes: ; Among them, is the gradient mean value, I(x, y) is the gray value of the image at the coordinate (x, y), and are the gradients in the horizontal or vertical directions respectively, and N is the total number of ROI pixels; The calculating the brightness error according to the brightness of the ROI includes: ; Among them, is the brightness error, is the normalized brightness of the i-th pixel within the ROI, is the target brightness; The adjusting the exposure value according to the gradient mean and the brightness error includes: setting the initial exposure value to 0, and calculating the exposure value increment to be applied according to the following formula: ; Among them, is the normalized gradient mean of the ROI, α is the maximum single-step adjustment amplitude, k is the gradient sensitivity coefficient, and β is the brightness error suppression factor.
6. The non-destructive detection device for the surface properties of eggshells according to claim 2, wherein The processing module includes: The first trait detection unit is used to input four reflection images into the trained first detection model respectively, output the spot detection and Shar-Pei detection results corresponding to each reflection image, and determine the comprehensive spot and Shar-Pei type according to the detection results of the four images; The second trait detection unit is used to input four transmission images into the trained second detection model respectively, output the dark spot detection results corresponding to each image, and determine the comprehensive dark spot type according to the dark spot detection results of the four images; The third trait detection unit is used to input four reflection images into the trained third detection model respectively, output the eggshell color corresponding to each sample reflection image, and comprehensively determine the eggshell color according to the color detection results of the four images; Among them, the first detection model is obtained by training with the traits of multiple normal, spotted and Shar-Pei eggs as labels and the corresponding reflection images as input data, the second detection model is obtained by training with the traits of multiple normal and dark spot eggs as labels and the transmission images as input data, and the third detection model is obtained by training with the reflection images of various shell colors as input data.
7. The non-destructive detection device for the surface properties of eggshells according to claim 6, characterized in that The processing module further includes a spot grade detection unit, and the spot grade detection unit is used for: When the spot and Shar-Pei trait type is spot, input four reflection images into the trained fourth detection model respectively, and output the spot area of each reflection image; Determine the comprehensive spot score grade according to the ratio of the spot area of the four reflection images to the egg product area.
8. The non-destructive detection device for the surface traits of an eggshell according to claim 2, wherein, The processing module further includes an egg shape index detection unit, which is used for: Obtain the average value of the number of long-axis pixel points of the detected egg product according to the front image and the back image in the four reflection images, and obtain the average value of the number of short-axis pixel points of the detected egg product according to the big-end image and the small-end image in the reflection images; Input the average values of the number of long-axis and short-axis pixel points into the linear fitting models of the long axis and short axis of the egg product respectively, obtain the long-axis and short-axis sizes correspondingly, and determine the egg shape index according to the long-axis and short-axis sizes.
9. The non-destructive detection device for the surface traits of eggshells according to claim 1, wherein It further includes: An interaction module, which is used to receive the selection result of the eggshell transmission type detection and / or reflection type detection input by the user; A display screen, which is used to display the trait detection results.
10. A non-destructive detection method for the surface characteristics of an eggshell based on the non-destructive detection device for the surface characteristics of an eggshell described in claims 1-9, characterized in that, It includes: After receiving the start instruction, control the rotating pan-tilt to perform a uniform step rotation four times a week, and after each rotation, turn on and off the annular reflection light source and the transmission light source according to the execution requirements of the current reflection type detection and transmission type detection, and control the image acquisition instrument to collect the corresponding transmission images and reflection images after turning on the corresponding light sources; Determine the detection result of the eggshell transmission type detection according to the transmission images, and determine the detection result of the reflection type detection according to the reflection images; Among them, when collecting the transmission images, turn on the transmission light source and turn off the annular reflection light source, and when collecting the reflection images, turn on the annular reflection light source and turn off the transmission light source.
Citation Information
Patent Citations
Nondestructive determining device and determining method for freshness of fresh livestock meat
CN104049068A
Non-destructive testing device for protein conformation in egg white and method of non-destructive testing device
CN106018292A
Image edge brightness correction method and system, and device for image edge brightness correction method
CN114078094A
Adaptive exposure adjustment method based on anchor point area estimation
CN115604586A
Device and method for measuring multiple qualities of hatching eggs
CN119245745A