A quality inspection system and inspection method for the production of baked goods

Through image acquisition and edge processing technology, combined with dynamic point distribution and redundant distance analysis, automated and high-precision quality detection of baked goods production is achieved, solving the problem of insufficient detection accuracy in traditional methods, and improving the robustness and efficiency of the detection system.

CN120031874BActive Publication Date: 2025-07-04SHANGHAI XINYING BAKERY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional baked food quality detection methods rely on manual sampling or fixed position puncture, which are susceptible to wrinkles of packaging bags and changes in food shape, resulting in insufficient detection accuracy and the existing automatic system fails to effectively deal with the problem of multi-region collaborative analysis.

Method used

Image acquisition and edge processing technology are used to identify packaging bags and food edges, and detection points are selected through dynamic point distribution and redundant distance analysis, combined with adaptive extrusion devices and residual oxygen detection, to achieve automated and high-precision detection point selection and quality judgment.

Benefits of technology

It improves the scientificity and accuracy of the detection, can adapt to baked goods of different forms and sizes, reduces false alarm rates, improves detection coverage and sensitivity, ensures the scientificity and objectivity of the selection of detection points, and shortens the detection cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031874B_ABST
    Figure CN120031874B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of food detection, and discloses a quality detection system and detection method for the production of baked foods. By collecting the relationship between the edge of the packaging bag and the edge of the food to construct a regional relationship, combined with a dynamic point distribution algorithm and redundant distance analysis, the area to be detected caused by the deformation of the packaging bag or the offset of the contents is screened out. By calculating the vertical line segment length of the target area to optimize the selection of detection points, and combined with an adaptive extrusion device and residual oxygen detection technology, accurate puncture and gas sampling are achieved. The system includes an image acquisition module, an edge processing module, a point distribution calculation module, a regional analysis module, a detection decision module and an execution unit, realizing the full-process automation of quality determination. This method significantly improves the detection accuracy and efficiency, solves problems such as blind selection of detection points in traditional manual sampling inspection, and is applicable to the on-line quality control of large-scale baked food production lines.
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 specifically to a quality detection system and method for baking food production. Background Art

[0002] With the development of the food industry, especially the baking products industry, the packaging and preservation technologies of products have become increasingly mature. However, after the products are produced, how to effectively conduct quality detection, especially the automated and high-precision detection of oxygen content and key indicators, is still a major problem in the industry. Traditional detection methods generally rely on manual sampling inspection or puncture equipment at fixed positions. Traditional methods mostly rely on the experience of operators to select puncture positions, which are easily interfered by factors such as packaging bag wrinkles and food shape changes. It is difficult for manual operation to accurately judge the safe distance between the food edge and the packaging bag, resulting in the puncture needle accidentally touching the food body and affecting the detection accuracy. 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 regions in the packaging bag at the same time, the existing methods 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 detection system and method for baking food production to achieve scientific selection of detection points and improve the response speed and reliability of the detection process. Summary of the Invention

[0004] The present invention provides a quality detection system and method for baking food production, which helps to solve the problems mentioned in the above background art.

[0005] The present invention provides the following technical solutions: A quality detection system and method for baking food production, including:

[0006] Obtain the baked products that have completed production, denoted as the products to be detected;

[0007] Collect an image of the product to be detected directly above the product to be detected;

[0008] Obtain the edge of the rectangular packaging bag in the image of the product to be detected, denoted as the first edge, and the area surrounded by the first edge is denoted as the first area;

[0009] Arbitrarily select one side of the first region, denoted as the first side; the two vertices of the first side are respectively denoted as the first vertex and the second vertex; among the four sides of the first region, the side that intersects the first side at the first vertex is denoted as the second side; among the four sides of the first region, the side that intersects the first side at the second vertex is denoted as the third side; among the four sides of the first region, the side other than the first side, the second side, and the third side is denoted as the fourth side; among the two vertices of the second side, the vertex other than the first vertex is denoted as the third vertex; among the two vertices of the third side, the vertex other than the second vertex is denoted as the fourth vertex; the direction from the first vertex to the second vertex is denoted as the first direction, the direction from the first vertex to the third vertex is denoted as the second direction, the direction from the fourth vertex to the third vertex is denoted as the third direction, and the direction from the fourth vertex to the second vertex is denoted as the fourth direction;

[0010] Obtain the edge of the baked food in the image of the product to be detected, denoted as the second edge, and the region enclosed by the second edge is denoted as the second region;

[0011] Perform point distribution on the four sides of the first region;

[0012] Obtain the region to be detected;

[0013] Select detection points according to the region to be detected, specifically:

[0014] Obtain the areas of all regions to be detected and sort them in descending order of area. Select the top three regions to be detected in terms of area, and denote them as the first target region, the second target region, and the third target region in descending order of area;

[0015] Obtain the geometric center of the first target region, denoted as the first detection position;

[0016] Draw four perpendicular line segments from the first detection position to the four sides of the first region respectively; one endpoint of the perpendicular line segment is the first detection position, and the other endpoint is on the corresponding side of the first region;

[0017] Respectively obtain the lengths of the four perpendicular line segments, and select the perpendicular line segment with the longest length and denote it as the first perpendicular line segment;

[0018] Obtain the geometric center of the second target region, denoted as the second detection position;

[0019] Draw four perpendicular line segments from the second detection position to the four sides of the first region respectively; one endpoint of the perpendicular line segment is the first detection position, and the other endpoint is on the corresponding side of the first region;

[0020] Respectively obtain the lengths of the four perpendicular line segments, and select the perpendicular line segment with the longest length and denote it as the second perpendicular line segment;

[0021] Obtain the geometric center of the third target region, denoted as the third detection position;

[0022] Four perpendicular line segments are drawn through the third detection position and are perpendicular to the four sides of the first region respectively; one end point of the perpendicular line segment is the first detection position, and the other end point is on the corresponding side of the first region;

[0023] The lengths of the four perpendicular line segments are obtained respectively, and the perpendicular line segment with the longest length is selected and recorded as the third perpendicular line segment;

[0024] Compare the lengths of the first perpendicular line segment, the second perpendicular line segment and the third perpendicular line segment; if the first perpendicular line segment is the longest, select the first detection position as the detection point and select the side of the first region corresponding to the first perpendicular line segment as the extrusion side; if the second perpendicular line segment is the longest, select the second detection position as the detection point and select the side of the first region corresponding to the second perpendicular line segment as the extrusion side; if the third perpendicular line segment is the longest, select the third detection position as the detection point and select the side of the first region corresponding to the third perpendicular line segment as the extrusion side;

[0025] Perform quality inspection on the product to be detected.

[0026] Optionally, the step of arranging points on the four sides of the first region specifically includes:

[0027] Set a point arrangement interval, and the point arrangement interval is used to arrange points on the sides of the first region;

[0028] On the first side, starting from the first vertex, a point is arranged on the first side every other point arrangement interval until reaching the second vertex, and the arranged points are numbered in ascending order of natural numbers along the first direction;

[0029] On the second side, starting from the first vertex, a point is arranged on the second side every other point arrangement interval until reaching the third vertex, and the arranged points are numbered in ascending order of natural numbers along the second direction;

[0030] On the third side, starting from the second vertex, a point is arranged on the third side every other point arrangement interval until reaching the fourth vertex, and the arranged points are numbered in ascending order of natural numbers along the fourth direction;

[0031] On the fourth side, starting from the third vertex, a point is arranged on the fourth side every other point arrangement interval until reaching the fourth vertex, and the arranged points are numbered in ascending order of natural numbers along the third direction.

[0032] Optionally, the step of obtaining the region to be detected specifically includes:

[0033] Taking each arranged point on the first side as an endpoint, draw a ray perpendicular to the first side, and the direction of the ray is the second 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 between the starting point of the ray and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the drawn ray does not intersect the second edge, obtain the distance between the starting point of the ray and the intersection point of the ray and the third side, which is the redundant distance of this ray.

[0034] Taking each arranged point on the second side as an endpoint, draw a ray perpendicular to the second side, and the direction of the ray is 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 between the starting point of the ray and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the drawn ray does not intersect the second edge, obtain the distance between the starting point of the ray and the intersection point of the ray and the fourth side, which is the redundant distance of this ray.

[0035] Taking each arranged point on the third side as an endpoint, draw a ray perpendicular to the third side, and the direction of the ray is the fourth 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 between the starting point of the ray and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the drawn ray does not intersect the second edge, obtain the distance between the starting point of the ray and the intersection point of the ray and the first side, which is the redundant distance of this ray.

[0036] Taking each arranged point on the fourth side as an endpoint, draw a ray perpendicular to the fourth side, 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 between the starting point of the ray and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the drawn ray does not intersect the second edge, obtain the distance between the starting point of the ray and the intersection point of the ray and the second side, which is the redundant distance of this ray.

[0037] Optionally, the obtaining of the area to be detected further includes:

[0038] Set a distance threshold and a consecutive times threshold, and the distance threshold and the consecutive times threshold are used to obtain the area to be detected.

[0039] Obtain the redundant distances of the rays made with each point arranged on the first side as endpoints respectively, and mark the endpoints of the rays corresponding to the redundant distances greater than the distance threshold; starting from the first vertex and along the first direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the first side, if the difference in the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as consecutive; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number. If the continuous number is less than or equal to the continuous times threshold, then select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times threshold, then 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 denote them as the first auxiliary ray and the second auxiliary ray respectively; if both auxiliary rays intersect the second edge, then obtain the first intersection points of the two auxiliary rays and the second edge along the second direction respectively, and the part of the second edge between the two intersection points along the first direction is denoted as the first auxiliary curve; the closed figure formed by the first auxiliary ray, the second auxiliary ray, the first side and the first auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, then denote the closed region formed by the first auxiliary ray, the second auxiliary ray, the first side and the fourth side as the region to be detected; if only one auxiliary ray intersects the second edge, then obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge along the second direction, denoted as the first auxiliary intersection point, and draw a straight line perpendicular to the auxiliary ray not intersecting the second edge through the first auxiliary intersection point, denoted as the first auxiliary straight line; the closed region formed by the first auxiliary ray, the second auxiliary ray, the first side and the first auxiliary straight line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all the situations where the marked endpoints on the first side appear continuously.

[0040] Optionally, obtaining the region to be detected further includes:

[0041] Obtain the redundant distances of the rays drawn with each point arranged on the second side as an endpoint respectively, and mark the endpoints of the rays corresponding to the redundant distances greater than the distance threshold; starting from the first vertex along the second direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the second side, if the difference in the numbers of the two marked endpoints is 1, it is regarded as the two marked endpoints being continuous; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number, if the continuous number is less than or equal to the continuous times threshold, then select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times threshold, then along the second direction, obtain the first marked endpoint and the last marked endpoint, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, denoted as the third auxiliary ray and the fourth auxiliary ray respectively; if both auxiliary rays intersect the second edge, then along the first direction, obtain the first intersection points of the two auxiliary rays and the second edge respectively, and the part of the second edge between the two intersection points along the second direction is denoted as the second auxiliary curve; the closed figure enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the second auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, then the closed region enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the third side is denoted as the region to be detected; if only one auxiliary ray intersects the second edge, then along the first direction, obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge, denoted as the second auxiliary intersection point, and draw a straight line perpendicular to the auxiliary ray not intersecting the second edge through the second auxiliary intersection point, denoted as the second auxiliary straight line; the closed region enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the second auxiliary straight line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all situations where the marked endpoints on the second side appear continuously.

[0042] Optionally, the obtaining of the region to be detected further includes:

[0043] Obtain the redundant distances of the rays made with each point arranged on the third side as endpoints respectively, and mark the endpoints of the rays corresponding to the redundant distances greater than the distance threshold; starting from the fourth vertex and along the fourth direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the third side, if the difference in the numbers of the two marked endpoints is 1, it is regarded as the two marked endpoints being continuous; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number, if the continuous number is less than or equal to the continuous times threshold, then select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times threshold, then along the fourth direction, obtain the first marked endpoint and the last marked endpoint, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and denote them as the fifth auxiliary ray and the sixth auxiliary ray respectively; if both auxiliary rays intersect the second edge, then along the third direction, obtain the first intersection points of the two auxiliary rays and the second edge respectively, and the part of the second edge between the two intersection points along the fourth direction is denoted as the third auxiliary curve; the closed figure enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, then the closed region enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the second side is denoted as the region to be detected; if only one auxiliary ray intersects the second edge, then along the third direction, obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge, denoted as the third auxiliary intersection point, and draw a line perpendicular to the auxiliary ray not intersecting the second edge through the third auxiliary intersection point, denoted as the third auxiliary line; the closed region enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all the situations where the marked endpoints on the third side appear continuously.

[0044] Optionally, the obtaining of the region to be detected further includes:

[0045] Redundancy distances of the rays made with each point arranged on the fourth side as an endpoint are obtained respectively, and the endpoints of the rays corresponding to the redundancy distances greater than the distance threshold are marked; starting from the fourth vertex and along the third direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the fourth side, if the difference in the numbers of the two marked endpoints is 1, it is regarded that the two marked endpoints are continuous; for a situation where the marked endpoints appear continuously once, the number of the continuously appearing marked endpoints is obtained and denoted as the continuous number. If the continuous number is less than or equal to the continuous number threshold, other situations where the marked endpoints appear continuously are selected; if the continuous number is greater than the continuous number threshold, the first marked endpoint and the last marked endpoint are obtained along the third direction, and the rays corresponding to the first marked endpoint and the last marked endpoint are obtained respectively, and denoted as the seventh auxiliary ray and the eighth auxiliary ray; if both auxiliary rays intersect the second edge, the first intersection points of the two auxiliary rays and the second edge are obtained respectively along the fourth direction, and the part of the second edge between the two intersection points along the third direction is denoted as the fourth auxiliary curve; the closed figure enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side and the fourth auxiliary curve is denoted as the area to be detected; if both auxiliary rays do not intersect the second edge, the closed area enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side and the first side is denoted as the area to be detected; if only one auxiliary ray intersects the second edge, the first intersection point of the auxiliary ray intersecting the second edge and the second edge is obtained along the fourth direction and denoted as the fourth auxiliary intersection point, and a straight line perpendicular to the auxiliary ray not intersecting the second edge is drawn through the fourth auxiliary intersection point and denoted as the fourth auxiliary straight line; the closed area enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side and the fourth auxiliary straight line is denoted as the area to be detected; according to the above method, the areas to be detected corresponding to all the situations where the marked endpoints on the fourth side appear continuously are obtained.

[0046] Optionally, the quality inspection of the product to be detected specifically includes:

[0047] Obtain the position of the detection point and paste an aluminum foil sticker at the detection point;

[0048] Set the residual oxygen amount threshold, which is used to judge whether the quality of the baked food is qualified;

[0049] Obtain the residual oxygen amount of the product to be detected, specifically:

[0050] Insert the needle of the residual oxygen detector into the detection point of the product to be detected, and at the same time squeeze the extrusion edge of the product to be detected;

[0051] Obtain the reading of the residual oxygen detector and denote it as the actual residual oxygen amount;

[0052] If the actual residual oxygen amount is greater than the residual oxygen amount threshold, it is determined that the quality of the baked food is unqualified;

[0053] If the actual residual oxygen content is less than or equal to the residual oxygen content threshold, it is determined that the quality of the baked food is qualified.

[0054] A system for implementing a quality inspection method for the production of baked foods, comprising:

[0055] An image acquisition module, configured to acquire an image directly above the product to be inspected and obtain image data including the edges of the rectangular packaging bag and the baked food;

[0056] An edge processing module, configured to identify the first edge of the packaging bag and the second edge of the food in the image and construct the spatial relationship between the first region and the second region;

[0057] A point layout calculation module, configured to perform dynamic point layout at preset intervals on the four sides of the first region and generate the numbers of the points on each side;

[0058] A region analysis module, configured to calculate the redundant distances of the rays of each point layout, in combination with the distance threshold and the continuous times threshold;

[0059] A detection decision module, configured to calculate the length of the vertical line segment, select the detection point and the corresponding extrusion side after comparing the lengths of each vertical line segment, and generate a detection instruction including the detection coordinates and the extrusion side identifier;

[0060] An execution unit, comprising:

[0061] A positioning mechanism, carrying an aluminum foil sticker and moving to the detection point in response to the detection instruction for pre-fixing the sticker;

[0062] An adaptive extrusion device, having adjustable jaws, and adaptively matching the clamping angle of the packaging bag boundary according to the extrusion side identifier;

[0063] A residual oxygen detector, a micro-needle sensor integrated on the puncture positioning mechanism, and performing puncture and gas sampling synchronously during the extrusion process;

[0064] A result feedback unit, comparing the residual oxygen content data with the threshold and outputting a quality determination signal.

[0065] The present invention has the following beneficial effects:

[0066] 1. For the quality inspection system and inspection method of a certain kind of baked food production, points are evenly distributed at preset intervals on the four sides of the first area to form a point distribution matrix, ensuring comprehensive sampling of the surface state of the packaging bag edge. This process numbers along four directions by setting the point distribution interval, and each distribution point corresponds to a unique number, enabling accurate positioning of subsequent operations such as ray redundancy distance calculation and area to be inspected generation, and avoiding overlap or omission. The uniform point distribution strategy can save computing resources to the greatest extent while ensuring sampling coverage compared with random or dense grid sampling. For packaging bags of different specifications, the point distribution interval can be flexibly adjusted to meet the production output and inspection accuracy requirements of various production lines. In addition, the point numbering system makes the storage, query, and visualization of inspection data more convenient, facilitating subsequent statistical analysis and traceability management. In summary, this strategy takes into account the operation efficiency while improving the inspection coverage, providing efficient support for the subsequent extraction of the area to be inspected and the selection of inspection points.

[0067] 2. For the quality inspection system and inspection method of a certain kind of baked food production, by taking the edge points as the ray endpoints and vertically projecting rays inward respectively, the intersections of the rays with the edge or boundary of the baked food are calculated to obtain the ray redundancy distance, which is used to judge the remaining space between the internal structure and the edge of the product. This method has high flexibility: in the case of complex food edges or multiple break points, the ray projection can automatically adapt to the specific shape without manual preset templates. The redundancy distance as a measurement index can accurately reflect the internal void distribution and deformation degree of the product, facilitating the extraction of abnormal areas. Compared with the traditional scheme based on overall area segmentation, the method of the present invention is more sensitive to minor defects or local defects. In addition, the ray projections corresponding to the multi-sided point distribution achieve multi-angle and multi-dimensional space scanning, providing key data support for subsequent continuous distance threshold discrimination. In summary, this step effectively improves the adaptive division ability of the area to be inspected, can dynamically respond to the diversification of product shapes, and improves the inspection accuracy and sensitivity.

[0068] 3. The quality inspection system and inspection method for the production of a baked food introduce a distance threshold and a consecutive number threshold, mark and screen the redundant distance of the rays, and judge the range of the suspicious area based on the number of consecutive marked points. If multiple rays with redundant distances greater than the distance threshold appear continuously, it indicates that the enclosed area formed by the intersection of these rays and the first edge or the second edge is relatively large. Detecting within this enclosed area will not pierce the needle of the residual oxygen detector into the baked food. By combining steps such as calculating the difference in the numbers of consecutive marked points and the intersection of the first auxiliary ray and the second auxiliary ray, closed areas of various shapes can be flexibly generated to adapt to different product forms and detection requirements. After adopting the consecutive number threshold, pseudo-regions formed by occasional noise points can be eliminated, improving the stability and accuracy of region extraction. In addition, this method can dynamically adjust the threshold parameters to meet the real-time response to changes in different types of baked foods, packaging materials, and production environments. In summary, this step optimizes region extraction while effectively reducing the false alarm rate and improving the robustness and practicality of the detection system. By generating auxiliary rays and dividing the closed area for each of the four edges of the packaging bag respectively, the method of the present invention can perform multi-angle detection of the product from four directions. Whether it is the layout points corresponding to the first side, the second side, the third side, or the fourth side, the area to be detected can be extracted according to the same process, realizing a comprehensive scan of the entire packaging area of the food. This process not only ensures the integrity of the detection area extraction but also improves the accuracy of positioning defects through comprehensive analysis of the data on the four sides.

[0069] 4. The quality inspection system and inspection method for the production of a baked food project four line segments vertically along the edge of the first area at the geometric centers of the first to third target areas respectively and select the longest one. The central position corresponding to the longest line segment is the detection point, and the extrusion edge corresponding to the detection point is further determined. This method automatically finds the optimal detection point based on the spatial distribution characteristics without manual presetting or empirical rules and can adaptively handle baked foods of different shapes and sizes. By selecting the longest vertical line segment, it can ensure that the impact on the detection point during subsequent extrusion of the extrusion edge is minimized. If the detection point is close to the extrusion edge, wrinkles may appear at the detection point during extrusion of the extrusion edge, resulting in gas leakage or packaging rupture when piercing the detection point, 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 improvement of the accuracy of residual oxygen measurement during the extrusion process. In summary, this step realizes the intelligence, adaptability, and optimization of the detection point selection. Description of the Drawings

[0070] Figure 1 It is a schematic diagram of the area to be detected according to the present invention.

[0071] Figure 2 It is a schematic diagram of the detection point selection according to the present invention. Detailed Embodiment

[0072] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0073] Example, refer to Figure 1 and Figure 2 , a quality inspection system and inspection method for baking food production, including:

[0074] Obtain the baked products that have completed production, denoted as the products to be inspected;

[0075] Collect an image of the product to be inspected directly above the product to be inspected; by obtaining the product to be inspected immediately after production is completed and collecting the image directly above the product to be inspected, this step can ensure that the collected image is highly consistent with the product itself, eliminating the influence of perspective deviation and perspective distortion. First, by shooting at a directly upward angle, the complete contour information of the packaging bag and the food edge can be obtained, laying a solid foundation for subsequent edge recognition and image segmentation.

[0076] Obtain the edge of the rectangular packaging bag in the image of the product to be inspected, denoted as the first edge, and the area surrounded by the first edge is denoted as the first area;

[0077] Arbitrarily select one side of the first area, denoted as the first side; the two vertices of the first side are respectively denoted as the first vertex and the second vertex; the side of the four sides of the first area that intersects the first side at the first vertex is denoted as the second side; the side of the four sides of the first area that intersects the first side at the second vertex is denoted as the third side; the side of the four sides of the first area other than the first side, the second side, and the third side is denoted as the fourth side; the vertex of the two vertices of the second side other than the first vertex is denoted as the third vertex; the vertex of the two vertices of the third side other than the second vertex is denoted as the fourth vertex; the direction from the first vertex to the second vertex is denoted as the first direction, the direction from the first vertex to the third vertex is denoted as the second direction, the direction from the fourth vertex to the third vertex is denoted as the third direction, and the direction from the fourth vertex to the second vertex is denoted as the fourth direction;

[0078] Obtain the edge of the baked food in the image of the product to be inspected, denoted as the second edge, and the area surrounded by the second edge is denoted as the second area;

[0079] Perform point distribution on the four sides of the first area;

[0080] Obtain the area to be inspected;

[0081] Select inspection points according to the area to be inspected, specifically:

[0082] Obtain the areas of all regions to be detected and sort them in descending order of area. Select the top three regions to be detected in terms of area, and denote them as the first target region, the second target region, and the third target region in descending order of area.

[0083] Obtain the geometric center of the first target region and denote it as the first detection position.

[0084] Draw four perpendicular line segments from the first detection position to the four sides of the first region respectively; one end of the perpendicular line segment is the first detection position, and the other end is on the corresponding side of the first region.

[0085] Obtain the lengths of the four perpendicular line segments respectively, and select the perpendicular line segment with the longest length and denote it as the first perpendicular line segment.

[0086] Obtain the geometric center of the second target region and denote it as the second detection position.

[0087] Draw four perpendicular line segments from the second detection position to the four sides of the first region respectively; one end of the perpendicular line segment is the first detection position, and the other end is on the corresponding side of the first region.

[0088] Obtain the lengths of the four perpendicular line segments respectively, and select the perpendicular line segment with the longest length and denote it as the second perpendicular line segment.

[0089] Obtain the geometric center of the third target region and denote it as the third detection position.

[0090] Draw four perpendicular line segments from the third detection position to the four sides of the first region respectively; one end of the perpendicular line segment is the first detection position, and the other end is on the corresponding side of the first region.

[0091] Obtain the lengths of the four perpendicular line segments respectively, and select the perpendicular line segment with the longest length and denote it as the third perpendicular line segment.

[0092] 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 side 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 side 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 side of the first area corresponding to the third vertical line segment as the extrusion edge; for the quality detection system and method for producing a baked food, at the geometric centers of the first to third target areas, project four line segments vertically along the edge of the first area and select the longest one, and the central position corresponding to the longest line segment is the detection point, and further determine the extrusion edge corresponding to the detection point. This method automatically finds the optimal detection point based on the spatial distribution characteristics, without manual presetting or empirical rules, and can adaptively handle baked foods of different shapes and sizes. By selecting the longest vertical line segment, it can ensure that the impact on the detection point is minimized when extruding the extrusion edge in the subsequent process; if the detection point is close to the extrusion edge, wrinkles may appear at the detection point when extruding the extrusion edge; resulting in gas leakage or packaging rupture when piercing the detection point, thus affecting the detection result; this strategy significantly improves the scientificity and objectivity of the selection of the detection point. The adaptive matching of the detection point and the extrusion edge can ensure the maximum improvement of the accuracy of residual oxygen measurement during the extrusion process. In summary, this step realizes the intelligence, adaptability, and optimization of the selection of the detection point.

[0093] Conduct quality inspection on the product to be inspected.

[0094] The step of arranging points on the four sides of the first area specifically includes:

[0095] Set the point arrangement interval, and the point arrangement interval is used to arrange points on the side of the first area;

[0096] On the first side, starting from the first vertex, arrange a point on the first side every other point arrangement interval until reaching the second vertex, and number the arranged points in ascending order of natural numbers along the first direction;

[0097] On the second side, starting from the first vertex, arrange a point on the second side every other point arrangement interval until reaching the third vertex, and number the arranged points in ascending order of natural numbers along the second direction;

[0098] On the third side, starting from the second vertex, arrange a point on the third side every other point arrangement interval until reaching the fourth vertex, and number the arranged points in ascending order of natural numbers along the fourth direction;

[0099] On the fourth side, starting from the third vertex, a point is arranged at every other point interval until reaching the fourth vertex, and the arranged points are numbered in ascending order of natural numbers along the third direction;

[0100] The quality inspection system and inspection method for the production of a certain baked food evenly arrange points at preset intervals on the four sides of the first area to form a point arrangement matrix, ensuring a comprehensive sampling of the surface state of the bag edge. Through setting the point interval and numbering along four directions, each arranged point corresponds to a unique number, enabling accurate positioning of subsequent operations such as ray redundancy distance calculation and area to be detected generation, and avoiding overlap or omission. The uniform point arrangement strategy can save computing resources to the greatest extent while ensuring sampling coverage compared with random or dense grid sampling. For bags of different specifications, the point interval can be flexibly adjusted to meet the requirements of various production line outputs and inspection precisions. In addition, the point numbering system makes the storage, query, and visualization of inspection data more convenient, facilitating subsequent statistical analysis and traceability management. In summary, based on improving the inspection coverage, this strategy takes into account the operation efficiency and provides efficient support for the subsequent extraction of the area to be detected and the selection of inspection points.

[0101] The obtaining of the area to be detected specifically includes:

[0102] Taking each arranged point on the first side as an endpoint, a ray perpendicular to the first side is made, and the direction of the ray is the second direction; if the made 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 between the ray starting point and the first intersection point of the ray and the second edge along the ray direction is the redundancy distance of this ray; if the made ray does not intersect with the second edge, the distance between the ray starting point and the intersection point of the ray and the third side is the redundancy distance of this ray;

[0103] Taking each arranged point on the second side as an endpoint, a ray perpendicular to the second side is made, and the direction of the ray is the first direction; if the made 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 between the ray starting point and the first intersection point of the ray and the second edge along the ray direction is the redundancy distance of this ray; if the made ray does not intersect with the second edge, the distance between the ray starting point and the intersection point of the ray and the fourth side is the redundancy distance of this ray;

[0104] Taking each point arranged on the third side as an endpoint, draw a ray perpendicular to the third side, and the direction of the ray is the fourth 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 between the starting point of the ray and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the drawn ray does not intersect the second edge, obtain the distance between the starting point of the ray and the intersection point of the ray and the first side, which is the redundant distance of this ray.

[0105] Taking each point arranged on the fourth side as an endpoint, draw a ray perpendicular to the fourth side, 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 between the starting point of the ray and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the drawn ray does not intersect the second edge, obtain the distance between the starting point of the ray and the intersection point of the ray and the second side, which is the redundant distance of this ray.

[0106] The quality detection system and detection method for the production of a baked food, by taking the edge points as the ray endpoints, respectively project rays vertically inward, calculate the intersection points of the rays and the edges or boundary edges of the baked food, obtain the redundant distances of the rays, and use them to judge the remaining space between the internal structure and the edge of the product. This method has high flexibility: in the case of complex food edges or multiple break points, the ray projection can automatically adapt to the specific shape without manual preset templates. The redundant distance as a metric can accurately reflect the internal void distribution and deformation degree of the product, facilitating the extraction of abnormal areas. Compared with the traditional scheme based on overall region segmentation, the method of the present invention is more sensitive to minor defects or local defects. In addition, the ray projections corresponding to the multi-sided points realize multi-angle and multi-dimensional space scanning, providing key data support for subsequent continuous distance threshold discrimination. In summary, this step effectively improves the adaptive partitioning ability of the area to be detected, can dynamically respond to the diversification of product shapes, and improves the detection accuracy and sensitivity.

[0107] The obtaining of the area to be detected further includes:

[0108] Setting a distance threshold and a consecutive number threshold, where the distance threshold and the consecutive number threshold are used to obtain the area to be detected;

[0109] Obtain the redundant distances of the rays made with each point arranged on the first side as endpoints respectively, and mark the endpoints of the rays corresponding to the redundant distances greater than the distance threshold; starting from the first vertex and along the first direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the first side, if the difference in the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as consecutive; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number, if the continuous number is less than or equal to the continuous times threshold, then select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times threshold, then along the first direction, obtain the first marked endpoint and the last marked endpoint, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and denote them as the first auxiliary ray and the second auxiliary ray respectively; if both auxiliary rays intersect the second edge, then along the second direction, obtain the first intersection points of the two auxiliary rays and the second edge respectively, and the part of the second edge between the two intersection points along the first direction is denoted as the first auxiliary curve; the closed figure enclosed by the first auxiliary ray, the second auxiliary ray, the first side and the first auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, then the closed region enclosed by the first auxiliary ray, the second auxiliary ray, the first side and the fourth side is denoted as the region to be detected; if only one auxiliary ray intersects the second edge, then along the second direction, obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge, denoted as the first auxiliary intersection point, and draw a line perpendicular to the auxiliary ray not intersecting the second edge through the first auxiliary intersection point, denoted as the first auxiliary line; the closed region enclosed by the first auxiliary ray, the second auxiliary ray, the first side and the first auxiliary line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all the situations where the marked endpoints on the first side appear continuously.

[0110] The obtaining of the region to be detected further includes:

[0111] Obtain the redundant distances of the rays made with each point arranged on the second side as endpoints respectively, and mark the endpoints of the rays corresponding to the redundant distances 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 side, if the difference in the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as consecutive; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number, if the continuous number is less than or equal to the continuous times threshold, then select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times threshold, then 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, and denote them as the third auxiliary ray and the fourth auxiliary ray respectively; if both auxiliary rays intersect the second edge, then obtain the first intersection points of the two auxiliary rays and the second edge along the first direction respectively, and the part of the second edge between the two intersection points along the second direction is denoted as the second auxiliary curve; the closed figure enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the second auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, then denote the closed region enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the third side as the region to be detected; if only one auxiliary ray intersects the second edge, then obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge along the first direction, denoted as the second auxiliary intersection point, and draw a line perpendicular to the auxiliary ray not intersecting the second edge through the second auxiliary intersection point, denoted as the second auxiliary line; the closed region enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the second auxiliary line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all the situations where the marked endpoints appear continuously on the second side.

[0112] The obtaining of the region to be detected further includes:

[0113] Obtain the redundant distances of the rays made with each point arranged on the third side as endpoints respectively, and mark the endpoints of the rays corresponding to the redundant distances greater than the distance threshold; starting from the fourth vertex along the fourth direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the third side, if the difference in the numbers of the two marked endpoints is 1, then the two marked endpoints are regarded as consecutive; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number. If the continuous number is less than or equal to the continuous times threshold, then select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times threshold, then along the fourth direction, obtain the first marked endpoint and the last marked endpoint, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and denote them as the fifth auxiliary ray and the sixth auxiliary ray respectively; if both auxiliary rays intersect the second edge, then along the third direction, obtain the first intersection points of the two auxiliary rays and the second edge respectively, and the part of the second edge between the two intersection points along the fourth direction is denoted as the third auxiliary curve; the closed figure enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, then the closed region enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the second side is denoted as the region to be detected; if only one auxiliary ray intersects the second edge, then along the third direction, obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge, denoted as the third auxiliary intersection point, and draw a straight line perpendicular to the auxiliary ray not intersecting the second edge through the third auxiliary intersection point, denoted as the third auxiliary straight line; the closed region enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary straight line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all the situations where the marked endpoints appear continuously on the third side.

[0114] The obtaining of the region to be detected further includes:

[0115] Obtain the redundant distances of the rays with each point arranged on the fourth side as an endpoint respectively, and mark the endpoints of the rays corresponding to the redundant distances greater than the distance threshold; starting from the fourth vertex and along the third direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the fourth side, if the difference in the numbers of the two marked endpoints is 1, it is regarded as the two marked endpoints being continuous; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number. If the continuous number is less than or equal to the continuous times threshold, select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times 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 denote them as the seventh auxiliary ray and the eighth auxiliary ray respectively; if both auxiliary rays intersect the second edge, obtain the first intersection points of the two auxiliary rays and the second edge along the fourth direction respectively, and the part of the second edge between the two intersection points along the third direction is denoted as the fourth auxiliary curve; the closed figure enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side and the fourth auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, denote the closed region enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side and the first side as the region to be detected; if only one auxiliary ray intersects the second edge, obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge along the fourth direction, denoted as the fourth auxiliary intersection point, and draw a line perpendicular to the auxiliary ray not intersecting the second edge through the fourth auxiliary intersection point, denoted as the fourth auxiliary line; the closed region enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side and the fourth auxiliary line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all the situations where the marked endpoints appear continuously on the fourth side;

[0116] The quality inspection system and inspection method for the production of a baked food introduce a distance threshold and a consecutive number threshold, mark and screen the redundant distances of the rays, and determine the range of the suspicious area by combining the number of consecutive marked points. If multiple rays with redundant distances greater than the distance threshold appear continuously, it indicates that the enclosed area formed by the intersection of these rays with the first edge or the second edge is relatively large. Detecting within this enclosed area will not insert the needle of the residual oxygen detector into the baked food. By combining steps such as calculating the difference in the numbers of consecutive marked points and the intersection of the first auxiliary ray and the second auxiliary ray, closed areas of various shapes can be flexibly generated to adapt to different product forms and detection requirements. After adopting the consecutive number threshold, pseudo-regions formed by occasional noise points can be eliminated, improving the stability and accuracy of region extraction. In addition, this method can dynamically adjust the threshold parameters to meet the real-time response to changes in different types of baked foods, packaging materials, and production environments. In summary, this step optimizes region extraction while effectively reducing the false alarm rate and improving the robustness and practicality of the detection system; by generating auxiliary rays and dividing the closed area for each of the four edges of the packaging bag respectively, the method of the present invention can perform multi-angle detection of the product from four directions. Whether it is the points arranged corresponding to the first side, the second side, the third side, or the fourth side, the area to be detected can be extracted according to the same process, realizing a comprehensive scan of the entire packaging area of the food. This process not only ensures the integrity of the extraction of the detection area but also improves the accuracy of locating defects through the comprehensive analysis of the data of the four sides.

[0117] Performing quality inspection on the product to be detected specifically includes:

[0118] Obtain the positions of the detection points and paste aluminum foil stickers at the detection points; attach aluminum foil stickers at the detection points so that gas can only leak from the preset detection points, avoiding gas diffusion outside the whole bag and causing measurement errors. Combining the precise control of the corresponding extrusion edge by the adaptive extrusion device, the gas in the bag is concentrated and flows out along the direction of the auxiliary needle, improving the stability and reproducibility of the readings of the residual oxygen detector. The aluminum foil sticker provides an airtight function, eliminating the interference of background air on the measurement.

[0119] Set a residual oxygen threshold, and the residual oxygen threshold is used to judge whether the quality of the baked food is qualified;

[0120] Obtain the residual oxygen content of the product to be detected, specifically:

[0121] Insert the needle of the residual oxygen detector into the detection point of the product to be detected, and at the same time squeeze the extrusion edge of the product to be detected;

[0122] Obtain the reading of the residual oxygen detector and record it as the actual residual oxygen content;

[0123] If the actual residual oxygen content is greater than the residual oxygen threshold, it is determined that the quality of the baked food is unqualified;

[0124] If the actual residual oxygen content is less than or equal to the residual oxygen content threshold, the quality of the baked food is determined to be qualified; the residual oxygen detector automatically pierces the needle into the detection point and synchronously squeezes. After high-speed sensing and sampling inside the system, the residual oxygen reading is output in real time and compared with the preset threshold to determine whether it is qualified. This process does not require manual intervention, and the single detection cycle can be shortened to the level of a few hundred milliseconds, greatly improving the detection speed.

[0125] Implement a system for a quality detection method in baked food production, including:

[0126] An image acquisition module, used to acquire an image directly above the product to be detected and obtain image data including the edges of the rectangular packaging bag and the baked food.

[0127] An edge processing module, used to identify the first edge of the packaging bag and the second edge of the food in the image and construct the spatial relationship between the first region and the second region.

[0128] A point layout calculation module, used to dynamically layout points at preset intervals on the four sides of the first region and generate the numbers of the points on each side.

[0129] A region analysis module, used to calculate the redundant distances of the rays of each layout point, combined with the distance threshold and the continuous number threshold.

[0130] A detection decision module, used to calculate the length of the perpendicular line segment, select the detection point and the corresponding extrusion side after comparing the lengths of each perpendicular line segment, and generate a detection instruction including the detection coordinates and the extrusion side identifier.

[0131] An execution unit, including:

[0132] A positioning mechanism, carrying an aluminum foil sticker and moving to the detection point in response to the detection instruction for pre-fixing the sticker.

[0133] An adaptive extrusion device, having adjustable jaws, and adaptively matching the clamping angle of the packaging bag boundary according to the extrusion side identifier.

[0134] A residual oxygen detector, a micro-needle sensor integrated on the puncture positioning mechanism, and performing puncture and gas sampling synchronously during the extrusion process.

[0135] A result feedback unit, comparing the residual oxygen content data with the threshold and outputting a quality determination signal.

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

[0137] The above are only the preferred embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A quality inspection method for the production of baked goods, characterized in that, Including: Obtain the baked products that have completed production, denoted as the products to be detected; Collect an image of the product to be detected directly above the product to be detected; Obtain the edge of the rectangular packaging bag in the image of the product to be detected, denoted as the first edge, and the area enclosed by the first edge is denoted as the first area; Arbitrarily select one side of the first area, denoted as the first side; the two vertices of the first side are respectively denoted as the first vertex and the second vertex; among the four sides of the first area, the side that intersects the first side at the first vertex is denoted as the second side; among the four sides of the first area, the side that intersects the first side at the second vertex is denoted as the third side; among the four sides of the first area, the side other than the first side, the second side, and the third side is denoted as the fourth side; among the two vertices of the second side, the vertex other than the first vertex is denoted as the third vertex; among the two vertices of the third side, the vertex other than the second vertex is denoted as the fourth vertex; the direction from the first vertex to the second vertex is denoted as the first direction, the direction from the first vertex to the third vertex is denoted as the second direction, the direction from the fourth vertex to the third vertex is denoted as the third direction, and the direction from the fourth vertex to the second vertex is denoted as the fourth direction; Obtain the edge of the baked food in the image of the product to be detected, denoted as the second edge, and the area enclosed by the second edge is denoted as the second area; Perform point distribution on the four sides of the first area; Obtain the area to be detected; Select detection points according to the area to be detected, specifically: Obtain the areas of all areas to be detected and sort them in descending order of area, select the top three areas to be detected in terms of area, and denote them as the first target area, the second target area, and the third target area in descending order of area; Obtain the geometric center of the first target area, denoted as the first detection position; Draw four perpendicular line segments from the first detection position to the four sides of the first area respectively; one end of the perpendicular line segment is the first detection position, and the other end is on the corresponding side of the first area; Respectively obtain the lengths of the four perpendicular line segments, and select the perpendicular line segment with the longest length and denote it as the first perpendicular line segment; Obtain the geometric center of the second target area, denoted as the second detection position; Draw four perpendicular line segments from the second detection position to the four sides of the first area respectively; one end of the perpendicular line segment is the first detection position, and the other end is on the corresponding side of the first area; Respectively obtain the lengths of the four perpendicular line segments, and select the perpendicular line segment with the longest length and denote it as the second perpendicular line segment; Obtain the geometric center of the third target area, denoted as the third detection position; Draw four perpendicular line segments from the third detection position to the four sides of the first area respectively; one end of the perpendicular line segment is the first detection position, and the other end is on the corresponding side of the first area; Respectively obtain the lengths of the four perpendicular line segments, and select the perpendicular line segment with the longest length and denote it as the third perpendicular line segment; Compare the lengths of the first perpendicular line segment, the second perpendicular line segment, and the third perpendicular line segment; if the first perpendicular line segment is the longest, then select the first detection position as the detection point and select the side of the first area corresponding to the first perpendicular line segment as the extrusion side; If the second vertical line segment is the longest, select the second detection position as the detection point and select the side of the first region corresponding to the second vertical line segment as the extrusion side; if the third vertical line segment is the longest, select the third detection position as the detection point and select the side of the first region corresponding to the third vertical line segment as the extrusion side; Conduct quality inspection on the product to be inspected.

2. The quality inspection method for the production of a baked food according to claim 1, characterized in that: The layout of points on the four sides of the first region specifically includes: Set the point layout interval, which is used to layout points on the sides of the first region; On the first side, starting from the first vertex, layout a point on the first side every other point layout interval until reaching the second vertex, and number the layout points in ascending order of natural numbers along the first direction; On the second side, starting from the first vertex, layout a point on the second side every other point layout interval until reaching the third vertex, and number the layout points in ascending order of natural numbers along the second direction; On the third side, starting from the second vertex, layout a point on the third side every other point layout interval until reaching the fourth vertex, and number the layout points in ascending order of natural numbers along the fourth direction; On the fourth side, starting from the third vertex, layout a point on the fourth side every other point layout interval until reaching the fourth vertex, and number the layout points in ascending order of natural numbers along the third direction.

3. The quality inspection method for the production of a baked food according to claim 1, characterized in that: The obtaining of the region to be inspected specifically includes: Respectively, take each layout point on the first side as an endpoint to make a ray perpendicular to the first side, and the direction of the ray is the second direction; if the made 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 between the ray starting point and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the made ray does not intersect with the second edge, obtain the distance between the ray starting point and the intersection point of the ray and the third side, which is the redundant distance of this ray; Respectively, take each layout point on the second side as an endpoint to make a ray perpendicular to the second side, and the direction of the ray is the first direction; if the made 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 between the ray starting point and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the made ray does not intersect with the second edge, obtain the distance between the ray starting point and the intersection point of the ray and the fourth side, which is the redundant distance of this ray; Respectively, take each layout point on the third side as an endpoint to make a ray perpendicular to the third side, and the direction of the ray is the fourth direction; if the made 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 between the ray starting point and the first intersection point of the ray and the second edge along the ray direction, which is the redundant distance of this ray; if the made ray does not intersect with the second edge, obtain the distance between the ray starting point and the intersection point of the ray and the first side, which is the redundant distance of this ray; Taking each point arranged on the fourth side as an endpoint, draw a ray perpendicular to the fourth side, 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 direction of the ray, and obtain the distance between the starting point of the ray and the first intersection point of the ray and the second edge along the direction of the ray, which is the redundant distance of this ray; if the drawn ray does not intersect with the second edge, obtain the distance between the starting point of the ray and the intersection point of the ray and the second side, which is the redundant distance of this ray.

4. A quality inspection method for baking food production according to claim 3, characterized in that: The obtaining of the region to be detected further includes: Setting a distance threshold and a consecutive number threshold, which are used to obtain the region to be detected; Respectively obtain the redundant distances of the rays drawn with each point arranged on the first side as an endpoint, and mark the endpoints corresponding to the redundant distances greater than the distance threshold; starting from the first vertex, if there is a situation where the marked endpoints continuously appear among all the points arranged on the first side in the first direction, if the difference in the numbers of the two marked endpoints is 1, it is regarded as the two marked endpoints being consecutive; for a situation where the marked endpoints continuously appear once, obtain the number of the continuously appearing marked endpoints, denoted as the consecutive number, if the consecutive number is less than or equal to the consecutive number threshold, select other situations where the marked endpoints continuously appear; if the consecutive number is greater than the consecutive 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 denote them as the first auxiliary ray and the second auxiliary ray respectively; if both auxiliary rays intersect with the second edge, respectively obtain the first intersection points of the two auxiliary rays and the second edge along the second direction, and the part of the second edge between the two intersection points along the first direction is denoted as the first auxiliary curve; the closed figure surrounded by the first auxiliary ray, the second auxiliary ray, the first side and the first auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect with the second edge, denote the closed region surrounded by the first auxiliary ray, the second auxiliary ray, the first side and the fourth side as the region to be detected; if only one auxiliary ray intersects with the second edge, obtain the first intersection point of the auxiliary ray intersecting with the second edge and the second edge along the second direction, denoted as the first auxiliary intersection point, and draw a straight line perpendicular to the auxiliary ray not intersecting with the second edge through the first auxiliary intersection point, denoted as the first auxiliary straight line; the closed region surrounded by the first auxiliary ray, the second auxiliary ray, the first side and the first auxiliary straight line is denoted as the region to be detected; according to the above method, obtain the region to be detected corresponding to the situation where all the marked endpoints on the first side continuously appear.

5. A quality inspection method for the production of baked goods according to claim 4, characterized in that: The obtaining of the region to be detected further includes: Obtain the redundant distances of the rays made with each of the points arranged on the second side as endpoints respectively, and mark the endpoints of the rays corresponding to the redundant distances 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 side, if the difference in the numbers of the two marked endpoints is 1, it is regarded as the two marked endpoints being continuous; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number, if the continuous number is less than or equal to the continuous times threshold, then select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times threshold, then along the second direction, obtain the first marked endpoint and the last marked endpoint, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, denoted as the third auxiliary ray and the fourth auxiliary ray respectively; if both auxiliary rays intersect the second edge, then along the first direction, obtain the first intersection points of the two auxiliary rays and the second edge respectively, and the part of the second edge between the two intersection points along the second direction is denoted as the second auxiliary curve; the closed figure enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the second auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, then the closed region enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the third side is denoted as the region to be detected; if only one auxiliary ray intersects the second edge, then along the first direction, obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge, denoted as the second auxiliary intersection point, and draw a straight line perpendicular to the auxiliary ray not intersecting the second edge through the second auxiliary intersection point, denoted as the second auxiliary straight line; the closed region enclosed by the third auxiliary ray, the fourth auxiliary ray, the second side and the second auxiliary straight line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all the situations where the marked endpoints on the second side appear continuously.

6. A quality inspection method for the production of baked goods according to claim 1, characterized in that: The obtaining of the region to be detected further includes: Obtain the redundant distances of the rays made with each point arranged on the third side as the endpoint respectively, and mark the endpoints of the rays corresponding to the redundant distances greater than the distance threshold; starting from the fourth vertex along the fourth direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the third side, if the difference in the numbers of the two marked endpoints is 1, it is regarded as the two marked endpoints being continuous; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number, if the continuous number is less than or equal to the continuous times threshold, then select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times threshold, then along the fourth direction, obtain the first marked endpoint and the last marked endpoint, obtain the ray corresponding to the first marked endpoint and the ray corresponding to the last marked endpoint, and denote them as the fifth auxiliary ray and the sixth auxiliary ray respectively; if both auxiliary rays intersect the second edge, then along the third direction, obtain the first intersection points of the two auxiliary rays and the second edge respectively, and the part of the second edge between the two intersection points along the fourth direction is denoted as the third auxiliary curve; the closed figure enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, then the closed region enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the second side is denoted as the region to be detected; if only one auxiliary ray intersects the second edge, then along the third direction, obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge, denoted as the third auxiliary intersection point, and draw a straight line perpendicular to the auxiliary ray not intersecting the second edge through the third auxiliary intersection point, denoted as the third auxiliary straight line; the closed region enclosed by the fifth auxiliary ray, the sixth auxiliary ray, the third side and the third auxiliary straight line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all the situations where the marked endpoints on the third side appear continuously.

7. A quality inspection method for the production of baked goods according to claim 1, characterized in that: The obtaining of the region to be detected further includes: Obtain the redundant distances of the rays made with each point arranged on the fourth side as endpoints respectively, and mark the endpoints of the rays corresponding to the redundant distances greater than the distance threshold; starting from the fourth vertex and along the third direction, if there is a situation where the marked endpoints appear continuously among all the points arranged on the fourth side, if the difference in the numbers of the two marked endpoints is 1, it is regarded as the two marked endpoints being continuous; for a situation where the marked endpoints appear continuously once, obtain the number of the continuously appearing marked endpoints, denoted as the continuous number. If the continuous number is less than or equal to the continuous times threshold, select other situations where the marked endpoints appear continuously; if the continuous number is greater than the continuous times 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 denote them as the seventh auxiliary ray and the eighth auxiliary ray respectively; if both auxiliary rays intersect the second edge, obtain the first intersection points of the two auxiliary rays and the second edge along the fourth direction respectively, and denote the part of the second edge between the two intersection points along the third direction as the fourth auxiliary curve; the closed figure enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side, and the fourth auxiliary curve is denoted as the region to be detected; if both auxiliary rays do not intersect the second edge, denote the closed region enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side, and the first side as the region to be detected; if only one auxiliary ray intersects the second edge, obtain the first intersection point of the auxiliary ray intersecting the second edge and the second edge along the fourth direction, denoted as the fourth auxiliary intersection point, and draw a straight line perpendicular to the auxiliary ray not intersecting the second edge through the fourth auxiliary intersection point, denoted as the fourth auxiliary straight line; the closed region enclosed by the seventh auxiliary ray, the eighth auxiliary ray, the fourth side, and the fourth auxiliary straight line is denoted as the region to be detected; according to the above method, obtain the regions to be detected corresponding to all situations where the marked endpoints on the fourth side appear continuously.

8. A quality inspection method for the production of baked goods according to claim 1, characterized in that: The quality inspection of the product to be detected specifically includes: Obtain the position of the detection point and paste an aluminum foil sticker at the detection point; Set the residual oxygen amount threshold, which is used to judge whether the quality of the baked food is qualified; Obtain the residual oxygen amount of the product to be detected, specifically: Insert the needle of the residual oxygen detector into the detection point of the product to be detected, and at the same time squeeze the extrusion side of the product to be detected; Obtain the reading of the residual oxygen detector, denoted as the actual residual oxygen amount; If the actual residual oxygen amount is greater than the residual oxygen amount threshold, it is determined that the quality of the baked food is unqualified; If the actual residual oxygen amount is less than or equal to the residual oxygen amount threshold, it is determined that the quality of the baked food is qualified.

9. A system for implementing the quality inspection method of a baked food production described in claim 1, characterized in that, It includes: An image acquisition module, which is used to acquire an image directly above the product to be detected and obtain image data including the edges of the rectangular packaging bag and the edges of the baked food; An edge processing module, which is used to identify the first edge of the packaging bag and the second edge of the food in the image and construct the spatial relationship between the first region and the second region; A point layout calculation module, which is used to dynamically layout points at preset intervals on the four sides of the first region and generate the numbers of the points on each side; The area analysis module is used to calculate the redundant distances of the rays at each layout point, and combine the distance threshold and the consecutive times threshold; The 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 the vertical line segments, and generate a detection instruction including the detection coordinates and the extrusion edge identifier; The execution unit includes: The positioning mechanism carries the aluminum foil sticker and moves to the detection point in response to the detection instruction for pre-fixing the sticker; The adaptive extrusion device has adjustable jaws and adaptively matches the clamping angle of the packaging bag boundary according to the extrusion edge identifier; The residual oxygen detector is a micro-needle sensor integrated on the puncture positioning mechanism, and performs puncture and gas sampling synchronously during the extrusion process; The result feedback unit compares the residual oxygen content data with the threshold and outputs a quality determination signal.

Citation Information

Patent Citations

  • Method for detecting quadrangular marker in image

    CN105654097A

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

    US20160349139A1