An automatic quality detection method and system for baked goods

CN122882464APending Publication Date: 2026-10-09SHANGHAI TAOLI FOOD CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611132676.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

针对现有技术的不足,本发明提供了一种面向烘焙食品的自动质量检测方法及系统,解决了现有烘焙食品外观检测中反光、阴影与真实烤色异常难以区分,导致烤色缺陷误判、漏判及在线剔除准确性不足的问题

Benefits of technology

(1)一种面向烘焙食品的自动质量检测方法及系统,通过主漫射、交叉偏振、左斜光和右斜光图像帧采集,并结合输送带编码器脉冲值进行位置回补,将同一烘焙食品表面位置统一重采样为具有相同面元编号的同名面元,使不同光态下的亮度、色度和斜光响应能够在同一空间基准下进行比对,避免因输送位移、图像错位导致烤色异常判断失真。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122882464A_ABST
    Figure CN122882464A_ABST
Patent Text Reader

Abstract

The application discloses a kind of automatic quality detection methods and systems for baked food, it is related to food optical detection technical field, comprising: S1, establish detection plane, collect the same baked food four light state image frame, according to conveyor belt encoder pulse value back and generate the same name surface element sampling table;S2, calculate polarization blanking brightness difference value, red proportion change value, blue proportion change value and oblique light reversing brightness difference value, generate sugar oil mirror explainable brightening value and main diffusion explainable darkening value;S3, reconstruct main diffusion brightness value, screen out reflection and shadow pseudo anomaly, generate real baking color residual error band record;S4, compare baking color quality parameter table, generate baked food baking color quality grade mark, baking color quality rejection token and automatic quality detection result record.The problems that reflection, shadow and real baking color anomaly are difficult to distinguish in the existing baked food appearance detection, leading to baking color defect misjudgment, missing judgment and the problem of insufficient accuracy of online rejection are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of food optical inspection technology, specifically to an automatic quality inspection method and system for baked goods. Background Technology

[0002] As food processing production lines develop towards continuous, automated, and online operations, food quality inspection is gradually evolving from manual sampling and single-point instrument testing to multi-source sensing, intelligent visual recognition, and automatic judgment. For baked goods, surface browning, localized caramelization, sugar and oil highlights, edge shadows, and texture all directly reflect the product's processing status. Therefore, achieving quality inspection of baked goods through image acquisition, optical response analysis, and data processing has become an important technological direction in the field of food quality inspection.

[0003] For example, application CN112903929A discloses a food quality testing system, characterized in that: the testing system includes a food odor collection platform and a food quality big data processing subsystem, and the testing system realizes the detection of food odor parameters and the classification of food freshness; this invention effectively solves the problem that existing food freshness identification systems do not reflect the nonlinearity, large lag and complex changes of food volatile odor characteristics, thus greatly affecting the problem of food freshness identification.

[0004] For example, application CN113671134B discloses a food quality and safety testing device and its testing method, including a housing, a canned sample movably placed on one side of the bottom of the housing, a strong oxidant movably placed on the other side of the bottom of the housing, a rotating arm movably mounted above the canned sample and electrically driven, a turntable movably connected to the bottom of the rotating arm, a threaded rod fixedly connected to the bottom of the turntable, and a pressure button movably mounted at the bottom of the threaded rod. This invention drives the rotating arm to rotate, causing the turntable to rotate and descend, penetrating into the canned sample. The pressure button, under the pressure of the bottom of the can, causes the spring to lift the reversing column, opening the side opening, thereby connecting the negative connector at the bottom of the circuit, the negative connector of the iron block, and the negative connector of the rotating arm. This enables the rotating arm to drive the turntable to rotate in the opposite direction and rise, causing the iron block to generate a repulsive force, causing the N-pole magnet to rise and extract the sample, solving the problem that it is difficult to extract the bottom sample of powdery samples during testing.

[0005] However, existing food quality inspection technologies mostly focus on odor freshness identification, sample extraction and inspection, or routine image appearance judgment, making it difficult to distinguish between sugar and oil reflections, caramelization highlights, conveyor belt shadows, and abnormal coloring on the surface of baked goods. When normal bright spots, dark shadows, and actual over- or under-baked areas show similar brightness variations in the image, existing detection methods are prone to misjudgment and missed detection, leading to inaccurate localization of coloring defects and insufficient stability in online quality assessment. Therefore, there is an urgent need for an automated quality inspection method and system for baked goods to improve the accuracy of identifying and online rejecting abnormal coloring in baked goods.

[0006] Therefore, in order to address the above problems, there is an urgent need for an automated quality inspection method and system for baked goods. Summary of the Invention

[0007] Technical problems to be solved To address the shortcomings of existing technologies, this invention provides an automated quality inspection method and system for baked goods, which solves the problem that existing baked goods appearance inspection methods struggle to distinguish between reflective and shading abnormalities and true browning abnormalities, leading to misjudgments, missed judgments, and insufficient accuracy in online rejection of browning defects.

[0008] Technical solution To achieve the above objectives, the present invention provides the following technical solution: an automatic quality inspection method for baked goods, comprising: S1, establishing a detection plane with the intersection of the upstream shooting edge line of the detection conveyor belt and the left reference edge line as the origin, acquiring main diffuse, cross-polarized, left oblique light, and right oblique light image frames of the same baked goods, performing position compensation based on the conveyor belt encoder pulse value, and resampling to generate a corresponding surface element sampling table; S2, calculating the polarization blanking brightness difference, red proportion change value, blue proportion change value, and oblique light reversal brightness based on the corresponding surface element sampling table. S3, using the cross-polarized brightness value as a low-reflectivity substrate, superimpose the sugar-oil specular explanation brightness value and subtract the principal diffuse explanation darkness value to generate the principal diffuse reconstructed brightness value. Based on the principal light closure residual value, filter out reflection and shadow pseudo-anomalies to generate a true baking color residual band record. S4, compare the true baking color residual band record with the baking color quality parameter table to generate a baking color quality grade mark for baked goods. When the quality grade mark is unqualified, generate a baking color quality rejection token and an automatic quality detection result record.

[0009] Furthermore, the specific steps for establishing a detection plane with the intersection of the upstream shooting edge of the detection conveyor belt and the left reference edge as the origin, and acquiring the main diffuse, cross polarization, left oblique light, and right oblique light image frames of the same baked food are as follows: The intersection of the upstream shooting edge of the detection conveyor belt and the left reference edge of the detection conveyor belt is taken as the origin of the detection plane coordinates, the running direction of the detection conveyor belt is taken as the positive direction of the vertical axis of the detection plane, and the width direction of the detection conveyor belt from left to right is taken as the positive direction of the horizontal axis of the detection plane. The camera intrinsic parameters, camera extrinsic parameters, lens distortion parameter values, and conveyor belt encoder pulse values ​​are read to generate a calibration mapping table from pixel coordinates to detection plane coordinates and a conversion relationship between encoder pulse values ​​and conveyor belt displacement. When baked goods enter the detection field of view, the main diffuse light source, the cross-polarized light source, the left low-angle oblique light source, and the right low-angle oblique light source are lit sequentially based on the same product trigger number. After each light source is lit, the corresponding image frame is acquired to generate a coded light state image group. The coded light state image group includes the product trigger number, image acquisition timestamp, conveyor belt encoder pulse value, detection conveyor belt speed value, product type code value, target baking color grade code value, main diffuse image frame, cross-polarized image frame, left oblique light image frame, right oblique light image frame, and empty conveyor belt background image frame.

[0010] Further, the specific steps for position backfilling based on the conveyor belt encoder pulse value and resampling to generate a corresponding surface element sampling table are as follows: Distortion correction is performed on the main diffuse image frame, cross-polarized image frame, left oblique light image frame, and right oblique light image frame according to the lens distortion parameter values. The conveyor belt displacement compensation value of the cross-polarized image frame, left oblique light image frame, and right oblique light image frame relative to the main diffuse image frame is calculated based on the conveyor belt encoder pulse value corresponding to each detected image frame. After translating the cross-polarized image frame, left oblique light image frame, and right oblique light image frame in the opposite direction along the longitudinal axis of the detection plane by the corresponding conveyor belt displacement compensation value, bilinear interpolation resampling is performed to generate the backfilled cross-polarized image frame, backfilled left oblique light image frame, and backfilled right oblique light image frame. Pixel difference is performed between the main diffuse image frame and the empty conveyor belt background image frame. Connected component extraction is performed on the foreground difference image frame, and the connected component with the largest area is used as the outline of the baked goods. The system generates a baking food contour mask and contour boundary coordinates. Based on the contour boundary coordinates, it calculates the contour center coordinates, contour major axis direction angle, and contour minor axis direction angle. Using the contour center coordinates as the origin of the product surface coordinates, the contour major axis direction as the positive direction of the product surface horizontal axis, and the contour minor axis direction as the positive direction of the product surface vertical axis, it establishes a product surface coordinate system. According to the equally spaced horizontal and vertical coordinates of the product surface, it resamples the image pixels within the baking food contour mask into surface element grids, ensuring that the same product surface location in four image frames has the same element number, generating a homonymous element sampling table. The homonymous element sampling table includes the element number, the product surface horizontal coordinate value, the product surface vertical coordinate value, the main diffuse red, green, and blue channel values, the cross-polarized red, green, and blue channel values, the left oblique brightness value, the right oblique brightness value, the product type code value, and the target baking color grade code value.

[0011] Further, based on the same-named element sampling table, the specific steps for calculating the polarization blanking brightness difference, red proportion change value, blue proportion change value, and oblique light reversal brightness difference, and generating the sugar-oil specular interpretable brightening value and the main diffuse interpretable darkening value are as follows: Read the same-named element sampling table; calculate the main diffuse brightness value, main diffuse red proportion value, and main diffuse blue proportion value based on the main diffuse red-green-blue channel values; calculate the cross-polarized brightness value, cross-polarized red proportion value, and cross-polarized blue proportion value based on the cross-polarized red-green-blue channel values; the red proportion value is the ratio of the red channel value to the sum of the red, green, and blue channels, and the blue proportion value is the ratio of the blue channel value to the sum of the red, green, and blue channels; for the same element number, subtract the cross-polarized brightness value from the main diffuse brightness value to generate the polarization blanking brightness difference; calculate the absolute value of the difference between the main diffuse red proportion value and the cross-polarized red proportion value to generate the red proportion change value; calculate the absolute value of the difference between the main diffuse blue proportion value and the cross-polarized blue proportion value to generate the blue proportion change value. The percentage change value; when the polarization blanking brightness difference is greater than the polarization blanking brightness threshold, and the percentage change values ​​of red and blue are both less than the chromaticity perturbation threshold, the polarization blanking brightness difference is written as the interpretable brightening value of the sugar-oil mirror and written to the corresponding surface element number; for surface elements that have not been written with the interpretable brightening value of the sugar-oil mirror, the interpretable brightening value of the sugar-oil mirror is set to 0; calculate the difference between the left oblique light brightness value and the right oblique light brightness value for the same surface element number to generate the oblique light reversal brightness difference value; along the horizontal axis of the product surface Read the oblique light commutation brightness difference of adjacent face elements, and write adjacent face elements with opposite signs of oblique light commutation brightness difference and whose absolute values ​​of both oblique light commutation brightness differences are greater than the oblique light commutation threshold into the shadow commutation face element set; read the absolute value of the oblique light commutation brightness difference of each face element in the shadow commutation face element set, multiply the absolute value of the oblique light commutation brightness difference by the oblique light principal light mapping coefficient to generate the principal diffuse interpretable shading value; for face elements that do not generate a principal diffuse interpretable shading value, set the principal diffuse interpretable shading value to 0.

[0012] Furthermore, using cross-polarized brightness values ​​as a low-reflectivity substrate, superimposing sugar-oil specular interpretable brightening values ​​and subtracting principal diffuse interpretable darkening values, the specific steps for generating principal diffuse reconstructed brightness values ​​are as follows: Cross-polarized brightness values, cross-polarized red proportion values, and cross-polarized blue proportion values ​​are used as low-reflectivity primary color data; standard surface cell records corresponding to the product type coding value and the target baking grade coding value are read from the baking standard surface cell library. These standard surface cell records include standard cross-polarized brightness values, standard cross-polarized red proportion values, standard cross-polarized blue proportion values, brightness tolerance values, red proportion tolerance values, blue proportion tolerance values, over-baked direction channel coding values, and under-baked direction channel coding values. According to the cell number, the low-reflectivity primary color data is matched with the standard cell record. The differences between the cross-polarized brightness value, the cross-polarized red proportion value, and the cross-polarized blue proportion value and their corresponding standard values ​​are calculated to obtain the brightness primary color deviation value, the red primary color deviation value, and the blue primary color deviation value. The three primary color deviation values ​​are divided by the corresponding allowable deviation value to obtain the three normalized deviation values. The sum of the absolute values ​​of the three normalized deviation values ​​is used as the primary color baking deviation value. The channel deviation direction encoding value is generated according to the positive and negative combination of the three primary color deviation values. According to the same cell number, the cross-polarized brightness value is added to the sugar-oil specular interpretable brightening value and then subtracted from the main diffuse interpretable darkening value to generate the main diffuse reconstructed brightness value.

[0013] Further, the specific steps for filtering out reflections and shadow pseudo-anomalies based on the master light closure residual value are as follows: The absolute value of the difference between the master diffuse reconstructed brightness value and the master diffuse brightness value is taken as the master light closure residual value; the face cells with primary color baking deviation values ​​greater than the primary color deviation threshold are selected, and the corresponding face cells are written into the set of face cells to be confirmed for baking deviation; when the sugar-oil mirror's explainable brightening value is greater than the polarization blanking brightness threshold, the master light closure residual value is less than the closure residual threshold, and the absolute value of the difference between the cross-polarization brightness value and the standard cross-polarization brightness value does not exceed the brightness allowable deviation value, the corresponding face cell is removed from the set of face cells to be confirmed for baking deviation; when the master diffuse's explainable darkening value is greater than the shadow inverse darkening threshold, the master light closure residual value is less than the closure residual threshold, and the absolute values ​​of the differences between the cross-polarization red proportion value and the cross-polarization blue proportion value and the corresponding standard proportion value do not exceed the corresponding allowable deviation value, the corresponding face cell is removed from the set of face cells to be confirmed for baking deviation; the remaining face cells are written into the set of face cells with true baking deviation.

[0014] Further, the specific steps for generating the true baking color residual band record are as follows: According to the horizontal coordinate value and the vertical coordinate value of the product surface, connect the spatially adjacent face cells in the true baking color deviation face cell set that have the same channel deviation direction encoding value and whose adjacent difference in primary color baking color deviation value is less than the residual continuity threshold to form the true baking color residual band; calculate the coverage area value, average deviation value, maximum deviation value and residual band channel deviation direction encoding value of the true baking color residual band, and generate the true baking color residual band record based on whether the residual band channel deviation direction encoding value is equal to the over-baked direction channel encoding value and the under-baked direction channel encoding value.

[0015] Further, the specific steps for generating a baking color quality grade mark by comparing the actual baking color residual band records with the baking color quality parameter table are as follows: Read the actual baking color residual band records, product type code values, and target baking color grade code values; read the residual band coverage area limit, residual band maximum deviation limit, over-baked residual band quantity limit, and under-baked residual band quantity limit from the baking color quality parameter table; count the over-baked residual band quantity value and under-baked residual band quantity value based on the actual baking color residual band records; compare the coverage area value, maximum deviation value, over-baked residual band quantity value, and under-baked residual band quantity value of any actual baking color residual band with the corresponding limit value to generate a baking color quality grade mark for the baked goods.

[0016] Furthermore, the specific steps for generating a browning quality rejection token and an automatic quality inspection result record when the product is non-compliant are as follows: When the browning quality grade of the baked goods is marked as non-compliant, the rejection execution point distance value is read from the rejection mechanism parameter table. The rejection trigger time stamp is calculated based on the image acquisition timestamp, the detection conveyor belt speed value, and the rejection execution point distance value. The product trigger number, rejection trigger time stamp, and non-compliant rejection mark are written into the browning quality rejection token. The product trigger number, the actual browning residual band record, the baked goods browning quality grade mark, and the browning quality rejection token are combined to generate an automatic quality inspection result record.

[0017] The second aspect of this invention provides an automatic quality inspection system for baked goods, comprising: a corresponding surface element optical state sampling module, an interference response interpretation and generation module, a main beam closure residual recognition module, and a browning quality token output module, wherein: the corresponding surface element optical state sampling module is used to establish a detection plane with the intersection of the upstream shooting edge line and the left reference edge line of the detection conveyor belt as the origin, to collect main diffuse, cross polarization, left oblique light, and right oblique light image frames of the same baked goods, to perform position compensation based on the pulse value of the conveyor belt encoder, and to resample and generate a corresponding surface element sampling table; the interference response interpretation and generation module is used to calculate the polarization blanking brightness difference and the red proportion change based on the corresponding surface element sampling table. The system generates a sugar-oil specular brightening value and a principal diffuse interpretable darkening value by using the cross-polarized brightness value as a low-reflectivity substrate, superimposing the sugar-oil specular brightening value, and subtracting the principal diffuse interpretable darkening value to generate a principal diffuse reconstructed brightness value. It then filters out reflective and shadow pseudo-anomalies based on the principal light closure residual value to generate a true baking color residual band record. Finally, a baking color quality token output module compares the true baking color residual band record with the baking color quality parameter table to generate a baking color quality grade mark for baked goods. When the quality grade mark is unqualified, it generates a baking color quality rejection token and an automatic quality detection result record.

[0018] Beneficial effects The present invention has the following beneficial effects: (1) An automatic quality inspection method and system for baked goods, which acquires image frames of main diffuse, cross polarization, left oblique light and right oblique light, and performs position backfilling by combining the pulse value of the conveyor belt encoder, and uniformly resamples the same surface position of baked goods into the same surface element with the same surface element number, so that the brightness, color and oblique light response under different light states can be compared under the same spatial reference, avoiding the distortion of the judgment of abnormal baking color caused by conveyor displacement and image misalignment.

[0019] (2) An automatic quality inspection method and system for baked goods does not directly judge the abnormal baking color based on the brightness and darkness changes in the main diffuse image. Instead, it generates an interpretable brightening value for the sugar and oil mirror by using the polarization blanking brightness difference, the red proportion change value and the blue proportion change value, and generates an interpretable darkening value for the main diffuse by using the oblique light reversal brightness difference. This separates the sugar and oil mirror reflection and the edge shadow darkening from the real baking color changes, thereby improving the physical interpretability of the baking color detection results.

[0020] (3) An automatic quality inspection method and system for baked goods, using cross-polarized brightness values ​​as a low-reflectivity substrate, superimposing sugar-oil specularly explainable brightening values ​​and subtracting principal diffusely explainable darkening values ​​to generate principal diffusely reconstructed brightness values, and then verifying the closure relationship between the principal diffusely reconstructed brightness values ​​and the principal diffusely brightness values ​​through the principal light closure residual value. This can eliminate abnormal surface elements that can be explained by reflection and shadow, reducing the possibility of normal sugar-oil bright areas and normal shadow areas being misjudged as overbaked or underbaked defects.

[0021] (4) An automatic quality inspection method and system for baked goods, after the reverse evidence screening, connects the spatially adjacent face cells with consistent channel deviation direction coding values ​​and the basic color baking color deviation value that meets the continuity requirement to form a real baking color residual band, and further generates baking color quality grade mark, baking color quality rejection token and automatic quality inspection result record for baked goods, so that the inspection results can not only point out single point abnormalities, but also form continuous defect areas and executable rejection instructions, thereby improving the stability of online quality judgment, defect traceability and automatic sorting control. Attached Figure Description

[0022] Figure 1 This is a flowchart of an automated quality inspection method for baked goods. Figure 2 This is a structural diagram of an automated quality inspection system for baked goods. Figure 3 Flowchart for generating a sampling table of elements with the same name; Figure 4 This is a residual discriminant diagram for the principal beam closure of the same type of surface element. Detailed Implementation

[0023] 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 some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] Please see Figures 1-4This invention provides a technical solution: an automatic quality inspection method for baked goods, comprising: S1, establishing a detection plane with the intersection of the upstream shooting edge line and the left reference edge line of the detection conveyor belt as the origin, acquiring main diffuse, cross-polarized, left oblique light, and right oblique light image frames of the same baked goods, performing position compensation based on the conveyor belt encoder pulse value, and resampling to generate a corresponding surface element sampling table; S2, calculating the polarization blanking brightness difference, red proportion change value, blue proportion change value, and oblique light reversal brightness difference based on the corresponding surface element sampling table, generating... S3: Using the cross-polarized brightness value as a low-reflectivity substrate, superimpose the brightening value explained by the sugar-oil mirror and subtract the darkening value explained by the main diffuse to generate the main diffuse reconstructed brightness value. Based on the main light closure residual value, filter out reflection and shadow pseudo-anomalies to generate a true baking color residual band record. S4: Compare the true baking color residual band record with the baking color quality parameter table to generate a baking color quality grade mark for baked goods. When the quality grade mark is unqualified, generate a baking color quality rejection token and an automatic quality detection result record.

[0025] Specifically, the steps for establishing a detection plane with the intersection of the upstream shooting edge line and the left reference edge line of the detection conveyor belt as the origin, and acquiring image frames of the same baked food with main diffuse, cross polarization, left oblique light, and right oblique light are as follows: Using the intersection of the upstream shooting edge line and the left reference edge line of the detection conveyor belt as the origin of the detection plane coordinates, the direction of the detection conveyor belt's running direction as the positive direction of the vertical axis of the detection plane, and the width direction of the detection conveyor belt from left to right as the positive direction of the horizontal axis of the detection plane, the camera intrinsic parameters, camera extrinsic parameters, lens distortion parameters, and conveyor belt code are read. The system generates a calibration mapping table from encoder pulse values ​​to pixel coordinates to detection plane coordinates, as well as a conversion relationship between encoder pulse values ​​and conveyor belt displacement. Camera intrinsic parameters include focal length, principal point coordinates, and pixel size; camera extrinsic parameters include camera mounting height, camera pitch angle, camera roll angle, and camera yaw angle; and lens distortion parameters include radial distortion coefficient and tangential distortion coefficient. During equipment calibration, a planar calibration plate with known calibration point spacing values ​​is placed on the conveyor belt bearing plane. The calibration points on the planar calibration plate are arranged in rows and columns. The calibration points are arranged in a regular pattern. The coordinate values ​​of the calibration point detection plane are determined by the row number, column number, and spacing of the calibration points. After acquiring the calibration board image frames, the pixel coordinate values ​​of each calibration point are extracted, and the pixel coordinate values ​​of the calibration points are paired with the corresponding coordinate values ​​of the calibration point detection plane point one by one. A calibration mapping table from pixel coordinates to detection plane coordinates is generated through planar homography calibration, so that the pixel positions in subsequent image frames can be converted into the actual positions in the detection plane. At the same time, the number of pulses per revolution of the conveyor belt encoder, the radius of the conveyor belt drive roller, and the cumulative value of the encoder pulses are read. The perimeter of the conveyor belt drive roller is divided by the number of pulses per revolution of the conveyor belt encoder to generate the single pulse displacement. The single pulse displacement is multiplied by the encoder pulse difference between adjacent image acquisition times to obtain the conveyor belt displacement compensation value between corresponding image frames. Through the calibration mapping table from pixel coordinates to detection plane coordinates and the conversion relationship between encoder pulse values ​​and conveyor belt displacement, the product displacement caused by the difference in acquisition time of different light state image frames is converted into the coordinate offset in the longitudinal direction of the detection plane, providing a unified spatial reference for the position compensation of subsequent four light state images. The detection field of view boundary is formed by projecting the four corner points of the camera's effective imaging area onto the detection plane through a calibration mapping table of pixel coordinates to detection plane coordinates. The upstream shooting edge of the detection conveyor belt serves as the entry boundary of the detection field of view. When the entrance photoelectric trigger signal switches from an unobstructed state to an obstructed state, and the corresponding encoder pulse accumulation value reaches the entry trigger pulse value in the detection parameter table, it is determined that the baked food has entered the detection field of view, and a trigger number for the same product is generated based on the entrance photoelectric trigger signal, the encoder pulse accumulation value, and the current production batch number.When baked goods enter the detection field of view, the main diffuse light source, cross-polarized light source, left low-angle oblique light source, and right low-angle oblique light source are sequentially illuminated based on the same product trigger number. After each light source is illuminated, a corresponding image frame is acquired, generating a coded light state image group. Specifically, the main diffuse light source is used to acquire the normal brightness and color response of the baked goods surface. The cross-polarized image frame is acquired under the condition of cross-polarized light source and camera side-detection polarizer. A light source side-polarizer is set at the emission end of the cross-polarized light source, and a camera side-detection polarizer is set in front of the camera lens. The polarization direction of the light source side-polarizer is at a 90-degree angle to the transmission direction of the camera side-detection polarizer, used to reduce the specular reflection of sugar and oil to obtain a low-reflectivity substrate. The left low-angle oblique light source and right low-angle oblique light source... Light is incident from both sides of the product surface laterally to create oblique light responses with opposite shadow directions, thus providing paired inputs for subsequent calculation of the brightness difference between oblique light reversals. Under the same product trigger number, four light state acquisitions are executed according to a fixed trigger sequence. Each acquisition first writes the light source code value, then waits for the light source to light up and stabilize before exposure begins via the camera's hard trigger interface. The midpoint of the exposure is used as the image acquisition timestamp, and the corresponding conveyor belt encoder pulse value is recorded. This ensures that the main diffuse image frame, cross-polarized image frame, left oblique light image frame, and right oblique light image frame have traceable time and displacement references. The coded light state image group includes the product trigger number, image acquisition timestamp, and conveyor belt encoder pulse value. The image includes the following frames: conveyor belt speed value, product type code value, target browning grade code value, main diffuse image frame, cross-polarized image frame, left oblique light image frame, right oblique light image frame, and empty conveyor belt background image frame. The conveyor belt speed value is calculated from the encoder pulse difference, single-pulse displacement, and time difference between adjacent sampling times. The product type code value is written from the production batch work order, and the target browning grade code value is written from the current production recipe record. The empty conveyor belt background image frame is acquired when the conveyor belt is running and there is no baked goods within the detection field of view. During acquisition, the main diffuse light source is illuminated while the cross-polarized light source, left low-angle oblique light source, and right low-angle oblique light source are turned off, ensuring the empty conveyor belt background image frame is synchronized with subsequent images. The main diffuse image frame used for the prime difference uses the same illumination aperture; the background image frame of the empty conveyor belt is acquired once at the beginning of the production batch and re-acquired during the empty update time window when no products pass through the detection field of view. The re-acquired background image frame replaces the previous empty conveyor belt background image frame to eliminate the influence of conveyor belt surface residues and slow changes in ambient illumination on the contour extraction of baked goods; by binding the four optical image frames, image acquisition timestamps, conveyor belt encoder pulse values ​​and product trigger numbers to the same coded optical image group, it can be ensured that the main diffuse brightness value, cross-polarization brightness value, left oblique light brightness value and right oblique light brightness value in the subsequent same-name surface element sampling table all come from the same surface position of the same baked goods.

[0026] In this implementation scheme, by unifying the detection plane, calibration mapping table, the conversion relationship between encoder pulse values ​​and conveyor belt displacement, and the coded optical image group into the same spatial and temporal reference, the main diffuse image frame, cross-polarized image frame, left oblique light image frame, and right oblique light image frame have a traceable, replenishable, and comparable data foundation before entering the same-name surface element sampling table. This reduces the risk of surface element mismatch caused by conveyor displacement, differences in acquisition timing, and confusion of optical source from the source. It provides stable input for the subsequent calculation of the interpretable brightening value of sugar and oil mirror, the interpretable darkening value of main diffuse, and the residual value of main light closure. This allows the brightness and darkness response of the baked food surface to be supported by data relationships with consistent positions during the intelligent visual recognition process, improving the reliability of the browning anomaly judgment and the verifiability of online detection results.

[0027] Specifically, the steps for position backfilling based on the conveyor belt encoder pulse values ​​and resampling to generate a sampling table of the same surface element are as follows: Figure 3As shown, distortion correction is performed on the main diffuse image frame, cross-polarized image frame, left oblique light image frame, and right oblique light image frame according to the lens distortion parameter values, to obtain the corrected main diffuse image frame, corrected cross-polarized image frame, corrected left oblique light image frame, and corrected right oblique light image frame; wherein, the distortion correction is based on the radial distortion coefficient value, tangential distortion coefficient value, focal length value, and principal point coordinate value, and the corrected red, green, and blue channel values ​​and brightness values ​​are written back through bilinear interpolation. Using the conveyor belt encoder pulse value corresponding to the midpoint of the exposure of the main diffuse image frame as the reference pulse value, the pulse difference between the conveyor belt encoder pulse value and the reference pulse value corresponding to the midpoint of the exposure of the cross-polarized image frame, the left oblique light image frame, and the right oblique light image frame is calculated respectively. The pulse difference is multiplied by the single pulse displacement to obtain the conveyor belt displacement compensation value. In the detection plane coordinate system, the lateral compensation is set to 0, and the longitudinal compensation is set to the corresponding conveyor belt displacement compensation value to form a two-dimensional compensation amount for the detection plane. According to the calibration mapping table from pixel coordinates to detection plane coordinates, the cross-polarized image frame, the left oblique light image frame, and the right oblique light image frame are... The pixel coordinates in the image frame and the right oblique light image frame are mapped to the detection plane coordinates. Then, the corresponding longitudinal compensation amount is subtracted from the mapped detection plane longitudinal coordinates to align the same baked food surface position to the spatial reference of the main diffuse image frame. By calibrating the inverse mapping relationship of the mapping table and bilinear interpolation resampling, the back-compensated cross-polarized image frame, the back-compensated left oblique light image frame, and the back-compensated right oblique light image frame are generated. This positional compensation uses the conveyor belt encoder pulse value at the midpoint of the exposure of each image frame as the displacement measurement basis, which can adapt to the slight fluctuations in the detection conveyor belt speed value within the adjacent light state acquisition interval. The main diffuse image frame and the background image frame of the empty conveyor belt are pixel-differentiated to generate a foreground difference image frame. Connected component extraction is performed on the foreground difference image frame, and connected components whose area is within the allowable range of the product projection area and whose contour center coordinates are within the range of the viewing position corresponding to the product trigger number are retained. The allowable range of the product projection area is determined by the minimum and maximum qualified baked food projection area values ​​corresponding to the current product type code value. The viewing position range corresponding to the product trigger number is calculated by converting the entrance photoelectric trigger position value, the detection conveyor belt speed value, and the image acquisition timestamp. When a single baked food enters the detection field of view, the connected component that meets the conditions and has the largest area is taken as the contour region of the baked food, and the contour mask and contour boundary coordinate values ​​of the baked food are generated.Based on the contour boundary coordinates, calculate the contour center coordinates, contour major axis direction angle, and contour minor axis direction angle. Establish a product surface coordinate system using the contour center coordinates as the origin, the contour major axis direction as the positive horizontal axis direction, and the contour minor axis direction as the positive vertical axis direction. Specifically, read the horizontal and vertical coordinates of all foreground pixels within the baked goods contour mask, calculate the mean coordinates of all foreground pixels, and generate the contour center coordinates. Perform principal component direction analysis on the coordinate offsets of all foreground pixels relative to the contour center coordinates, selecting the direction with the largest variance as the contour major axis direction and generating the contour major axis direction angle, and selecting the direction perpendicular to the contour major axis direction as the contour minor axis direction and generating the contour minor axis direction angle. Based on the equally spaced horizontal and vertical coordinates of the product surface, the image pixels within the contour mask of the baked goods are resampled into surface cell grids. The equally spaced horizontal and vertical coordinates of the product surface represent the coordinate sampling interval in the product surface coordinate system, measured in millimeters, ranging from 1 mm to 5 mm. This interval is determined by the camera's detection plane resolution, the minimum identifiable browning defect width, and the surface dimension corresponding to the current product type code. Based on the minimum, maximum, minimum, and maximum horizontal coordinates of the contour boundary in the product surface coordinate system, horizontal cell numbers are assigned according to the equally spaced horizontal coordinates, and vertical cell numbers are assigned according to the equally spaced vertical coordinates. The horizontal and vertical cell numbers are then combined to generate a cell number. For the main diffuse image frame, the inpainted cross-polarized image frame, the inpainted left oblique light image frame, and the inpainted right oblique light image frame, the pixel coordinates are first converted to detection plane coordinates via a calibration mapping table from pixel coordinates to detection plane coordinates. Then, based on the contour center coordinates, contour major axis direction angle, and contour minor axis direction angle, they are converted to the horizontal and vertical coordinates of the product surface. Finally, the same cell number is written according to the horizontal and vertical cell numbers. For each cell number, the pixels that fall within the cell boundary and are located within the baked food contour mask are read, and the average values ​​of the red, green, and blue channels are calculated in the main diffuse image frame. The average values ​​of the red, green, and blue channels are calculated and written into the main diffuse red, green, and blue channel values. In the cross-polarized image frame after inpainting, the average values ​​of the red, green, and blue channels are calculated and written into the cross-polarized red, green, and blue channel values. In the left oblique light image frame after inpainting, the average brightness value is calculated and written into the left oblique light brightness value. In the right oblique light image frame after inpainting, the average brightness value is calculated and written into the right oblique light brightness value. A corresponding surface element sampling table is generated. The corresponding surface element sampling table includes the surface element number, the horizontal coordinate value of the product surface, the vertical coordinate value of the product surface, the main diffuse red, green, and blue channel values, the cross-polarized red, green, and blue channel values, the left oblique light brightness value, the right oblique light brightness value, the product type code value, and the target baking color level code value.By binding the corresponding sampled values ​​in four optical image frames with the same product surface coordinate system, the same surface element grid, and the same element number, the subsequent polarization blanking brightness difference, red proportion change value, blue proportion change value, and oblique light reversal brightness difference are all calculated at the same product surface position.

[0028] In this implementation scheme, by forming a continuous and consistent data connection between the position compensation results, the baking food contour mask, the product surface coordinate system, and the corresponding surface element sampling table, the values ​​of the main diffuse red, green, and blue channels, the cross-polarized red, green, and blue channels, the left oblique light brightness value, and the right oblique light brightness value are all constrained to be compared under the same surface element number. This reduces the impact of lens distortion, transport displacement, product rotation, and boundary noise on the surface element matching accuracy. It provides a consistent input basis for the interpretable brightening value of the sugar and oil mirror, the interpretable darkening value of the main diffuse, and the main light closure residual value, thereby improving the accuracy of subsequent differentiation between reflection pseudo-anomalies, shadow pseudo-anomalies, and true baking color deviation.

[0029] Specifically, the steps for calculating the polarization blanking brightness difference, red proportion change value, blue proportion change value, and oblique light reversal brightness difference based on the same-named element sampling table, and generating the interpretable brightening value and the interpretable darkening value of the sugar-oil mirror, are as follows: Read the same-named element sampling table; calculate the main diffuse brightness value, main diffuse red proportion value, and main diffuse blue proportion value based on the main diffuse red, green, and blue channel values; calculate the cross-polarized brightness value, cross-polarized red proportion value, and cross-polarized blue proportion value based on the cross-polarized red, green, and blue channel values; wherein, the main diffuse brightness value is obtained by weighting the main diffuse red channel value, main diffuse green channel value, and main diffuse blue channel value according to brightness conversion factors of 0.299, 0.587, and 0.114; the cross-polarized brightness value is obtained by weighting the cross-polarized red channel value, cross-polarized green channel value, and cross-polarized blue channel value according to the same brightness conversion factor of 0.299, 0.587, and 0.114. The calculation coefficients are written from the image processing parameter table to ensure that the main diffuse brightness value and the cross-polarization brightness value have the same brightness aperture. The red proportion is the ratio of the red channel value to the sum of the red, green, and blue channels, and the blue proportion is the ratio of the blue channel value to the sum of the red, green, and blue channels. Before calculating the red and blue proportions, it is first determined whether the sum of the red, green, and blue channels is greater than the lower limit of the channel sum. The lower limit of the channel sum is 10 to 20 gray levels, determined by the upper limit of the camera's dark field noise and the residual brightness value of the background of the empty conveyor belt. When the sum of the red, green, and blue channels is not greater than the lower limit of the channel sum, the corresponding cell number is recorded as the low signal-to-noise ratio cell number, the red and blue proportions are not calculated, and no interpretable brightening value is written to this cell number. When the sum of the red, green, and blue channels is greater than the lower limit of the channel sum, the red and blue proportions are calculated separately according to the same denominator to ensure that the changes in the red and blue proportions have consistent denominator validity conditions.For the same element number, the main diffuse brightness value is subtracted from the cross-polarization brightness value to generate a polarization blanking brightness difference. This polarization blanking brightness difference characterizes the brightness components in the main diffuse image frame that can be suppressed by the cross-polarization image frame. The specular reflection from the sugar-oil mirror is weakened under cross-polarization acquisition conditions, and the true color change maintains a relatively consistent chromaticity change in both the main diffuse and cross-polarization image frames. The absolute value of the difference between the main diffuse red proportion value and the cross-polarization red proportion value is calculated to generate a red proportion change value. The absolute value of the difference between the main diffuse blue proportion value and the cross-polarization blue proportion value is also calculated. The system generates a blue percentage change value; red and blue percentage change values ​​are used to determine whether the highlight change is accompanied by a change in the baking color channel; the polarization blanking brightness threshold is set to 8 to 25 gray levels, determined by the 95th quantile of the difference distribution obtained by subtracting the cross-polarization brightness value from the main diffuse brightness value in historical qualified baked goods samples; the chromaticity perturbation threshold is set to 0.015 to 0.035, determined by the normal fluctuation range of the absolute difference between the main diffuse red percentage value and the cross-polarization red percentage value, and the absolute difference between the main diffuse blue percentage value and the cross-polarization blue percentage value in historical qualified baked goods samples. When the polarization blanking brightness difference is greater than the polarization blanking brightness threshold, and both the red and blue percentage change values ​​are less than the chromaticity perturbation threshold, the polarization blanking brightness difference is written as the interpretable brightening value of the sugar-oil mirror and written to the corresponding surface cell number; for surface cells that do not have an interpretable brightening value written, the interpretable brightening value of the sugar-oil mirror is set to 0. For the same surface element number, calculate the difference between the left and right oblique light brightness values ​​to generate an oblique light reversal brightness difference value. This value is recorded using a signed brightness difference: a positive value indicates the left oblique light brightness is higher than the right, a negative value indicates the left oblique light brightness is lower than the right, and zero indicates the left and right oblique light brightness are the same. Since the left and right low-angle oblique light sources are incident from the horizontal sides of the product surface, shadow reversal mainly occurs along the horizontal axis of the product surface. Therefore, the oblique light reversal brightness difference value of adjacent surface elements is read along the horizontal axis of the product surface. Adjacent surface elements are two directly adjacent surface elements with the same vertical surface element number and a horizontal surface element number difference of 1. The surface elements are then arranged according to the product surface... The horizontal axis is arranged from left to right. When the product of the two oblique light reversal brightness differences of a pair of face elements is less than 0, and the absolute value of both oblique light reversal brightness differences is greater than the oblique light reversal threshold, the pair of face elements is written into the shadow reversal face element set. When any oblique light reversal brightness difference is 0, the product of the two oblique light reversal brightness differences is greater than 0, and the absolute value of any oblique light reversal brightness difference is not greater than the oblique light reversal threshold, the pair of face elements is not written into the shadow reversal face element set. Boundary face elements located on the horizontal axis boundary of the product surface and lacking horizontally adjacent face elements are not included in the pairing face element judgment. The oblique light reversal threshold is taken from 6 to 18 gray levels and is determined by the 95th quantile of the distribution of the absolute value of the difference between the left and right oblique light brightness values ​​in historical qualified baked food samples.The absolute values ​​of the oblique light commutation brightness differences for each element in the set of shadow commutation elements are read. These absolute values ​​are then multiplied by the oblique light principal ray mapping coefficient to generate the interpretable principal diffuse shading value. The oblique light principal ray mapping coefficient is a conversion factor from the left and right oblique light commutation intensities to the principal diffuse shading amount, obtained from historical qualified baked goods samples. During calibration, the absolute values ​​of the oblique light commutation brightness differences for shadow commutation elements in the historical qualified baked goods samples, as well as the absolute values ​​of the differences between the principal diffuse brightness value of the same element and the median principal diffuse brightness of neighboring non-shadow elements, are read. For each value, the absolute value of the main diffuse brightness difference is divided by the absolute value of the corresponding oblique light reversal brightness difference to obtain the single-sample mapping ratio. The median of all single-sample mapping ratios under the same product type code value and the same target baking color level code value is taken as the oblique light main light mapping coefficient. The oblique light main light mapping coefficient is used to convert the shadow reversal intensity under the left and right oblique lights into the interpretable shading amount in the main diffuse image frame, so that the main diffuse interpretable shading value and the main diffuse brightness value adopt the same brightness caliber. For face cells that do not generate a main diffuse interpretable shading value, the main diffuse interpretable shading value is set to 0. By writing the sugar-oil mirror interpretable brightening value and the main diffuse interpretable shading value respectively, the bright reflection component and shadow shading component under the same face cell number have a computable source, providing direct input for the subsequent calculation of the main diffuse reconstructed brightness value and the main light closure residual value.

[0030] In this implementation scheme, the polarization blanking brightness difference, red proportion change value, blue proportion change value, and oblique light reversal brightness difference value are converted into interpretable brightening values ​​of sugar and oil mirror and interpretable darkening values ​​of main diffuse under the same surface element number. This makes the deviation between the reflection of sugar and oil mirror and shadow darkening and the actual baking color form a distinguishable data evidence chain in the intelligent visual recognition process, avoiding the confusion of brightness and dark anomalies caused by simply relying on the main diffuse brightness value. It also enables the subsequent main diffuse reconstructed brightness value and main light closure residual value to be closed based on the same surface element number, thereby improving the interpretability, stability and anti-interference ability of baking color anomaly recognition in baked goods.

[0031] Specifically, the steps for generating the main diffuse reconstructed brightness value are as follows: using the cross-polarized brightness value as a low-reflectivity base, superimposing the sugar-oil specular interpretable brightening value and subtracting the main diffuse interpretable darkening value. The cross-polarized brightness value, cross-polarized red proportion value, and cross-polarized blue proportion value are used as low-reflectivity primary color data. The low-reflectivity primary color data are used to characterize the surface base baking response after the sugar-oil specular reflection is suppressed by cross-polarized acquisition. The cross-polarized brightness value reflects the basic brightness and darkness state of the surface element, and the cross-polarized red proportion value and cross-polarized blue proportion value reflect the basic chromaticity state of the surface element, so that the subsequent baking deviation judgment does not directly depend on the bright reflection and shadow darkening response in the main diffuse image frame. Standard surface element records corresponding to the product type code value and the target baking color grade code value are read from the baking color standard surface element library. The standard surface element records include standard cross-polarized brightness value, standard cross-polarized red proportion value, standard cross-polarized blue proportion value, brightness allowable deviation value, red proportion allowable deviation value, blue proportion allowable deviation value, over-baked direction channel code value, and under-baked direction channel code value. The baking color standard surface element library is indexed according to the product type code value, the target baking color grade code value, and the surface element number. The historical qualified baked food samples in the baking color standard surface element library are baked food samples that have been manually verified to reach the target baking color grade, have not detected the true baking color residual band, and have qualified image acquisition quality. The historical qualified baked food samples are processed according to the same detection plane, product surface coordinate system, surface surface element grid, and same surface element sampling table generation rules as the baked food to be tested, so that the standard surface element records have the same surface element number and coordinate diameter as the surface elements to be tested. For the same product type code value, the same target browning grade code value, and the same face element number, the cross-polarized brightness value, cross-polarized red percentage value, and cross-polarized blue percentage value of historical qualified baked food samples are statistically analyzed, and the median value under each face element number is written into the standard cross-polarized brightness value, standard cross-polarized red percentage value, and standard cross-polarized blue percentage value, respectively. When the product formula, target browning grade code value, camera calibration parameter value, and light source installation parameter value change, historical qualified baked food samples are re-collected and the standard face element records under the corresponding index are updated.The allowable deviation value for brightness is taken as the 95th quartile of the absolute value of the difference between the cross-polarized brightness value and the standard cross-polarized brightness value in historical qualified baked goods samples. The allowable deviation value for red proportion is taken as the 95th quartile of the absolute value of the difference between the cross-polarized red proportion and the standard cross-polarized red proportion in historical qualified baked goods samples. The allowable deviation value for blue proportion is taken as the 95th quartile of the absolute value of the difference between the cross-polarized blue proportion and the standard cross-polarized blue proportion in historical qualified baked goods samples. The unit of the allowable deviation value for brightness is gray level, and the allowable deviation values ​​for red proportion and blue proportion are dimensionless ratios. When the deviation value is less than the lower limit of the luminance allowable deviation, the luminance allowable deviation value is taken as the lower limit of the luminance allowable deviation, which is 1 to 3 gray levels; when the red proportion allowable deviation value is less than the lower limit of the red proportion allowable deviation, the red proportion allowable deviation value is taken as the lower limit of the red proportion allowable deviation, which is 0.003 to 0.010; when the blue proportion allowable deviation value is less than the lower limit of the blue proportion allowable deviation, the blue proportion allowable deviation value is taken as the lower limit of the blue proportion allowable deviation, which is 0.003 to 0.010, so that all three allowable deviation values ​​are non-zero positive values. The low-reflectivity primary color data is matched with the standard primary color record according to the cell number. The differences between the cross-polarized brightness value, the cross-polarized red proportion value, and the cross-polarized blue proportion value and the corresponding standard value are calculated to obtain the brightness primary color deviation value, the red primary color deviation value, and the blue primary color deviation value. Specifically, the brightness primary color deviation value is the difference between the cross-polarized brightness value and the standard cross-polarized brightness value, the red primary color deviation value is the difference between the cross-polarized red proportion value and the standard cross-polarized red proportion value, and the blue primary color deviation value is the difference between the cross-polarized blue proportion value and the standard cross-polarized blue proportion value. The three primary color deviation values ​​are divided by their corresponding allowable deviation values ​​to obtain three normalized deviation values. The sum of the absolute values ​​of the three normalized deviation values ​​is used as the primary color baking deviation value. Specifically, the luminance primary color deviation value is divided by the luminance allowable deviation value to generate the luminance normalized deviation value, the red primary color deviation value is divided by the red proportion allowable deviation value to generate the red normalized deviation value, and the blue primary color deviation value is divided by the blue proportion allowable deviation value to generate the blue normalized deviation value. All three normalized deviation values ​​are dimensionless values. The primary color baking deviation value is the sum of the absolute values ​​of the three normalized deviation values. This is an accumulation with the same caliber after each channel has been normalized by its corresponding allowable deviation value, without setting additional empirical weights, thereby avoiding incomparability of deviation intensity between the luminance channel and the chrominance channel due to different dimensions.The channel deviation direction encoding value is generated based on the positive and negative combinations of the three primary color deviation values. Specifically, the luminance direction encoding tolerance value, red proportion direction encoding tolerance value, and blue proportion direction encoding tolerance value are read from the direction encoding tolerance table. The luminance direction encoding tolerance value is one-tenth of the luminance allowable deviation value, the red proportion direction encoding tolerance value is one-tenth of the red proportion allowable deviation value, and the blue proportion direction encoding tolerance value is one-tenth of the blue proportion allowable deviation value. When the luminance primary color deviation value is greater than the luminance direction encoding tolerance value, it is recorded as L+; when the luminance primary color deviation value is less than the negative of the luminance direction encoding tolerance value, it is recorded as L-; when the absolute value of the luminance primary color deviation value is not greater than the luminance direction encoding tolerance value, it is recorded as L0. When the red primary color deviation value is greater than the red proportion... The directional encoding tolerance value is denoted as R+. When the red primary color deviation value is less than the negative of the red proportion directional encoding tolerance value, it is denoted as R-. When the absolute value of the red primary color deviation value is not greater than the red proportion directional encoding tolerance value, it is denoted as R0. When the blue primary color deviation value is greater than the blue proportion directional encoding tolerance value, it is denoted as B+. When the blue primary color deviation value is less than the negative of the blue proportion directional encoding tolerance value, it is denoted as B-. When the absolute value of the blue primary color deviation value is not greater than the blue proportion directional encoding tolerance value, it is denoted as B0. The channel deviation directional encoding value is generated by concatenating the luminance item, red proportion item, and blue proportion item in the order of luminance item, red proportion item, and blue proportion item. For example, when the luminance primary color deviation value is positive, the red primary color deviation value is positive, and the blue primary color deviation value is negative, the channel deviation directional encoding value is L+R+B-. The over-baked and under-baked direction channel codes are written into the direction code mapping table corresponding to the baking color standard surface element library. The direction code mapping table is obtained by statistical analysis of over-baked and under-baked samples that have been manually verified. Subsequently, the residual band type value in the real baking color residual band record is determined by comparing the residual band channel deviation direction code value with the over-baked and under-baked direction channel code values. According to the same facet number, the cross-polarized brightness value is added to the sugar-oil specular interpretable brightening value, and then the main diffuse interpretable darkening value is subtracted to generate the main diffuse reconstructed brightness value. Specifically, the goal of the main diffuse reconstructed brightness value is to reconstruct the actual observed main diffuse brightness value under the same facet number, which is used for subsequent calculation of the main light closure residual value, rather than generating the true interference-free brightness value after removing interference. The cross-polarized brightness value serves as the low reflectance base brightness. The sugar-oil specular interpretable brightening value represents the suppressed interpretable bright components in the main diffuse image frame relative to the cross-polarized image frame. Therefore, addition is used to replenish the interpretable bright components in the main diffuse image frame. The main diffuse interpretable darkening value represents the amount of interpretable brightness reduction caused by shadow shading in the main diffuse image frame. Therefore, subtraction is used to reproduce the interpretable dark areas in the main diffuse image frame. The three data items are algebraically synthesized under the same element number; when the synthesized principal diffuse reconstruction brightness value is less than 0, the principal diffuse reconstruction brightness value is set to 0; when the synthesized principal diffuse reconstruction brightness value is greater than 255, the principal diffuse reconstruction brightness value is set to 255, so that the principal diffuse reconstruction brightness value is kept within the grayscale value range of the image.The reconstructed brightness value of the main diffuse reflection is at the same brightness aperture as the main diffuse reflection brightness value, providing a direct input for the subsequent calculation of the main beam closure residual value.

[0032] In this implementation scheme, by unifying low-reflectivity primary color data, standard surface cell records, primary color browning deviation values, channel deviation direction encoding values, and main diffuse reconstructed brightness values ​​under the same surface cell number, the judgment of browning deviation on the surface of baked goods simultaneously has a standard reference, direction differentiation, and brightness reconstruction basis. This avoids confusion between sugar and oil specular reflection, shadow obscuring, and true browning deviation caused by relying solely on the main diffuse brightness value. At the same time, the primary color browning deviation value is normalized and constrained by the allowable deviation values ​​of brightness, red proportion, and blue proportion, so that the deviation intensity of different channels can be compared under a unified dimension. This provides a stable and reliable data foundation for subsequent calculation of the main light closure residual value, screening of true browning deviation surface cells, and generation of true browning residual bands, thereby improving the accuracy and verifiability of browning anomaly judgment.

[0033] Specifically, the steps for filtering out false anomalies of reflection and shadow based on the main light closure residual value are as follows: The absolute value of the difference between the reconstructed brightness value of the main diffuse and the main diffuse brightness value is used as the main light closure residual value. The main light closure residual value is used to characterize the degree of closure between the brightness result reconstructed by the cross-polarization brightness value, the sugar-oil specular interpretable brightening value, and the main diffuse interpretable darkening value and the actual collected main diffuse brightness value. When the main light closure residual value is small, it means that the change in the main diffuse brightness of the current surface element can be explained by the sugar-oil specular interpretable brightening value and the main diffuse interpretable darkening value. When the main light closure residual value is large, it means that the current surface element still has a baking color deviation component that cannot be explained by the reflection brightening and shadow darkening. The closure residual threshold is taken from 3 to 8 gray levels and is determined by the 95th quantile of the distribution of the absolute value of the difference between the reconstructed brightness value of the main diffuse and the main diffuse brightness value in historical qualified baked food samples, so that the closure judgment has a basis for the normal light state difference of similar products. Cells with a base color deviation value greater than the base color deviation threshold are selected and written into the cell set to be confirmed for color deviation. The base color deviation threshold is between 1.5 and 3.0, which is determined by the 95th quantile of the distribution of base color deviation values ​​of historical qualified baked food samples and the boundary value of slightly overbaked samples confirmed by manual review. The cell set to be confirmed for color deviation is used to temporarily store cells whose low reflective base color data has deviated from the standard cell record but have not yet completed the pseudo-anomaly removal. When the interpretable brightening value of the sugar-oil specular surface is greater than the polarization blanking brightness threshold, the main light closure residual value is less than the closure residual threshold, and the absolute value of the difference between the cross-polarization brightness value and the standard cross-polarization brightness value does not exceed the brightness allowable deviation value, the corresponding facet will be removed from the set of facets to be confirmed for color deviation. The polarization blanking brightness threshold is the same threshold used when generating the interpretable brightening value of the sugar-oil specular surface, which is used to confirm that the current facet has a sugar-oil specular brightening amount that can be explained by polarization blanking. The technical principle of this removal condition is that the reflection of the sugar-oil specular surface will increase the main diffuse brightness value, but the cross-polarization brightness value still falls within the allowable range of the standard cross-polarization brightness value, and the main diffuse reconstructed brightness value can close with the main diffuse brightness value. Therefore, the corresponding brightness is not retained as a true color deviation.When the explanatory shading value of the main diffuse is greater than the shading threshold for evidence of shading, the residual value of the main light closure is less than the residual value of closure, and the absolute value of the difference between the cross-polarized red proportion value and the standard cross-polarized red proportion value does not exceed the allowable deviation value of red proportion, and the absolute value of the difference between the cross-polarized blue proportion value and the standard cross-polarized blue proportion value does not exceed the allowable deviation value of blue proportion, the corresponding surface element will be removed from the set of surface elements to be confirmed for baking color deviation. Among them, the shading threshold for evidence of shading is taken from 6 to 18 gray levels, which is determined by the 10th percentile of the distribution of the explanatory shading value of the main diffuse in the shadow-reversed surface elements in historical qualified baked food samples. The technical principle of this removal condition is that shading will reduce the main diffuse brightness value, but the cross-polarized red proportion value and the cross-polarized blue proportion value are still within the allowable range of the standard surface element record, and the main diffuse reconstructed brightness value can close with the main diffuse brightness value. Therefore, the corresponding dark area is not retained as a true baking color deviation. For the unremoved face cells, it is further determined whether the main light closure residual value is not less than the closure residual threshold, and whether at least one of the cross-polarized brightness value, cross-polarized red proportion value, and cross-polarized blue proportion value exceeds the corresponding allowable deviation value. When the main light closure residual value is not less than the closure residual threshold, and at least one of the following conditions is met: the absolute value of the difference between the cross-polarized brightness value and the standard cross-polarized brightness value exceeds the brightness allowable deviation value; the absolute value of the difference between the cross-polarized red proportion value and the standard cross-polarized red proportion value exceeds the red proportion allowable deviation value; or the absolute value of the difference between the cross-polarized blue proportion value and the standard cross-polarized blue proportion value exceeds the blue proportion allowable deviation value, the corresponding face cell is written into the real baking deviation face cell set as a remaining face cell. When the unremoved face cells do not meet the above conditions, the corresponding face cells are not written into the real baking deviation face cell set, and the corresponding face cells are not involved in the real baking residual band connection. The remaining cells in the true baking color deviation cell set are those whose primary color baking color deviation value exceeds the primary color deviation threshold and cannot be eliminated as pseudo-anomalies by the sugar-oil mirror interpretable brightening value, the primary diffuse interpretable darkening value, and the primary light closure residual value, and further meet the low reflectivity primary color data deviation confirmation conditions; the true baking color deviation cell set is used to subsequently generate the true baking color residual band by connecting the product surface horizontal coordinate value, product surface vertical coordinate value, channel deviation direction encoding value, and residual continuity threshold.

[0034] In this implementation scheme, by using the main light closure residual value as the filtering criterion, the bright and dark anomalous surface elements in the set of surface elements to be confirmed for browning deviation are further distinguished into reflective pseudo-anomalies that can be explained by the brightening value of sugar oil specular reflection, shadow pseudo-anomalies that can be explained by the darkening value of the main diffuse reflection, and true browning deviation surface elements that have not been eliminated by reflective and shadow pseudo-anomalies. This prevents the base color browning deviation value from independently determining the browning anomalous conclusion, avoids sugar oil specular reflection and shadow darkening being mistakenly written into the set of true browning deviation surface elements, improves the purity of the set of true browning deviation surface elements, and provides a more reliable judgment basis for subsequent connection of true browning residual bands, generation of browning quality grade markers for baked goods, and output of browning quality elimination tokens.

[0035] Specifically, the steps for generating the true baking color residual band record are as follows: Based on the horizontal and vertical coordinate values ​​of the product surface, connect the spatially adjacent facets in the true baking color deviation facet set that have the same channel deviation direction encoding value and whose adjacent difference in primary color baking color deviation value is less than the residual continuity threshold to form the true baking color residual band; Specifically, using the horizontal and vertical coordinate values ​​of the product surface corresponding to the facet number as the facet spatial index, determine the spatially adjacent facets in the product surface coordinate system using the eight-neighbor adjacency rule, and determine two facets with a horizontal facet number difference of no more than 1, a vertical facet number difference of no more than 1, and different facet numbers as spatially adjacent facets; Facets located at the boundary of the baking food contour mask only establish candidate connection relationships with the adjacent facets that actually exist within the baking food contour mask, and do not extend the connection relationship outside the baking food contour mask. For each candidate connection, the channel deviation direction encoding value and the primary color baking deviation value of the two end face elements are read. The absolute value of the difference between the primary color baking deviation values ​​of the two end face elements is taken as the adjacent difference of the primary color baking deviation value. When the channel deviation direction encoding values ​​of the two end face elements are the same and the adjacent difference of the primary color baking deviation value is less than the residual continuity threshold, the candidate connection is retained. The residual continuity threshold is taken from 0.6 to 1.8, which is determined by the 95th quantile of the distribution of adjacent differences of the primary color baking deviation values ​​of adjacent face elements in the same manually checked defect area in the historical defect baked food sample. This allows the gradient face elements in the same real baking defect area to be connected and blocks the erroneous connection between areas with different deviation directions and abrupt changes in deviation intensity. After the candidate connection is retained, the face elements that can reach each other through the retained connection are merged into the same real baking residual band by using the connected component traversal method, and a residual band number is written for each real baking residual band. The coverage area, average deviation, maximum deviation, and channel deviation direction encoding value of the true baking color residual band are calculated. Based on whether the channel deviation direction encoding value is equal to the over-baked and under-baked channel encoding values, a true baking color residual band record is generated. Specifically, the area value of a single complete surface element is obtained by multiplying the equally spaced horizontal coordinate segmentation value of the product surface by the equally spaced vertical coordinate segmentation value, with the unit being square millimeters. For surface elements located at the boundary of the baked food contour mask, the area value of a single complete surface element is proportionally corrected based on the ratio of the number of effective pixels within the baked food contour mask to the theoretical number of pixels within the surface element, resulting in the boundary surface element area value. The coverage area value of the true baking color residual band is obtained by summing the area values ​​of all surface elements within the true baking color residual band, ensuring that the coverage area value has a definite area dimension in the product surface coordinate system.The average deviation value is obtained by averaging the primary color baking deviation values ​​of all facets within the true baking residual band; the maximum deviation value is obtained by taking the maximum primary color baking deviation value of all facets within the true baking residual band; the channel deviation direction encoding value of the residual band is determined by the channel deviation direction encoding value that appears most frequently within the true baking residual band. When the channel deviation direction encoding value that appears most frequently is not unique, the channel deviation direction encoding value with the largest sum of primary color baking deviation values ​​of the corresponding facets is selected as the channel deviation direction encoding value of the residual band. The residual band channel deviation direction encoding value is compared with the over-baked and under-baked direction channel encoding values ​​respectively. When the residual band channel deviation direction encoding value equals the over-baked direction channel encoding value, the residual band type value in the real baked residual band record is written as over-baked; when the residual band channel deviation direction encoding value equals the under-baked direction channel encoding value, the residual band type value in the real baked residual band record is written as under-baked; when the residual band channel deviation direction encoding value is not equal to either the over-baked or under-baked direction channel encoding values, the residual band type value in the real baked residual band record is written as null. The over-baked and under-baked direction channel encoding values ​​are set to be distinct in the direction encoding mapping table. The real baked residual band record includes the residual band number, the set of residual band inner element numbers, the coverage area value, the average deviation value, the maximum deviation value, the residual band channel deviation direction encoding value, and the residual band type value. By recording the actual baking color residual band, the subsequent baking color quality grade marking of baked goods can be determined based on the area, deviation intensity, and over- or under-baking direction of continuous defect areas.

[0036] In this implementation scheme, by transforming the set of true browning deviation facets into true browning residual band records with spatial continuity, directional consistency, and deviation stability, the intelligent visual recognition results are elevated from isolated anomalies of single facets to a structured expression of continuous defect regions, reducing the interference of discrete reflective and shadow residual points on browning quality judgment. At the same time, the true browning residual band records contain coverage area values, average deviation values, maximum deviation values, and residual band channel deviation direction encoding values, which can provide three types of judgment criteria for marking the browning quality grade of baked goods: regional scale, deviation intensity, and over- or under-baking direction, thereby improving the accuracy of true browning defect location, quality grading, and subsequent rejection control.

[0037] Table 1. Data Table for Determining Principal Beam Closure of Same-Name Surface Elements

[0038] In this embodiment, a single baked food item is used as the detection object. Main diffuse, cross-polarized, left oblique light, and right oblique light image frames are acquired on the detection conveyor belt. Position re-sampling of the four-light-state images is performed based on the conveyor belt encoder pulse values, resampling the same product surface location into identically named elements with the same element number. Subsequently, interpretable brightening values ​​for the sugar-oil specular surface and interpretable darkening values ​​for the main diffuse surface are generated based on the identically named element sampling table. The main diffuse brightness value is reconstructed using the cross-polarized brightness value as a low-reflectivity substrate. The main light closure residual value between the reconstructed main diffuse brightness value and the main diffuse brightness value is used to filter out reflective and shadow pseudo-anomalies. After filtering, elements that meet the low-reflectivity primary color data deviation confirmation conditions continue to generate a true baking color residual band based on the product surface coordinates, primary color baking color deviation value, and channel deviation direction encoding value.

[0039] As shown in Table 1, it records the main light closure determination data for each corresponding surface element in this embodiment. The fields include surface element number, product surface coordinates, interpretable brightening value of the sugar-oil specular surface, interpretable darkening value of the main diffuse surface, main light closure residual value, primary color baking deviation value, channel deviation direction encoding value, residual band number, and determination result. In the table, the interpretable brightening value of the sugar-oil specular surface is used to characterize the amount of brightness that can be explained by polarization blanking; the interpretable darkening value of the main diffuse surface is used to characterize the amount of dark area that can be explained by oblique light reversal; the main light closure residual value is used to verify whether there is a closure between the reconstructed brightness value of the main diffuse surface and the main diffuse brightness value; and the primary color baking deviation value and the channel deviation direction encoding value are used to determine the connection relationship between the actual baking deviation surface element and the residual band. In Table 1, the channel deviation direction encoding value D1 is an example encoding in the direction encoding mapping table. D1 is equal to the over-baked direction channel encoding value. The judgment result "true over-baked" indicates that the corresponding surface element belongs to the true baked residual band of residual band number B1, and the residual band type value of this true baked residual band is over-baked. Table 1 is a key field table showing the results of the main light closure screening and residual band formation. The true baked residual band record also includes the coverage area value, average deviation value, maximum deviation value, and residual band channel deviation direction encoding value.

[0040] like Figure 4 As shown, the results of identifying the same-named surface elements formed after four-light-state image frame interpolation for the same baked food are displayed. Each grid in the figure corresponds to a surface element. The background color represents the primary color baking color deviation value, the blue triangle represents the reflection pseudo-anomaly, the orange square represents the shadow pseudo-anomaly, and the red dot represents the real over-baked surface element in this embodiment. The red dots and red connecting bands at positions M06, M07, and M08 indicate that the channel deviation direction encoding values ​​of the three spatially adjacent surface elements are consistent, the primary color baking color deviation values ​​all exceed the primary color deviation threshold, and the adjacent differences meet the residual continuity threshold requirement, thus forming the real baking color residual band corresponding to residual band number B1. Figure 4This corresponds to the steps in the claims that generate interpretable brightening values ​​and interpretable darkening values ​​for sugar-oil mirror based on the sampling table of the same name surface element, filter out reflective pseudo-anomalies and shadow pseudo-anomalies based on the principal light closure residual value, and generate a true baking residual band record.

[0041] Specifically, the steps for generating a baking color quality grade mark by comparing the actual baking color residual band record with the baking color quality parameter table are as follows: Read the actual baking color residual band record, product type code value, and target baking color grade code value; read the residual band coverage area limit, maximum residual band deviation limit, over-baked residual band quantity limit, and under-baked residual band quantity limit from the baking color quality parameter table; specifically, the baking color quality parameter table establishes a parameter index according to the product type code value and target baking color grade code value, with each parameter index corresponding to a baking color quality limit record; based on the current product type code value and target baking color grade code value of the baked food, query the corresponding baking color quality limit record in the baking color quality parameter table, and read the residual color residual band from the queried baking color quality limit record. The limits for the coverage area of ​​the residual band, the maximum deviation limit of the residual band, the limit for the number of overbaked residual bands, and the limit for the number of underbaked residual bands are set to ensure that baked goods of different sizes, formulas, and target browning levels are judged according to corresponding quality standards. Among them, the limit for the coverage area of ​​the residual band is 20 square millimeters to 300 square millimeters, which is determined by the allowable local color difference area of ​​the product, the minimum continuous defect area in the manually reviewed unqualified samples, and the production quality inspection standards. The limit for the maximum deviation of the residual band is 3.0 to 8.0, which is determined by the distribution boundary of the basic color deviation value in the manually reviewed overbaked and underbaked samples. The limit for the number of overbaked residual bands is 1 to 5, and the limit for the number of underbaked residual bands is 1 to 5, which is determined by the allowable number of consecutive overbaked areas and consecutive underbaked areas in a single baked goods. The number of over-baked and under-baked residual bands is calculated based on the actual baking residual band records. Specifically, the residual band type value in each actual baking residual band record is read. The number of actual baking residual bands with the residual band type value of over-baked is accumulated to generate the number of over-baked residual bands. The number of actual baking residual bands with the residual band type value of under-baked is accumulated to generate the number of under-baked residual bands. Actual baking residual bands with the residual band type value of null are not included in the number of over-baked and under-baked residual bands.The coverage area, maximum deviation, number of overbaked and underbaked residual bands of any true coloring residual band are compared with their corresponding limits to generate a coloring quality grade mark for baked goods. Specifically, a single-band exceedance judgment is first performed on each true coloring residual band. When the coverage area of ​​any true coloring residual band is greater than the residual band coverage area limit, a non-compliance mark is generated. When the maximum deviation of any true coloring residual band is greater than the residual band maximum deviation limit, a non-compliance mark is generated. Then, a global quantity exceedance judgment is performed. When the number of overbaked residual bands exceeds the overbaked residual limit, a non-compliance mark is generated. When there is a quantity limit, a non-conforming mark is generated; when the quantity value of the underbaked residual band is greater than the quantity limit of the underbaked residual band, a non-conforming mark is generated; when the coverage area value is equal to the coverage area limit of the residual band, the maximum deviation value is equal to the maximum deviation limit of the residual band, the quantity value of the overbaked residual band is equal to the quantity limit of the overbaked residual band, and the quantity value of the underbaked residual band is equal to the quantity limit of the underbaked residual band, a non-conforming mark is not triggered; when neither the single band exceeding the limit judgment nor the global quantity exceeding the limit judgment triggers a non-conforming mark, a conforming mark is generated; the conforming mark and the non-conforming mark constitute the baking color quality grade mark of the baked food. The technical principle of this process is that the coverage area value of the true baking color residual band is used to characterize the influence range of baking color defects, the maximum deviation value is used to characterize the severity of baking color defects, and the number of over-baked and under-baked residual bands is used to characterize the frequency of occurrence of defect areas. By first judging the area and intensity of a single true baking color residual band, and then judging the number of residual bands within the same baked food, the baking color quality grade mark of baked food can simultaneously reflect the defect range, defect intensity, and defect distribution quantity, avoiding the direct triggering of a quality non-compliance conclusion by a single slight deviation of a surface element, and making the quality judgment result correspond to the true continuous defect area.

[0042] In this implementation plan, by establishing a corresponding comparison relationship between the actual browning residual band records and the browning quality parameter table, the browning quality grade marking of baked goods no longer depends on the deviation value of a single point element, but is supported by the coverage area value, the maximum deviation value, the number of over-baked residual bands, and the number of under-baked residual bands. This allows the quality judgment to simultaneously reflect the defect range, defect intensity, and defect distribution quantity, reducing the interference of slight local fluctuations on the qualified and unqualified markings, and improving the consistency, verifiability, and production adaptability of browning quality judgment under different product type coding values ​​and target browning grade coding values.

[0043] Specifically, the steps for generating a browning quality rejection token and an automatic quality inspection result record when a product is found to be non-compliant are as follows: When the browning quality grade of the baked goods is marked as non-compliant, the rejection execution point distance value is read from the rejection mechanism parameter table. The rejection trigger time stamp is calculated based on the image acquisition timestamp, the detection conveyor belt speed value, and the rejection execution point distance value. The product trigger number, rejection trigger timestamp, and non-compliant rejection mark are then written into the browning quality rejection token. Specifically, the rejection execution point distance value is the distance measured along the running direction of the detection conveyor belt between the main diffuse image frame acquisition baseline and the center line of the rejection execution point. The main diffuse image frame acquisition baseline is the transverse baseline of the detection field of view center position in the longitudinal direction of the detection plane. The center line of the rejection execution point is the transverse baseline of the rejection mechanism's action center in the width direction of the detection conveyor belt. The unit of the rejection execution point distance value is millimeters. The conveyor belt speed value is determined using the speed value bound to the product trigger number in the coded optical image group, measured in millimeters per second. The image acquisition timestamp uses the image acquisition timestamp corresponding to the main diffuse image frame as the reference timestamp, ensuring that the browning quality judgment position and the rejection trigger timestamp share the same time reference. Under stable conveyor belt speed conditions, the rejection trigger timestamp is calculated as follows: the rejection trigger timestamp equals the image acquisition timestamp plus the ratio of the rejection execution point distance value to the detected conveyor belt speed value. Under conditions of conveyor belt speed fluctuations, the conveyor belt encoder pulse value corresponding to the main diffuse image frame is used as the starting pulse value. Subsequent conveyor belt encoder pulse values ​​are continuously read, and the cumulative conveyor displacement value is calculated based on the conversion relationship between encoder pulse values ​​and conveyor belt displacement. When the cumulative conveyor displacement value reaches the rejection execution point distance value, the corresponding moment is recorded as the rejection trigger timestamp, thus avoiding rejection position deviations caused by calculating based solely on a single detected conveyor belt speed value. When a browning quality rejection token has already been generated for the same product trigger number, a new browning quality rejection token is not written again, and the earliest generated rejection trigger timestamp is retained to prevent the same baked goods from being repeatedly triggered at the rejection execution point. The non-conforming rejection mark in the browning quality rejection token is used to indicate that the rejection action will be performed when the rejection trigger timestamp arrives. The product trigger number is used to bind the rejection action to the corresponding baked goods, and the rejection trigger timestamp is used to limit the execution time of the rejection action. The technical principle of this calculation is that after the baked goods complete image acquisition, they continue to move with the detection conveyor belt. The distance value of the rejection execution point and the conveyor belt displacement measurement result can convert the spatial distance between the detection position and the rejection position into the arrival time, so that the same baked goods corresponding to the browning quality grade mark are accurately rejected when they arrive at the rejection execution point. The product trigger number, the actual browning residual band record, the baked goods browning quality grade mark, and the browning quality rejection token are combined to generate an automatic quality detection result record.Specifically, the automatic quality inspection result record uses the product trigger number as the primary index and writes the residual band number, residual band inner element number set, coverage area value, average deviation value, maximum deviation value, residual band channel deviation direction code value, and residual band type value from the actual browning residual band record. Simultaneously, it writes the baked goods browning quality grade mark. When the baked goods browning quality grade mark is unqualified, a browning quality rejection token is written to the automatic quality inspection result record; when the baked goods browning quality grade mark is qualified, the browning quality rejection token field in the automatic quality inspection result record is set to empty. Through the automatic quality inspection result record, the four-light state image acquisition, actual browning residual band record, baked goods browning quality grade mark, and rejection action sequence of each baked goods form a closed traceability chain under the same product trigger number, facilitating subsequent verification of the actual browning residual band location, quality judgment basis, and rejection execution results.

[0044] In this implementation plan, by binding the baking color quality grade mark, baking color quality rejection token, and automatic quality inspection result record of baked goods to the same product trigger number, the real baking color residual band record obtained by intelligent vision recognition can be directly converted into an executable and traceable online rejection basis, avoiding object mismatch and timing deviation between detection conclusion and rejection action; at the same time, the automatic quality inspection result record retains the correspondence between the real baking color residual band record, the baking color quality grade mark, and the baking color quality rejection token, improving the accuracy of rejecting unqualified baked goods, the completeness of quality verification, and the stability of continuous detection on the production line.

[0045] like Figure 2As shown, the second aspect of the present invention provides an automatic quality inspection system for baked goods, comprising: a homonymous surface element optical state sampling module, an interference response interpretation and generation module, a main beam closure residual recognition module, and a browning quality token output module, wherein: the homonymous surface element optical state sampling module is used to establish a detection plane with the intersection of the upstream shooting edge line and the left reference edge line of the detection conveyor belt as the origin, to collect main diffuse, cross polarization, left oblique light, and right oblique light image frames of the same baked goods, to perform position backfilling based on the pulse value of the conveyor belt encoder, and to resample and generate a homonymous surface element sampling table; the interference response interpretation and generation module is used to calculate the polarization blanking brightness difference and red proportion based on the homonymous surface element sampling table. The system generates interpretable brightening values ​​for the sugar-oil specular surface and interpretable darkening values ​​for the main diffuse reflection, based on the change values ​​of the blue proportion and the brightness difference of the oblique light reversal. The main light closure residual recognition module uses a cross-polarized brightness value as a low-reflectivity substrate, superimposes the interpretable brightening value of the sugar-oil specular surface, and subtracts the interpretable darkening value of the main diffuse reflection to generate the main diffuse reconstructed brightness value. It then filters out reflective and shadow pseudo-anomalies based on the main light closure residual value, generating a true baking color residual band record. The baking color quality token output module compares the true baking color residual band record with the baking color quality parameter table, generates a baking color quality grade mark for baked goods, and generates a baking color quality rejection token and an automatic quality detection result record when the quality grade mark is unqualified.

[0046] In this implementation scheme, by linking the same-name surface element sampling table, the interpretable brightening value of sugar and oil specular surface, the interpretable darkening value of main diffuse reflection, the main light closure residual value, the true baking color residual band record, the baking color quality grade mark of baked food, and the baking color quality rejection token into a complete data processing chain, the surface brightness and darkness response of baked food has a continuous basis for intelligent visual recognition from light state sampling, interference interpretation, residual closure judgment to quality output. This avoids the direct impact of reflective false anomalies and shadow false anomalies on the baking color quality judgment. At the same time, it enables true baking color defects to be transformed into verifiable residual band records and executable rejection tokens, improving the consistency, interpretability, and rejection accuracy of online detection.

[0047] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0048] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. An automated quality inspection method for baked goods, characterized in that, Includes the following steps: S1. Establish a detection plane with the intersection of the upstream shooting edge line of the detection conveyor belt and the left reference edge line as the origin. Collect the main diffuse, cross polarization, left oblique light and right oblique light image frames of the same baked food. Perform position compensation based on the pulse value of the conveyor belt encoder and resample to generate a sampling table of the same surface element. S2, based on the same-name surface element sampling table, calculate the polarization blanking brightness difference, red proportion change value, blue proportion change value and oblique light reversal brightness difference, and generate the sugar oil mirror interpretable brightening value and the main diffuse interpretable darkening value. S3, with the cross-polarized brightness value as a low reflectivity substrate, superimpose the sugar oil mirror interpretable brightening value and subtract the principal diffuse interpretable darkening value to generate the principal diffuse reconstructed brightness value. Based on the principal light closure residual value, filter out reflective and shadow pseudo-anomalies to generate a true baking residual band record. S4 compares the actual browning residual band record with the browning quality parameter table to generate a browning quality grade mark for baked goods, and generates a browning quality rejection token and automatic quality detection result record when the quality grade mark is unqualified.

2. The automatic quality inspection method for baked goods according to claim 1, characterized in that: The specific steps for establishing a detection plane with the intersection of the upstream shooting edge line of the detection conveyor belt and the left reference edge line as the origin, and acquiring the main diffuse, cross-polarized, left oblique light, and right oblique light image frames of the same baked food are as follows: The origin of the detection plane coordinate system is taken as the intersection of the upstream shooting edge line of the detection conveyor belt and the left reference edge line of the detection conveyor belt. The longitudinal direction of the detection plane is taken as the positive direction of the detection plane, and the transverse direction of the detection plane is taken as the width direction of the detection conveyor belt from left to right. The camera intrinsic parameters, camera extrinsic parameters, lens distortion parameters and conveyor belt encoder pulse values ​​are read to generate a calibration mapping table from pixel coordinates to detection plane coordinates and a conversion relationship from encoder pulse values ​​to conveyor belt displacement. When baked goods enter the detection field of view, the main diffuse light source, the cross-polarized light source, the left low-angle oblique light source, and the right low-angle oblique light source are lit sequentially based on the same product trigger number. After each light source is lit, the corresponding image frame is acquired to generate a coded light state image group. The coded light state image group includes the product trigger number, image acquisition timestamp, conveyor belt encoder pulse value, detection conveyor belt speed value, product type code value, target baking color grade code value, main diffuse image frame, cross-polarized image frame, left oblique light image frame, right oblique light image frame, and empty conveyor belt background image frame.

3. The automatic quality inspection method for baked goods according to claim 2, characterized in that: The specific steps for position recovery based on the conveyor belt encoder pulse value and resampling to generate a sampling table of the same surface element are as follows: Distortion correction is performed on the main diffuse image frame, cross-polarized image frame, left oblique light image frame, and right oblique light image frame according to the lens distortion parameter values. The conveyor belt displacement compensation value of the cross-polarized image frame, left oblique light image frame, and right oblique light image frame relative to the main diffuse image frame is calculated according to the conveyor belt encoder pulse value corresponding to each detected image frame. After the cross-polarized image frame, left oblique light image frame, and right oblique light image frame are translated in the opposite direction along the vertical axis of the detection plane according to the corresponding conveyor belt displacement compensation value, bilinear interpolation resampling is performed to generate the back-compensated cross-polarized image frame, back-compensated left oblique light image frame, and back-compensated right oblique light image frame. The main diffuse image frame and the background image frame of the empty conveyor belt are pixel-differentiated. Connected component extraction is performed on the foreground difference image frame. The connected component with the largest area is taken as the outline region of the baked food, and the outline mask and outline boundary coordinate values ​​are generated. The outline center coordinate value, the outline major axis direction angle value and the outline minor axis direction angle value are calculated based on the outline boundary coordinate value. The outline center coordinate value is taken as the origin of the product surface coordinate system, the outline major axis direction is taken as the positive direction of the horizontal axis of the product surface, and the outline minor axis direction is taken as the positive direction of the vertical axis of the product surface. Based on the equally spaced segmentation values ​​of the horizontal coordinates and the equally spaced segmentation values ​​of the vertical coordinates of the product surface, the image pixels within the outline mask of the baked food are resampled into surface cell grids, so that the same product surface position in four image frames has the same cell number, and a cell sampling table with the same name is generated. The same-named surface element sampling table includes the surface element number, the horizontal coordinate value of the product surface, the vertical coordinate value of the product surface, the main diffuse red, green and blue channel value, the cross-polarized red, green and blue channel value, the left oblique light brightness value, the right oblique light brightness value, the product type code value, and the target baking color grade code value.

4. The automatic quality inspection method for baked goods according to claim 3, characterized in that: The specific steps for calculating the polarization blanking brightness difference, red proportion change, blue proportion change, and oblique light reversal brightness difference based on the same-name surface element sampling table, and generating the interpretable brightening value and the interpretable darkening value of the sugar-oil specular surface, are as follows: Read the sampling table of the same-named elements, calculate the main diffuse brightness value, the main diffuse red proportion value, and the main diffuse blue proportion value based on the main diffuse red, green, and blue channel values, and calculate the cross-polarized brightness value, the cross-polarized red proportion value, and the cross-polarized blue proportion value based on the cross-polarized red, green, and blue channel values; the red proportion value is the ratio of the red channel value to the sum of the red, green, and blue channel values, and the blue proportion value is the ratio of the blue channel value to the sum of the red, green, and blue channel values; For the same surface element number, the main diffuse brightness value is subtracted from the cross-polarization brightness value to generate a polarization blanking brightness difference; the absolute value of the difference between the main diffuse red proportion value and the cross-polarization red proportion value is calculated to generate a red proportion change value; the absolute value of the difference between the main diffuse blue proportion value and the cross-polarization blue proportion value is calculated to generate a blue proportion change value; when the polarization blanking brightness difference value is greater than the polarization blanking brightness threshold, and both the red proportion change value and the blue proportion change value are less than the chromaticity perturbation threshold, the polarization blanking brightness difference value is written as the sugar-oil mirror interpretable brightening value to the corresponding surface element number; for surface elements that have not been written with a sugar-oil mirror interpretable brightening value, the sugar-oil mirror interpretable brightening value is set to 0; For the same surface element number, calculate the difference between the left oblique light brightness value and the right oblique light brightness value to generate the oblique light reversal brightness difference value; Read the oblique light reversal brightness difference value of adjacent surface elements along the horizontal axis of the product surface, and write the adjacent surface elements with opposite signs of oblique light reversal brightness difference value and both absolute values ​​of oblique light reversal brightness difference value are greater than the oblique light reversal threshold into the shadow reversal surface element set. Read the absolute value of the oblique light commutation brightness difference of each element in the shadow commutation element set, multiply the absolute value of the oblique light commutation brightness difference with the oblique light principal light mapping coefficient, and generate the principal diffuse interpretable shading value. For facets that do not have a primary diffuse interpretable shading value, set the primary diffuse interpretable shading value to 0.

5. The automatic quality inspection method for baked goods according to claim 4, characterized in that: The specific steps for generating the main diffuse reconstructed brightness value by using a low-reflectivity substrate with cross-polarized brightness value, superimposing a sugar-oil specular explanatory brightness value, and subtracting the main diffuse explanatory darkness value are as follows: The cross-polarized brightness value, cross-polarized red proportion value, and cross-polarized blue proportion value are used as low-reflectivity primary color data. Standard surface cell records corresponding to the product type code value and the target baking color grade code value are read from the baking color standard surface cell library. The standard surface cell records include standard cross-polarized brightness value, standard cross-polarized red proportion value, standard cross-polarized blue proportion value, brightness allowable deviation value, red proportion allowable deviation value, blue proportion allowable deviation value, over-baked direction channel code value, and under-baked direction channel code value. The low-reflectivity primary color data is matched with the standard primary color record according to the surface cell number. The differences between the cross-polarized brightness value, the cross-polarized red proportion value, and the cross-polarized blue proportion value and the corresponding standard value are calculated respectively to obtain the brightness primary color deviation value, red primary color deviation value, and blue primary color deviation value. Divide the three primary color deviation values ​​by their respective allowable deviation values ​​to obtain the three normalized deviation values. Use the sum of the absolute values ​​of the three normalized deviation values ​​as the primary color baking deviation value. Generate the channel deviation direction encoding value based on the positive and negative combinations of the three primary color deviation values. Based on the same element number, the cross-polarized brightness value is added to the sugar-oil mirror-explained brightening value, and then the principal diffuse-explained darkening value is subtracted to generate the principal diffuse reconstructed brightness value.

6. The automatic quality inspection method for baked goods according to claim 5, characterized in that: The specific steps for filtering out reflections and shadow anomalies based on the main light closure residual value are as follows: The absolute value of the difference between the reconstructed brightness value of the principal diffuse and the brightness value of the principal diffuse is taken as the principal light closure residual value; Filter out the face cells whose base color deviation value is greater than the base color deviation threshold, and write the corresponding face cells into the face cell set to be confirmed for color deviation; When the interpretable brightening value of the sugar-oil mirror is greater than the polarization blanking brightness threshold, the main light closure residual value is less than the closure residual threshold, and the absolute value of the difference between the cross-polarization brightness value and the standard cross-polarization brightness value does not exceed the brightness allowable deviation value, the corresponding face element will be removed from the set of face elements to be confirmed for baking color deviation. When the explanatory shading value of the main diffuse is greater than the shading threshold for inverse evidence of shading, the closure residual value of the main light is less than the closure residual threshold, and the absolute values ​​of the differences between the cross-polarized red proportion value and the cross-polarized blue proportion value and the corresponding standard proportion value do not exceed the corresponding allowable deviation value, the corresponding element will be removed from the set of elements to be confirmed for color deviation. The remaining face elements are written into the set of face elements that are offset from the actual baked color.

7. The automatic quality inspection method for baked goods according to claim 6, characterized in that: The specific steps for generating the true baking residual band record are as follows: Based on the horizontal and vertical coordinate values ​​of the product surface, connect the spatially adjacent cells in the set of true baking color deviation cells, cells with the same channel deviation direction encoding value and adjacent primary color baking color deviation values ​​less than the residual continuity threshold, to form the true baking color residual band. Calculate the coverage area, average deviation, maximum deviation, and channel deviation direction encoding value of the true baked residual band. Then, generate a true baked residual band record based on whether the channel deviation direction encoding value of the residual band is equal to the channel encoding values ​​of the over-baked and under-baked directions.

8. The automatic quality inspection method for baked goods according to claim 7, characterized in that: The specific steps for comparing the actual browning residual band with the browning quality parameter table to generate a browning quality grade label for baked goods are as follows: Read the actual baking color residual band record, product type code value and target baking color grade code value, and read the residual band coverage area limit, residual band maximum deviation limit, over-baked residual band quantity limit and under-baked residual band quantity limit from the baking color quality parameter table; Based on the actual baking color residual band records, the number of overbaked residual bands and underbaked residual bands are statistically analyzed; the coverage area value, maximum deviation value, number of overbaked residual bands and number of underbaked residual bands of any actual baking color residual band are compared with the corresponding limit values ​​to generate a baking color quality grade mark for baked goods.

9. An automatic quality inspection method for baked goods according to claim 8, characterized in that: The specific steps for generating browning quality rejection tokens and automatic quality inspection result records when defects are found are as follows: When the browning quality grade of baked goods is marked as unqualified, the distance value of the rejection execution point is read from the rejection mechanism parameter table. The rejection trigger time stamp is calculated based on the image acquisition time stamp, the detection conveyor belt speed value, and the rejection execution point distance value. The product trigger number, rejection trigger time stamp, and unqualified rejection mark are written into the browning quality rejection token. The system combines the product trigger number, the true browning residual band record, the browning quality grade mark of baked goods, and the browning quality rejection token to generate an automatic quality inspection result record.

10. An automated quality inspection system for baked goods, characterized in that, include: The module includes a surface element optical state sampling module, an interference response interpretation and generation module, a main beam closure residual identification module, and a color baking quality token output module, among which: The same-name surface element optical state sampling module is used to establish a detection plane with the intersection of the upstream shooting edge line of the detection conveyor belt and the left reference edge line as the origin, collect the main diffuse, cross polarization, left oblique light and right oblique light image frames of the same baked food, perform position backfilling according to the pulse value of the conveyor belt encoder, and resample to generate the same-name surface element sampling table. The interference response interpretation generation module is used to calculate the polarization blanking brightness difference, red proportion change value, blue proportion change value and oblique light reversal brightness difference based on the same-name surface element sampling table, and generate the sugar oil mirror interpretable brightening value and the main diffuse interpretable darkening value. The main light closure residual recognition module is used to generate the main diffuse reconstructed brightness value by superimposing the sugar oil mirror interpretable brightening value and subtracting the main diffuse interpretable darkening value on a low reflective substrate with the cross-polarized brightness value. Based on the main light closure residual value, reflective and shadow pseudo-anomalies are screened out to generate a true baking residual band record. The browning quality token output module is used to compare the actual browning residual band record with the browning quality parameter table, generate a browning quality grade mark for baked goods, and generate a browning quality rejection token and automatic quality detection result record when the quality grade mark is unqualified.

Citation Information

Patent Citations

  • Food quality detection system

    CN112903929A

  • Food quality and safety detection device and detection method thereof

    CN113671134B