Quality detection system and detection method for baked food production

Through image processing and edge recognition technology, points are uniformly distributed on the edges of baked goods, calculating the ray distance and combining with threshold judgment, the problem of unscientific selection of detection points in the prior art is solved, and efficient and reliable quality detection is achieved.

CN120031874AActive Publication Date: 2025-05-23SHANGHAI XINYING BAKERY CO LTD

Patent Information

Application Number
CN202510503173.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-05-23
Estimated Expiration
2045-04-22

AI Technical Summary

Technical Problem

The existing quality inspection methods for baked goods production are difficult to achieve scientific selection of inspection points, resulting in insufficient response speed and reliability of the inspection process.

Method used

Through image acquisition and edge processing, images of baked goods are acquired and edges of packaging bags and food are identified. Then, points are evenly distributed on the edges, ray redundancy distance is calculated, and the distance threshold and continuous number of times are combined to select the optimal detection point and extrusion edge.

Benefits of technology

The scientific selection of detection points is realized, the response speed and reliability of the detection process are improved, and the accuracy and sensitivity of the detection results are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031874A_ABST
    Figure CN120031874A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of food detection, and discloses a quality detection system and a detection method for baked food production, a region relationship is constructed by collecting packaging bag edges and food edges, and a region to be detected caused by packaging bag deformation or content deviation is screened out in combination with a dynamic point distribution algorithm and redundancy distance analysis. Detection point selection is optimized by calculating the length of a vertical line section of a target area, and precise puncture and gas sampling are achieved in combination with a self-adaptive extrusion device and a residual oxygen detection technology. The system comprises an image acquisition module, an edge processing module, a distribution point calculation module, a region analysis module, a detection decision module and an execution unit, and full-process automation of quality judgment is realized. According to the method, the detection precision and efficiency are remarkably improved, the problem that detection points are selected blindly in traditional manual sampling inspection is solved, and the method is suitable for online quality control of a large-scale baked food production line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of food detection, and in particular to a quality detection system and a detection method for baked food production. Background Art

[0002] With the development of the food industry, especially the baked goods industry, product packaging and preservation technologies are becoming more and more mature. However, after the product is produced, how to effectively conduct quality inspections, especially automated and high-precision inspections of oxygen content and key indicators, is still a major problem in the industry. Traditional detection methods generally rely on manual sampling or fixed-position puncture equipment. Traditional methods rely on the operator's experience to select the puncture position, which is easily affected by factors such as wrinkles in the packaging bag and changes in the shape of the food. It is difficult for humans to accurately judge the safe distance between the edge of the food and the packaging bag, causing the puncture needle to accidentally touch the food body, affecting the accuracy of the detection. Traditional automatic systems mostly adopt a single detection point strategy and do not consider multi-region collaborative analysis. For example, when there are multiple suspicious detection areas on the packaging bag at the same time, the existing method cannot determine the optimal detection position through weight comparison, resulting in insufficient representativeness of the detection results.

[0003] In summary, there is an urgent need for a quality inspection system and inspection method for baked food production to achieve scientific selection of inspection points and improve the response speed and reliability of the inspection process. Summary of the invention

[0004] The present invention provides a quality detection system and method for baked food production, which facilitate solving the problems mentioned in the above background technology.

[0005] The present invention provides the following technical solution: a quality detection system and detection method for baked food production, comprising: Obtain the baked products that have been produced and record them as products to be tested; Capture an image of the product to be inspected directly above the product to be inspected; Obtain an edge of a rectangular packaging bag in the image of the product to be detected, record it as a first edge, and record the area enclosed by the first edge as a first area; An edge of the first region is randomly selected and recorded as the first edge; the two vertices of the first edge are recorded as the first vertex and the second vertex respectively; the edge of the four edges of the first region that intersects with the first edge at the first vertex is recorded as the second edge; the edge of the four edges of the first region that intersects with the first edge at the second vertex is recorded as the third edge; the edge of the four edges of the first region other than the first edge, the second edge and the third edge is recorded as the fourth edge; the vertex of the two vertices of the second edge other than the first vertex is recorded as the third vertex; the vertex of the two vertices of the third edge other than the second vertex is recorded as the fourth vertex; the direction from the first vertex to the second vertex is recorded as the first direction, the direction from the first vertex to the third vertex is recorded as the second direction, the direction from the fourth vertex to the third vertex is recorded as the third direction, and the direction from the fourth vertex to the second vertex is recorded as the fourth direction; Acquire an edge of the baked food in the product image to be detected, record it as a second edge, and record the area surrounded by the second edge as a second area; Arrange points on the four sides of the first area; Get the area to be detected; Select the detection points according to the area to be detected, specifically: The areas of all the areas to be detected are obtained and sorted in descending order, and the top three areas to be detected are selected and recorded as the first target area, the second target area and the third target area in descending order. Obtaining the geometric center of the first target area, recorded as the first detection position; Draw four vertical line segments through the first detection position and perpendicular to the four sides of the first area respectively; one end point of the vertical line segment is the first detection position, and the other end point is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the first vertical line segment; Obtaining the geometric center of the second target area, recorded as the second detection position; Draw four vertical line segments through the second detection position that are respectively perpendicular to the four sides of the first area; one end point of the vertical line segment is the first detection position, and the other end point is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the second vertical line segment; Obtaining the geometric center of the third target area, recorded as the third detection position; Draw four vertical line segments through the third detection position that are respectively perpendicular to the four sides of the first area; one endpoint of the vertical line segment is the first detection position, and the other endpoint is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the third vertical line segment; Compare the lengths of the first vertical line segment, the second vertical line segment, and the third vertical line segment; if the first vertical line segment is the longest, select the first detection position as the detection point, and select the edge of the first area corresponding to the first vertical line segment as the extrusion edge; if the second vertical line segment is the longest, select the second detection position as the detection point, and select the edge of the first area corresponding to the second vertical line segment as the extrusion edge; if the third vertical line segment is the longest, select the third detection position as the detection point, and select the edge of the first area corresponding to the third vertical line segment as the extrusion edge; Conduct quality inspection on the products to be inspected.

[0006] Optionally, the arranging points on the four sides of the first area specifically includes: Setting a point distribution interval, wherein the point distribution interval is used to distribute points on the edge of the first area; Starting from the first vertex on the first side, a point is arranged on the first side at every point arrangement interval until reaching the second vertex, and the arranged points are numbered in ascending order of natural numbers along the first direction; Starting from the first vertex on the second side, a point is arranged on the second side at every point arrangement interval until the third vertex is reached, and the arranged points are numbered in ascending order of natural numbers along the second direction; Starting from the second vertex on the third side, a point is arranged on the third side at every point arrangement interval until the fourth vertex is reached, and the arranged points are numbered in ascending order of natural numbers along the fourth direction; Starting from the third vertex on the fourth side, a point is placed on the fourth side at every point placement interval until the fourth vertex is reached. The points placed along the third direction are numbered in ascending order according to natural numbers.

[0007] Optionally, obtaining the area to be detected specifically includes: Draw a ray perpendicular to the first edge with each point arranged on the first edge as an endpoint, and the direction of the ray is the second direction; if the drawn ray intersects with the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect with the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the third edge, which is the redundant distance of the ray; Take each point on the second edge as an endpoint and draw a ray perpendicular to the second edge, the direction of the ray being the first direction; if the drawn ray intersects the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the fourth edge, which is the redundant distance of the ray; A ray perpendicular to the third side is drawn with each point arranged on the third side as an endpoint, and the direction of the ray is the fourth direction; if the drawn ray intersects with the second edge, the first intersection point of the ray and the second edge along the ray direction is obtained, and the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction is obtained, which is the redundant distance of the ray; if the drawn ray does not intersect with the second edge, the distance from the starting point of the ray to the intersection point of the ray and the first side is obtained, which is the redundant distance of the ray; Draw a ray perpendicular to the fourth side with each point on the fourth side as an endpoint, and the direction of the ray is the third direction; if the drawn ray intersects the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the second side, which is the redundant distance of the ray.

[0008] Optionally, the obtaining of the area to be detected further includes: Setting a distance threshold and a consecutive number threshold, wherein the distance threshold and the consecutive number threshold are used to obtain the area to be detected; Respectively obtain the redundant distance of the ray with each point arranged on the first edge as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the first vertex and along the first direction among all the points arranged on the first edge, if there is a situation where the marked endpoints appear continuously, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, and record it as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the first direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and record them as the first auxiliary ray and the second auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the second direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the first direction is recorded as the first auxiliary curve; the closed figure surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the first auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the fourth edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the second direction, recorded as the first auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the first auxiliary intersection point, recorded as the first auxiliary straight line; the closed area surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the first auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all the marked endpoints on the first edge appear continuously is obtained.

[0009] Optionally, the obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point arranged on the second edge as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the first vertex and along the second direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the second edge, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, which is recorded as the continuous number, and if the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the second direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, which are recorded as the third auxiliary ray and the fourth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the first direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the second direction is recorded as the second auxiliary curve; the closed figure surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the second auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the third edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the first direction, recorded as the second auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the second auxiliary intersection point, recorded as the second auxiliary straight line; the closed area surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the second auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all the marked endpoints on the second edge appear continuously is obtained.

[0010] Optionally, the obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point on the third side as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the fourth vertex, if there is a situation where the marked endpoints appear continuously among all the points on the third side along the fourth direction, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, which is recorded as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the fourth direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, which are recorded as the fifth auxiliary ray and the sixth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the third direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the fourth direction is recorded as the third auxiliary curve; the closed figure surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the second side is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the third direction, recorded as the third auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the third auxiliary intersection point, recorded as the third auxiliary straight line; the closed area surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all marked endpoints on the third side appear continuously is obtained.

[0011] Optionally, the obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point on the fourth side as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the fourth vertex, if there is a situation where the marked endpoints appear continuously among all the points on the fourth side along the third direction, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, and record it as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the third direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and record them as the seventh auxiliary ray and the eighth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the fourth direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the third direction is recorded as the fourth auxiliary curve; the closed figure surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the fourth auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the first edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the fourth direction, recorded as the fourth auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the fourth auxiliary intersection point, recorded as the fourth auxiliary straight line; the closed area surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the fourth auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all marked endpoints on the fourth edge appear continuously is obtained.

[0012] Optionally, the quality inspection of the product to be inspected specifically includes: Get the location of the test point and stick the aluminum foil sticker on the test point; Setting a residual oxygen threshold, which is used to determine whether the quality of baked food is qualified; Obtain the residual oxygen content of the product to be tested, specifically: Insert the needle of the residual oxygen detector into the detection point of the product to be detected, and squeeze the extrusion edge of the product to be detected at the same time; Obtain the reading of the residual oxygen detector and record it as the actual residual oxygen; If the actual residual oxygen content is greater than the residual oxygen content threshold, the baked food is deemed to be of unqualified quality; If the actual residual oxygen content is less than or equal to the residual oxygen content threshold, the quality of the baked food is deemed to be qualified.

[0013] A system for implementing a quality inspection method for baked food production, comprising: An image acquisition module, used to acquire images directly above the product to be inspected, and obtain image data including the edge of the rectangular packaging bag and the edge of the baked food; An edge processing module, used to identify a first edge of the packaging bag and a second edge of the food in the image, and to construct a spatial relationship between the first area and the second area; A point distribution calculation module is used to dynamically distribute points on the four sides of the first area at preset intervals and generate numbers for each side point; The regional analysis module is used to calculate the redundant distance of each distribution point ray, combining the distance threshold and the continuous number threshold; A detection decision module is used to calculate the length of the vertical line segment, select the detection point and the corresponding extrusion edge after comparing the lengths of each vertical line segment, and generate a detection instruction including the detection coordinates and the extrusion edge identifier; Execution unit, including: The positioning mechanism carries the aluminum foil sticker and moves to the detection point in response to the detection instruction to pre-fix the sticker; An adaptive squeezing device with adjustable jaws that adaptively matches the gripping angle of the packaging bag boundary according to the squeezing edge mark; Residual oxygen detector, a micro needle sensor integrated in the puncture positioning mechanism, performs puncture and gas sampling simultaneously during the extrusion process; The result feedback unit compares the residual oxygen data with the threshold and outputs a quality judgment signal.

[0014] The present invention has the following beneficial effects: 1. A quality inspection system and method for the production of baked food, which evenly distributes points at preset intervals on the four sides of the first area to form a point matrix, ensures that the surface state of the edge of the packaging bag is fully sampled. This process sets the point interval and numbers them along four directions. Each point corresponds to a unique number, which can accurately locate subsequent operations such as ray redundant distance calculation and generation of the area to be inspected, and avoid overlap or omission. Compared with random or dense grid sampling, the uniform point distribution strategy can save computing resources to the greatest extent while ensuring sampling coverage. For packaging bags of different specifications, the point distribution interval can be flexibly adjusted to meet the production and detection accuracy requirements of various production lines. In addition, the point numbering system makes the storage, query and visualization of detection data more convenient, which is convenient for subsequent statistical analysis and traceability management. In summary, this strategy not only improves the detection coverage, but also takes into account the computational efficiency, providing efficient support for the subsequent extraction of the area to be inspected and the selection of detection points.

[0015] 2. A quality inspection system and method for the production of baked food, by taking the edge points as the ray endpoints, respectively projecting rays vertically inward, calculating the intersection of the rays with the edge or boundary of the baked food, and obtaining the redundant distance of the rays, which is used to judge the remaining space between the internal structure of the product and the edge. This method is highly flexible: in the case of complex edges or multiple breakpoints of food, the ray projection can automatically adapt to the specific form without the need for manual preset templates. As a measurement indicator, the redundant distance can accurately reflect the distribution of gaps and the degree of deformation inside the product, and is convenient for extracting abnormal areas. Compared with the traditional solution based on overall area segmentation, the method of the present invention is more sensitive to minor defects or local defects. In addition, the ray projection corresponding to the multi-sided points realizes multi-angle and multi-dimensional spatial scanning, providing key data support for subsequent continuous distance threshold judgment. In summary, this step effectively improves the adaptive division capability of the area to be detected, can dynamically respond to the diversification of product forms, and improves the detection accuracy and sensitivity.

[0016] 3. A quality inspection system and method for the production of baked food introduces a distance threshold and a continuous number threshold, marks and screens the redundant distance of the ray, and judges the scope of the suspicious area in combination with the number of continuous marking points. If multiple redundant distances greater than the distance threshold appear continuously, it means that the closed area surrounded by the intersection of these rays with the first edge or the second edge is large. When detecting in this closed area, the needle of the residual oxygen detector will not be inserted into the baked food; combined with the number difference of the continuous marking points, the intersection calculation of the first auxiliary ray and the second auxiliary ray, etc., closed areas of various shapes can be flexibly generated to adapt to different product forms and detection requirements. After adopting the continuous number threshold, the pseudo-area formed by occasional noise points can be eliminated, and the stability and accuracy of area extraction can be improved. In addition, the method can dynamically adjust the threshold parameters to meet the real-time response to changes in different types of baked food, packaging materials and production environment. In summary, this step effectively reduces the false alarm rate while optimizing the area extraction, and improves the robustness and practicality of the detection system; by generating auxiliary rays and dividing the closed area for the four edges of the packaging bag, the method of the present invention can perform multi-angle detection of the product from four directions. Regardless of the points corresponding to the first, second, third or fourth side, the area to be inspected can be extracted according to the same process to achieve a comprehensive scan of the entire food packaging area. This process not only ensures the integrity of the inspection area extraction, but also improves the accuracy of defect positioning through comprehensive analysis of the four-side data.

[0017] 4. A quality inspection system and method for the production of baked food, at the geometric center of the first to third target areas, four line segments are vertically projected along the edge of the first area and the longest one is selected. The center position of the corresponding longest line segment is the inspection point, and the extrusion edge corresponding to the inspection point is further determined. This method automatically finds the optimal inspection point based on the spatial distribution characteristics, without manual preset or empirical rules, and can adaptively cope with baked goods of different shapes and sizes. By selecting the longest vertical line segment, it can be ensured that the impact on the inspection point is minimized when the extrusion edge is subsequently extruded; if the inspection point is close to the extrusion edge, wrinkles may appear at the inspection point when the extrusion edge is extruded; thus, gas leakage or packaging rupture may occur when the inspection point is pierced, thereby affecting the inspection results; this strategy significantly improves the scientificity and objectivity of the inspection point selection. The adaptive matching of the inspection point and the extrusion edge can ensure that the accuracy of residual oxygen measurement is maximized during the extrusion process. In summary, this step realizes the intelligent, adaptive and optimized selection of inspection points. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 Schematic diagram of the area to be detected in the present invention.

[0019] Figure 2 This is a schematic diagram of the detection point selection of the present invention. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] Example, see Figure 1 and Figure 2 , a quality inspection system and inspection method for baked food production, comprising: Obtain the baked products that have been produced and record them as products to be tested; Capture the image of the product to be inspected directly above it; by acquiring the product to be inspected immediately after production is completed and capturing the image directly above it, this step can ensure that the captured image is highly consistent with the product itself, eliminating the influence of perspective deviation and perspective distortion. First, by shooting from a straight-up angle, the complete contour information of the edge of the packaging bag and food can be obtained, laying a solid foundation for subsequent edge recognition and image segmentation.

[0022] Obtain an edge of a rectangular packaging bag in the image of the product to be detected, record it as a first edge, and record the area surrounded by the first edge as a first area; An edge of the first region is randomly selected and recorded as the first edge; the two vertices of the first edge are recorded as the first vertex and the second vertex respectively; the edge of the four edges of the first region that intersects with the first edge at the first vertex is recorded as the second edge; the edge of the four edges of the first region that intersects with the first edge at the second vertex is recorded as the third edge; the edge of the four edges of the first region other than the first edge, the second edge and the third edge is recorded as the fourth edge; the vertex of the two vertices of the second edge other than the first vertex is recorded as the third vertex; the vertex of the two vertices of the third edge other than the second vertex is recorded as the fourth vertex; the direction from the first vertex to the second vertex is recorded as the first direction, the direction from the first vertex to the third vertex is recorded as the second direction, the direction from the fourth vertex to the third vertex is recorded as the third direction, and the direction from the fourth vertex to the second vertex is recorded as the fourth direction; Acquire an edge of the baked food in the product image to be detected, record it as a second edge, and record the area surrounded by the second edge as a second area; Arrange points on the four sides of the first area; Get the area to be detected; Select the detection points according to the area to be detected, specifically: The areas of all the areas to be detected are obtained and sorted in descending order, and the top three areas to be detected are selected and recorded as the first target area, the second target area and the third target area in descending order. Obtaining the geometric center of the first target area, recorded as the first detection position; Draw four vertical line segments through the first detection position and perpendicular to the four sides of the first area respectively; one end point of the vertical line segment is the first detection position, and the other end point is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the first vertical line segment; Obtaining the geometric center of the second target area, recorded as the second detection position; Draw four vertical line segments through the second detection position that are respectively perpendicular to the four sides of the first area; one end point of the vertical line segment is the first detection position, and the other end point is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the second vertical line segment; Obtaining the geometric center of the third target area, recorded as the third detection position; Draw four vertical line segments through the third detection position that are respectively perpendicular to the four sides of the first area; one endpoint of the vertical line segment is the first detection position, and the other endpoint is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the third vertical line segment; Compare the lengths of the first vertical line segment, the second vertical line segment and the third vertical line segment; if the first vertical line segment is the longest, select the first detection position as the detection point, and select the edge of the first area corresponding to the first vertical line segment as the extrusion edge; if the second vertical line segment is the longest, select the second detection position as the detection point, and select the edge of the first area corresponding to the second vertical line segment as the extrusion edge; if the third vertical line segment is the longest, select the third detection position as the detection point, and select the edge of the first area corresponding to the third vertical line segment as the extrusion edge; the quality detection system and detection method for the production of baked food, at the geometric center of the first to third target areas, vertically project four line segments along the edge of the first area and select the longest one, the center position of the corresponding longest line segment is the detection point, and further determine the extrusion edge corresponding to the detection point. The method automatically finds the optimal detection point based on the spatial distribution characteristics, without manual preset or empirical rules, and can adaptively deal with baked foods of different shapes and sizes. By selecting the longest vertical line segment, it can be ensured that the impact on the detection point is minimized when the extrusion edge is squeezed later; if the detection point is close to the extrusion edge, wrinkles may appear at the detection point when the extrusion edge is squeezed; this may cause gas leakage or packaging rupture when the detection point is pierced, thus affecting the detection result; this strategy significantly improves the scientificity and objectivity of the detection point selection. The adaptive matching of the detection point and the extrusion edge can ensure the maximum accuracy of the residual oxygen measurement during the extrusion process. In summary, this step realizes the intelligent, adaptive and optimized selection of detection points.

[0023] Conduct quality inspection on the products to be inspected.

[0024] The arranging points on the four sides of the first area specifically includes: Setting a point distribution interval, wherein the point distribution interval is used to distribute points on the edge of the first area; Starting from the first vertex on the first side, a point is arranged on the first side at every point arrangement interval until reaching the second vertex, and the arranged points are numbered in ascending order of natural numbers along the first direction; Starting from the first vertex on the second side, a point is arranged on the second side at every point arrangement interval until the third vertex is reached, and the arranged points are numbered in ascending order of natural numbers along the second direction; Starting from the second vertex on the third side, a point is arranged on the third side at every point arrangement interval until the fourth vertex is reached, and the arranged points are numbered in ascending order of natural numbers along the fourth direction; On the fourth side, starting from the third vertex, a point is placed on the fourth side at every point placement interval until the fourth vertex is reached, and the points placed along the third direction are numbered in ascending order according to natural numbers; This quality inspection system and method for baked food production evenly distributes points at preset intervals on the four sides of the first area to form a point matrix to ensure comprehensive sampling of the surface state of the edge of the packaging bag. This process sets the point distribution interval and numbers them along four directions. Each distribution point corresponds to a unique number, which can accurately locate subsequent operations such as ray redundant distance calculation and generation of the area to be detected, and avoid overlap or omission. Compared with random or dense grid sampling, the uniform point distribution strategy can save computing resources to the greatest extent while ensuring sampling coverage. For packaging bags of different specifications, the point distribution interval can be flexibly adjusted to meet the production and detection accuracy requirements of various production lines. In addition, the point numbering system makes the storage, query and visualization of detection data more convenient, which is convenient for subsequent statistical analysis and traceability management. In summary, this strategy not only improves the detection coverage, but also takes into account the computational efficiency, providing efficient support for the subsequent extraction of the area to be detected and the selection of detection points.

[0025] The obtaining of the area to be detected specifically includes: Draw a ray perpendicular to the first edge with each point arranged on the first edge as an endpoint, and the direction of the ray is the second direction; if the drawn ray intersects with the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect with the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the third edge, which is the redundant distance of the ray; Take each point on the second edge as an endpoint and draw a ray perpendicular to the second edge, the direction of the ray being the first direction; if the drawn ray intersects the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the fourth edge, which is the redundant distance of the ray; A ray perpendicular to the third side is drawn with each point arranged on the third side as an endpoint, and the direction of the ray is the fourth direction; if the drawn ray intersects with the second edge, the first intersection point of the ray and the second edge along the ray direction is obtained, and the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction is obtained, which is the redundant distance of the ray; if the drawn ray does not intersect with the second edge, the distance from the starting point of the ray to the intersection point of the ray and the first side is obtained, which is the redundant distance of the ray; Draw a ray perpendicular to the fourth side with each point arranged on the fourth side as an endpoint, and the direction of the ray is the third direction; if the drawn ray intersects with the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect with the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the second edge, which is the redundant distance of the ray; The quality inspection system and inspection method for the production of baked food, by taking the edge points as the ray endpoints, respectively projecting the rays vertically inward, calculating the intersection of the rays with the edge or boundary of the baked food, and obtaining the ray redundant distance, is used to judge the remaining space between the internal structure of the product and the edge. The method is highly flexible: in the case of complex edges or multiple breakpoints of food, the ray projection can automatically adapt to the specific form without the need for manually preset templates. The redundant distance, as a measurement indicator, can accurately reflect the distribution of gaps and the degree of deformation inside the product, and is convenient for extracting abnormal areas. Compared with the traditional solution based on overall area segmentation, the method of the present invention is more sensitive to minor defects or local defects. In addition, the ray projection corresponding to the multi-sided points realizes multi-angle and multi-dimensional spatial scanning, providing key data support for subsequent continuous distance threshold judgment. In summary, this step effectively improves the adaptive division capability of the area to be detected, can dynamically respond to the diversification of product forms, and improves the detection accuracy and sensitivity.

[0026] The obtaining of the area to be detected further includes: Setting a distance threshold and a consecutive number threshold, wherein the distance threshold and the consecutive number threshold are used to obtain the area to be detected; Respectively obtain the redundant distance of the ray with each point arranged on the first edge as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the first vertex and along the first direction among all the points arranged on the first edge, if there is a situation where the marked endpoints appear continuously, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, and record it as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the first direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and record them as the first auxiliary ray and the second auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the second direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the first direction is recorded as the first auxiliary curve; the closed figure surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the first auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the fourth edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the second direction, recorded as the first auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the first auxiliary intersection point, recorded as the first auxiliary straight line; the closed area surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the first auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all the marked endpoints on the first edge appear continuously is obtained.

[0027] The obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point arranged on the second edge as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the first vertex and along the second direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the second edge, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, which is recorded as the continuous number, and if the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the second direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, which are recorded as the third auxiliary ray and the fourth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the first direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the second direction is recorded as the second auxiliary curve; the closed figure surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the second auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the third edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the first direction, recorded as the second auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the second auxiliary intersection point, recorded as the second auxiliary straight line; the closed area surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the second auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all the marked endpoints on the second edge appear continuously is obtained.

[0028] The obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point on the third side as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the fourth vertex, if there is a situation where the marked endpoints appear continuously among all the points on the third side along the fourth direction, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, which is recorded as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the fourth direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, which are recorded as the fifth auxiliary ray and the sixth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the third direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the fourth direction is recorded as the third auxiliary curve; the closed figure surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the second side is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the third direction, recorded as the third auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the third auxiliary intersection point, recorded as the third auxiliary straight line; the closed area surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all marked endpoints on the third side appear continuously is obtained.

[0029] The obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point on the fourth side as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the fourth vertex, if there is a situation where the marked endpoints appear continuously among all the points on the fourth side along the third direction, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, and record it as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the third direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and record them as the seventh auxiliary ray and the eighth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the fourth direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the third direction is recorded as the fourth auxiliary curve; the closed figure surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the fourth auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the first edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the fourth direction, recorded as the fourth auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the fourth auxiliary intersection point, recorded as the fourth auxiliary straight line; the closed area surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the fourth auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all marked endpoints on the fourth edge appear continuously is obtained; The quality inspection system and inspection method for the production of baked food introduce a distance threshold and a continuous number threshold, mark and screen the redundant distance of the ray, and judge the scope of the suspicious area in combination with the number of continuous marking points. If multiple rays with redundant distances greater than the distance threshold appear continuously, it means that the closed area surrounded by the intersection of these rays with the first edge or the second edge is large. When the detection is performed in this closed area, the needle of the residual oxygen detector will not be inserted into the baked food; combined with the number difference of the continuous marking points, the intersection calculation of the first auxiliary ray and the second auxiliary ray, etc., closed areas of various shapes can be flexibly generated to adapt to different product forms and detection requirements. After adopting the continuous number threshold, the pseudo-area formed by occasional noise points can be eliminated, and the stability and accuracy of area extraction can be improved. In addition, the method can dynamically adjust the threshold parameters to meet the real-time response to changes in different types of baked food, packaging materials and production environment. In summary, this step effectively reduces the false alarm rate while optimizing the area extraction, and improves the robustness and practicality of the detection system; by generating auxiliary rays and dividing the closed area for the four edges of the packaging bag, the method of the present invention can perform multi-angle detection on the product from four directions. Regardless of the points corresponding to the first, second, third or fourth side, the area to be inspected can be extracted according to the same process to achieve a comprehensive scan of the entire food packaging area. This process not only ensures the integrity of the inspection area extraction, but also improves the accuracy of defect positioning through comprehensive analysis of the four-side data.

[0030] The quality inspection of the product to be inspected specifically includes: Get the location of the detection point and paste the aluminum foil sticker at the detection point; paste the aluminum foil sticker at the detection point so that the gas can only leak from the preset detection point to prevent the gas from diffusing outside the whole bag and causing measurement errors. Combined with the precise control of the corresponding extrusion edge by the adaptive extrusion device, the gas in the bag flows out in the direction of the auxiliary needle, improving the stability and reproducibility of the residual oxygen detector reading. The aluminum foil sticker provides an airtight closure function, eliminating the interference of background air on the measurement.

[0031] Setting a residual oxygen threshold, which is used to determine whether the quality of baked food is qualified; Obtain the residual oxygen content of the product to be tested, specifically: Insert the needle of the residual oxygen detector into the detection point of the product to be detected, and squeeze the extrusion edge of the product to be detected at the same time; Obtain the reading of the residual oxygen detector and record it as the actual residual oxygen; If the actual residual oxygen content is greater than the residual oxygen content threshold, the baked food is deemed to be of unqualified quality; If the actual residual oxygen level is less than or equal to the residual oxygen threshold, the baked food is deemed to be of qualified quality; the residual oxygen detector automatically inserts the needle into the detection point and squeezes it synchronously, and after high-speed sensing and sampling inside the system, it outputs the residual oxygen reading in real time, and compares it with the preset threshold to determine whether it is qualified or not. This process does not require manual intervention, and the single detection cycle can be shortened to a few hundred milliseconds, greatly improving the detection speed.

[0032] A system for implementing a quality inspection method for baked food production, comprising: An image acquisition module, used to acquire images directly above the product to be inspected, and obtain image data including the edge of the rectangular packaging bag and the edge of the baked food; An edge processing module, used to identify a first edge of the packaging bag and a second edge of the food in the image, and to construct a spatial relationship between the first area and the second area; A point distribution calculation module is used to dynamically distribute points on the four sides of the first area at preset intervals and generate numbers for each side point; The regional analysis module is used to calculate the redundant distance of each distribution point ray, combining the distance threshold and the continuous number threshold; A detection decision module is used to calculate the length of the vertical line segment, select the detection point and the corresponding extrusion edge after comparing the lengths of each vertical line segment, and generate a detection instruction including the detection coordinates and the extrusion edge identifier; Execution unit, including: The positioning mechanism carries the aluminum foil sticker and moves to the detection point in response to the detection instruction to pre-fix the sticker; An adaptive squeezing device with adjustable jaws that adaptively matches the gripping angle of the packaging bag boundary according to the squeezing edge mark; Residual oxygen detector, a micro needle sensor integrated in the puncture positioning mechanism, performs puncture and gas sampling simultaneously during the extrusion process; The result feedback unit compares the residual oxygen data with the threshold and outputs a quality judgment signal.

[0033] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0034] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A quality inspection method for baked food production, characterized in that: include: Obtain the baked products that have been produced and record them as products to be tested; Capture an image of the product to be inspected directly above the product to be inspected; Obtain an edge of a rectangular packaging bag in the image of the product to be detected, record it as a first edge, and record the area enclosed by the first edge as a first area; An edge of the first region is randomly selected and recorded as the first edge; the two vertices of the first edge are recorded as the first vertex and the second vertex respectively; the edge of the four edges of the first region that intersects with the first edge at the first vertex is recorded as the second edge; the edge of the four edges of the first region that intersects with the first edge at the second vertex is recorded as the third edge; the edge of the four edges of the first region other than the first edge, the second edge and the third edge is recorded as the fourth edge; the vertex of the two vertices of the second edge other than the first vertex is recorded as the third vertex; the vertex of the two vertices of the third edge other than the second vertex is recorded as the fourth vertex; the direction from the first vertex to the second vertex is recorded as the first direction, the direction from the first vertex to the third vertex is recorded as the second direction, the direction from the fourth vertex to the third vertex is recorded as the third direction, and the direction from the fourth vertex to the second vertex is recorded as the fourth direction; Acquire the edge of the baked food in the product image to be detected, record it as the second edge, and record the area surrounded by the second edge as the second area; Arrange points on the four sides of the first area; Get the area to be detected; Select the detection points according to the area to be detected, specifically: The areas of all the areas to be detected are obtained and sorted in descending order, and the top three areas to be detected are selected and recorded as the first target area, the second target area and the third target area in descending order. Obtaining the geometric center of the first target area, recorded as the first detection position; Draw four vertical line segments through the first detection position and perpendicular to the four sides of the first area respectively; one end point of the vertical line segment is the first detection position, and the other end point is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the first vertical line segment; Obtaining the geometric center of the second target area, recorded as the second detection position; Draw four vertical line segments through the second detection position that are respectively perpendicular to the four sides of the first area; one end point of the vertical line segment is the first detection position, and the other end point is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the second vertical line segment; Obtaining the geometric center of the third target area, recorded as the third detection position; Draw four vertical line segments through the third detection position that are respectively perpendicular to the four sides of the first area; one endpoint of the vertical line segment is the first detection position, and the other endpoint is on the side corresponding to the first area; Obtain the lengths of the four vertical line segments respectively, and select the vertical line segment with the longest length as the third vertical line segment; Compare the lengths of the first vertical line segment, the second vertical line segment, and the third vertical line segment; if the first vertical line segment is the longest, select the first detection position as the detection point, and select the edge of the first area corresponding to the first vertical line segment as the extrusion edge; If the second vertical line segment is the longest, the second detection position is selected as the detection point, and the edge of the first area corresponding to the second vertical line segment is selected as the extrusion edge; if the third vertical line segment is the longest, the third detection position is selected as the detection point, and the edge of the first area corresponding to the third vertical line segment is selected as the extrusion edge; Conduct quality inspection on the products to be inspected.

2. The method for quality inspection of baked food production according to claim 1, characterized in that: The arranging points on the four sides of the first area specifically includes: Setting a point distribution interval, wherein the point distribution interval is used to distribute points on the edge of the first area; Starting from the first vertex on the first side, a point is arranged on the first side at every point arrangement interval until reaching the second vertex, and the arranged points are numbered in ascending order of natural numbers along the first direction; Starting from the first vertex on the second side, a point is arranged on the second side at every point arrangement interval until the third vertex is reached, and the arranged points are numbered in ascending order of natural numbers along the second direction; Starting from the second vertex on the third side, a point is arranged on the third side at every point arrangement interval until the fourth vertex is reached, and the arranged points are numbered in ascending order of natural numbers along the fourth direction; Starting from the third vertex on the fourth side, a point is placed on the fourth side at every point placement interval until the fourth vertex is reached. The points placed along the third direction are numbered in ascending order according to natural numbers.

3. The quality inspection method for baked food production according to claim 1, characterized in that: The obtaining of the area to be detected specifically includes: Draw a ray perpendicular to the first edge with each point arranged on the first edge as an endpoint, and the direction of the ray is the second direction; if the drawn ray intersects with the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect with the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the third edge, which is the redundant distance of the ray; Take each point on the second edge as an endpoint and draw a ray perpendicular to the second edge, the direction of the ray being the first direction; if the drawn ray intersects the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the fourth edge, which is the redundant distance of the ray; A ray perpendicular to the third side is drawn with each point arranged on the third side as an endpoint, and the direction of the ray is the fourth direction; if the drawn ray intersects with the second edge, the first intersection point of the ray and the second edge along the ray direction is obtained, and the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction is obtained, which is the redundant distance of the ray; if the drawn ray does not intersect with the second edge, the distance from the starting point of the ray to the intersection point of the ray and the first side is obtained, which is the redundant distance of the ray; Draw a ray perpendicular to the fourth side with each point on the fourth side as an endpoint, and the direction of the ray is the third direction; if the drawn ray intersects the second edge, obtain the first intersection point of the ray and the second edge along the ray direction, and obtain the distance from the starting point of the ray to the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of the ray; if the drawn ray does not intersect the second edge, obtain the distance from the starting point of the ray to the intersection point of the ray and the second side, which is the redundant distance of the ray.

4. The method for quality inspection of baked food production according to claim 3, characterized in that: The obtaining of the area to be detected further includes: Setting a distance threshold and a consecutive number threshold, wherein the distance threshold and the consecutive number threshold are used to obtain the area to be detected; Respectively obtain the redundant distance of the ray with each point arranged on the first edge as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the first vertex and along the first direction among all the points arranged on the first edge, if there is a situation where the marked endpoints appear continuously, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, and record it as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the first direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and record them as the first auxiliary ray and the second auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the second direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the first direction is recorded as the first auxiliary curve; the closed figure surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the first auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the fourth edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the second direction, recorded as the first auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the first auxiliary intersection point, recorded as the first auxiliary straight line; the closed area surrounded by the first auxiliary ray, the second auxiliary ray, the first edge and the first auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all the marked endpoints on the first edge appear continuously is obtained.

5. The method for quality inspection of baked food production according to claim 4, characterized in that: The obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point arranged on the second edge as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the first vertex and along the second direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the second edge, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, which is recorded as the continuous number, and if the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the second direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, which are recorded as the third auxiliary ray and the fourth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the first direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the second direction is recorded as the second auxiliary curve; the closed figure surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the second auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the third edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the first direction, recorded as the second auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the second auxiliary intersection point, recorded as the second auxiliary straight line; the closed area surrounded by the third auxiliary ray, the fourth auxiliary ray, the second edge and the second auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all the marked endpoints on the second edge appear continuously is obtained.

6. The method for quality inspection of baked food production according to claim 1, characterized in that: The obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point on the third side as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the fourth vertex, if there is a situation where the marked endpoints appear continuously among all the points on the third side along the fourth direction, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, which is recorded as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the fourth direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, which are recorded as the fifth auxiliary ray and the sixth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the third direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the fourth direction is recorded as the third auxiliary curve; the closed figure surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the second side is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the third direction, recorded as the third auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the third auxiliary intersection point, recorded as the third auxiliary straight line; the closed area surrounded by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all marked endpoints on the third side appear continuously is obtained.

7. The method for quality inspection of baked food production according to claim 1, characterized in that: The obtaining of the area to be detected further includes: Respectively obtain the redundant distance of the ray with each point on the fourth side as the endpoint, and mark the endpoint of the ray corresponding to the redundant distance greater than the distance threshold; starting from the fourth vertex, if there is a situation where the marked endpoints appear continuously among all the points on the fourth side along the third direction, if the difference between the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as continuous; for the situation where the marked endpoints appear continuously once, obtain the number of marked endpoints that appear continuously, and record it as the continuous number. If the continuous number is less than or equal to the continuous number threshold, select the situation where other marked endpoints appear continuously; if the continuous number is greater than the continuous number threshold, obtain the first marked endpoint and the last marked endpoint along the third direction, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and record them as the seventh auxiliary ray and the eighth auxiliary ray respectively; if both auxiliary rays intersect with the second edge, then along the fourth direction The first intersection points of the two auxiliary rays with the second edge are obtained respectively, and the part of the second edge between the two intersection points along the third direction is recorded as the fourth auxiliary curve; the closed figure surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the fourth auxiliary curve is recorded as the area to be detected; if both auxiliary rays do not intersect with the second edge, the closed area surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the first edge is recorded as the area to be detected; if only one auxiliary ray intersects with the second edge, the first intersection point of the auxiliary ray intersecting with the second edge and the second edge is obtained along the fourth direction, recorded as the fourth auxiliary intersection point, and a straight line perpendicular to the auxiliary ray that does not intersect with the second edge is drawn through the fourth auxiliary intersection point, recorded as the fourth auxiliary straight line; the closed area surrounded by the seventh auxiliary ray, the eighth auxiliary ray, the fourth edge and the fourth auxiliary straight line is recorded as the area to be detected; according to the above method, the corresponding area to be detected when all marked endpoints on the fourth edge appear continuously is obtained.

8. The method for quality inspection of baked food production according to claim 1, characterized in that: The quality inspection of the product to be inspected specifically includes: Get the location of the test point and stick the aluminum foil sticker on the test point; Setting a residual oxygen threshold, which is used to determine whether the quality of baked food is qualified; Obtain the residual oxygen content of the product to be tested, specifically: Insert the needle of the residual oxygen detector into the detection point of the product to be detected, and squeeze the extrusion edge of the product to be detected at the same time; Obtain the reading of the residual oxygen detector and record it as the actual residual oxygen; If the actual residual oxygen content is greater than the residual oxygen content threshold, the baked food is deemed to be of unqualified quality; If the actual residual oxygen content is less than or equal to the residual oxygen content threshold, the quality of the baked food is deemed to be qualified.

9. A system for implementing the quality inspection method for baked food production according to claim 1, characterized in that: include: An image acquisition module, used to acquire images directly above the product to be inspected, and obtain image data including the edge of the rectangular packaging bag and the edge of the baked food; An edge processing module, used to identify a first edge of the packaging bag and a second edge of the food in the image, and to construct a spatial relationship between the first area and the second area; A point distribution calculation module is used to dynamically distribute points on the four sides of the first area at preset intervals and generate numbers for each side point; The regional analysis module is used to calculate the redundant distance of each point ray, combining the distance threshold and the consecutive number threshold; A detection decision module is used to calculate the length of the vertical line segment, select the detection point and the corresponding extrusion edge after comparing the lengths of each vertical line segment, and generate a detection instruction including the detection coordinates and the extrusion edge identifier; Execution unit, including: The positioning mechanism carries the aluminum foil sticker and moves to the detection point in response to the detection instruction to pre-fix the sticker; An adaptive squeezing device with adjustable jaws that adaptively matches the gripping angle of the packaging bag boundary according to the squeezing edge mark; Residual oxygen detector, a micro needle sensor integrated in the puncture positioning mechanism, performs puncture and gas sampling simultaneously during the extrusion process; The result feedback unit compares the residual oxygen data with the threshold and outputs a quality judgment signal.

Citation Information

Patent Citations

  • Method for detecting quadrangular marker in image

    CN105654097A

  • X-ray detection device

    CN117902292A

  • Food package sealing detection method

    CN118758530A

  • Inspection methods and systems for detecting leaks in vacuum bag assemblies

    US20160349139A1

  • Crown cap surface defect online inspection method employing image processing

    WO2020248439A1

Cited By

  • Quality detection system for baked food production

    CN121640473A