The present application relates to machine vision systems, and more particularly to vision system tools that find line features in acquired images.
Machine vision systems (also termed herein, simply “vision systems”) are used for a variety of tasks in manufacturing, logistics, and industry. Such tasks can include surface and part inspection, alignment of objects during assembly, reading of patterns and ID codes, and any other operation in which visual data is acquired and interpreted for use in further processes. Vision systems typically employ one or more cameras that acquire images of a scene containing an object or subject of interest. The object/subject can be stationary or in relative motion. Motion can also be controlled by information derived by the vision system, as in the case of manipulation of parts by a robot.
A common task for a vision system is finding and characterizing line features in an image. A variety of tools are used to identify and analyze such line features. Where an image contains multiple lines, such as from a surface having a fixed pattern, or where an image contains texture changes, color changes, and/or albedo changes, such tools may be limited in ability to quickly and accurately identify lines or edges.
The present application overcomes the disadvantages of the prior art by providing a stable and cost effective line-finding process that that efficiently operates on runtime images having single and multiple edges.
One or more aspects of the present disclosure provides a method of generating training results using a vision system, including: selecting at least one training image comprising at least one representative feature: operating a line-finding tool that searches the at least one training image for the at least one representative feature using at least one caliper; generating a projection signal from projection data associated with the at least one caliper; generating a filter signal from the projection signal; and generating an index value by finding an edge of the at least one caliper nearest to an expected feature.
In one example, the method further includes: configuring at least one line-finding parameter of the line-finding tool prior to operating the line-finding tool.
In one example, the at least one line-finding parameter comprises at least one of: search direction; search length; projection width; or polarity.
In one example, the method further includes normalizing the projection data prior to generating the projection signal.
In one example, the line-finding tool comprises at least one caliper.
In one example, the filter signal comprises a first derivative of the projection signal.
In one example, the at least one representative feature comprises at least one line segment.
Another aspect of the disclosure provides a method of identifying a line segment with a vision system, including: operating a line-finding tool that searches at least one runtime image for the at least one feature using at least one caliper; generating a runtime projection signal from runtime projection data associated with the at least one caliper: generating a runtime filter signal from the runtime projection signal; determining a best path by warping and mapping a training projection signal relative to a runtime projection signal and a training filter signal relative to a runtime filter signal; generating a runtime projection index and a runtime filter index using the determined best path and at least one training parameter; determining a confidence index based upon the runtime projection index and the runtime filter index; and identifying at least one line segment from at least one candidate line segment based upon the confidence index.
In one example, the method further includes: configuring at least one line-finding parameter of the line-finding tool prior to operating the line-finding tool.
In one example, the at least one line-finding parameter comprises at least one of: search direction; search length; projection width; or polarity.
In one example, the method further includes normalizing the projection data prior to generating the projection signal.
In one example, the at least one caliper comprises a plurality of calipers.
In one example, the runtime filter signal comprises a first derivative of the runtime projection signal.
In one example, the at least one feature comprises a line segment.
In one example, the warping and mapping comprises dynamically warping and mapping a positional value of the runtime projection signal to a corresponding positional value of the training projection signal.
In one example, the method further includes: refining the position of the identified at least one line segment to a sub-pixel positon.
Another aspect of the disclosure provides a system for identifying a line segment, including: at least one vision camera configured to image a runtime object comprising at least one feature; and a vision system processor configured to: operate a line-finding tool that searches at least one runtime image for the at least one feature using at least one caliper; generate a runtime projection signal from runtime projection data associated with the at least one caliper; generate a runtime filter signal from the runtime projection signal; determine a best path by warping and mapping a training projection signal relative to a runtime projection signal and a training filter signal relative to a runtime filter signal; generate a runtime projection index and a runtime filter index using the determined best path and at least one training parameter: determine a confidence index based upon the runtime projection index and the runtime filter index; and identify at least one line segment from at least one candidate line segment based upon the confidence index.
The invention description below refers to the accompanying drawings, of which:
An exemplary vision system arrangement 100 that can be employed according to an illustrative embodiment is shown in
The camera(s) 110 (and, optionally 112) image some or all of an object 150 located within the scene. Each camera defines an optical axis OA, around which a field of view is established based upon the optics 116, focal distance, etc. The object 150 includes a plurality of edges 152, 154 and 156 that are respectively arranged in different directions. For example, the object edges can comprise those of a cover glass mounted within a smartphone body. Illustratively, the camera(s) can image the entire object, or specific locations (e.g. corners where the glass meets the body). A (common) coordinate space can be established with respect to the object, one of the cameras or another reference point (for example a moving stage upon which the object 150 is supported). As shown, the coordinate space is represented by axes 158. These axes illustratively define orthogonal x, y and z axes and rotation θz, about the z axis in the x-y plane.
According to an illustrative embodiment, the vision system process 130 interoperates with one or more applications/processes (running on the computing device 140) that collectively comprise a set of vision system tools/processes 132. These tools can include a variety of conventional and specialized algorithms that are used to resolve image data-for example a variety of calibration tools and affine transform tools can be used to transform acquired image data to a predetermined (e.g. common) coordinate system. Tools that convert image grayscale intensity data to a binary image based upon a predetermined threshold can also be included. Likewise, tools that analyze the gradient of intensity (contrast) between adjacent image pixels (and subpixels) can be provided.
The vision system process (or) 130 includes a line-finding process, tool or module 134 that locates one or more lines in an acquired image according to an illustrative embodiment. The vision system process (or) 130 also includes a warping process, tool or module 136 that operates on data from one or more identified lines according to an illustrative embodiment.
Reference is, thus, made to
At block (each block herein also representing one or more process step(s)) 310, at least one image is selected as the at least one training image, which at least one training image can comprise at least one golden image. The selected at least one golden image can be selected from an image set (e.g., acquired by vision system camera(s) 110-112, or by any other camera assembly) such that the golden image includes features (e.g., edges or lines (e.g., line segment(s)) corresponding to edges) that are the representative of one or more features (e.g., edges or lines (e.g., line segment(s)) corresponding to edges) of the physical object being imaged. In one example, the image set from which the at least one golden image is selected is acquired using predetermined acquisition parameters and under predetermined illumination conditions. Such predetermined acquisition and illumination conditions can be selected such that they are identical to conditions used in runtime image acquisition. In other examples, the at least one golden image is a model image, such as a CAD model.
At block 320, optionally, one or more parameters are configured for the line-finding tool. Such parameters can include, for example, a search direction, a search length, a projection width, and a polarity.
At block 330, one or more training results are trained from the at least one golden image. This is explained in greater detail with reference to
At block 332, the line-finding tool operates on the at least one golden image at block 332 to search for at least one representative feature (e.g., edges or lines (e.g., line segment(s)) corresponding to an edge) using at least one caliper. The line-finding tool operates according to the one or more parameters optionally configured at block 320.
While only one caliper 410a is depicted, it is understood that one or more calipers 410a can be implemented in one or more sections 405a with respect to the training image 400a in order to search for and identify one or more edges 415a.
At block 334, a one-dimensional training projection signal is generated by normalizing the projection data for each caliper instantiated by the line-finding tool, with the projection data representing a reduction of a 2D array of pixels from the image to a 1D array of pixels. In this regard, pixels of the projected caliper that overlap with the 2D array of pixels are summed along respective rays of the projected caliper in the search direction, with the sum along each ray corresponding to the 1D pixel value. An exemplary training projection signal 400b is depicted at
At block 336, a training filter signal 400c is generated from the training projection signal 400b. An exemplary training filter signal is depicted at
In the equation above, P(xn) refers to the training projection signal value at the index n and ƒ(xn) refers to the training filter signal value.
At block 338, a training index is determined by finding a caliper edge nearest to an expected feature (e.g., edge or line (e.g., line segment(s)). An exemplary training index 400d is depicted at
At block 340, the training results are outputted (and/or stored) for use during a runtime process. The training results can include the results from blocks 330-338, including at least one training projection signal, at least one training filter signal, and/or at least one training index value.
At block 510, a line-finding tool operates on a runtime image to extract caliper information from the runtime image, with the caliper information including runtime projection data, runtime filter data, and one or more edges identified by the line-finding tool. The line-finding tool can operate similar to block 332 in that the line-finding tool operates on the runtime image to search for at least one representative feature (e.g., edge or line (e.g., line segment(s)) corresponding to an edge) using at least one caliper.
At block 520, a runtime projection index is determined in the runtime image. This is explained in greater detail with reference to
With reference to
At block 524, a best path is extracted by warping (e.g., dynamic time warping) and mapping the training projection signal relative to the runtime projection signal. An example of warping (e.g., dynamic time warping) and mapping is depicted in
In this example, two signals 505d and 510d are warped and mapped relative to one another to arrive at a best path 515d (also referred to as a “match result” or a “mapping result”). The best path 515d represents a mapping from column to column of the first signal 505d and the second signal 510d that minimizes a sum of distances between matched features from a first end 520d of the best path 515d to a second end 525d of the best path. The use of dynamic time warping advantageously allows a mapping from points in the first signal 505d to corresponding points in the second signal 510d where one of the signals experiences distortion, missing features, excess noise, or other unwanted artifacts.
Returning to block 524, the training projection signal is warped (e.g., dynamic time warping) and mapped relative to the runtime projection signal to generate a projection best path indicative of a mapping between the training projection signal and the runtime projection signal. In particular, the warping and mapping can dynamically warp and map a positional value of the runtime projection signal to a corresponding positional value of the training projection signal. This warping and mapping is also depicted with reference to
At block 526, a runtime projection index is determined by using the best projection path and the training index value. Since the projection best path represents a paired index between training and runtime projection signal, the corresponding runtime projection index can be determined with the projection best path and the training index value.
At block 530, a runtime filter index is determined in the runtime image. This is explained in greater detail with reference to
At block 532, a runtime filter signal is determined. In one example, the runtime filter signal is a first derivative of the runtime projection signal. In another example, the runtime filter signal can be represented by the following equation:
In the equation above, P(xn) refers to the runtime projection signal value at the index n and ƒ(xn) refers to the runtime filter signal value.
At block 534, a filter best path is extracted by dynamically warping (e.g., dynamic time warping) and mapping the training filter signal relative to the runtime filter signal. As described above, the training filter signal and the runtime filter signal are dynamically warped and mapped to generate a best path indicative of a mapping between the training filter signal and the runtime filter signal. In this regard, the warping and mapping can dynamically warp and map a positional value of the runtime filter signal to a corresponding positional value of the training filter signal. This mapping is also depicted with reference to
At block 536, a runtime filter index is determined using the filter best path and the training index value. Since the filter best path represents a paired index between training and runtime filter signals, the corresponding runtime filter index can be determined with the filter best path and the training index value.
At block 540, one or more found edges are refined to a sub-pixel position. This can be done using the runtime filter index and the runtime projection index. For example, a confidence index can be generated by comparing the projection index with the filter index. The projection index and the filter index are expected to be equal or near equal. The confidence index thus represents a difference between projection index and filter index, with the best fitting edge corresponding to a lowest confidence index. The best candidate edge can be chosen according to a highest confidence index from a plurality of candidate edges. In another example, the polarity and distance can be used to refine the sub-pixel position or to select the best candidate edge.
At block 550, a line segment is fit to the found edges according to the refined sub-pixel position. A line-fitting procedure can iteratively be operated in order to reduce a root mean square (RMS) error between one or more candidate lines and the refined found edges.
It should be clear that the line-finder provided according to the system, and method and various alternate embodiments/improvements is an effective and robust tool for determining multiple line features under a variety of conditions. In general, when used to find line features, the system and method has no particular limit on the maximum number of lines to be found in an image. Only memory and compute time will place practical limits on the number of lines that can be found.
The foregoing has been a detailed description of illustrative embodiments of the invention. Various modifications and additions can be made without departing from the spirit and scope of this invention. Features of each of the various embodiments described above may be combined with features of other described embodiments as appropriate in order to provide a multiplicity of feature combinations in associated new embodiments. Furthermore, while the foregoing describes a number of separate embodiments of the apparatus and method of the present invention, what has been described herein is merely illustrative of the application of the principles of the present invention. For example, as used herein the terms “process” and/or “processor” should be taken broadly to include a variety of electronic hardware and/or software based functions and components (and can alternatively be termed functional “modules” or “elements”). Moreover, a depicted process or processor can be combined with other processes and/or processors or divided into various sub-processes or processors. Such sub-processes and/or sub-processors can be variously combined according to embodiments herein. Likewise, it is expressly contemplated that any function, process and/or processor herein can be implemented using electronic hardware, software consisting of a non-transitory computer-readable medium of program instructions, or a combination of hardware and software. Additionally, as used herein various directional and dispositional terms such as “vertical”, “horizontal”, “up”, “down”, “bottom”, “top”, “side”, “front”, “rear”, “left”, “right”, and the like, are used only as relative conventions and not as absolute directions/dispositions with respect to a fixed coordinate space, such as the acting direction of gravity. Additionally, where the term “substantially” or “approximately” is employed with respect to a given measurement, value or characteristic, it refers to a quantity that is within a normal operating range to achieve desired results, but that includes some variability due to inherent inaccuracy and error within the allowed tolerances of the system (e.g. 1-5 percent). Accordingly, this description is meant to be taken only by way of example, and not to otherwise limit the scope of this invention.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2022/074430 | 1/27/2022 | WO |