Patent Description:
AVI systems are used in the clinical packaging environment for quality control purposes. In particular, AVI systems may be used to test syringes, such as those used in auto-injector pens, for example, for the proper plunger (i.e., rubber piston or stopper) depth. For auto-injector syringes, the position of the plunger within the syringe is of particular importance, as a plunger depth falling outside of a specified range of depth measurements may cause the auto-injector to malfunction or provide an incorrect dosage. For example, if the plunger is positioned too low in the syringe (i.e., towards the needle) the spring-activated piston used by the auto-injector pen may travel a longer distance before contact, thereby gathering excessive kinetic energy. This may produce a shockwave down the glass body of the syringe upon contact with the plunger, resulting in glass-breakage near the tapered needle-end. Moreover, plunger depth measurement is an important check in controlling the filling process and ensuring container closure integrity.

Traditional AVI systems measure plunger depth by identifying a top edge of the syringe flange and a top edge of the plunger, determining the difference between these two edges in terms of pixels, and then converting the pixel value to a linear real-world measurement based upon a conversion factor. However, due to the manufacturing process, glass syringe flanges typically have a somewhat uneven and unpredictable shape, and may include undulations that make it difficult for typical image processing algorithms to accurately identify the flange top edge. Furthermore, because the testing procedure is often conducted in an area that is not a cleanroom environment, dust or debris may settle on the syringe flange, causing traditional image processing techniques to incorrectly identify the top edge of the flange as an area associated with such artifacts. Further compounding this problem, defects in the trays holding the syringes may carry over into the image being analyzed, and typical image processing techniques may incorrectly identify such defects in the tray as the top edge of the flange. <CIT> and <CIT> disclose systems for imaging syringes.

Regarding the measurement of the top edge of the plunger, conventional image analyses such as edge detection function to identify the top and side edges of the plunger within a fixed region of interest (ROI). Using this information, conventional AVI systems typically identify the plunger centerline and use the intersection of the centerline with the top edge of the plunger as a reference by which to measure the plunger depth from the top edge of the flange. However, these techniques are constrained by the use of a fixed ROI, and therefore such conventional systems may only be used to test a single size and type of syringe. Furthermore, tray features used to secure each syringe within the tray may partially obscure the plunger and/or the operator may fail to align the syringes properly, causing edge detection techniques to fail. Further complicating this issue, blemishes on the syringe container wall and/or plunger dimples that exist along the top edge of the plunger may cause typical edge-detection algorithms to fail or to incorrectly identify the uppermost edge of the plunger. As a result, typical AVI systems used for syringe testing have several drawbacks.

The invention is defined in the claims. Embodiments described herein are directed to an AVI system that measures the depth of plungers positioned within a vessel (e.g., a syringe or cartridge). In doing so, the AVI system described herein may function to reduce the improper rejection of tested vessels while ensuring that a business adheres to regulatory and compliance testing guidelines within an acceptable level of business risk. The AVI system described herein includes a stage that accepts either a single vessel or a tray of vessels. In the embodiment, a linear motorized system incrementally advances each vessel within the field of view of an imager to sequentially acquire and test each vessel using image processing in conjunction with other processing techniques. In other embodiments, several vessels may be imaged at one time with a wider field of view. Once an image of a particular vessel (or several vessels) is acquired via the imager, the AVI system described herein executes a series of image processing algorithms on different regions within the acquired image. In the event that the vessel being tested is a syringe, the image processing algorithms result in the identification of a y-coordinate for the uppermost edge of the syringe flange and the syringe plunger. Once identified, the AVI system measures the difference between these y-coordinate values in terms of pixels, and then convert this pixel value to a real-world measurement, which represents the plunger depth.

To overcome the aforementioned issues related to identifying the uppermost edge of the flange, the AVI system identifies a flange ROI within the image of the syringe and binarize the flange ROI using a technique referred to as blob analysis. The AVI system may perform additional image processing algorithms to reduce artifacts such as a closing algorithm that includes pixel dilation, hole-filling, and erosion, and use a horizontal row-scanning and linking technique to fill in voids of fragmented blob fragments. Upon completion of this image processing, the AVI system identifies an uppermost edge of the flange within the processed binarized image, thereby ensuring an accurate identification even in the presence of dust, debris, tray defects, flange inconsistencies, etc..

To overcome the aforementioned issues related to identifying the uppermost edge of the plunger, the AVI system identifies a plunger ROI within the image of the vessel and uses a template-matching algorithm to mathematically match the plunger to a smaller template image. Once this template is identified, the AVI system refines the original plunger ROI by aligning, or tethering, the matching template over the image of the plunger. This refined plunger ROI allows a more detailed analysis to be performed at the top of the plunger, which may not be completely flat and/or perpendicular to the inner glass wall, but include dimples or other artifacts such as tray protrusions. To address these artifacts, the AVI system executes a series of one-dimensional (1D) edge detections that are evenly spaced across the top of the plunger using the refined ROI as a guide. This series of 1D edge detections produces an array of y-coordinate values, with a y-coordinate value being assigned to each evenly-spaced division. The array of y-coordinate values is further constrained via a filtering process to remove outliers (i.e., y-coordinate values that deviate substantially from the flat portion of the top of the plunger). The uppermost edge of the plunger is then accurately calculated and used as reference point for measuring plunger depth using this constrained set of y-coordinate values.

The skilled artisan will understand that the figures, described herein, are included for purposes of illustration and are not limiting on the present disclosure. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the present disclosure. It is to be understood that, in some instances, various aspects of the described implementations may be shown exaggerated or enlarged to facilitate an understanding of the described implementations. In the drawings, like reference characters throughout the various drawings generally refer to functionally similar and/or structurally similar components.

The various concepts introduced above and discussed in greater detail below may be implemented in any of numerous ways, and the described concepts are not limited to any particular manner of implementation. Examples of implementations are provided for illustrative purposes.

<FIG> illustrates an automated visual inspection (AVI) system <NUM>, according to an embodiment of the present disclosure. The AVI system <NUM> includes a stage <NUM>, to which various components of the AVI system <NUM> are mounted, including a controller <NUM> that may contain the various electronic communication, control, and/or processing components used in accordance with the embodiments as described herein, which are further discussed below with reference to <FIG>.

The AVI system <NUM> includes a tray holder <NUM>. As shown in <FIG>, the tray holder <NUM> is illustrated as being configured to receive a tray <NUM> including one or more vessels <NUM>. As discussed herein, the operation of AVI system <NUM> is described in terms of measuring plunger depth within a syringe. However, the AVI system <NUM> may be implemented to measure plunger depth in any suitable type of vessel having a plunger, such as cartridges, for example. Thus, tray holder <NUM> may be implemented, in various embodiments, as a modular component to facilitate plunger depth measurements for a wide variety of vessel sizes and/or types. For example, the trays <NUM> may be implemented as fluted trays, such as those manufactured by Rondo-Pak, Inc. of Camden, NJ, and may be sized to hold a total of <NUM> syringes having a maximum volume of <NUM> each, a total of <NUM> syringes having a maximum volume of <NUM> each, etc. Thus, embodiments include the AVI system <NUM> utilizing a tray holder <NUM> of any suitable size and shape to accommodate different trays and vessels, and to firmly hold the tray of vessels in a fixed position during testing regardless of the size and number of vessels contained within the tray <NUM>.

As further discussed below, embodiments include the AVI system <NUM> operating in an iterative manner, i.e., sequentially measuring the plunger depth of each vessel <NUM> contained in the tray <NUM> in accordance with the various image processing techniques discussed herein. To do so, the AVI system <NUM> includes a linear drive mechanism <NUM>, which is coupled to the stage <NUM> and to the tray holder <NUM>. The linear drive mechanism <NUM> may be implemented as any suitable type of motor-driven system that can be reliably and consistently align the vessels <NUM> beneath the imager <NUM>. For example, the linear drive mechanism <NUM> may be implemented as a modularized component having an integrated motor, controller, amplifier, encoder, and communication bus, such as the Smartmotor SM23165D, manufactured by Moog Animatics of Mountain View, CA. To provide another example, linear drive mechanism <NUM> may be implemented as any suitable type of conveyor belt (e.g., a translucent conveyor belt) configured to advance the tray <NUM> for plunger depth measurement. Of course, certain components may need to be adapted to changes for conveyor belt systems. For example, a vision-guided camera (not shown) may be implemented to scan each vessel in a stop-and-go matter, unless the camera moves briefly with the conveyor belt before moving back to its origin.

In embodiments, the imager <NUM> may include any suitable number and/or type of digital cameras and/or optical elements configured to acquire an image of each vessel <NUM> as it is advanced within a field of view of the imager <NUM> of suitable quality and resolution for image processing. The imager <NUM> may include any suitable combination of hardware and/or software to facilitate this functionality, such as image sensors, optical stabilizers, image buffers, frame buffers, frame grabbers, charge-coupled devices (CCDs), complementary metal oxide semiconductor (CMOS) devices, etc. Furthermore, the imager <NUM> may include one or more telecentric lenses to provide image magnification of the vessels <NUM> that is independent of the vessel's distance or position in the field of view. Moreover, the imager <NUM> may communicate with the controller <NUM> (as discussed below with reference to <FIG>), and send acquired images to the controller <NUM> for image processing. Alternatively, the imager <NUM> may store the acquired images locally in any suitable type of memory, and this memory may be accessed by the controller <NUM> for image processing.

To provide another example, the imager <NUM> may be implemented as a "smart camera," with image processing logic built into the camera using any suitable techniques, such as field programmable gate array (FPGA) technologies, for example. To provide yet another example, the imager <NUM> may be implemented as part of a plenoptic 3D camera system. To provide a specific example of an implementation of the imager <NUM>, the camera portion of the imager <NUM> may be implemented as an industrial area scan camera unit with a Gigabit Ethernet communication interface, such as the piA2400-17gm industrial monochrome camera manufactured by Basler, AG of Ahrensburg, Germany, which records images at a resolution of 5MP. To provide another specific example of an implementation of the imager <NUM>, the imager <NUM> may utilize a telecentric lens manufactured by Edmund Optics of Barrington, NJ, having part. <NUM>-<NUM> and providing a <NUM>. 28X magnification. Using the example implementations of the Basler camera in conjunction with the Edmund Optics telecentric lens described above, the imager <NUM> may acquire images having a spatial resolution of approximately <NUM> microns per pixel.

To implement syringe imaging, the AVI system <NUM> may also include a light source <NUM> that is mounted beneath the imager <NUM>, which illuminates the area behind the tray <NUM> as each vessel <NUM> is imaged. This light source may be implemented as any suitable number and/or type of lighting units configured to provide a sufficiently uniform and bright source of light for the imager <NUM>. For example, the light source <NUM> may be implemented as a high-uniformity LED manufactured by CCS America, Inc. , of Burlington, MA, having part no. TH-83X75RD.

The controller <NUM> may include one or more components configured to communicate with and/or control the linear drive mechanism <NUM>, the light source <NUM>, and the imager <NUM>. Thus, the controller <NUM> may command the linear drive mechanism <NUM> to selectively move the tray holder <NUM>, and thus the vessels <NUM> contained in the tray <NUM>, within a field of view beneath the imager <NUM>, to activate the light source <NUM>, and to acquire an image of each vessel <NUM> for image processing and plunger depth measurement. As each vessel <NUM> is tested in this manner, the AVI system <NUM> may also notify a user in the event that the plunger depth measurement is outside of an acceptable specified range of values with any suitable type of alert or warning system, which is not shown in <FIG> for purposes of brevity.

Although the AVI system <NUM> is shown in <FIG> as receiving the tray <NUM> and advancing the vessels <NUM> in a horizontal manner, embodiments include the AVI system <NUM> being configured to sequentially image vessels <NUM> in any suitable orientation and/or direction. For example, the linear drive mechanism <NUM>, the tray holder <NUM>, and the light source <NUM> may be mounted vertically with respect to the stage <NUM>, whereas the imager <NUM> may be mounted horizontally, allowing for the vessels <NUM> to be advanced and imaged in the vertical direction.

Furthermore, AVI system <NUM> is described as performing plunger depth measurements of various vessels in terms of linearly incrementing the tray <NUM> and taking individual images of each vessel <NUM> in turn. However, the embodiments described herein are not limited to such embodiments. For example, imager <NUM> may implement optics to provide a wider field of view such that an image of any suitable number of vessels may be simultaneously captured within a single image, with the embodiments including applying the algorithms discussed herein to each of the individual vessels included in the same image. Moreover, in some embodiments, the tray <NUM> and tray holder <NUM> may be omitted or modified such that a single vessel <NUM> is imaged at one time.

<FIG> is a block diagram example illustrating a control system <NUM> associated with AVI system <NUM>, according to an embodiment of the present disclosure. As further discussed below, control system <NUM> may include a controller <NUM> that is configured to communicate with and control various components of AVI system <NUM>, such as imager <NUM>, linear drive mechanism <NUM>, and/or light source <NUM>, for example. In an embodiment, controller <NUM>, imager <NUM>, linear drive mechanism <NUM>, and light source <NUM> may be an implementation of controller <NUM>, imager <NUM>, linear drive mechanism <NUM>, and light source <NUM>, respectively, as discussed herein with respect to <FIG>.

Furthermore, in an embodiment, control system <NUM> is configured to facilitate fully autonomous or semi-autonomous operation of AVI system <NUM>. To do so, control system <NUM> may support performing automatic image analysis of a number of syringes that are included on a tray to measure the plunger depth for each syringe. Again, this syringe plunger depth measurement may then be compared to compare to a range of acceptable values (for each syringe tested), which may be established based upon the size and/or type of syringes being tested.

Controller <NUM> may be implemented, for example, as any suitable combination of hardware and/or software coupled to or otherwise in communication with one or more of imager <NUM>, linear drive mechanism <NUM>, light source <NUM>, and/or other components of the AVI system <NUM>. For example, the controller <NUM> may be implemented as device mounted to or integrated as part of stage <NUM>, as shown in <FIG>, or controller <NUM> may be located remote from AVI system <NUM>. In any event, controller <NUM> may be coupled to one or more of the imager <NUM>, the linear drive mechanism <NUM>, and/or the light source <NUM> via wired links, wireless links, or any suitable combination thereof. Therefore, links <NUM>, <NUM>, and/or <NUM> may represent such links to facilitate communications between these components. Although three separate links <NUM>, <NUM>, and <NUM> are shown in <FIG>, it will be understood that controller <NUM> may communicate with one or more of the imager <NUM>, the linear drive mechanism <NUM>, and/or the light source <NUM> via any suitable number of links, including a single shared link.

To facilitate communication with and/or control of these components, controller <NUM> may include a processing unit <NUM>, a communication unit <NUM>, and a memory unit <NUM>. Processing unit <NUM> may be implemented as any suitable type and/or number of processors, such as a host processor of controller <NUM>, for example. To provide additional examples, processing unit <NUM> may be implemented as an application specific integrated circuit (ASIC), an embedded processor, a central processing unit associated with controller <NUM>, etc. Processing unit <NUM> may be coupled with and/or otherwise configured to communicate, control, operate in conjunction with, and/or affect operation of one or more of communication unit <NUM> and/or memory unit <NUM> via one or more wired and/or wireless interconnections, such as any suitable number of data and/or address buses, for example. These interconnections are not shown in <FIG> for purposes of brevity.

For example, processing unit <NUM> may be configured to retrieve, process, and/or analyze data stored in memory unit <NUM>, to store data to memory unit <NUM>, to replace data stored in memory unit <NUM>, and/or to control various functions associated with the imager <NUM>, the linear drive mechanism <NUM>, and/or the light source <NUM>. For example, the processing unit <NUM>, alone or in conjunction with other components implemented by the controller <NUM> (some of which may not be shown in <FIG> for purposes of brevity), may cause linear drive mechanism <NUM> to advance a tray of syringes to be aligned with the imager <NUM>, to activate the light source <NUM>, to acquire syringe images, and to store the syringe images in any suitable portion of memory unit <NUM> (or another suitable storage device). Moreover, the processing unit <NUM>, alone or in conjunction with other components implemented by the controller <NUM>, may facilitate controller <NUM> analyzing the stored syringe images in accordance with the image processing techniques discussed herein, calculating a plunger depth based upon this image processing, determining whether the measured plunger depth is within a range of acceptable values, and notifying a user of these results in any suitable manner. Additional details associated with such functions are further discussed below.

Communication unit <NUM> may be configured to support any suitable number and/or type of communication protocols to facilitate communications between controller <NUM> and one or more of imager <NUM>, linear drive mechanism <NUM>, and/or light source <NUM>. Communication unit <NUM> may be configured to facilitate the exchange of any suitable type of information between controller <NUM> and one or more of these components (e.g., via links <NUM>, <NUM>, and/or <NUM>), and may be implemented as any suitable combination of hardware and/or software to facilitate such functionality. For example, communication unit <NUM> may be implemented with any number of wired and/or wireless transceivers, buffers, modems, ports, input/output interfaces, connectors, antennas, etc..

In accordance with various embodiments, memory unit <NUM> may be a computer-readable non-transitory storage device that may include any suitable combination of volatile (e.g., a random access memory (RAM), or non-volatile memory (e.g., battery-backed RAM, FLASH, etc.). Memory unit <NUM> may be configured to store instructions executable on processing unit <NUM>. These instructions may include machine readable instructions that, when executed by processing unit <NUM>, cause processing unit <NUM> to perform various acts as described herein. Although the various functions of controller <NUM> are described herein in terms of execution of instructions stored in memory unit <NUM> via processing unit <NUM>, it will be understood that equivalent functions may be realized exclusively via hardware components (e.g., circuit components) or hardware components (e.g., those implemented via communication unit <NUM>) working in conjunction with processing unit <NUM> executing instructions stored in memory unit <NUM>. Memory unit <NUM> may also be configured to store any other suitable data used in conjunction with AVI system <NUM>, such as images captured by the imager <NUM>.

The various modules stored in memory unit <NUM> may represent one or more applications (e.g., software, hardware, or combinations thereof) that are associated with different functions and/or carry out specific tasks associated with the operation of the AVI system <NUM>, and thus are modularized in <FIG> for ease of explanation. These modules may represent, for example, one or more algorithms, logic and code, executable instructions, programs, general, specialized, or programmable hardware components, etc..

For example, control module <NUM> may be a region of memory unit <NUM> configured to store instructions, that when executed by processing unit <NUM>, cause processing unit <NUM> to transmit one or more commands to and/or to receive information from one or more components of the AVI system <NUM>. In an embodiment, processing unit <NUM> may execute instructions stored in control module <NUM> to read the current position of the linear drive mechanism <NUM> and transmit one or more commands (e.g., via link <NUM>) to the linear drive mechanism <NUM> to advance the tray <NUM> and position the next syringe beneath the imager <NUM>. Furthermore, instructions stored in the control module <NUM> may cause the controller <NUM> to transmit one or more commands to the light source <NUM> (e.g., via link <NUM>) to control the state of the light source <NUM>, which may include turning the light source on and off, adjusting the wavelength and/or intensity of light, etc..

Still further, instructions stored in the control module <NUM> may cause the controller <NUM> to transmit one or more commands to the imager <NUM> to control the state of the imager <NUM>, which may include acquiring and storing vessel images. An example of one such image is shown in <FIG> as syringe image <NUM>, which is further referenced herein for ease of explanation. In particular, syringe image <NUM> may be referenced to describe the image processing techniques used to measure the plunger depth <NUM>, which is represented in <FIG> as a difference between the uppermost edge of the flange <NUM> and the uppermost edge of the plunger <NUM>.

Reference image analysis module <NUM> is a region of memory unit <NUM> configured to store instructions, that when executed by processing unit <NUM>, cause processing unit <NUM> to perform various acts in accordance with applicable embodiments as described herein. In an embodiment, reference image analysis module <NUM> includes instructions that, when executed by processing unit <NUM>, cause processing unit <NUM> to analyze a vessel image acquired by the imager <NUM> to identify a reference or anchor point suitable to measure plunger depth. For example, if syringes are being imaged, reference image analysis module <NUM> includes instructions that, when executed by processing unit <NUM>, cause processing unit <NUM> to identify the uppermost edge of a syringe flange within the image. To provide another example, if cartridges are being imaged, reference image analysis module <NUM> may include instructions that, when executed by processing unit <NUM>, cause processing unit <NUM> to identify a terminal or distal edge of the glass cartridge body within the image. In either case, this may be defined in any suitable manner. For example, an anchor point may be established as the "highest" point (i.e., y-coordinate of the highest pixel) of a flange's upper surface or the highest point associated with the upper edge of the cartridge relative to the body axis of the syringe. In the example of a syringe being imaged, this is indicated by the uppermost edge of the flange <NUM>, as shown in <FIG>.

Defining the uppermost edge of the flange in this manner allows it to be identified in spite of any flange undulations. To do so, flange image analysis module <NUM> includes instructions that enable processing unit <NUM> to identify a flange region of interest (ROI) <NUM> within the overall syringe image <NUM> that encompasses the flange <NUM>. In embodiments, the flange ROI <NUM>, as well as the other ROIs within the syringe image <NUM>, are identified to improve the efficiency of the image processing operations. In other words, the use of ROIs allow image processing to be performed on a smaller portion of the vessel image rather than the entire image, which is unnecessary and would require a much greater use of processing resources and time to do so.

In various embodiments, any suitable reference point ROI, such as the flange ROI <NUM> in this example, may be identified in any suitable manner. For example, processing unit <NUM> may localize the flange ROI <NUM> by identifying the largest dark feature within a predefined larger region of the syringe image <NUM>. The flange image <NUM> also includes other ROIs, such as an initial, or coarse, plunger ROI <NUM>, as well as refined plunger ROIs <NUM> and <NUM>. These plunger ROIs are discussed further below with reference to the image analysis techniques used to identify the uppermost edge of the plunger <NUM>.

Once the flange ROI <NUM> is identified, embodiments include the processing unit <NUM> executing instructions stored in flange image analysis module <NUM> to perform various image processing operations to determine the uppermost edge of the flange <NUM>. In the embodiment, an initial image processing step includes applying a threshold value to the reference point ROI (e.g., the flange ROI) to create a "binarized" image. Continuing this example, once the flange ROI has been binarized, adjacent pixels of similar value can be organized into continuous objects, or blobs. Characteristics such as area, centroid position, and bounding edges may then be defined from the two-dimensional objects contained in the binarized image, which may be used to identify the uppermost edge of the flange.

In embodiments, this binarized image is generated, for example, in accordance with blob analysis techniques, which compare the color value of each pixel to a threshold pixel color value, and set each pixel color value within the flange ROI to either a one (white) or zero (black) based upon this comparison. For example, for an <NUM>-bit greyscale image, each pixel within the flange ROI may represents a color value between <NUM> (black) and <NUM> (white). A threshold color value may be selected between this scale of color values such that pixel color values below this threshold color value are set to a binary value of <NUM> (black), whereas pixel color values above this threshold color value are set to a binary value of <NUM> (white). In various embodiments, any suitable threshold color value may be chosen to suitably differentiate the flange within the flange ROI from the image background. For example, a threshold color value of <NUM>/<NUM> may be chosen such that pixel color values between <NUM>-<NUM> are set to black, whereas pixel color values between <NUM>-<NUM> are set to white.

An example of the application of blob analysis to convert a flange ROI to a binarized image is shown in <FIG>. In particular, <FIG> shows a flange ROI <NUM> in greater detail, and <FIG> shows a binarized flange ROI <NUM> after the application of the blob analysis discussed above to the flange ROI <NUM>. Because the flange ROI <NUM> includes a tray defect <NUM> in the background, this particular defect is also present in the binarized flange ROI <NUM>. As a result, a conventional image processing analysis of the binarized flange ROI <NUM> would incorrectly identify the uppermost edge of the flange as line <NUM> instead of line <NUM>.

In various embodiments, one or more image processing steps may be performed prior to converting the ROI to a binarized image, such as those shown in <FIG>, for example. For instance, some larger vessels (e.g., those with a maximum volume of <NUM>) may tend to become aligned with certain tray features. To provide an illustrative example, larger syringes may become oriented within a tray such that the flanges are positioned above a darker area of the tray within the image than that of smaller syringes. One reason for this alignment is the differences in vessel sizes as well as differences in tray designs to accommodate different types of syringes.

In any event, when a flange (or other reference point associated with another type of vessel) rests over a darker area of the tray within the image, a loss of contrast may introduce difficulties when attempting to identify the top edge of the flange. To remedy this, embodiments include first extracting the flange ROI, but applying a convolution of the flange ROI with one or more kernels if any suitable size and/or type. To provide an illustrative example, a 3x3 Sobel variant kernel, in accordance with a Labview coding application, may be implemented to perform this image processing operation. This produces an "edge" image that essentially highlights the top edges of the dark features in the original image. Once this convolution is performed, embodiments further include subtracting the convoluted (i.e., edge) image from the original image to darken the top edge of the flange and sharpening the contrast of the flange against the tray background. As a result, the subsequent distinction of the flange from the tray in the background can be performed more easily and in a more robust manner. An example of the images generated in accordance with this image processing step are shown in the last page of the Appendix. Once this image processing is performed, embodiments include binarizing the resulting image to produce the binarized ROI, as discussed herein.

Other artifacts that are present in the flange ROI may also be introduced into the binarized flange ROI, and may likewise cause conventional image processing techniques to incorrectly identify the actual uppermost edge of the flange. For example, depending on the specific form of the glass and the rotational orientation of the vessel in the tray when imaged, the binarized flange ROI may vary substantially from one syringe to another. For example, as shown in <FIG>, a fragmented binarized flange ROI <NUM> illustrates the result of blob fragmentation. In particular, the upper portion of the binarized flange ROI <NUM> includes several smaller blobs <NUM> that constitute the flange as well as a blob <NUM> that is caused by the tray in the background being imaged and binarized. To identify the uppermost edge of the flange, image processing techniques may assume that the largest continuous blob within the binarized flange ROI is associated with the flange. However, if the blob is fragmented and/or other artifacts are present in the binarized image, this may not necessarily be the case, as shown in <FIG>. As a result, a conventional image processing analysis of the binarized flange ROI <NUM> would incorrectly identify the uppermost edge of the flange as line <NUM> instead of line <NUM>, as blob <NUM> is the largest continuous blob within the binarized flange ROI <NUM>.

Therefore, embodiments include processing unit <NUM> executing instructions stored in flange image analysis module <NUM> to perform one or more additional image processing operations to reliably identify the uppermost edge of the flange regardless of dust, debris, tray defects, fragmentation of the flange object, etc. In various embodiments, different metrics associated with the imaging system may be varied to counter many of these artifacts, which may be adjusted in combination with various image processing algorithms, as discussed below and elsewhere herein.

For example, backlight intensity, among other imaging parameters, may be adjusted to reduce background artifacts. Referring back to <FIG>, this may include adjusting the light intensity associated with the light source <NUM> such that some of these artifacts are "bleached out," or reduced in size, which in turn increases the efficacy of the other image processing algorithms as discussed herein. Moreover, increasing the backlight intensity poses a small risk to the fidelity of the measurement, as extremities of the flange object (or other suitable portion of the imaged vessel, as the case may be) can also be bleached out. This may lead to an overall reduction in the size of the relevant object (e.g., the flange), as well as a reduction in the apparent measured position of the top edge. Therefore, embodiments include balancing the light intensity in any suitable manner, such as based upon the tray and/or vessel type being tested and/or via other imaging metrics, taking into consideration the biological product impact when relevant. To provide an illustrative example, an imager backlight intensity of <NUM>-<NUM> lx. may suitably reduce artifacts in accordance with the embodiments as described herein. Furthermore, embodiments include one or more metrics associated with the imager (e.g., imager <NUM>) being adjusted such as the aperture on the telecentric lens, the gain on the camera, and/or digital image processing techniques, in addition to or instead of increasing the illuminating intensity, to reduce artifacts.

Regardless of the imaging setup used to acquire images, once an image is acquired and binarized, embodiments include one or more image processing algorithms being additionally or alternatively performed on the initial binarized flange ROI to "close" the blobs, to remove artifacts, and help ensure that the largest continuous blob within the binarized flange ROI is, in fact, associated with the flange. In an embodiment, a "closing" algorithm may be executed by processing unit <NUM>. To do so, embodiments include first applying a pixel dilation algorithm to the initial binarized flange ROI, such that the border of each blob is expanded in every direction by a set number of pixels to generate a dilated binarized flange image. This dilation may be performed over any suitable number of iterations (e.g., <NUM>, <NUM>, <NUM>, etc.), with each iteration expanding the borders of each blob by one or more pixels. For instance, the dilation algorithm may be applied <NUM> times, with each iteration expanding the borders of the blobs contained in the binarized flange ROI by a single pixel, resulting in the blob borders being expanded by <NUM> pixels in each direction. Upon expanding the borders of each blob by one or more pixels, the closing algorithm may also include processing unit <NUM> executing a "fill-hole" algorithm to fill in cavities within each (now expanded) blob.

After the dilation and hole filling have been completed, the closing algorithm may further include processing unit <NUM> applying an erosion algorithm to the dilated and hole-filled binarized flange image to iteratively remove pixels from its edges by a set number of pixels for each successive iteration, thereby creating the binarized flange ROI. In an embodiment, the number of erosion iterations may be equal to the number of aforementioned dilation iterations, with each iteration reducing the borders of each blob by one or more pixels. Continuing the previous example, the erosion algorithm may be applied <NUM> times, with each iteration reducing the borders of the dilated and hole-filled binarized flange image by a single pixel, resulting in the blob borders being reduced by <NUM> pixels in each direction.

In some embodiments, processing unit <NUM> may apply a void-filling or "linking" algorithm to the blob fragments after the closing algorithm has been executed as described above. In other embodiments, the linking algorithm may be executed regardless of whether the closing algorithm has been performed. In any event, this linking algorithm may allow processing unit <NUM> to combine the blobs associated with the flange together with one another without combining them with blobs associated with the tray in the background. This may include, for example, horizontally scanning and linking individual rows within the blobs contained in the binarized flange image, which is now described in further detail with reference to the binarized flange image <NUM>, as shown in <FIG>.

In an embodiment, the linking algorithm may include processing unit <NUM> scanning each individual horizontal row within the binarized flange image <NUM> in either direction (i.e., right-to-left or left-to-right). One of these scanned rows is shown in <FIG> as row <NUM>, although embodiments include processing unit <NUM> repeating this process for each horizontal row contained in the binarized flange image <NUM>. In an embodiment, the horizontal row may be associated with a single pixel dimension, thus allowing the processing unit <NUM> to perform a one-dimensional (1D) scan of each horizontal row on a pixel-by-pixel basis. As the row <NUM> is scanned (e.g., from left-to-right in the example shown in <FIG>), the processing unit <NUM> may identify the pixel value associated with each pixel in the binarized flange image <NUM> as having a value of <NUM> (i.e., white or another monochrome color) or a value of <NUM> (i.e., the black background).

In doing so, the processing unit <NUM> may further identify the location and occurrence of pixel binary value transitions from a binary value of <NUM> to a binary value of <NUM>, which are referred to herein as "falling edges," as shown in <FIG>. Moreover, the processing unit <NUM> may identify the location and occurrence of pixel binary value transitions from a binary value of <NUM> back to a binary value of <NUM>, which are referred to herein as "rising edges. " Thus, as each horizontal row is scanned, falling and rising edge pixel pairs may be identified, and the 1D pixel space between these falling and rising edge pixel pairs may be "filled" or "linked" together. This linking process may include, for example, processing unit <NUM> setting, or otherwise adjusting, the pixel value of each pixel between adjoining falling and rising edge pixel pairs from a binary value of <NUM> to a binary value of <NUM>, as shown in <FIG> for row <NUM>. Upon each row within the binarized flange image <NUM> being scanned and filled in this manner, embodiments include the processing unit <NUM> generating a unified binarized flange image <NUM> that includes the pixels within each individually scanned horizontal row being adjusted in this manner, as shown in <FIG>. Thus, the process of executing the closing algorithm in conjunction with the linking algorithm may function to "close" each of the blobs contained in the binarized flange ROI to combine flange image fragments. Moreover, the "erosion" step described above with respect to the closing algorithm may further remove artifacts, such as dust and debris and other tray artifacts in the background. This ensures that the largest continuous blob is, in fact, associated with the flange, and thus the uppermost edge of the flange is accurately identified. In particular, once the unified binarized flange image is generated, embodiments include processing unit <NUM> storing the unified binarized flange image in memory unit <NUM> (or another suitable storage device), and identifying the uppermost edge of the syringe flange as shown in <FIG> (<NUM>) as the y-coordinate of the highest pixel within the unified binarized flange image associated with the largest continuous blob.

Plunger image analysis module <NUM> is a region of memory unit <NUM> configured to store instructions, that when executed by processing unit <NUM>, cause processing unit <NUM> to perform various acts in accordance with applicable embodiments as described herein. In the embodiment, plunger image analysis module <NUM> includes instructions that, when executed by processing unit <NUM>, cause processing unit <NUM> to analyze a syringe image acquired by the imager <NUM> to identify an uppermost edge of the plunger within the image. For the plunger, this may be defined in any suitable manner that utilizes a reference point from which plunger depth within a particular type of vessel may be measured. For example, the uppermost edge of the plunger may be defined as the center of the top edge of the plunger (excluding dimples and other small defects). Continuing this example, the uppermost edge of the plunger may be identified as a point in which the top edge of the plunger intersects with the body centerline of the syringe. This point may thus be identified as another y-coordinate at this location, which is then associated with the plunger's uppermost surface, as indicated by the uppermost edge of the plunger <NUM>, as shown in <FIG>.

Again, to measure the plunger depth from an acquired syringe image, the uppermost edge of the flange and the uppermost edge of the plunger are each detected. The embodiments used to implement detection of the uppermost edge of the flange were discussed above, and utilize specific image processing techniques to address issues related to image analysis of the flange region. Moreover, and as further discussed below, embodiments include executing one or more image processing techniques and/or other analyses to accurately identify the uppermost edge of the plunger, which presents its own set of issues that are addressed using different image processing techniques.

To do so, plunger image analysis module <NUM> includes instructions that enable processing unit <NUM> to "localize" the plunger within the image, which need not be binarized given the dark coloration of the plunger in contrast to the translucent flange. However, embodiments include the plunger being localized within the image in accordance with the template-matching process as further described herein. In any event, the initial plunger ROI may be considered a "coarse" ROI, which corresponds to an area within the image that the plunger could reasonably be expected to be found. As discussed above with reference to <FIG>, in some embodiments, each syringe may be sequentially advanced into the imager's field of view via the linear drive mechanism <NUM>. In doing so, each syringe is centered within the imager's field of view to facilitate identification of the initial plunger ROI. In embodiments in which vessels are not incrementally imaged, any suitable techniques may be implemented to localize the plunger within each respective vessel image as needed. An example of an initial plunger ROI is shown in <FIG> within a syringe as initial plunger ROI <NUM>, which includes the syringe body beneath the flange ROI <NUM> and encompasses the plunger <NUM>.

Conventional image processing techniques perform plunger localization by analyzing the initial plunger ROI <NUM> for the largest dark feature, and then using the center-of-mass of this corresponding object to a calculate <NUM> smaller ROIs. Conventionally, two of these ROIs are established by determining the left and right edges of the corresponding object (i.e., the assumed plunger). A standard image processing technique known as edge detection is typically implemented to measure the position of these edges in each respective ROI. Then, a third ROI for the plunger top edge is defined using the plunger's apparent position within the image, which is then used to identify the top edge of the plunger. Once the plunger is localized in this manner, conventional image analyses using edge detection identify the top and side edges of the plunger within the ROI, identify the plunger centerline, and use the intersection of the centerline with the top edge of the plunger to measure the plunger depth from the top edge of the flange.

However, the aforementioned conventional image processing techniques do not work well over a range of vessel types and volumes, some of which may incorporate differing plunger designs. In particular, syringes with higher fill volumes (e.g., those filled in accordance with <NUM> volume vessels, which may have some fill volume that is a fraction thereof) have plungers that sit higher up (i.e., closer to the flange) than syringes with lower fill volumes. In such scenarios, these plungers may be positioned, when imaged, behind protruding features associated with the tray (e.g., tray <NUM>), which serve to grip the syringe and hold it in place. If the plunger is located behind these features, it may be partially obscured, causing the traditional edge detection techniques described above to fail to adequately locate the plunger edges. This may result in inaccurate plunger top edge detection, or even prevent the plunger top edge from being detected. A plunger ROI <NUM> is shown in <FIG>, and shows tray protrusions A and B that are part of the tray <NUM>, which partially obscure the image of the plunger <NUM>.

Therefore, to remedy this issue, embodiments include plunger image analysis module <NUM> including instructions that, when executed by processing unit <NUM>, facilitate the execution of one or more template-matching algorithms to map refined ROIs (e.g., the refined ROIs <NUM> and <NUM>, as shown in <FIG>) within the initial (i.e., coarse) plunger ROI based upon the characteristics of a matching plunger image template. For example, memory unit <NUM> (or another suitable storage device accessible by the controller <NUM>) may store several plunger image templates, which may be idealized theoretical templates or based upon real-world image samples, in various embodiments.

To provide an illustrative example, for a single type of syringe, several (e.g., <NUM>, <NUM>, <NUM>, etc.) syringes may be imaged as part of a "training" process that is separate from the plunger depth image analysis techniques discussed herein. This training process may include processing the acquired images for a specific type of syringe design to mathematically average characteristics from these acquired images together to form an "ideal" plunger template. For example, for each syringe/plunger type (each syringe having a unique plunger), some number N (e.g., <NUM>) of different plungers may be imaged, each localized within their respective initial plunger ROIs, and then cropped. Controller <NUM> may then execute an algorithm on each of the cropped plunger templates to identify various characteristics (e.g., geometric features and dimensions) in a manner such that subsequent plunger images can later be matched to their respective ideal plunger templates (which may also have tray protrusions present when imaged based upon real-world examples). The characteristics from each of these N number of cropped plunger templates may then be averaged to create an ideal plunger template that is specific to the particular type of plunger. This ideal plunger template is then stored in any suitable portion of controller <NUM> (e.g., memory unit <NUM>) or external storage that may be accessible by controller <NUM>. These ideal plunger templates may be stored with their respective identifying characteristic (e.g., as metadata stored with each ideal plunger template image).

Once the ideal plunger templates are created, embodiments include processing unit <NUM> executing instructions stored in plunger image analysis module <NUM> to identify a particular ideal plunger template image and any identifying characteristic data (e.g., the metadata described above), and matching the initial plunger ROI to an ideal plunger template using the characteristic data. That is, controller <NUM> may match a particular ideal plunger template to the current plunger image within the initial plunger ROI. This matching process may be implemented in any suitable manner, in various embodiments, such as using the metadata stored in the ideal plunger template image, as discussed above.

To provide an illustrative example, plunger matching may be executed via a greyscale value pyramid template matching algorithm. In any event, once the matching plunger template is identified, embodiments further include processing unit <NUM> identifying a further localized image of the plunger within the image of the syringe using the identified characteristics (e.g., dimensions and other detected features) of the matching template to the actual image of the plunger being analyzed. This localized region may be considered a refined ROI, such as refined ROI <NUM>, for example, as shown in <FIG>.

Additionally, once the plunger has been localized within the refined ROI using template matching, embodiments include processing unit <NUM> executing instructions stored in plunger image analysis module <NUM> to align a further refined plunger ROI to the top of the plunger within the refined ROI. For example, because key geometric features are known for the matching template image, embodiments may include overlaying the matching plunger template over the image of the plunger.

To provide an illustrative example, embodiments include processing unit <NUM> executing instructions stored in plunger image analysis module <NUM> to execute a plunger matching algorithm, as discussed above, to identify a matching ideal plunger template. The characteristic data that is associated with this matching ideal plunger template may further include a set of coordinates defining a bounding box. In an embodiment, this set of coordinates may be utilized as the basis for the refined ROI and to anchor and align the further refined ROI within the already refined ROI. In doing so, key features such as shapes and edges of the plunger template may be mapped to those same features in the plunger image, allowing the further refined ROI to be identified and aligned with the top of the plunger that encompasses the top edge of the plunger in even finer detail. This further refined ROI may include, for example, the refined ROI <NUM> as shown in <FIG>, or the refined ROI <NUM> as shown in <FIG>, the latter of which is further discussed below.

Again, some plungers may have small dimples or other imperfections, which present additional issues when using image processing techniques to identify the plunger's top edge. Two examples of the difficulties of conventional image processing systems to properly identify the top edges of a plunger are shown in the images <NUM> and <NUM> of <FIG>, respectively. For example, performing conventional edge detection upon the image <NUM>, as shown in <FIG>, results in the calculation of an incorrectly-identified top edge <NUM>, which is offset from the actual uppermost edge of the plunger <NUM> by the height of the dimples. Moreover, performing conventional edge detection upon the image <NUM>, as shown in <FIG>, results in the calculation of the incorrectly-identified top edge <NUM>, which is misaligned with the uppermost edge of the plunger <NUM>.

Therefore, to address these issues, embodiments include processing unit <NUM> executing instructions stored in plunger image analysis module <NUM> to perform post-processing operations on data identified within the refined and aligned ROI (i.e., using template matching), as discussed above. An example of such post-processing operations is described with reference to <FIG>. For example, <FIG> shows an example of a refined ROI <NUM> for an image <NUM> of a plunger, as discussed above. Embodiments include processing unit <NUM> performing a series of one-dimensional (1D) edge detections evenly spaced across the top of the plunger ROI <NUM>, and filtering the y-coordinates obtained in this manner to identify the uppermost edge of the plunger <NUM>.

The refined ROI <NUM> is divided into a number of evenly-spaced columns <NUM>, each of which may be occupied by one or more pixels. In an embodiment, each column <NUM> may have a single pixel-width to facilitate a 1D edge detection algorithm that is iteratively executed in the vertical direction (i.e., top-to-bottom or perpendicular to the top surface of the plunger as shown in <FIG>), within each column, across the top surface of the plunger. As a result, processing unit <NUM> calculates, for each single-pixel width column <NUM>, a single y-coordinate value corresponding to the edge detection algorithm's highest ranking score for a falling edge (bright-to-dark) along that particular edge. These y-coordinate values are represented in <FIG> as dots <NUM>.

However, performing the 1D edge detection within each of the columns <NUM> produces y-coordinate values (<NUM>) that track the outline of the plunger, which may include any artifacts, such as dimples, for example. Therefore, embodiments include processing unit <NUM> executing instructions stored in plunger image analysis module <NUM> to filter these results to produce a y-coordinate value that accurately and reliably corresponds to the uppermost edge of the plunger <NUM>. This filtering process may be performed in accordance with any suitable filtering techniques, such as averaging, a histogram analysis, weighted averaging, statistical analysis, mean height analysis, etc..

In an embodiment, processing unit <NUM> generates a 1D array from the individual y-coordinate values (<NUM>), which may represent y-coordinate values organized by their corresponding x-coordinate (i.e., horizontal position) within the refined ROI <NUM> from left to right. In addition, the y-coordinate values contained in the 1D array are then binned in accordance with a histogram according to these y-coordinate values. In various embodiments, any suitable number of histogram bins may be selected based upon the expected variation amongst the y-coordinate values (e.g., <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, etc.). Then, bins having less than a threshold number of y-coordinate value entries, or elements, are discarded. As a result of using histogram binning in this manner, outlying y-coordinate values (e.g., those that excessively deviate from a mean height due to dimples or other artifacts) may be removed from the 1D array. An example of the filtered y-coordinate values as a result of this process is represented in <FIG> by the box <NUM>, which demonstrates a constrained set of y-coordinate values that are refined by mean height in accordance with the histogram binning technique described above.

This process of filtering, or constraining, the y-coordinate values may be repeated any suitable number of times to achieve a final cull of y-coordinate values for calculating the uppermost edge of the plunger <NUM>. Once the 1D array has been filtered in this manner, the statistical majority of points in the 1D array now represent plunger heights within a small range of a maximum value, which can now be associated with the top edge of the plunger and not the dimples or other artifacts. Regardless of how many iterations of filtering are performed on the 1D array to generate a set of constrained values, embodiments include processing unit <NUM> executing instructions stored in plunger image analysis module <NUM> to apply a best-fit-line algorithm to the constrained set of y-coordinate values. The output of this best-fit algorithm may then generate a line that is used as the uppermost edge of the plunger <NUM>.

Plunger depth calculation module <NUM> is a region of memory unit <NUM> configured to store instructions, that when executed by processing unit <NUM>, cause processing unit <NUM> to perform various acts in accordance with applicable embodiments as described herein. In an embodiment, plunger depth calculation module <NUM> includes instructions that, when executed by processing unit <NUM>, cause processing unit <NUM> to calculate a plunger depth from an acquired image of a syringe by determining the difference in y-coordinate values from the uppermost edge of the flange and the uppermost edge of the plunger, as discussed above. Once this difference is known, processing unit <NUM> may further execute instructions stored in plunger depth calculation module <NUM> to convert the y-coordinate value, which may be measured in terms of pixels, to a real-world measurement based upon a calibrated conversion factor. This conversion factor may be based upon characteristics of the acquired image and associated components, such as the spatial resolution of the acquired image, for instance. Once known, this measured depth value may be compared to a range of acceptable values, and this process may be repeated for any suitable number of syringes, such as each syringe in an entire tray, for example. Again, the controller <NUM> may notify a user to a syringe having a plunger depth outside of a specified range, which may be implemented via processing unit <NUM> executing instructions stored in plunger depth calculation module <NUM>.

<FIG> illustrates an example of a method flow <NUM> for testing the proper syringe plunger depth, according to an embodiment of the present disclosure. In various embodiments, one or more regions of method <NUM> (or the entire method <NUM>) may be implemented by any suitable device. For example, one or more regions of method <NUM> may be performed by controller <NUM>, imager <NUM>, linear drive mechanism <NUM>, and/or light source <NUM>, as shown in <FIG>, working independently or in conjunction with one another. Method <NUM> represents the various steps performed during the testing of a single syringe, which may be repeated any suitable number of times for multiple syringes, and may include iteratively testing each syringe within a tray (e.g., tray <NUM>, as shown in <FIG>).

Method <NUM> may begin when one or more processors acquire an image of a vessel, such as a syringe, for example (block <NUM>). This image may be, for example, one of several sequential images acquired during testing of several syringes on a tray, as discussed above with reference to the AVI system <NUM> shown in <FIG> (block <NUM>). This acquired image may also include, for example, an image of a syringe including a flange ROI and a plunger ROI, as shown and discussed with reference to <FIG>.

Method <NUM> may include one or more processors generating a binarized flange image of the flange ROI using blob analysis and image post processing (block <NUM>). This may include, for example, the various image processing techniques to close fragmented flange blobs and to reduce artifacts and blob fragments, as discussed above with reference to <FIG> and <NUM> (block <NUM>). This may also include, for example, performing a horizontal linking algorithm on the fragmented flange blobs to combine them with one another, as discussed above with reference to <FIG> (block <NUM>).

Method <NUM> may include one or more processors calculating an uppermost flange edge within the binarized flange image (block <NUM>). This may include, for example, identifying the y-coordinate associated with highest pixel within the binarized flange image after post processing operations have been applied (block <NUM>) to the flange ROI (block <NUM>).

Method <NUM> may include one or more processors aligning a refined plunger ROI with the top of the plunger using template matching (block <NUM>). This may include, for example, identifying a matching plunger template and using the characteristics included in the matching plunger to template to align one or more refined ROIs with the top of the plunger (block <NUM>). For example, this may include generating and aligning refined ROIs <NUM> and <NUM> with the top of the plunger within the initial ROI <NUM>, as discussed above with reference to <FIG> (block <NUM>).

Method <NUM> may include one or more processors calculating an uppermost plunger edge within the refined plunger ROI (block <NUM>). This may include, for instance, dividing the top surface of the plunger image into one pixel-wide columns, performing 1D edge detection within each column, and filtering the y-coordinate values obtained in this manner, as discussed herein with reference to <FIG> (block <NUM>).

Method <NUM> may include one or more processors calculating a plunger depth (block <NUM>). This may include for example, calculating the plunger depth using the difference in y-coordinate values from the uppermost edge of the flange (block <NUM>) and the uppermost edge of the plunger (block <NUM>), as discussed herein (block <NUM>). Method <NUM> may also include converting this y-coordinate value to a real-world measurement based upon a calibrated conversion factor (block <NUM>).

Method <NUM> may include one or more processors determining whether the plunger depth is within an acceptable range (block <NUM>). This may include, for instance, comparing the calculated plunger depth (block <NUM>) to a specified range of acceptable plunger depths, which may be based upon the particular type and/or size of the vessel being tested (block <NUM>).

If the measured plunger depth is within the acceptable specified depth, then method <NUM> may continue to indicate that the syringe being tested passes inspection (block <NUM>). This may include, for example, advancing the next vessel for testing, causing a notification to be issued (e.g., illuminating a green light or displaying a suitable indicator, sounding a "passing" tone, etc.), or otherwise continuing testing until either every syringe in the tray has been tested or one of the vessels fails inspection.

In the event that the plunger depth is outside of an acceptable range, method <NUM> may continue to indicate that the vessel being tested has failed inspection (block <NUM>). Additionally, a vessel may fail inspection in the event that a tray is missing one or more vessels, or a particular incremental test indicates that an expected vessel is not present (block <NUM>). This may additionally or alternatively include, for example, pausing the testing, causing a notification to be issued (e.g., illuminating a red light or displaying a suitable indicator, sounding a "fail" tone, etc.), or otherwise notifying a user of the failed status (block <NUM>). In some embodiments, vessel testing may continue regardless of whether some vessels fail inspection, with a report indicating at the end of the tray being tested those vessels that failed and their corresponding plunger depth measurements (block <NUM>). In other embodiments, method <NUM> may stop each time a vessel fails inspection (block <NUM>).

Some of the Figures described herein illustrate example block diagrams having one or more functional components. It will be understood that such block diagrams are for illustrative purposes and the devices described and shown may have additional, fewer, or alternate components than those illustrated. Additionally, in various embodiments, the components (as well as the functionality provided by the respective components) may be associated with or otherwise integrated as part of any suitable components. For example, the controller <NUM> may be integrated with the illumination system <NUM> or the imager <NUM>.

Many examples discussed herein refer to the measurement of plunger depth with reference to a syringe. Again, it will be understood that the embodiments discussed herein may be applied to any suitable type of plunger depth measurement within any suitable type of vessel for which AVI systems may be implemented. For example, plunger depth may be measured within cartridges that may be placed onto trays in a similar manner as syringes.

Additionally, the embodiments described herein are directed to measuring plunger depth within various types of vessels (e.g., syringes and cartridges). For ease of explanation, this technique has been described by primarily focusing upon the identification of the uppermost edge of a reference or anchor point on the vessel (e.g., the uppermost edge of the flange) and the plunger.

Embodiments of the disclosure relate to a non-transitory computer-readable storage medium having computer code thereon for performing various computer-implemented operations. The term "computer-readable storage medium" is used herein to include any medium that is capable of storing or encoding a sequence of instructions or computer codes for performing the operations, methodologies, and techniques described herein. The media and computer code may be those specially designed and constructed for the purposes of the embodiments of the disclosure, or they may be of the kind well known and available to those having skill in the computer software arts. Examples of computer-readable storage media include, but are not limited to: magnetic media such as hard disks, floppy disks, and magnetic tape; optical media such as CD-ROMs and holographic devices; magneto-optical media such as optical disks; and hardware devices that are specially configured to store and execute program code, such as ASICs, programmable logic devices ("PLDs"), and ROM and RAM devices.

Examples of computer code include machine code, such as produced by a compiler, and files containing higher-level code that are executed by a computer using an interpreter or a compiler. For example, an embodiment of the disclosure may be implemented using Java, C++, or other object-oriented programming language and development tools. Additional examples of computer code include encrypted code and compressed code. Moreover, an embodiment of the disclosure may be downloaded as a computer program product, which may be transferred from a remote computer (e.g., a server computer) to a requesting computer (e.g., a client computer or a different server computer) via a transmission channel. Another embodiment of the disclosure may be implemented in hardwired circuitry in place of, or in combination with, machine-executable software instructions.

As used herein, the singular terms "a," "an," and "the" may include plural referents unless the context clearly dictates otherwise.

As used herein, relative terms, such as "above," "below," "up," "left," "right," "down," "top," "bottom," "vertical," "horizontal," "side," "higher," "lower," "upper," "over," "under," "inner," "interior," "outer," "exterior," "front," "back," "upwardly," "lower," "downwardly," "vertical," "vertically," "lateral," "laterally" and the like refer to an orientation of a set of components with respect to one another; this orientation is in accordance with the drawings, but is not required during manufacturing or use.

As used herein, the terms "connect," "connected," and "connection" refer to an operational coupling or linking. Connected components can be directly or indirectly coupled to one another, for example, through another set of components.

As used herein, the terms "approximately," "substantially," "substantial" and "about" are used to describe and account for small variations. When used in conjunction with an event or circumstance, the terms can refer to instances in which the event or circumstance occurs precisely as well as instances in which the event or circumstance occurs to a close approximation. For example, when used in conjunction with a numerical value, the terms can refer to a range of variation less than or equal to ±<NUM>% of that numerical value, such as less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, or less than or equal to ±<NUM>%. For example, two numerical values can be deemed to be "substantially" the same if a difference between the values is less than or equal to ±<NUM>% of an average of the values, such as less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, less than or equal to ±<NUM>%, or less than or equal to ±<NUM>%.

Additionally, amounts, ratios, and other numerical values are sometimes presented herein in a range format. It is to be understood that such range format is used for convenience and brevity and should be understood flexibly to include numerical values explicitly specified as limits of a range, but also to include all individual numerical values or sub-ranges encompassed within that range as if each numerical value and sub-range is explicitly specified.

Claim 1:
A method for performing plunger depth inspection for a vessel (<NUM>) having a plunger (<NUM>, <NUM>), comprising:
acquiring, via an imager (<NUM>, <NUM>), an image (<NUM>) of the vessel including a reference point region of interest, ROI, (<NUM>, <NUM>) that encompasses an image of a reference point from which to measure plunger depth, and an initial plunger ROI (<NUM>) that encompasses an image of the plunger;
identifying, via a controller (<NUM>, <NUM>), the reference point ROI and the initial plunger ROI in the image of the vessel;
generating, via the controller, a binarized reference point image (<NUM>, <NUM>, <NUM>) based upon a blob analysis of the reference point ROI;
calculating, via the controller, an uppermost vessel edge (<NUM>, <NUM>, <NUM>) within the binarized reference point image;
aligning, via the controller, a refined plunger ROI (<NUM>, <NUM>, <NUM>) with the top of the plunger within the initial plunger ROI using a matching plunger image template from among a plurality of plunger image templates;
calculating, via the controller, an uppermost plunger edge (<NUM>, <NUM>) within the refined plunger ROI; and
calculating, via the controller, a depth (<NUM>) of the plunger within the vessel using a difference between respective coordinate values of the uppermost vessel edge and the uppermost plunger edge with respect to a direction perpendicular to a top surface of the plunger;
wherein the act of calculating the uppermost plunger edge within the refined plunger ROI comprises:
dividing the top of the refined plunger ROI into a plurality of columns (<NUM>);
performing one-dimensional edge-detection on each of the plurality of columns to determine, for each column, a y-coordinate value (<NUM>) associated with an upper edge of the plunger;
binning the y-coordinate value in each of the plurality of columns in accordance with a histogram according to y-coordinate values;
removing bins having less than a threshold number of elements to generate a constrained set of y-coordinate values; and
calculating the uppermost plunger edge within the refined plunger ROI based upon the constrained set of y-coordinate values.