Method and device for detecting foreign matter in a shaped bottle
Patent Information
- Application Number
- CN202610791154.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-09-29
AI Technical Summary
[0007]本发明提供了一种异形瓶内可见异物检测方法及装置,以解决在现有检测方案中,因依赖紧急制动制造异物运动轨迹,导致图像无畸变与异物运动轨迹不可兼得的技术问题
本发明的异形瓶内异物检测方法,首先,将待检瓶体输送至初检位置,在瓶体与成像系统之间建立第一预设相对空间关系,并在此状态下采集瓶体内液体的第一图像。此时瓶内液面平静,所获图像清晰可靠,完整记录了异物在液体中的初始状态,为后续对比分析提供了准确的基准。其次,使瓶体运动以改变异物在液体中的位置,随后使瓶体恢复至一个预设的受控姿态,并等待液面恢复平静。之后,在瓶体与成像系统之间,重建与第一预设相对空间关系实质相同的第二预设相对空间关系,再由成像系统采集瓶体内液体的第二图像。在此过程中,使瓶体运动的目的仅在于赋予异物一个相对位移,瓶体可以平稳恢复至预设的受控姿态,液面即便因运动出现暂时性扰动也能自行恢复平静,通过重建与第一预设相对空间关系实质相同的第二预设相对空间关系,确保了两次图像采集时成像条件完全相同,仅有异物位置可能发生变化。最后,将在第一预设相对空间关系和第二预设相对空间关系下采集的两幅成像条件严格一致、仅异物位置可能不同的静止图像进行对比分析以识别异物。由于两幅图像中液面无畸变、成像关系一致,异物位置变化可通过简单的图像差分等算法清晰检出,极大降低了图像处理难度,提高了检测准确率,对于高粘度液体中运动幅度微小、难以形成轨迹的异物同样有效。相对于现有技术,本方案通过“建立成像关系采集静止基准—运动移物并恢复姿态—重建成像关系同条件复检—对比差异”的检测逻辑,从根源上规避了因紧急制动导致的图像畸变对成像和后续识别的干扰,解决了现有旋转急停法中图像无畸变与异物运动轨迹不可兼得的难题,显著提升了异形瓶内异物检测的可靠性和适用性,实用性强,适于广泛推广和应用。
Smart Images

Figure CN122836080A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of foreign object detection technology, and in particular, to a method for detecting foreign objects inside irregularly shaped bottles. Furthermore, this invention also relates to a foreign object detection device for irregularly shaped bottles employing the aforementioned method. Background Technology
[0002] In the food and pharmaceutical industries, some products are packaged in irregularly shaped bottles. These bottles typically refer to non-circular cross-sections with complex curved surfaces or patterns. Because irregularly shaped bottles enhance product visibility, their application is becoming increasingly widespread. However, to ensure product quality and consumer safety, rigorous inspection of the bottle interior for foreign objects such as hair, fibers, glass fragments, and metal particles is usually required. In particular, the irregular shape of irregularly shaped bottles means that refraction, scattering, and local magnification effects from the bottle walls can affect image quality. Furthermore, the presence of patterns or edges on the bottle body makes foreign object detection significantly more difficult than with standard round bottles.
[0003] Currently, automated detection of foreign objects in bottled liquids mainly employs machine vision-based automatic light inspection machines. The core technology is the "rotational emergency stop method," which involves first rotating the bottle at high speed, causing the liquid and any potential foreign objects inside to move together, and then applying an emergency brake to bring the bottle to a sudden stop. Due to inertia, the liquid and foreign objects continue to rotate. After the bottle comes to a stop, a high-speed camera immediately takes continuous photos of the bottle's interior, acquiring a multi-frame image sequence. Image analysis algorithms then capture the trajectory of the foreign objects due to their density difference from the liquid, thereby identifying defective products containing foreign objects. For example, Chinese utility model patent CN201732068U describes a rotating bottle detection device and a foreign object detection equipment that uses the aforementioned rotational emergency stop method, rotating the bottle to be inspected at high speed and then stopping it abruptly, performing image acquisition and analysis while the liquid inside the bottle is still in high-speed motion.
[0004] However, the aforementioned "rotational emergency stop method" has serious drawbacks when applied to irregularly shaped bottles. After emergency braking, although the bottle body is stationary, the liquid inside continues to rotate at high speed due to inertia. For irregularly shaped bottles with non-circular cross-sections, the irregular shape of their inner walls will cause severe disturbances to the rotating liquid flow. The high-speed rotating liquid surface will collide severely with the irregular bottle wall, resulting in severe deformation, tearing, and even cavitation. This causes the liquid interface in the detection area to exhibit highly irregular shapes such as distortion and warping, resulting in severe optical imaging distortion. This makes it difficult for subsequent image analysis algorithms to effectively identify foreign objects, making detection extremely difficult and even leading to detection failure.
[0005] To address the aforementioned issues, existing technologies have attempted various improvements. One approach involves waiting a delay after an emergency stop, allowing the liquid surface to return to calm before taking the picture. However, after this delay, the liquid's inertial rotation has largely ceased, and the foreign object remains stationary or moves only minimally, failing to form a identifiable trajectory and resulting in missed detections. Another approach is to reduce the bottle rotation speed to lessen the collision between the liquid and the inner wall of the irregularly shaped bottle, thereby reducing image distortion. However, a reduced rotation speed results in insufficient kinetic energy transferred to the liquid and the foreign object, making it difficult for the object to generate sufficient motion after the emergency stop, thus failing to form an effective trajectory and again leading to missed detections. Therefore, existing detection methods based on the "rotation emergency stop method" and its derivatives consistently face an irreconcilable contradiction: ensuring sufficient trajectory for the foreign object results in severe image distortion; reducing image distortion results in insufficient or absent trajectory for the foreign object.
[0006] In summary, existing visual detection methods for foreign objects in bottles, especially for irregularly shaped bottles, rely on emergency braking to create a trajectory for the foreign object's movement. This presents a persistent technical challenge: achieving both distortion-free images and a reliable foreign object trajectory is not feasible. Therefore, a new method is urgently needed that can fundamentally avoid image distortion interference while reliably identifying changes in the foreign object's position. Summary of the Invention
[0007] This invention provides a method and apparatus for detecting visible foreign objects inside irregularly shaped bottles, in order to solve the technical problem in existing detection schemes that rely on emergency braking to create the trajectory of foreign objects, resulting in a trade-off between image distortion-free images and foreign object movement trajectories.
[0008] According to one aspect of the present invention, a method for detecting foreign objects inside an irregularly shaped bottle is provided, comprising the following steps: transporting the bottle to be inspected to an initial inspection position; establishing a first preset relative spatial relationship between the bottle and an imaging system, and having the imaging system acquire a first image of the liquid inside the bottle, at which point the liquid surface inside the bottle is calm; moving the bottle to change the position of any foreign object that may be present in the liquid, and then restoring the bottle to a preset controlled posture; after waiting for the liquid surface inside the bottle to return to calm, reconstructing a second preset relative spatial relationship that is substantially the same as the first preset relative spatial relationship between the bottle and the imaging system, and having the imaging system acquire a second image of the liquid inside the bottle; comparing and analyzing the first image and the second image, and identifying whether a foreign object exists inside the bottle based on the differences between the two.
[0009] As a further improvement to the above technical solution: Furthermore, the conveyor line for the bottles to be inspected includes at least one first inspection station and at least one second inspection station, with the initial inspection position being the first inspection station; at the first inspection station, the imaging system establishes a first preset relative spatial relationship with the bottle and acquires a first image; at the second inspection station, the imaging system reconstructs a second preset relative spatial relationship with the bottle and acquires a second image.
[0010] Furthermore, the first inspection station and the second inspection station are set on the same rotary conveyor device, with the first inspection station and the second inspection station arranged sequentially along the conveying direction on the rotary conveyor device; when the bottle moves to the first inspection station with the rotary conveyor device, the imaging system establishes a first preset relative spatial relationship with the bottle and acquires a first image; before the bottle moves to the second inspection station with the rotary conveyor device, it performs a movement step and returns to a preset controlled posture; when the bottle moves to the second inspection station, the imaging system reconstructs a second preset relative spatial relationship with the bottle and acquires a second image.
[0011] Furthermore, the first inspection station and the second inspection station are set on the same linear conveyor device, with the first inspection station and the second inspection station arranged sequentially along the conveying direction on the linear conveyor device; when the bottle moves to the first inspection station with the linear conveyor device, the imaging system establishes a first preset relative spatial relationship with the bottle and acquires a first image; before the bottle moves to the second inspection station with the linear conveyor device, it performs a movement step and returns to a preset controlled posture; when the bottle moves to the second inspection station, the imaging system reconstructs a second preset relative spatial relationship with the bottle and acquires a second image.
[0012] Furthermore, the conveyor line for the bottles to be inspected also includes at least one third inspection station, which is located after the second inspection station. At the third inspection station, the imaging system reconstructs a third preset relative spatial relationship with the bottle that is substantially the same as the first preset relative spatial relationship. After the liquid surface in the bottle returns to calm, a third image of the liquid in the bottle is acquired, and the third image is compared and analyzed with the first image, or the third image, the second image, and the first image are compared and analyzed together to identify whether there are foreign objects in the bottle.
[0013] Furthermore, the conveyor line for the bottles to be inspected also includes at least one fourth inspection station, which is located after the third inspection station. At the fourth inspection station, the imaging system reconstructs a fourth preset relative spatial relationship with the bottle that is substantially the same as the first preset relative spatial relationship. After the liquid surface in the bottle returns to calm, a fourth image of the liquid in the bottle is acquired, and the fourth image is compared and analyzed with the first image, or the fourth image, the third image, the second image, and the first image are compared and analyzed together to identify whether there are foreign objects in the bottle.
[0014] Furthermore, the bottle to be inspected moves continuously on the conveyor line, moving from one inspection station to the next. During this movement, the imaging system moves synchronously with the bottle to track it and maintain a preset relative spatial relationship. When the bottle reaches the next inspection station, the imaging system triggers the capture of an image.
[0015] Furthermore, moving the bottle includes at least one of rotating the bottle, flipping the bottle, tilting the bottle and then straightening it, or swinging the bottle.
[0016] Furthermore, the comparative analysis employs an image difference algorithm to perform pixel-level comparison between the first and second images, identifying foreign objects based on the areas where differences exist between the two.
[0017] According to another aspect of the present invention, a foreign object detection device for irregularly shaped bottles is also provided, which employs the aforementioned method for detecting foreign objects in irregularly shaped bottles. The device includes: an actuator for transporting the bottle to be inspected to a designated station and driving the bottle to perform motion steps and return to a preset controlled posture; at least one imaging unit for establishing a preset relative spatial relationship with the bottle at each detection station and acquiring images of the liquid inside the bottle under this relationship; and an image analysis unit for comparing and analyzing at least two images acquired under the preset relative spatial relationship and identifying whether a foreign object exists inside the bottle based on the differences between the two images.
[0018] The present invention has the following beneficial effects: The foreign object detection method for irregularly shaped bottles of the present invention firstly transports the bottle to be inspected to the initial inspection position, establishes a first preset relative spatial relationship between the bottle and the imaging system, and acquires a first image of the liquid inside the bottle in this state. At this time, the liquid surface inside the bottle is calm, and the acquired image is clear and reliable, completely recording the initial state of the foreign object in the liquid, providing an accurate benchmark for subsequent comparative analysis. Secondly, the bottle is moved to change the position of the foreign object in the liquid, and then the bottle is restored to a preset controlled posture, waiting for the liquid surface to return to calm. Afterwards, a second preset relative spatial relationship, substantially the same as the first preset relative spatial relationship, is reconstructed between the bottle and the imaging system, and the imaging system then acquires a second image of the liquid inside the bottle. In this process, the purpose of moving the bottle is only to give the foreign object a relative displacement. The bottle can smoothly return to the preset controlled posture, and even if the liquid surface is temporarily disturbed due to the movement, it can recover its calm on its own. By reconstructing a second preset relative spatial relationship, substantially the same as the first preset relative spatial relationship, it is ensured that the imaging conditions are exactly the same during the two image acquisitions, with only the position of the foreign object possibly changing. Finally, two static images acquired under strictly identical imaging conditions, differing only in the location of the foreign object, are compared and analyzed to identify the foreign object. Since the liquid surface in both images is distortion-free and the imaging relationship is consistent, changes in the foreign object's position can be clearly detected using simple image differencing algorithms, greatly reducing image processing difficulty and improving detection accuracy. This method is also effective for foreign objects in high-viscosity liquids with minimal movement and difficulty in forming a trajectory. Compared to existing technologies, this solution, through its detection logic of "establishing imaging relationship and acquiring a static reference—moving the object and restoring its posture—reconstructing the imaging relationship and re-examining under the same conditions—comparing differences," fundamentally avoids the interference of image distortion caused by emergency braking on imaging and subsequent identification. It solves the problem of the incompatibility between distortion-free images and the trajectory of the foreign object in existing rotational emergency stop methods, significantly improving the reliability and applicability of foreign object detection in irregularly shaped bottles. It is highly practical and suitable for widespread promotion and application.
[0019] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the figures. Attached Figure Description
[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart of the steps of the method for detecting foreign objects inside irregularly shaped bottles according to a preferred embodiment of the present invention; Figure 2 This is a difference image of the image acquired in the foreign object detection method inside the irregularly shaped bottle according to a preferred embodiment of the present invention; Figure 3 This is a difference image of the image acquired in the foreign object detection method inside the irregularly shaped bottle according to a preferred embodiment of the present invention. Detailed Implementation
[0021] The following description provides specific application scenarios and requirements for this specification, intended to enable those skilled in the art to make and use the contents of this specification. Various partial modifications to the disclosed embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments and applications without departing from the spirit and scope of this specification.
[0022] like Figure 1 As shown, the foreign object detection method for irregularly shaped bottles in this embodiment includes the following steps: transporting the bottle to be inspected to the initial inspection position; establishing a first preset relative spatial relationship between the bottle and the imaging system, and having the imaging system acquire a first image of the liquid inside the bottle, at which point the liquid surface inside the bottle is calm; moving the bottle to change the position of any foreign object that may be present in the liquid, and then restoring the bottle to a preset controlled posture; after the liquid surface inside the bottle has returned to calm, reconstructing a second preset relative spatial relationship that is substantially the same as the first preset relative spatial relationship between the bottle and the imaging system, and having the imaging system acquire a second image of the liquid inside the bottle; comparing and analyzing the first image and the second image, and identifying whether a foreign object exists inside the bottle based on the differences between the two.
[0023] like Figure 1As shown, specifically, the foreign object detection method for irregularly shaped bottles of the present invention firstly transports the bottle to be inspected to the initial inspection position, establishes a first preset relative spatial relationship between the bottle and the imaging system, and acquires a first image of the liquid inside the bottle in this state. At this time, the liquid surface inside the bottle is calm, and the acquired image is clear and reliable, completely recording the initial state of the foreign object in the liquid, providing an accurate benchmark for subsequent comparative analysis. Secondly, the bottle is moved to change the position of the foreign object in the liquid, and then the bottle is restored to a preset controlled posture, waiting for the liquid surface to return to calm. Afterwards, a second preset relative spatial relationship, substantially the same as the first preset relative spatial relationship, is reconstructed between the bottle and the imaging system, and the imaging system then acquires a second image of the liquid inside the bottle. In this process, the purpose of moving the bottle is only to give the foreign object a relative displacement. The bottle can smoothly return to the preset controlled posture, and even if the liquid surface is temporarily disturbed due to the movement, it can recover its calm on its own. By reconstructing a second preset relative spatial relationship, substantially the same as the first preset relative spatial relationship, it is ensured that the imaging conditions are exactly the same during the two image acquisitions, with only the position of the foreign object possibly changing. Finally, two static images acquired under strictly identical imaging conditions, differing only in the location of the foreign object, are compared and analyzed to identify the foreign object. Since the liquid surface in both images is distortion-free and the imaging relationship is consistent, changes in the foreign object's position can be clearly detected using simple image differencing algorithms, greatly reducing image processing difficulty and improving detection accuracy. This method is also effective for foreign objects in high-viscosity liquids with minimal movement and difficulty in forming a trajectory. Compared to existing technologies, this solution, through its detection logic of "establishing imaging relationship and acquiring a static reference—moving the object and restoring its posture—reconstructing the imaging relationship and re-examining under the same conditions—comparing differences," fundamentally avoids the interference of image distortion caused by emergency braking on imaging and subsequent identification. It solves the problem of the incompatibility between distortion-free images and the trajectory of the foreign object in existing rotational emergency stop methods, significantly improving the reliability and applicability of foreign object detection in irregularly shaped bottles. It is highly practical and suitable for widespread promotion and application.
[0024] It should be understood that a still liquid surface means that the liquid surface is free from distortion or deformation, allowing for the capture of clear images.
[0025] Optionally, "restoring the bottle to a preset controlled posture" can be achieved through a mechanical positioning structure, such as setting a positioning pin or limit block on the bottle clamp, so that the posture is controlled when the clamp returns to the mechanical limit after movement; alternatively, the angle / position parameters before movement can be recorded by a servo motor encoder, and the drive motor can return to the position corresponding to the recorded parameter value after movement.
[0026] Optionally, "waiting for the liquid level in the bottle to return to calm" can be achieved by presetting a fixed waiting time, which can be pre-calibrated through experiments based on the liquid viscosity and bottle size; alternatively, a liquid level monitoring sensor can be set at the detection station to detect the liquid level fluctuation amplitude in real time, and triggering shooting when the fluctuation is lower than the set threshold.
[0027] Optionally, "reconstructing a second preset relative spatial relationship that is substantially the same as the first preset relative spatial relationship" can be achieved in two ways: one is to physically reset the bottle to its initial spatial position and rotation angle, while keeping the imaging system fixed; the other is to move the imaging system synchronously with the bottle to maintain the relative spatial relationship unchanged, and trigger shooting after reaching the shooting position.
[0028] In this embodiment, the conveyor line for the bottles to be inspected includes at least one first inspection station and at least one second inspection station. The initial inspection position is the first inspection station. At the first inspection station, the imaging system establishes a first preset relative spatial relationship with the bottle and acquires a first image. At the second inspection station, the imaging system reconstructs a second preset relative spatial relationship with the bottle and acquires a second image. Specifically, the bottle is first transported to the first inspection station by the conveyor line. Here, the imaging system establishes a first preset relative spatial relationship with the bottle and captures a first image. Then, the bottle leaves the first inspection station and enters the motion execution area located between the two stations to complete motion and posture recovery. Afterward, the bottle continues to move to the second inspection station, where the imaging system reconstructs the second preset relative spatial relationship with the bottle. After confirming that the bottle's posture has been restored and the liquid surface is calm, the imaging system captures a second image. By allocating the two image acquisitions to different stations, the first inspection station is spatially isolated from the motion execution area and is not affected by the vibration of the motion mechanism, thus ensuring the quality of the first image. Simultaneously, the bottle completes posture recovery and liquid surface calming during its movement between the two stations. This waiting time overlaps with the conveying time, without additionally occupying the inspection cycle, thus balancing the waiting time required for full liquid surface recovery with the inspection efficiency of the production line. The imaging system can be configured as needed at the first inspection station and at different stations, or the same imaging system can be used to reconstruct a preset relative spatial relationship with the bottle.
[0029] In this embodiment, the first and second inspection stations are located on the same rotary conveyor. The rotary conveyor has the first and second inspection stations sequentially arranged along the conveying direction. When the bottle moves to the first inspection station with the rotary conveyor, the imaging system establishes a first preset relative spatial relationship with the bottle and captures a first image. Before the bottle moves to the second inspection station, it performs a movement step and returns to a preset controlled posture. When the bottle moves to the second inspection station, the imaging system reconstructs the second preset relative spatial relationship with the bottle and captures a second image. Specifically, the station layout is achieved using a rotary conveyor. The first and second inspection stations are sequentially arranged along the circumferential direction on the rotary disk. The bottle is fed into the rotary disk by the bottle feeding mechanism and revolves with the disk. When the bottle moves to the circumferential position corresponding to the first inspection station, the bottle itself does not rotate, and the imaging system establishes a first preset relative spatial relationship with the bottle and captures a first image. After the bottle continues to revolve with the large disc and leaves the first inspection station, it moves along the path before reaching the second inspection station. A bottle rotation mechanism on the large disc drives the bottle's movement, and after completion, the rotation mechanism stops, and the bottle returns to a preset controlled posture. When the bottle reaches the second inspection station, the liquid surface has returned to calm. The imaging system reconstructs the second preset relative spatial relationship between the bottle and the system and captures a second image. The rotary conveyor system has a compact structure, with each station arranged circumferentially, maximizing space utilization and making it suitable for production workshops with limited space. The bottle's continuous revolving motion with the large disc ensures smooth operation and avoids the sudden stops and impacts that can occur in linear conveying. The movement of each bottle is completed by an independent rotation mechanism integrated into the bottle holder, without interference, suitable for parallel processing of multiple bottles and high throughput. The rotary layout facilitates direct connection with the star wheel transfer mechanisms of upstream and downstream processes such as filling and sealing, and is easily integrated into existing rotary production lines. Optionally, multiple bottle holders are distributed circumferentially along the upper edge of the rotating disc, each bottle holder being able to support one bottle.
[0030] In this embodiment, the first and second inspection stations are arranged on the same linear conveyor. The linear conveyor has the first and second inspection stations sequentially arranged along the conveying direction. When the bottle moves to the first inspection station with the linear conveyor, the imaging system establishes a first preset relative spatial relationship with the bottle and acquires a first image. Before the bottle moves to the second inspection station, it performs a motion step and returns to a preset controlled posture. When the bottle moves to the second inspection station, the imaging system reconstructs the second preset relative spatial relationship with the bottle and acquires a second image. Specifically, by using a linear conveyor, the first and second inspection stations are arranged sequentially along the conveying direction on the linear conveyor belt. When the bottle is conveyed to the first inspection station by the conveyor belt, a position sensor is triggered, the conveyor belt pauses, or the imaging system tracks and captures the first image, establishing a first preset relative spatial relationship between the imaging system and the bottle. The bottle then continues forward, entering the motion execution area between the two stations, where a mechanism clamps the bottle and performs the motion. After completion, the bottle is released, and it returns to a controlled posture on the conveyor belt. As the bottle continues to the second inspection station, the liquid surface has calmed. The imaging system reconstructs the second preset relative spatial relationship between the bottle and the system and captures a second image. The linear conveyor device has a simple structure, low manufacturing cost, and is easy to install and maintain. The stations are arranged sequentially along a straight line, providing a clear and intuitive layout and facilitating debugging. The linear layout is easily integrated with existing linear filling production lines, resulting in low modification costs and good equipment compatibility. The bottle can move in either a stepping or continuous motion mode on the linear conveyor line, and the inspection cycle can be flexibly adjusted according to the production speed, making it suitable for medium-speed inspection scenarios.
[0031] In this embodiment, the conveyor line for the bottle to be inspected also includes at least one third inspection station, which is located after the second inspection station. At the third inspection station, the imaging system reconstructs a third preset relative spatial relationship with the bottle that is substantially the same as the first preset relative spatial relationship. After the liquid surface in the bottle returns to calm, a third image of the liquid in the bottle is acquired, and the third image is compared and analyzed with the first image, or the third image, the second image, and the first image are compared and analyzed together to identify whether there are foreign objects in the bottle. Specifically, after the bottle completes the image acquisition at the second inspection station, it moves again and returns to its original position, waiting for the liquid surface to calm. Then, at the third inspection station, the imaging system and the bottle reconstruct a third preset relative spatial relationship that is substantially the same as the first preset relative spatial relationship, and a third image is captured. The third image is compared with the first image separately, or the third image is compared and analyzed together with the second image and the first image to comprehensively determine whether there are foreign objects. At the same time, multiple inspection results can be cross-validated to improve the reliability of the inspection results.
[0032] In this embodiment, the conveyor line for the bottle to be inspected also includes at least one fourth inspection station, which is located after the third inspection station. At the fourth inspection station, the imaging system reconstructs a fourth preset relative spatial relationship with the bottle that is substantially the same as the first preset relative spatial relationship. After the liquid surface in the bottle returns to calm, a fourth image of the liquid in the bottle is acquired, and the fourth image is compared and analyzed with the first image, or the fourth image, the third image, the second image, and the first image are compared and analyzed together to identify whether there are foreign objects in the bottle. Specifically, during the process of moving the bottle to the fourth inspection station, the bottle undergoes movement again, returns to its original position, and waits for calm. The imaging system reconstructs a fourth preset relative spatial relationship with the bottle that is substantially the same as the first preset relative spatial relationship, and captures a fourth image, which is then compared and analyzed together with the first image and multiple previously acquired images. The four inspection stations perform repeated inspections from the same perspective, further improving the reliability of the inspection results.
[0033] In this embodiment, the bottle to be inspected moves continuously on the conveyor line, moving from one inspection station to the next. During this movement, the imaging system moves synchronously with the bottle, tracking it to maintain a preset relative spatial relationship. When the bottle reaches the next inspection station, the imaging system triggers an image capture. Specifically, the bottle maintains continuous movement on the conveyor line without stopping at any station. As the bottle moves from one inspection station to the next, the imaging system moves synchronously with it via a follow-up tracking mechanism to maintain a preset relative spatial relationship. When the bottle reaches the preset image capture position at the next inspection station, the tracking imaging system triggers an image capture. The continuous movement of the bottle without stopping avoids the additional disturbance to the liquid surface caused by frequent starts and stops, facilitating a rapid return to calm. It also eliminates the loss of production cycle time due to start-stop actions, enabling higher inspection speeds. The tracking image capture ensures that the imaging system and the bottle are relatively stationary at the moment of triggering, preventing motion blur and achieving image quality equivalent to static imaging. At the first inspection station, the liquid surface is already stationary, allowing the imaging system to move relative to the bottle. A clear image can be obtained by directly capturing the image the instant the bottle passes by. Optionally, the imaging system can be tracked using a mechanical cam-linkage mechanism. The imaging system is mounted on a swing arm, which is driven by a cam to follow the bottle on the conveyor line and swing synchronously, triggering the capture when it reaches the shooting position. Alternatively, an electronic cam can be used, where the imaging system is fixed to a linear motor-driven slide. The bottle's position information is acquired in real time via an encoder, and the control system drives the slide to move synchronously with the bottle.
[0034] In this embodiment, moving the bottle includes at least one of rotating the bottle, flipping the bottle, tilting and then straightening the bottle, and swinging the bottle. Specifically, the specific method of moving the bottle is any one or a combination of rotation, flipping, tilting and then straightening, and swinging. For example, the bottle may be rotated several times around its own axis and then stopped; or the bottle may be flipped around a horizontal axis at a certain angle and then straightened; or the bottle may be tilted to one side at a certain angle and then returned to an upright position; or the bottle may be swinged back and forth within a certain angle range. Different movement methods are suitable for different bottle shapes and liquid properties. The rotation method is smooth and controllable, suitable for most conventional irregular-shaped bottles, and can adapt to the detection needs of liquids with different viscosities and different types of foreign matter by adjusting the rotation speed and number of rotations. The flipping method can use gravity to cause foreign matter to be displaced over a large span within the bottle, which is particularly effective for specific bottle shapes such as flat bottles and square bottles. The tilting and then straightening method has a smaller range of motion, lower liquid disturbance, and a shorter waiting time for the liquid surface to return to calm, which is beneficial for improving the detection cycle and is suitable for liquid products that are prone to generating bubbles or have a slow liquid surface recovery. The oscillating motion is gentle and has minimal shearing effect on the liquid, making it suitable for high-viscosity or gas-containing liquids. It can change the position of foreign objects while avoiding the generation of a large number of bubbles. Multiple motion modes can be selected individually or in combination according to product characteristics, enhancing the method's adaptability to different bottle types, different liquids, and different production conditions.
[0035] like Figure 2 and Figure 3As shown, in this embodiment, the comparative analysis employs an image difference algorithm to perform pixel-level comparison between the first and second images, identifying foreign objects based on the regions where differences exist between them. Specifically, in the difference image, green areas represent normal regions, and red areas represent difference regions. The comparative analysis step specifically uses an image difference algorithm to perform image registration between the first and second images (or subsequent images), followed by pixel-level subtraction to obtain the difference image. Regions in the difference image whose grayscale values exceed a preset threshold are marked as difference regions, corresponding to the positional changes of the foreign object between the two images. Using an image difference algorithm to perform pixel-level comparison between the first and second images is simple in principle, highly efficient, and suitable for real-time online processing in industrial production lines. Since the two images are consistent in imaging relationship and liquid surface state, the non-zero regions in the difference image highly point to the differences caused by the positional changes of the foreign object, making the identification logic clear and explicit. Compared with existing technologies that require complex moving target detection in dynamic sequences with image distortion and warping, the difference algorithm based on static images significantly reduces processing difficulty, requires less hardware computing resources, and is easier to implement in embedded systems or industrial computers. Optionally, the image differencing algorithm can be either absolute differencing (directly calculating the absolute value of the gray-level difference between corresponding pixels) or normalized differencing (considering compensation for minor changes in illumination). Image registration before differencing can employ a feature-point-based registration algorithm or a template matching algorithm based on gray-level information. The difference threshold can be a fixed threshold or an adaptive threshold. The adaptive threshold can be dynamically adjusted according to the gray-level statistical characteristics of local image regions, further improving the detection capability for small or low-contrast foreign objects.
[0036] This embodiment of the foreign object detection device for irregularly shaped bottles adopts the aforementioned method for detecting foreign objects inside irregularly shaped bottles. The device includes: an actuator for transporting the bottle to be inspected to a designated station and driving the bottle to perform movement steps and return to a preset controlled posture; at least one imaging unit for establishing a preset relative spatial relationship with the bottle at each detection station and acquiring images of the liquid inside the bottle under this relationship; and an image analysis unit for comparing and analyzing at least two images acquired under the preset relative spatial relationship and identifying the presence of foreign objects inside the bottle based on the differences between the two images. Specifically, this device is configured correspondingly to the aforementioned method, with each functional unit modularly designed and flexibly configured according to the production line layout and detection requirements. The actuator and imaging unit can be functionally separated, and the imaging unit is not affected by vibrations that may be generated during the operation of the moving mechanism, ensuring stable and reliable imaging conditions. The image analysis unit can be integrated into the production line's overall control system to achieve real-time display, recording, and statistical analysis of the detection results, as well as the output of automatic rejection signals for non-conforming products, meeting the quality control requirements of automated production. The device has a clear structural composition, with well-defined functions for each unit, facilitating manufacturing, installation, and subsequent maintenance.
[0037] Optionally, the actuator may include a conveying device (such as a rotary table or linear conveyor belt), a clamping mechanism, and a drive motor. The clamping mechanism is used to fix the bottle, and the drive motor is used to drive the bottle to perform a preset motion action. After the motion is completed, the drive motor controls the bottle to decelerate smoothly and return to the preset controlled posture.
[0038] Optionally, the imaging unit includes an industrial camera and an illumination source, used to establish a preset relative spatial relationship with the bottle at each inspection station, and to acquire images of the liquid inside the bottle under this relationship. The illumination source can be a backlight or a ring LED light source to provide uniform illumination to the imaging area. The imaging unit can be configured as a single imaging system reconstructing the preset relative spatial relationship with the bottle at different stations, or independent imaging systems can be set up at multiple stations.
[0039] Optionally, the image analysis unit is electrically connected to the imaging unit, receives images acquired by the imaging units at each inspection station, runs a comparative analysis algorithm, identifies the presence of foreign objects inside the bottle based on the differences between the images, and outputs the inspection results. The image analysis unit can be implemented using an industrial computer or an embedded image processing module, and can be integrated into the production line's central control system to achieve real-time display and recording of inspection results, as well as the output of signals for rejecting defective products.
[0040] In summary, after reading the detailed disclosure of this specification, those skilled in the art will understand that the foregoing detailed disclosure is presented by way of example only and is not restrictive. Although not explicitly stated herein, those skilled in the art will understand that this specification requires various reasonable changes, improvements, and modifications to the embodiments. These changes, improvements, and modifications are intended to be made by this specification and are within the spirit and scope of the exemplary embodiments described herein.
[0041] Furthermore, certain terms in this specification have been used to describe embodiments of this specification. For example, "an embodiment," "an embodiment," and / or "some embodiments" mean that a particular feature, structure, or characteristic described in connection with that embodiment may be included in at least one embodiment of this specification. Therefore, it is to be emphasized and understood that two or more references to "an embodiment" or "an embodiment" or "alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. Moreover, specific features, structures, or characteristics may be suitably combined in one or more embodiments of this specification.
Claims
1. A method for detecting foreign objects inside irregularly shaped bottles, characterized in that, Includes the following steps: The bottles to be inspected are transported to the initial inspection position; A first preset relative spatial relationship is established between the bottle and the imaging system, and the imaging system acquires the first image of the liquid inside the bottle, at which point the liquid surface inside the bottle is calm. The bottle is moved to change the position of any foreign objects that may be inside the bottle in the liquid, and then the bottle is restored to a preset controlled posture. After the liquid surface in the bottle returns to calm, a second preset relative spatial relationship that is substantially the same as the first preset relative spatial relationship is reconstructed between the bottle and the imaging system, and the imaging system acquires a second image of the liquid in the bottle. The first image and the second image are compared and analyzed to identify whether there are foreign objects inside the bottle based on the differences between them.
2. The method for detecting foreign objects inside irregularly shaped bottles according to claim 1, characterized in that, The conveyor line for the bottles to be inspected includes at least one first inspection station and at least one second inspection station, with the initial inspection position being the first inspection station; At the first inspection station, the imaging system establishes a first preset relative spatial relationship with the bottle and acquires a first image; At the second inspection station, the imaging system reconstructs the second preset relative spatial relationship with the bottle and acquires a second image.
3. The method for detecting foreign objects inside irregularly shaped bottles according to claim 2, characterized in that, The first inspection station and the second inspection station are set on the same rotary conveyor device, and the first inspection station and the second inspection station are arranged sequentially along the conveying direction on the rotary conveyor device. When the bottle moves to the first detection station with the rotary conveyor, the imaging system establishes a first preset relative spatial relationship with the bottle and acquires the first image; Before the bottle moves to the second inspection station with the rotary conveyor, it performs motion steps and returns to the preset controlled posture; When the bottle moves to the second detection station, the imaging system reconstructs the second preset relative spatial relationship with the bottle and acquires the second image.
4. The method for detecting foreign objects inside irregularly shaped bottles according to claim 2, characterized in that, The first inspection station and the second inspection station are set on the same linear conveyor device, and the first inspection station and the second inspection station are set sequentially along the conveying direction on the linear conveyor device. When the bottle moves to the first inspection station with the linear conveyor, the imaging system establishes a first preset relative spatial relationship with the bottle and acquires a first image; Before the bottle moves to the second inspection station with the linear conveyor, it performs motion steps and returns to the preset controlled posture; When the bottle moves to the second detection station, the imaging system reconstructs the second preset relative spatial relationship with the bottle and acquires the second image.
5. The method for detecting foreign objects inside irregularly shaped bottles according to claim 2, characterized in that, The conveyor line for the bottles to be inspected also includes at least one third inspection station, which is located after the second inspection station. At the third inspection station, the imaging system reconstructs a third preset relative spatial relationship with the bottle that is substantially the same as the first preset relative spatial relationship. After the liquid surface in the bottle returns to calm, a third image of the liquid in the bottle is acquired, and the third image is compared and analyzed with the first image, or the third image, the second image, and the first image are compared and analyzed together to identify whether there are foreign objects in the bottle.
6. The method for detecting foreign objects inside irregularly shaped bottles according to claim 5, characterized in that, The conveyor line for the bottles to be inspected also includes at least one fourth inspection station, which is located after the third inspection station. At the fourth inspection station, the imaging system reconstructs a fourth preset relative spatial relationship between itself and the bottle, which is substantially the same as the first preset relative spatial relationship. After the liquid surface in the bottle returns to calm, a fourth image of the liquid in the bottle is acquired, and the fourth image is compared and analyzed with the first image, or the fourth image, the third image, the second image, and the first image are compared and analyzed together to identify whether there are foreign objects in the bottle.
7. The method for detecting foreign objects inside irregularly shaped bottles according to any one of claims 3 to 6, characterized in that, The bottle to be inspected moves continuously on the conveyor line, from one inspection station to the next. During this movement, the imaging system moves synchronously with the bottle to track it and maintain a preset relative spatial relationship. When the bottle reaches the next inspection station, the imaging system triggers the capture of an image.
8. The method for detecting foreign objects inside irregularly shaped bottles according to any one of claims 1 to 6, characterized in that, Moving the bottle includes at least one of rotating the bottle, flipping the bottle, tilting the bottle and then straightening it, or swinging the bottle.
9. The method for detecting foreign objects inside irregularly shaped bottles according to any one of claims 1 to 6, characterized in that, The comparative analysis uses an image difference algorithm to compare the first image with the second image at the pixel level and identify foreign objects based on the areas where there are differences between the two.
10. A foreign object detection device for irregularly shaped bottles, characterized in that, The method for detecting foreign objects inside irregularly shaped bottles according to any one of claims 1 to 9, the apparatus comprising: The actuator is used to transport the bottle to be inspected to the designated work station and drive the bottle to perform motion steps and return to the preset controlled posture; At least one imaging unit is used to establish a preset relative spatial relationship with the bottle at each detection station, and to acquire images of the liquid inside the bottle under this relationship; The image analysis unit is used to compare and analyze at least two images acquired under a preset relative spatial relationship, and to identify whether there are foreign objects inside the bottle based on the differences between the two images.
Citation Information
Patent Citations
Rotary bottle detector and in-bottle foreign material detection equipment
CN201732068U