Detection of a sheet of light based on second derivative
09754374 · 2017-09-05
Assignee
Inventors
Cpc classification
G06V10/145
PHYSICS
G06T7/521
PHYSICS
International classification
Abstract
A method for detecting a position of a sheet of light is described. A second derivative filter is applied to an intensity profile of a line of pixels. An ingress pixel position associated with an ingress zero-crossing second derivative value is determined. The ingress pixel position is between a first pixel position with a first minimum intensity value of the intensity profile and a second pixel position with a first maximum intensity value of the intensity profile. An egress pixel position associated with an egress zero-crossing second derivative value is determined. The egress pixel position is between a third pixel position with a second maximum intensity value of the intensity profile and a fourth pixel position with a second minimum intensity value of the intensity profile. A midpoint pixel position between the ingress pixel position and the egress pixel position is output as the position of the sheet of light.
Claims
1. A method for detecting a position of a sheet of light in an image, the method comprising: applying a second derivative filter to an intensity profile of a line of pixels included in an image of the sheet of light as projected onto an object to obtain a plurality of second derivative values associated with corresponding pixel positions; determining an ingress pixel position associated with an ingress zero-crossing second derivative value, wherein the ingress pixel position is between a first pixel position with a first minimum intensity value of the intensity profile and a second pixel position with a first maximum intensity value of the intensity profile; determining an egress pixel position associated with an egress zero-crossing second derivative value, wherein the egress pixel position is between a third pixel position with a second maximum intensity value of the intensity profile and a fourth pixel position with a second minimum intensity value of the intensity profile; determining a midpoint pixel position between the ingress pixel position and the egress pixel position; and outputting the midpoint pixel position as the position of the sheet of light.
2. The method of claim 1, wherein the method further comprises determining the first minimum intensity value and the first maximum intensity value respectively based on determining a first maximum second derivative value associated with the first pixel position and determining a first minimum second derivative value associated with the second pixel position.
3. The method of claim 1, wherein determining the ingress pixel position includes determining that a difference between the first maximum intensity value and the first minimum intensity value is greater than a threshold value.
4. The method of claim 1, wherein the method further comprises determining the second minimum intensity value and the second maximum intensity value respectively based on determining a first maximum second derivative value associated with the first pixel position and determining a first minimum second derivative value associated with the second pixel position.
5. The method of claim 1, wherein determining the egress pixel position includes determining that a difference between the second maximum intensity value and the second minimum intensity value is greater than a threshold value.
6. The method of claim 1, wherein the determining the ingress pixel position corresponding to the ingress zero-crossing second derivative value includes: determining that a sign of a previous second derivative value corresponding to a previous pixel position is positive; and determining that a current second derivative value corresponding to a current pixel position is less than or equal to zero.
7. The method of claim 6, wherein the determining the ingress pixel position further includes: estimating an ingress sub-pixel position using interpolation of the previous pixel position and the current pixel position.
8. The method of claim 1, wherein the determining the egress pixel position corresponding to the egress zero-crossing second derivative value includes: determining that the ingress zero-crossing second derivative value has been determined; determining that a sign of a previous second derivative value corresponding to a previous pixel position is negative; and determining that a current second derivative value corresponding to a current pixel position is greater than or equal to zero.
9. The method of claim 8, wherein the determining the egress pixel position further includes: estimating an egress sub-pixel position using interpolation of the previous pixel position and the current pixel position.
10. A field-programmable gate array (FPGA) to detect a position of a sheet of light in an image, the FPGA comprising: a set of one or more processing units; and a non-transitory machine-readable storage medium containing code, which when executed by the set of one or more processing units, causes the FPGA to: apply a second derivative filter to an intensity profile of a line of pixels included in an image of the sheet of light as projected onto an object to obtain a plurality of second derivative values associated with corresponding pixel positions, determine an ingress pixel position associated with an ingress zero-crossing second derivative value, wherein the ingress pixel position is between a first pixel position with a first minimum intensity value of the intensity profile and a second pixel position with a first maximum intensity value of the intensity profile, determine an egress pixel position associated with an egress zero-crossing second derivative value, wherein the egress pixel position is between a third pixel position with a second maximum intensity value of the intensity profile and a fourth pixel position with a second minimum intensity value of the intensity profile, determine a midpoint pixel position between the ingress pixel position and the egress pixel position, and output the midpoint pixel position as the position of the sheet of light.
11. The FPGA of claim 10, wherein the non-transitory machine-readable storage medium further contains code, which when executed by the set of one or more processing units, causes the FPGA to determine the first minimum intensity value and the first maximum intensity value respectively based on determining a first maximum second derivative value associated with the first pixel position and determining a first minimum second derivative value associated with the second pixel position.
12. The FPGA of claim 10, wherein to determine the ingress pixel position includes to determine that a difference between the first maximum intensity value and the first minimum intensity value is greater than a threshold value.
13. The FPGA of claim 10, wherein the non-transitory machine-readable storage medium further contains code, which when executed by the set of one or more processing units, causes the FPGA to determine the second minimum intensity value and the second maximum intensity value respectively based on determining a first maximum second derivative value associated with the first pixel position and determining a first minimum second derivative value associated with the second pixel position.
14. The FPGA of claim 10, wherein to determine the egress pixel position includes to determine that a difference between the second maximum intensity value and the second minimum intensity value is greater than a threshold value.
15. The FPGA of claim 10, wherein to determine the ingress pixel position corresponding to the ingress zero-crossing second derivative value includes: to determine that a sign of a previous second derivative value corresponding to a previous pixel position is positive; and to determine that a current second derivative value corresponding to a current pixel position is less than or equal to zero.
16. The FPGA of claim 15, wherein to determine the ingress pixel position further includes: to estimate an ingress sub-pixel position using interpolation of the previous pixel position and the current pixel position.
17. The FPGA claim 10, wherein to determine the egress pixel position corresponding to the egress zero-crossing second derivative value includes: to determine that the ingress zero-crossing second derivative value has been determined; to determine that a sign of a previous second derivative value corresponding to a previous pixel position is negative; and to determine that a current second derivative value corresponding to a current pixel position is greater than or equal to zero.
18. The FPGA of claim 17, wherein to determine the egress pixel position further includes: to estimate an egress sub-pixel position using interpolation of the previous pixel position and the current pixel position.
19. A non-transitory computer readable storage medium that provide instructions, which when executed by a processor of a proxy server, cause said processor to perform operations comprising: applying a second derivative filter to an intensity profile of a line of pixels included in an image of a sheet of light as projected onto an object to obtain a plurality of second derivative values associated with corresponding pixel positions; determining an ingress pixel position associated with an ingress zero-crossing second derivative value, wherein the ingress pixel position is between a first pixel position with a first minimum intensity value of the intensity profile and a second pixel position with a first maximum intensity value of the intensity profile; determining an egress pixel position associated with an egress zero-crossing second derivative value, wherein the egress pixel position is between a third pixel position with a second maximum intensity value of the intensity profile and a fourth pixel position with a second minimum intensity value of the intensity profile; determining a midpoint pixel position between the ingress pixel position and the egress pixel position; and outputting the midpoint pixel position as a position of the sheet of light.
20. The non-transitory computer readable storage medium of claim 19, wherein the operations further comprise determining the first minimum intensity value and the first maximum intensity value respectively based on determining a first maximum second derivative value associated with the first pixel position and determining a first minimum second derivative value associated with the second pixel position.
21. The non-transitory computer readable storage medium of claim 19, wherein the determining the ingress pixel position includes determining that a difference between the first maximum intensity value and the first minimum intensity value is greater than a threshold value.
22. The non-transitory computer readable storage medium of claim 19, wherein the operations further comprise determining the second minimum intensity value and the second maximum intensity value respectively based on determining a first maximum second derivative value associated with the first pixel position and determining a first minimum second derivative value associated with the second pixel position.
23. The non-transitory computer readable storage medium of claim 19, wherein the determining the egress pixel position includes determining that a difference between the second maximum intensity value and the second minimum intensity value is greater than a threshold value.
24. The non-transitory computer readable storage medium of claim 19, wherein the determining the ingress pixel position corresponding to the ingress zero-crossing second derivative value includes: determining that a sign of a previous second derivative value corresponding to a previous pixel position is positive; and determining that a current second derivative value corresponding to a current pixel position is less than or equal to zero.
25. The non-transitory computer readable storage medium of claim 24, wherein the determining the ingress pixel position further includes: estimating an ingress sub-pixel position using interpolation of the previous pixel position and the current pixel position.
26. The non-transitory computer readable storage medium of claim 19, wherein the determining the egress pixel position corresponding to the egress zero-crossing second derivative value includes: determining that the ingress zero-crossing second derivative value has been determined; determining that a sign of a previous second derivative value corresponding to a previous pixel position is negative; and determining that a current second derivative value corresponding to a current pixel position is greater than or equal to zero.
27. The non-transitory computer readable storage medium of claim 26, wherein the determining the egress pixel position further includes: estimating an egress sub-pixel position using interpolation of the previous pixel position and the current pixel position.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) The invention may best be understood by referring to the following description and accompanying drawings that are used to illustrate embodiments of the invention. In the drawings:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
DESCRIPTION OF EMBODIMENTS
(16) In the following description, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the understanding of this description. Those of ordinary skill in the art, with the included descriptions, will be able to implement appropriate functionality without undue experimentation.
(17) References in the specification to “one embodiment,” “an embodiment,” “an example embodiment,” etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
(18) Bracketed text and blocks with dashed borders (e.g., large dashes, small dashes, dot-dash, and dots) may be used herein to illustrate optional operations that add additional features to embodiments of the invention. However, such notation should not be taken to mean that these are the only options or optional operations, and/or that blocks with solid borders are not optional in certain embodiments of the invention.
(19) In the following description and claims, the terms “coupled” and “connected,” along with their derivatives, may be used. It should be understood that these terms are not intended as synonyms for each other. “Coupled” is used to indicate that two or more elements, which may or may not be in direct physical or electrical contact with each other, co-operate or interact with each other. “Connected” is used to indicate the establishment of communication between two or more elements that are coupled with each other.
(20) Standard Approaches for Detection of the Position of a Sheet of Light in an Image:
(21) 3D measurement and reconstructions systems analyze images of one or more sheet of lights (e.g., laser beam or a structured light) as projected on the surface of an object of interest to extract 3D measurements or reconstruct the object of interest. The accuracy of the 3D measurement/reconstruction depends on the accuracy of the detected positions of the sheet of lights in the acquired images.
(22) A standard approach used to detect the position of a sheet of light in an image is to determine the center of gravity of the sheet of light in an intensity profile of the image (or of a portion of an image such as a column or a row). According to this approach, a window of fixed size is moved across the intensity profile and for each window position, a sum or average of the pixel intensities in the window is computed. Window positions having a sum (average) of pixel intensities below a predefined threshold are discarded. Among the remaining window positions, the window position having the highest sum (average) of pixel intensities is selected and the center of gravity of the selected window position is returned as the detected laser position.
(23) Another approach used to detect the position of a sheet of light in an image is based on a first derivative of an intensity profile of the image (or of a portion of an image such as a column or a row). In this approach, two parameters are used, namely the width of the widest peak to be detected and the intensity difference of the least-contrasted peak to be detected. From these two parameters, a size S, a distance D, and a threshold T are determined. A region of interest (ROI) is determined based on the intensity profile, distance D and threshold T. A derivative filter of size S is applied to the intensity profile to produce a slope of the intensity profile. In the determined ROI, one or more zero-crossings in the slope of the intensity profile are detected. From the detected zero-crossings, a zero-crossing is selected and the position of the selected zero-crossing is returned as the detected position of the sheet of light for the line of pixels.
(24) These prior art approaches have several limitations and are therefore not suitable for certain applications. For example, the first approach is very sensitive to variations in the background intensity (DC offset) of the intensity profile. In addition, the effectiveness of the approach is highly dependent on the choice of the size of the window and the technique lacks robustness with regards to saturated peaks and large variations in peak widths. In some applications, the width of the sheet of light may vary significantly from a thin line with a Gaussian like profile of intensity to a large saturated flat line. Although the second approach may be used to detect the position of the sheet of light in the variety of scenarios (e.g., detecting the position of wide or thin sheet of lights), it cannot accomplish that with the same accuracy with a single set of parameters (e.g., a single set of size S, distance D, and threshold T).
(25) The embodiments of the present invention overcome the limitations of the prior approaches and enable a robust and accurate extraction of the position of a sheet of light in varying scenarios with a single set of parameters. In addition, the mechanism described herein provide a computationally efficient technique that can be implemented on dedicated hardware (such as a Field-Programmable Gate Array (FPGA)), and which can detect the position of the sheet of light when image acquisition rates are very high (which is typical for this type of applications).
(26) Detection of a Position of a Sheet of Light Based on Second Derivative
(27) The embodiments of the present invention present methods and apparatus for detecting the position of a sheet of light in an image. The methods are based on a second derivative of an intensity profile of the image. A second derivative filter is applied to the intensity profile of a line of pixels included in the image of the sheet of light as projected onto an object to obtain a plurality of second derivative values associated with corresponding pixel positions. An ingress pixel position associated with an ingress zero-crossing second derivative value is determined. The ingress pixel position is determined as being located between a first pixel position with a first minimum intensity value of the intensity profile and a second pixel position with a first maximum intensity value of the intensity profile. The methods continues with the determination of an egress pixel position associated with an egress zero-crossing second derivative value. The egress pixel position is determined as being located between a third pixel position with a second maximum intensity value of the intensity profile and a fourth pixel position with a second minimum intensity value of the intensity profile. When the ingress and egress pixel positions are determined, the midpoint pixel position between the ingress pixel position and the egress pixel position is output as the position of the sheet of light.
(28)
(29) The operations in the following figures will be described with reference to the exemplary system of
(30)
(31)
(32) In some embodiments, each one of the images 200A-B comprise a plurality of scan lines of pixels, each one having an associated intensity profile. The position detection system 108 may thus be configured to detect the position of the sheet of light in each scan line of pixels. For example, in the 2D image 200A, the position detection system 108 may be configured to detect the position x.sub.i of the sheet of light in each column of pixels k.sub.i where i=1, 2, . . . N and return an array of detected positions X=[x.sub.1, x.sub.2, . . . x.sub.N]. In some cases, no sheet of light is detected in the intensity profile, in which case the detection method may return a value indicating that no sheet of light was detected for the line of pixels. In other cases, multiple positions for the sheet of light may be detected within a single intensity profile (e.g., due to the shape of the object or because multiple sheets of light are projected onto the object), in which case the detection method may return the multiple detected positions for the line of pixels.
(33)
(34) Based on the second derivative values, the position detection system 108 determines an ingress pixel position x.sub.I associated with an ingress zero-crossing second derivative value. Thus the position detection system 108 determines the pixel position x.sub.I by scanning the second derivative values and locating an ingress zero-crossing second derivative value. In one embodiment, the scan line of pixels (e.g., scan line 204b) is traversed from a first pixel position x.sub.1 to a last pixel position x.sub.n. In some embodiments a first pixel position x.sub.1 and the last pixel position x.sub.n delimit the entire line of pixels (e.g., the line 204b), while in other embodiments these two positions delimit a portion of the scan line 204b illustrated in
(35) In some embodiments, the ingress pixel position x.sub.I is located between a first pixel position x.sub.min1 associated with a first minimum intensity value y.sub.min1 of the intensity profile 306a and a second pixel position x.sub.max1 with a first maximum intensity value y.sub.max1 of the intensity profile, where the difference between the first maximum intensity value y.sub.max1 and the first minimum intensity value y.sub.min1 is greater than a predetermined threshold intensity value (T.sub.1). According to these embodiments, the ingress pixel position x.sub.I is validated as corresponding to the ingress zero-crossing second derivative value if it is located between the first pixel position x.sub.min1 and the second pixel position x.sub.max1 and that the corresponding intensity values satisfy the threshold condition (i.e., that the difference between the first maximum intensity value y.sub.max1 and the first minimum intensity value y.sub.min1 is greater than a predetermined threshold intensity value (T.sub.1)). Alternatively, if the intensity threshold condition is not satisfied and a pixel position associated to the zero-crossing of the derivative curve is not identified as the ingress pixel position x.sub.I, in this case the position detection system 108 proceeds to analyzing the second derivative curve to locate another pixel position associated with a zero-crossing of the second derivative value. The predetermined threshold intensity value T.sub.1 may be input to the position detection system 108 by a user and may be dependent on the type of applications. Alternatively, the predetermined threshold intensity value T.sub.1 may be automatically determined by the position detection system 108 by a first pass analysis of the image and/or the scan line. The predetermined threshold intensity value T.sub.1 indicates the minimum local contrast that needs to be satisfied by intensity values to identify the presence of a sheet of light in the image.
(36) In one embodiment, the first minimum intensity value y.sub.min1 is determined based upon a first maximum second derivative value z.sub.max1 associated with the first pixel position x.sub.min1. When the scan line is traversed, for each current pixel position x.sub.i within the interval [x.sub.1, x.sub.n], the position detection system 108 estimates the second derivative value of the intensity at that position and determines whether it has reached the first maximum derivative value z.sub.max1. In some embodiments the first maximum second derivative value z.sub.max1 is a local maximum such that all second derivative values z.sub.i of preceding pixel positions and second derivative values of the following pixel positions, in the direction of the scan of the pixel positions, are smaller than the first maximum second derivative value z.sub.max1. In other embodiments the first maximum second derivative value z.sub.max1 is a local maximum such that all second derivative values z.sub.i of preceding pixel positions are smaller or equal than the first maximum second derivative value z.sub.max1 and all second derivative values z.sub.i of succeeding pixel positions are strictly smaller than the first maximum second derivative value z.sub.max1. When the position detection system 108 determines that the first maximum second derivative value z.sub.max1 has been reached at position x.sub.min1, the intensity value y.sub.min1 associated with that same position is identified as the first minimum intensity value y.sub.min1. In some embodiments, the first maximum second derivative value z.sub.max1 is one of multiple local maximum second derivative values (not illustrated) associated with pixel positions preceding the ingress pixel position. In these embodiments the first maximum second derivative value z.sub.max1 is selected as the maximum associated with the pixel position preceding ingress pixel position x.sub.I, i.e., the maximum which is the closest to the zero crossing position of the second derivative (or in other words the pixel position with the minimum intensity value that is the closest to the point of inflection of the intensity curve, where the point of inflection has the coordinates (x.sub.I, y.sub.I)).
(37) While in some embodiments the first minimum intensity value y.sub.min1 is determined based on the first maximum second derivative value z.sub.max1, in other embodiments, the first minimum intensity value y.sub.min1 is identified only with respect to intensity values of the intensity profile without reference to the second derivative values. For example, when the intensity profile is scanned from the first pixel position x.sub.1 to a current pixel position x.sub.i, the position detection system 108 may keep track of the latest minimum in intensity values recorded (i.e., the latest minimum being smaller than all succeeding intensity values).
(38) The first maximum intensity value y.sub.max1 is determined based on a first minimum second derivative value z.sub.min1 associated with the second pixel position x.sub.max1. In some embodiments the first minimum second derivative value z.sub.min1 is a local minimum such that all second derivative values z.sub.i of preceding pixel positions and second derivative values of the following pixel positions, in the direction of the scan of the pixel positions, are greater than the first minimum second derivative value z.sub.min1. In other embodiments the first minimum second derivative value z.sub.min1 is a local minimum such that all second derivative values z.sub.i of preceding pixel positions are strictly greater than the first minimum second derivative value z.sub.min1 and all second derivative values z.sub.i of succeeding pixel positions are greater or equal to first minimum second derivative value z.sub.min1. When the position detection system 108 determines that the first minimum second derivative value z.sub.min1 has been reached at position x.sub.min1, the intensity value y.sub.max1 associated with that same position is identified as the first maximum intensity value y.sub.max1. In some embodiments, the first minimum second derivative value z.sub.min1 is one of multiple local minimum second derivative values (not illustrated) associated with pixel positions following the ingress pixel position. In these embodiments the first minimum second derivative value z.sub.min1 is selected as the minimum associated with the pixel position immediately following the ingress pixel position x.sub.I in the direction of the scan of the pixel positions (i.e., the minimum which is the closest to the zero crossing position of the second derivative or in other words the pixel position with the maximum intensity value that is the closest to the point of inflection of the intensity curve, where the point of inflection has the coordinates (x.sub.I, y.sub.I)).
(39) While in some embodiments the first maximum intensity value y.sub.max1 is determined based on the first minimum second derivative value z.sub.min1, in other embodiments, the first maximum intensity value y.sub.max1 is identified only with respect to intensity values of the intensity profile without reference to the second derivative values. For example, when the intensity profile is scanned from the first pixel position x.sub.1 to a current pixel position x.sub.i, the position detection system 108 keeps track of the latest maximum in intensity values recorded (i.e., the latest maximum being greater or equal to all succeeding intensity values, for example the highest values prior to reaching the flat region of the intensity profile).
(40) Once the ingress pixel position x.sub.I associated with the ingress zero-crossing of the second derivative is determined, the position detection system 108 determines an egress pixel position x.sub.E associated with an egress zero-crossing second derivative value. The scan line of pixels (e.g., scan line 204b) is continued to be traversed from the ingress pixel position x.sub.I to a current position x.sub.i. For each current pixel position x.sub.i within the interval [x.sub.I, x.sub.n], the position detection system 108 estimates the second derivative value of the intensity at that position and determines whether it has reached a second zero-crossing of the second derivative. In some embodiments, the pixel position x.sub.i=x.sub.E is identified as corresponding to a second derivative of value 0 preceded with a pixel position corresponding to a second derivative value that is negative. In other embodiments, the pixel position x.sub.E is identified as a pixel position located between a first pixel position associated with a strictly negative second derivative value (which is referred herein as a second negative pixel position) and a second pixel position association with a strictly positive second derivative value (which is referred herein as a second positive pixel position). For example, the pixel position x.sub.E is an interpolation of the second negative pixel position and the first positive pixel position (e.g., using a sub-pixel interpolation technique such as linear interpolation).
(41) In an embodiment, the egress pixel position is between a third pixel position x.sub.max2 with a second maximum intensity value y.sub.max2 of the intensity profile 306a and a fourth pixel position x.sub.min2 with a second minimum intensity value y.sub.min2 of the intensity profile, where the difference between the second maximum intensity value y.sub.max2 and the second minimum intensity value y.sub.min2 is greater than a predetermined threshold intensity value (T.sub.2). According to these embodiments, the egress pixel position x.sub.E is validated as corresponding to the egress zero-crossing second derivative value if a first ingress pixel position has been found and the egress pixel position x.sub.E is located between the third pixel position x.sub.max2 and the fourth pixel position x.sub.min2 and that the corresponding intensity values satisfy the threshold condition (i.e., the difference between the second maximum intensity value y.sub.max2 and the second minimum intensity value y.sub.min2 is greater than a predetermined threshold intensity value (T.sub.2)). Alternatively, if the intensity threshold condition is not satisfied and a pixel position associated to the zero-crossing of the derivative curve is not identified as the egress pixel position x.sub.E, in this case the position detection system 108 proceeds to analyzing the second derivative curve to locate another pixel position associated with a zero-crossing of the second derivative value. The predetermined threshold intensity value T.sub.2 may be input to the position detection system 108 by a user and may be dependent on the type of applications. Alternatively, the predetermined threshold intensity value T.sub.2 may be automatically determined by the position detection system 108 by a first pass analysis of the image and/or the scan line. While in some embodiments, the threshold intensity value T.sub.2 can be different from the threshold intensity value T.sub.1, in other embodiments, the two threshold values are identical. The predetermined threshold intensity value T.sub.2 indicates the minimum local contrast that needs to be satisfied by intensity values to identify the presence of a sheet of light in the image.
(42) In one embodiment, the second maximum intensity value y.sub.max2 is determined based upon a second minimum second derivative value z.sub.min2 associated with the third pixel position x.sub.max2. When the scan line is traversed, for each current pixel position x.sub.i within the interval [x.sub.I, x.sub.n], the position detection system 108 estimates the second derivative value of the intensity at that position and determines whether it has reached the second minimum derivative value z.sub.min2. In some embodiments the second minimum second derivative value z.sub.min2 is a local minimum such that all second derivative values z.sub.i of preceding pixel positions and second derivative values of the following pixel positions, in the direction of the scan of the pixel positions, are greater than the second minimum second derivative value z.sub.min2. In other embodiments the second minimum second derivative value z.sub.min2 is a local minimum such that all second derivative values z.sub.i of preceding pixel positions are greater than or equal to the second minimum second derivative value z.sub.min2 and all second derivative values z.sub.i of succeeding pixel positions are strictly greater than the second minimum second derivative value z.sub.min2. When the position detection system 108 determines that the second minimum second derivative value z.sub.min2 has been reached at position x.sub.max2, the intensity value y.sub.max2 associated with that same position is identified as the second maximum intensity value y.sub.max2. In some embodiments, the second minimum second derivative value z.sub.min2 is one of multiple local minimum second derivative values (not illustrated) associated with pixel positions preceding the egress pixel position. In these embodiments the second minimum second derivative value z.sub.min2 is selected as the minimum associated with the pixel position immediately preceding egress pixel position x.sub.E, i.e., the minimum which is the closest to the zero crossing position of the second derivative (or in other words the pixel position with the maximum intensity value that is the closest to the point of inflection of the intensity curve, where the point of inflection has the coordinates (x.sub.E, y.sub.E)).
(43) While in some embodiments the second maximum intensity value y.sub.max2 determined based on the second minimum second derivative value z.sub.min2, in other embodiments, the second maximum intensity value y.sub.max2 is identified only with respect to intensity values of the intensity profile without reference to the second derivative values. For example, when the intensity profile is scanned from the first pixel position x.sub.I to a current pixel position x.sub.i, the position detection system 108 may keep track of the latest maximum in intensity values recorded (i.e., the latest maximum being greater than all succeeding intensity values).
(44) The second minimum intensity value y.sub.min2 is determined based on a second maximum second derivative value z.sub.max2 associated with the second pixel position x.sub.min2. In some embodiments the second maximum second derivative value z.sub.max2 is a local maximum such that all second derivative values z.sub.i of preceding pixel positions and second derivative values of the following pixel positions, in the direction of the scan of the pixel positions, are smaller than the second maximum second derivative value z.sub.max2. In other embodiments the second maximum second derivative value z.sub.max2 is a local maximum such that all second derivative values z.sub.i of preceding pixel positions are strictly smaller than the second maximum second derivative value z.sub.max2 and all second derivative values z.sub.i of succeeding pixel positions are smaller than or equal to the second maximum second derivative value z.sub.max2. When the position detection system 108 determines that the second maximum second derivative value z.sub.max2 has been reached at position x.sub.min2, the intensity value y.sub.min2 associated with that same position is identified as the second minimum intensity value y.sub.min2. In some embodiments, the second maximum second derivative value z.sub.max2 is one of multiple local maximum second derivative values (not illustrated) associated with pixel positions following the egress pixel position. In these embodiments the second maximum second derivative value z.sub.max2 is selected as the maximum associated with the pixel position immediately following the egress pixel position x.sub.E in the direction of the scan of the pixel positions (i.e., the maximum which is the closest to the zero crossing position of the second derivative or in other words the pixel position with the minimum intensity value that is the closest to the point of inflection of the intensity curve, where the point of inflection has the coordinates (x.sub.E, y.sub.E)).
(45) While in some embodiments the second minimum intensity value y.sub.min2 is determined based on the second maximum second derivative value z.sub.max2, in other embodiments, the second minimum intensity value y.sub.min2 is identified only with respect to intensity values of the intensity profile without reference to the second derivative values. For example, when the intensity profile is scanned from the first pixel position x.sub.E to a current pixel position x.sub.i, the position detection system 108 keeps track of the latest minimum in intensity values recorded (i.e., the latest minimum being greater or equal to all succeeding intensity values, for example the highest values prior to reaching the flat region of the intensity profile).
(46) Once the ingress pixel position and the egress pixel position are determined, the position of the sheet of light is identified as the midpoint pixel position between the two positions. The position detection system then outputs the midpoint pixel position as the position of the sheet of light. In some embodiments, the position of the sheet of light is a sub-pixel position.
(47) The techniques of the present invention can be used to determine the position of a sheet of light in a scan line of an image, when the intensity profile of the sheet takes several different shapes. For example,
(48)
(49) Based on the second derivative values, the position detection system 108 determines an ingress pixel position x.sub.I associated with an ingress zero-crossing second derivative value. Thus the position detection system 108 determines the pixel position x.sub.I by scanning the second derivative values and locating an ingress zero-crossing second derivative value. In one embodiment, the scan line of pixels (e.g., scan line 204a) is traversed from a first pixel position x.sub.1 to a last pixel position x.sub.n. In some embodiments a first pixel position x.sub.1 and the last pixel position x.sub.n delimit the entire line of pixels (e.g., the line 204a), while in other embodiments these two positions delimit a portion of the scan line 204a illustrated in
(50) In some embodiments, the ingress pixel position x.sub.i is located between a first pixel position x.sub.min1 associated with a first minimum intensity value y.sub.min1 of the intensity profile 406a and a second pixel position x.sub.max1 with a first maximum intensity value y.sub.max1 of the intensity profile, where the difference between the first maximum intensity value y.sub.max1 and the first minimum intensity value y.sub.min1 is greater than a predetermined threshold intensity value (T1). According to these embodiments, the ingress pixel position x.sub.I is validated as corresponding to the ingress zero-crossing second derivative value if it is located between the first pixel position x.sub.min1 and the second pixel position x.sub.max1 and that the corresponding intensity values satisfy the threshold condition (i.e., that the difference between the first maximum intensity value ymax1 and the first minimum intensity value ymin1 is greater than a predetermined threshold intensity value (T.sub.1)). Alternatively, if the intensity threshold condition is not satisfied, a pixel position associated to the zero-crossing of the derivative curve is not identified as the ingress pixel position x.sub.I, in this case the position detection system 108 proceeds to analyzing the second derivative curve to locate another pixel position associated with a zero-crossing of the second derivative value. In one embodiment, the predetermined threshold intensity value T.sub.1 may be input to the position detection system 108 by a user and may be dependent on the type of applications. In other embodiments, the predetermined threshold intensity value T.sub.1 may be automatically determined by the position detection system 108 by a first pass analysis of the image and/or the scan line. The predetermined threshold intensity value T.sub.1 indicates the minimum local contrast that needs to be satisfied by intensity values to identify the presence of a sheet of light in the image.
(51) In one embodiment, the first minimum intensity value y.sub.min1 is determined based upon a first maximum second derivative value z.sub.max1 associated with the first pixel position x.sub.min1. Similarly to the embodiments described with reference to
(52) While in some embodiments the first minimum intensity value y.sub.min1 is determined based on the first maximum second derivative value z.sub.max1, in other embodiments, the first minimum intensity value y.sub.min1 is identified only with respect to intensity values of the intensity profile without reference to the second derivative values. For example, when the intensity profile is scanned from the first pixel position x.sub.1 to a current pixel position x.sub.i, the position detection system 108 may keep track of the latest minimum in intensity values recorded (i.e., the latest minimum being smaller than all succeeding intensity values).
(53) The first maximum intensity value y.sub.max1 is determined based on a first minimum second derivative value z.sub.min1 associated with the second pixel position x.sub.max1. In some embodiments the first minimum second derivative value z.sub.min1 is a local minimum such that all second derivative values z.sub.i of preceding pixel positions and second derivative values of the following pixel positions, in the direction of the scan of the pixel positions, are greater than the first minimum second derivative value z.sub.min1. In other embodiments the first minimum second derivative value z.sub.min1 is a local minimum such that all second derivative values z.sub.i of preceding pixel positions are strictly greater than the first minimum second derivative value z.sub.min1 and all second derivative values z.sub.i of succeeding pixel positions are greater than or equal to the first minimum second derivative value z.sub.min1. When the position detection system 108 determines that the first minimum second derivative value z.sub.min1 has been reached at position x.sub.min1, the intensity value y.sub.max1 associated with that same position is identified as the first maximum intensity value y.sub.max1.
(54) While in some embodiments the first maximum intensity value y.sub.max1 is determined based on the first minimum second derivative value z.sub.min1, in other embodiments, the first maximum intensity value y.sub.max1 is identified only with respect to intensity values of the intensity profile without reference to the second derivative values. For example, when the intensity profile is scanned from the first pixel position x1 to a current pixel position x.sub.i, the position detection system 108 keeps track of the latest maximum in intensity values recorded (i.e., the latest maximum being greater or equal to all succeeding intensity values, for example the highest values prior to reaching the flat region of the intensity profile).
(55) Once the ingress pixel position x.sub.I associated with the ingress zero-crossing of the second derivative is determined, the position detection system 108 determines an egress pixel position x.sub.E associated with an egress zero-crossing second derivative value. The scan line of pixels (e.g., scan line 204a) is continued to be traversed from the ingress pixel position x.sub.I to a current position x.sub.i. For each current pixel position x.sub.i within the interval [x.sub.I, x.sub.n], the position detection system 108 estimates the second derivative value of the intensity at that position and determines whether it has reached a second zero-crossing of the second derivative. In some embodiments, the pixel position x.sub.i=x.sub.E is identified as corresponding to a second derivative of value 0 preceded with a pixel position x.sub.i-1 corresponding to a second derivative value that is negative. In other embodiments, the pixel position x.sub.E is identified as a pixel position located between a first pixel position associated with a strictly negative second derivative value (which is referred herein as a second negative pixel position) and a second pixel position association with a strictly positive second derivative value (which is referred herein as a second positive pixel position). For example, the pixel position x.sub.E is an interpolation of the second negative pixel position and the first positive pixel position (e.g., using a sub-pixel interpolation technique).
(56) In an embodiment, the egress pixel position is between a third pixel position x.sub.max2 with a second maximum intensity value y.sub.max2 of the intensity profile 406a and a fourth pixel position x.sub.min2 with a second minimum intensity value y.sub.min2 of the intensity profile, where the difference between the second maximum intensity value y.sub.max2 and the second minimum intensity value y.sub.min2 is greater than a predetermined threshold intensity value (T.sub.2). In the illustrated example of
(57) In one embodiment, the second maximum intensity value y.sub.max2 is determined based upon a second minimum second derivative value z.sub.min2 associated with the third pixel position x.sub.max2. When the scan line is traversed, for each current pixel position xi within the interval [x.sub.I, x.sub.n], the position detection system 108 estimates the second derivative value of the intensity at that position and determines whether it has reached the second minimum derivative value z.sub.min1. In some embodiments the second minimum second derivative value z.sub.min2 is a local minimum such that all second derivative values z.sub.i of preceding pixel positions and second derivative values of the following pixel positions, in the direction of the scan of the pixel positions, are greater than the second minimum second derivative value z.sub.min2. In other embodiments the second minimum second derivative value z.sub.min2 is a local minimum such that all second derivative values z.sub.i of preceding pixel positions are greater than or equal to the second minimum second derivative value z.sub.min2 and all second derivative values z.sub.i of succeeding pixel positions are strictly greater than the second minimum second derivative value z.sub.min2. When the position detection system 108 determines that the second minimum second derivative value z.sub.min2 has been reached at position x.sub.max2, the intensity value y.sub.max2 associated with that same position is identified as the second maximum intensity value y.sub.max2.
(58) While in some embodiments the second maximum intensity value y.sub.max2 is determined based on the second minimum second derivative value z.sub.min2, in other embodiments, the second maximum intensity value y.sub.max2 is identified only with respect to intensity values of the intensity profile without reference to the second derivative values. For example, when the intensity profile is scanned from the first pixel position x.sub.I to a current pixel position x.sub.i, the position detection system 108 may keep track of the latest maximum in intensity values recorded (i.e., the latest maximum being greater than all succeeding intensity values).
(59) The second minimum intensity value y.sub.min2 is determined based on a second maximum second derivative value z.sub.max2 associated with the second pixel position x.sub.min2. In some embodiments the second maximum second derivative value z.sub.max2 is a local maximum such that all second derivative values z.sub.i of preceding pixel positions and second derivative values of the following pixel positions, in the direction of the scan of the pixel positions, are smaller than the second maximum second derivative value z.sub.max2. In other embodiments the second maximum second derivative value z.sub.max2 is a local maximum such that all second derivative values z.sub.i of preceding pixel positions are strictly smaller than the second maximum second derivative value z.sub.max2 and all second derivative values z.sub.i of succeeding pixel positions are smaller than or equal to the second maximum second derivative value z.sub.max2. When the position detection system 108 determines that the second maximum second derivative value z.sub.max2 has been reached at position x.sub.min2, the intensity value y.sub.min2 associated with that same position is identified as the second minimum intensity value y.sub.min2. In some embodiments, the second maximum second derivative value z.sub.max2 is one of multiple local maximum second derivative values (not illustrated) associated with pixel positions following the egress pixel position. In these embodiments the second maximum second derivative value z.sub.max2 is selected as the maximum associated with the pixel position immediately following the egress pixel position x.sub.E in the direction of the scan of the pixel positions (i.e., the maximum which is the closest to the zero crossing position of the second derivative or in other words the pixel position with the minimum intensity value that is the closest to the point of inflection of the intensity curve, where the point of inflection has the coordinates (x.sub.E, y.sub.E)).
(60) While in some embodiments the second minimum intensity value y.sub.min2 is determined based on the second maximum second derivative value z.sub.max2, in other embodiments, the second minimum intensity value y.sub.min2 is identified only with respect to intensity values of the intensity profile without reference to the second derivative values. For example, when the intensity profile is scanned from the first pixel position x.sub.E to a current pixel position x.sub.i, the position detection system 108 keeps track of the latest minimum in intensity values recorded (i.e., the latest minimum being greater or equal to all succeeding intensity values, for example the highest values prior to reaching the flat region of the intensity profile).
(61) Once the ingress pixel position x.sub.I and the egress pixel position x.sub.E are determined, the position of the sheet of light 412 is identified as the midpoint pixel position between the two positions. The position detection system then outputs the position of the sheet of light. As illustrated in
(62)
(63) While the exemplary embodiment of
(64) In another embodiment, the first pixel position x.sub.0 and the second pixel position x.sub.0 may both satisfy the threshold condition, in this case, the position detection system 108 may select one of the two pixel positions to be the ingress pixel position based on additional criteria. For example, the ingress pixel position may be selected as the pixel position associated with the highest local contrast between its associated maximum intensity value and minimum intensity value. In other embodiments, the ingress pixel position is selected as the pixel position which is the closest to the peak of the intensity profile (where the peak can include a flat region). While the exemplary embodiments provided herein illustrate two potential ingress pixel positions, more than two ingress positions may be detected and the techniques described above can be used to select one ingress pixel position from the set of ingress pixel positions detected.
(65) Similarly to the examples provided for the ingress pixel position, the second derivative of the intensity profile may further include more than one zero-crossing pixel positions (once the ingress position is identified) that are potential candidates for the egress pixel positions. In this case, similar methods for selecting the egress pixel position can be used.
(66) The operations in the following flow diagrams will be described with reference to the exemplary embodiments of the other figures. However, it should be understood that the operations of the flow diagrams can be performed by embodiments of the invention other than those discussed with reference to the other figures, and the embodiments of the invention discussed with reference to these other figures can perform operations different than those discussed with reference to the flow diagrams.
(67)
(68)
(69)
(70) While embodiments described above discuss scanning an intensity profile or a second derivative curve from a first pixel position x.sub.1 to a last pixel position x.sub.n, and detecting the egress pixel position following the detection of the ingress pixel position, the present invention is not so limited. In alternative embodiments, the intensity profile and second derivative curve can be traversed in other directions and the detection of the ingress and egress pixel position can be performed in another order.
(71) The embodiments of the present invention overcome the limitations of standard approaches for detecting the position of a sheet of light in an image and enable a robust and accurate extraction of the position of a sheet of light in varying scenarios with a single set of parameters. In addition, the mechanism described herein provide a computationally efficient technique that can be implemented on dedicated hardware (such as a Field-Programmable Gate Array (FPGA)), and which can detect the position of the sheet of light when image acquisition rates are very high (which is typical for this type of applications).
(72)
(73) Alternatively, the data processing system 1000 is a system on a chip or Field-Programmable gate array. One or more such data processing systems 1000 may be utilized to implement the functionality of the position detection system 108 as illustrated in
(74) The data processing system 1000 is an electronic device which stores and transmits (internally and/or with other electronic devices over a network) code (which is composed of software instructions and which is sometimes referred to as computer program code or a computer program) and/or data using machine-readable media (also called computer-readable media), such as machine-readable storage media 1010 (e.g., magnetic disks, optical disks, read only memory (ROM), flash memory devices, phase change memory) and machine-readable transmission media (also called a carrier) (e.g., electrical, optical, radio, acoustical or other form of propagated signals—such as carrier waves, infrared signals), which is coupled to the processor(s) 1005, and machine-readable transmission media (also called a carrier) (e.g., electrical, optical, radio, acoustical or other form of propagated signals—such as carrier waves, infrared signals). For example, the depicted machine readable storage media 1010 may store position detection program code 1030 that, when executed by the processor(s) 1005, causes the data processing system 1000 (e.g., position detection system 108) to locate the position of a sheet of light in an image. Thus, an electronic device (e.g., a computer or an FPGA) includes hardware and software, such as a set of one or more processors coupled to one or more machine-readable storage media to store code for execution on the set of processors and/or to store data. For instance, an electronic device may include non-volatile memory containing the code since the non-volatile memory can persist the code even when the electronic device is turned off, and while the electronic device is turned on that part of the code that is to be executed by the processor(s) of that electronic device is copied from the slower non-volatile memory into volatile memory (e.g., dynamic random access memory (DRAM), static random access memory (SRAM)) of that electronic device. Typical electronic devices also include a set or one or more physical network interface(s) to establish network connections (to transmit and/or receive code and/or data using propagating signals) with other electronic devices. One or more parts of an embodiment of the invention may be implemented using different combinations of software, firmware, and/or hardware.
(75) The data processing system 1000 also includes an audio input/output subsystem 1015 which may include a microphone and/or a speaker for, for example, playing back music or other audio, receiving voice instructions to be executed by the processor(s) 1005, playing audio notifications, etc. A display controller and display device 1020 provides a visual user interface for the user, e.g., GUI elements or windows.
(76) The data processing system 1000 also includes one or more input or output (“I/O”) devices and interfaces 1025, which are provided to allow a user to provide input to, receive output from, and otherwise transfer data to and from the system. These I/O devices 1025 may include a mouse, keypad, keyboard, a touch panel or a multi-touch input panel, camera, frame grabber, optical scanner, network interface, modem, other known I/O devices or a combination of such I/O devices. The touch input panel may be a single touch input panel which is activated with a stylus or a finger or a multi-touch input panel which is activated by one finger or a stylus or multiple fingers, and the panel is capable of distinguishing between one or two or three or more touches and is capable of providing inputs derived from those touches to the processing system 1000.
(77) The I/O devices and interfaces 1025 may also include a connector for a dock or a connector for a USB interface, FireWire, Thunderbolt, Ethernet, etc., to connect the system 1000 with another device, external component, or a network. Exemplary I/O devices and interfaces 1025 also include wireless transceivers, such as an IEEE 802.11 transceiver, an infrared transceiver, a Bluetooth transceiver, a wireless cellular telephony transceiver (e.g., 2G, 3G, 4G), or another wireless protocol to connect the data processing system 1000 with another device, external component, or a network and receive stored instructions, data, tokens, etc. It will be appreciated that one or more buses may be used to interconnect the various components shown in
(78) It will be appreciated that additional components, not shown, may also be part of the system 1000, and, in certain embodiments, fewer components than that shown in
(79) While the flow diagrams in the figures show a particular order of operations performed by certain embodiments of the invention, it should be understood that such order is exemplary (e.g., alternative embodiments may perform the operations in a different order, combine certain operations, overlap certain operations, etc.).
(80) Additionally, while the invention has been described in terms of several embodiments, those skilled in the art will recognize that the invention is not limited to the embodiments described, can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of limiting.