System and method for shape detection
The shape detection method addresses the challenge of camera calibration in ADAS by generating a series of numbers from binary images of target objects, comparing them to pre-defined shapes, and calibrating camera parameters, resulting in a robust and efficient system for ADAS applications.
Patent Information
- Application Number
- PCT/EP2024/074992
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-08
- Filing Date
- 2024-09-06
- Publication Date
- 2025-03-13
AI Technical Summary
Existing camera calibration methods for Advanced Driver Assistance Systems (ADAS) rely on objects of specific geometry, which are not robust against external factors like vibrations and vehicle suspension movements, leading to corrupted input data and failure of computer vision applications.
A shape detection method that captures an image of a target object, generates a binary image, and uses a lossless data compression algorithm to create a series of numbers representing continuous pixels. These numbers are then compared to pre-defined-shape series of numbers to determine the shape of the target object, allowing for calibration of camera extrinsic parameters.
The method provides a robust and improved shape detection and camera calibration system, capable of handling irregular shapes and external disturbances, ensuring seamless operation of ADAS applications.
Smart Images

Figure EP2024074992_13032025_PF_FP_ABST
Abstract
Description
SYSTEM AND METHOD FOR SHAPE DETECTIONTECHNICAL FIELD
[0001] This disclosure relates to a method and a system for shape detection, e.g., for use in calibrating vehicle camera.BACKGROUND
[0002] Usage of camera in Advanced Driver Assistance System (ADAS) functionalities are important in vehicles such as cars, which can make the journey safe and secured. Inputs from camera contains very useful information for the ADAS based systems.
[0003] Most of the ADAS features depend on camera(s) on the vehicle to detect objects to ensure seamless working of the computer vision related applications such as pedestrian detection, sign board detection, lane detection. The field-of-view (FOV) of the camera on the vehicles are required to be proper in order to ensure seamless working of the computer vision related applications.
[0004] However, due to external circumstance like vibrations, vehicle suspension movement and other factors, the FOV of the camera on the vehicles might change. In that case, input data from the camera might get corrupted and consequently the computer vision related applications such as pedestrian detection, sign board detection, lane detection might fail.
[0005] Calibration of a camera is required for setting a proper FOV for the camera. However, the state-of-the-art algorithms for calibrating the camera are bound to use objects of some specific geometry.
[0006] Therefore, there is a need of developing a robust and improved method of shape detection and vehicle camera calibration.SUMMARY
[0007] According to a first aspect of the present disclosure, a shape detection method is provided. The shape detection method comprises: a step of capturing, by an image capturing device, an image of a target object; a step of generating, by a processor, a binary image of the target object based on the image of the target object, wherein an intensity of each pixel in the binary image is either a first value or a second value, the second value being different from the first value; a step of generating, by the processor, a series of numbers for the target object basedon the binary image using a lossless data compression algorithm, each number in the series of numbers representing a count of continuous pixels having an intensity of the first value of the binary image and each number in the series of numbers corresponding to a serial index; a step of determining, by the processor, a degree of similarity between the series of numbers for the target obj ect and each of a plurality of pre-defined-shape series of numbers, each of the plurality of pre-defined-shape series of numbers corresponding to a pre-defined shape; a step of determining, by the processor, a shape on the target object as a pre-defined shape corresponding to a pre-defined-shape series of numbers which has a maximum degree of similarity with the series of numbers for the target object.
[0008] The shape detection method can further comprise: a step of extracting, by the processor, shape features from the shape on the target object.
[0009] The shape detection method can further comprise: a step of calibrating, by the processor, extrinsic parameters of a camera based on the extracted shape features and intrinsic parameters of the camera using a calibration algorithm.
[0010] The degree of similarity between the series of numbers for the target object and each of a plurality of pre-defmed-shape series of numbers can be a degree of similarity between a plot for the target object and each of a plurality of pre-defined-shape plots, wherein the plot for the target object can be generated based on the series of numbers, wherein each of the plurality of pre-defmed-shape plots can be generated based on a corresponding pre-defmed-shape series of numbers in the plurality of pre-defined-shape series of numbers.
[0011] The plurality of pre-defined-shape series of numbers can be obtained by: a step of generating, by the processor, a binary image for each of a plurality of training objects based on an image of the training object, each training object corresponding to a pre-defmed shape, wherein an intensity of each pixel in each binary image for each training object is either a first value or a second value, the second value being different from the first value; and a step of generating, by the processor, a pre-defined-shape series of numbers for each training object based on the binary image of the training object using the lossless data compression algorithm, each number in the pre-defined-shape series of numbers representing a count of continuous pixels having an intensity of the first value of the binary image of the training object and each number in the pre-defmed-shape series of numbers corresponding to a serial index.
[0012] The step of generating a binary image based on the image of the target object can comprise: a step of comparing an intensity of each pixel of the image with a preset threshold value; a step of replacing the intensity of the pixel with the second value if the intensity of thepixel in the image is greater than the preset threshold value; and a step of replacing the intensity of the pixel with the first value if the intensity of the pixel in the image is equal to or less than the preset threshold value.
[0013] The lossless data compression algorithm can be a Run Length Encoding algorithm.
[0014] The calibration algorithm can be Gradient Descent algorithm.
[0015] The first value can be 255 and the second value can be 0.
[0016] The shape features can comprise a centroid of each geometric figure of the shape, a distance between two centroids, and / or centroid row arrangement.
[0017] According to a second aspect of the present disclosure, a shape detection system is provided. The shape detection system comprises: an image capturing device configured to capture an image of a target object; and a processor connected to the image capturing device, wherein the processor is configured to: generate a binary image of the target object based on the image, wherein an intensity of each pixel in the binary image is either a first value or a second value, the second value being different from the first value; generate a series of numbers for the target object based on the binary image using a lossless data compression algorithm, each number in the series of numbers representing a count of continuous pixels having an intensity of the first value of the binary image and each number in the series of numbers corresponding to a serial index; determine a degree of similarity between the series of numbers for the target object and each of a plurality of pre-defined-shape series of numbers, each of the plurality of pre-defined-shape series of numbers corresponding to a pre -defined shape; determine a shape on the target object as a pre-defined shape corresponding to a pre-defined- shape series of numbers which has a maximum degree of similarity with the series of numbers for the target object.
[0018] The processor can be configured to extract shape features from the shape on the target object.
[0019] The processor can be configured to calibrate extrinsic parameters of a camera based on the extracted shape features and intrinsic parameters of the camera using a calibration algorithm.
[0020] The degree of similarity between the series of numbers for the target object and each of a plurality of pre-defmed-shape series of numbers can be a degree of similarity between a plot for the target object and each of a plurality of pre-defined-shape plots, wherein the plot for the target object can be generated based on the series of numbers, wherein each of the pluralityof pre-defined-shape plots can be generated based on a corresponding pre-defmed-shape series of numbers in the plurality of pre-defined-shape series of numbers.
[0021] The plurality of pre-defined-shape series of numbers can be obtained by: generating, by the processor, a binary image for each of a plurality of training objects based on an image of the training object, each training object corresponding to a pre-defined shape, wherein an intensity of each pixel in each binary image for each training object is either a first value or a second value, the second value being different from the first value; generating, by the processor, a pre-defmed-shape series of numbers for each training object based on the binary image of the training object using the lossless data compression algorithm, each number in the pre-defined-shape series of numbers representing a count of continuous pixels having an intensity of the first value of the binary image of the training object and each number in the pre-defined-shape series of numbers corresponding to a serial index.
[0022] The binary image can be generated based on the image of the target object by: comparing an intensity of each pixel of the image with a preset threshold value; replacing the intensity of the pixel with the second value if the intensity of the pixel in the image is greater than the preset threshold value; and replacing the intensity of the pixel with the first value if the intensity of the pixel in the image is equal to or less than the preset threshold value.
[0023] The shape features can comprise a centroid of each geometric figure of the shape, a distance between two centroids, and / or centroid row arrangement.
[0024] According to a third aspect of the present disclosure, a computer program element is provided. The computer program element includes program instructions, which, when executed by one or more processors, cause the one or more processors to perform the method as described herein.
[0025] According to a fourth aspect of the present disclosure, a computer-readable medium is provided. The computer-readable medium includes program instructions, which, when executed by one or more processors, cause the one or more processors to perform the method as described herein.
[0026] The dependent claims define some examples associated with the system and method, respectively.BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The present disclosure will be better understood with reference to the detailed description when considered in conjunction with the non-limiting examples and the accompanying drawings, in which:- FIG. 1 A shows a schematic illustration of a shape detection system according to some embodiments.- FIG. IB shows a schematic illustration of a shape detection system in use for detecting a shape on a target object according to some embodiments.- FIG. 2 shows an example of a target board.- FIG.3A shows an example of an image of a target object.- FIG. 3B and 3C show a binary image generated based on the image of FIG. 3 A.- FIG. 4 shows a plot depicting a relationship between each number representing a count of continuous pixels having an intensity of the first value and the serial index corresponding to each number for the binary image of FIG. 3B.- FIG. 5 shows a shape on the target object determined as a pre-defined shape, wherein the pre-defined shape is referenced to or corresponds to a pre-defined-shape plot which has a maximum degree of similarity with the plot shown in FIG. 4 for the target object.- FIGs.6A to 6D show an example of an image for each of 4 training objects having a pre-defined shape of a circle, a triangle, a pentagon, and a hexagon, respectively.- FIGs.7A to 7D show an example of a binary image generated based on the image of FIGs.6A to 6D respectively.- FIGs.8A to 8D show an example of a plot depicting a relationship between each number representing the count of continuous pixels having an intensity of the first value and the serial index corresponding to each number for the binary image of FIGs.7A to 7D, respectively.- FIG.9 shows another example of an image of a target object.- FIG. 10 shows an example of a binary image generated based on the image of FIG. 9.- FIG. 11 shows a shape on the target object determined as a pre-defined shape, wherein the pre-defined shape is referenced to or corresponds to a pre-defined-shape plot which has a maximum degree of similarity with the plot for the target object.- FIG. 12 is a flow chart depicting a shape detection method according to some embodiments.DETAILED DESCRIPTION
[0028] The following detailed description refers to the accompanying drawings that show, by way of illustration, specific details and embodiments in which the disclosure may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the disclosure. Other embodiments may be utilized and structural, and logical changes may be made without departing from the scope of the disclosure. The various embodiments are not necessarily mutually exclusive, as some embodiments can be combined with one or more other embodiments to form new embodiments.
[0029] Embodiments described in the context of one of the systems or methods are analogously valid for the other systems or methods.
[0030] Features that are described in the context of an embodiment may correspondingly be applicable to the same or similar features in the other embodiments. Features that are described in the context of an embodiment may correspondingly be applicable to the other embodiments, even if not explicitly described in these other embodiments. Furthermore, additions and / or combinations and / or alternatives as described for a feature in the context of an embodiment may correspondingly be applicable to the same or similar feature in the other embodiments.
[0031] In the context of various embodiments, the articles “a”, “an” and “the” as used with regard to a feature or element include a reference to one or more of the features or elements.
[0032] As used herein, the term “and / or” includes any and all combinations of one or more of the associated listed items.
[0033] As used herein, the term “data” may be understood to include information in any suitable analog or digital form, for example, provided as a file, a portion of a file, a set of files, a signal or stream, a portion of a signal or stream, a set of signals or streams, and the like. The term data, however, is not limited to the aforementioned examples and may take various forms and represent any information as understood in the art.
[0034] As used herein, the term “processor” refers to, or forms part of, or include an Application Specific Integrated Circuit (ASIC); an electronic circuit; a combinational logic circuit; a field programmable gate array (FPGA) that executes code; other suitable hardware components that provide the described functionality; or a combination of some or all of the above, such as in a system-on-chip. The processor may include non-transitory computer readable medium such as memory (shared, dedicated, or group) that stores code executed by the processor.
[0035] A computer program (also known as a program, software, software application, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, object, or other unit suitable for use in a computing environment. A computer program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), in a single file dedicated to the program, or in multiple coordinated files (e.g., files that store one or more modules, sub programs, or portions of code). A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a communication network.
[0036] According to an aspect of the disclosure, a shape detection system 100 is provided for detecting a shape 12. FIG. 1 A shows a schematic illustration of a shape detection system 100 according to some embodiments. FIG. IB shows a schematic illustration of a shape detection system 100 in use for detecting a shape 12 on a target object 10 according to some embodiments.
[0037] The shape detection system 100 can comprise an image capturing device 110 and a processor 120 connected to the image capturing device 110. The image capturing device 110 can be a camera or a video recorder. The processor 120 can comprise a local server and / or a cloud server. The shape detection system 100 is configured to implement a shape detection method 800 according to some embodiments of the present disclosure.
[0038] The image capturing device 110 can be configured to capture an image 14 of the target object 10, e.g., a target board 10. FIG. 2 shows an example of a target board 10. The image capturing device 110 can be a camera or a video recorder mounted on a vehicle, such as a car, a bus, a truck, a water vessel (e.g., a ship), a plane, or any 2-wheeled or more-wheeled vehicle etc. The shape 12 on the target object 10 can be a circle, an oval, a triangle, a pentagon, a hexagon, etc. The shape 12 on the target object 10 can be any irregular shape.
[0039] The processor 120 can be configured to generate a binary image 16 of the target object 10 based on the image 14 of the target object 10, wherein an intensity of each pixel in the binary image 16 is either a first value or a second value, the second value being different from the first value. For example, an intensity of each pixel of the image 14 is compared with a preset threshold value. If the intensity of the pixel in the image is greater than the preset threshold value, the intensity of the pixel is replaced with a second value (e.g., 0); and if theintensity of the pixel in the image is equal to or less than the preset threshold value, the intensity of the pixel is replaced with a first value (e.g., 255). The threshold value can be a value between the first value and the second value. In some embodiments, the binary image 16 may be a black and white image.
[0040] FIG.3A shows an example of an image 14 of a target object 10. As shown in FIG. 3A, the shape 12 on the target object 10 is an oval. FIG. 3B and FIG. 3C show a binary image 16 generated based on the image 14 of FIG. 3A. In the binary image 16 of FIG. 3B, the pixels having an intensity of a first value (e.g., 255) are shown as white color, while the pixels having an intensity of a second value (e.g., 0) are shown as black color.
[0041] In some embodiments, the processor 120 can be configured to assign unique labels to one or more of the pixels in the binary image 16. In some embodiments, the processor 12 can be configured to assign labels to all the pixels having an intensity of the first value on the binary image 16 using a clustering algorithm. The clustering algorithm can comprise K-Nearest Neighborhood (KNN) clustering algorithm.
[0042] The processor 120 can be configured to generate a series of numbers 28 for the target object 10 based on the binary image 16 of the target object 10 using a lossless data compression algorithm, each number in the series of numbers 28 representing a count 22 of continuous pixels having an intensity of the first value of the binary image 16 and each number in the series of numbers 28 corresponding to a serial index. The first value can be 255. The lossless data compression algorithm can be Run Length Encoding algorithm.
[0043] In some embodiments, the processor 120 can be configured to generate a second series of numbers for the target object 10 based on the binary image 16 using a lossless data compression algorithm, each number in the second series of numbers representing a count 24 of continuous pixels having an intensity of the same value of the binary image 16 and each number in the second series of numbers corresponding to a second serial index. The lossless data compression algorithm can be Run Length Encoding algorithm. The second series of numbers can be used to obtain a first series of numbers 28, each number in the first series of numbers 28 representing a count 22 of continuous pixels having an intensity of the first value of the binary image 16 and each number in the first series of numbers 28 corresponding to a first serial index.
[0044] The number of continuous pixels having an intensity of the first value (e.g., continuous white pixels) in the binary image 16 (e.g., the binary image 16 in FIG. 3B) can be counted in a pre -determined sequence to obtain the count 22 of continuous pixels having anintensity of the first value. For example, the pre-determined sequence can be from a first pixel to a last pixel in a direction of AA for each row, and from a first row to a last row in a direction of BB as shown in FIG. 3C. Each of the pixels in the binary image 16 can be checked to determine if the pixel has an intensity of the first value (e.g., check if each pixel is a white pixel) in a pre-determined sequence, e.g., from a first pixel to a last pixel in a direction of AA for each row, and from a first row to a last row in a direction of BB as shown in FIG. 3C.
[0045] The counting can start when the pixel is determined as a pixel having an intensity of the first value (e.g., when the pixel is determined as a white pixel), the counted number can start from 1 or any pre-defined number. The counting continues when the next pixel is also determined as a pixel having an intensity of the first value (e.g., when the next pixel is also determined as a white pixel), and the counted number increases to another integer (e.g., 2, or any predefined number). The counting can end when the pixel is determined as a pixel having an intensity of a value other from the first value (e.g., when the pixel is determined as a black pixel) until the counting restarts (i.e., a second round of counting begins). When the counting ends, the last counted number is recognized as a count of continuous pixels having an intensity of the first value (e.g., the count of continuous white pixels) of this first round of counting. The count of continuous pixels having an intensity of the first value in this first round of counting may be referred to as a first count.
[0046] The counting restarts, i.e., a second round of counting begins, when a pixel is determined as a pixel having an intensity of the first value (e.g., when a pixel is determined as a white pixel). When the second round of counting begins, the counted number may restart from 1 or any predefined number. The restarted counting (i.e., the second round of counting) continues when the next pixel is also determined as a pixel having an intensity of the first value (e.g., when the next pixel is also determined as a white pixel), and the counted number in the second round of counting increases to another integer (e.g., 2, or any predefined number). The second round of counting can end when the pixel is determined as a pixel having an intensity of a value other from the first value (e.g., when the pixel is determined as a black pixel) until a next round of counting (i.e., the third round of counting) begins. When the second round of counting ends, the last counted number is recognized as a count of continuous pixels having an intensity of the first value (e.g., the count of continuous white pixels) of the second round of counting. The count of continuous pixels having an intensity of the first value in this second round of counting may be referred to as a second count. The counting restarts (i.e., the thirdround of counting begins) when a pixel is determined as a pixel having an intensity of the first value (e.g., when a pixel is determined as a white pixel).
[0047] The third round of counting, alone or with one or many subsequent rounds of counting, can occur in a way similar to the first / second round of counting until the last pixel in the binary image 16.
[0048] As illustrated above, the number of continuous pixels having an intensity of the first value (e.g., continuous white pixels) in each round of counting is counted. In other words, the count of continuous pixels having an intensity of the first value (e.g., continuous white pixels) in each incurrence of continuous pixels having an intensity of the first value is obtained.
[0049] Take the binary image 16 of FIG.3C for example, in the above-mentioned predetermined sequence of counting (i.e., from a first pixel to a last pixel in a direction of AA for each row, and from a first row to a last row in a direction of BB as shown in FIG. 3C), the first incurrence of continuous white pixels would occur in the first row, and the second incurrence of continuous white pixels would occur in the second row, and the 7?-th incurrence of continuous white pixels would occur in the R -th row (where R represents the row number of pixels in FIG.3C) until the 23th incurrence of continuous white pixels. The 24thincurrence of continuous white pixels would occur from the 24throw to the 35throw. Each of the subsequent incurrence of continuous white pixels after the 24thincurrence would occur in each subsequent row after the 35throw. In other words, the (24+Y)-th incurrence (Y is an integer from 1 to 23) of continuous white pixels would occur in the (35+Y)-th row. The count of continuous white pixels in each incurrence of continuous white pixels from the 1stincurrence to last incurrence (i.e., 47thincurrence) is therefore obtained.
[0050] The first incurrence of continuous white pixels corresponds to or assigned with a pixel index / a serial index of 1 ; the second incurrence of continuous white pixels corresponds to or assigned with a pixel index / a serial index of 2; the A- th incurrence of continuous white pixels corresponds to or assigned with a pixel index / a serial index of N (N can be an integer).
[0051] It should be appreciated that the pre-determined sequence can be from a first pixel to a last pixel in a direction of BB for each column, and from a first column to a last column in a direction of A A as shown in FIG. 3C.
[0052] The count of pixels in the first incurrence of continuous pixels having an intensity of the first value (e.g., continuous white pixels) can be used as the number that corresponds to a serial index of 1 ; the count of pixels in the second incurrence of continuous pixels having an intensity of the first value (e.g., continuous white pixels) can be used as the number thatcorresponds to a serial index of 2; the count of pixels in the 7V-th incurrence of continuous pixels having an intensity of the first value (e.g., continuous white pixels) can be used as the number that corresponds to a serial index of N (N can be an integer As described above, a series of numbers for the target object 10 are generated, each number in the series of numbers corresponds to a serial index and represents a count 22 of continuous positive pixels for a corresponding incurrence of continuous positive pixels. The continuous positive pixels refer to continuous pixels having an intensity of the first value (e.g., continuous white pixels).
[0053] The processor 120 can be configured to determine a degree of similarity between the series of numbers 28 for the target object 10 and each of a plurality of pre-defmed-shape series of numbers 28a, each of the plurality of pre-defmed-shape series of numbers 28a corresponds to a pre-defined shape 12a. The series of numbers 28 for the target object 10 can be compared with each of the plurality of pre-defined-shape series of numbers 28a to determine the respective degree of similarity.
[0054] The processor 120 can be configured to determine a shape 12 on the target object 10 as a pre-defined shape 12a, wherein the pre-defined shape 12a corresponds to a pre-defined shape series of numbers 28a which has a maximum degree of similarity with the series of numbers 28 for the target object 10.
[0055] In some embodiments, the degree of similarity can be a correlation value between the series of numbers 28 for the target object 10 and each of a plurality of pre-defmed-shape series of numbers 28a. The degree of similarity can range from 0 to 1.
[0056] In some embodiments, normalization can be performed on the series of numbers 28 for the target object 10 and each of the plurality of pre-defined-shape series of numbers 28a. For performing normalization, each number in the series of numbers 28 is divided by a maximum value in the series of numbers 28, and each number in a pre-defmed-shape series of numbers 28a is divided by a maximum value in the pre-defined-shape series of numbers 28a. Quantitation can be performed on the series of numbers 28 and each of the plurality of predefined-shape series of numbers 28a. Decimation / interpolation can be performed on the series of numbers 28 and each of the plurality of pre-defined-shape series of numbers 28a such that the series of numbers 28 have equal quantity of numbers with each of the plurality of pre- defmed-shape series of numbers 28a. A correlation value between the series of numbers 28 and each of the plurality of pre-defmed-shape series of numbers 28a can be obtained, e.g., by performing dot wise product and sum between the series of numbers 28 and pre-defmed-shape series of numbers 28a.
[0057] In an example, after the above-mentioned normalization, quantitation, and / or decimation / interpolation, the series of numbers 28 for the target object 10 is [Bl, B2, B3, B4], the pre-defined-shape series of numbers for a circle shape is [Cl, C2, C3, C4], the pre-defined- shape series of numbers for a triangle shape is [Tl, T2, T3, T4], the pre-defined-shape series of numbers for a hexagon shape is [Hl, H2, H3, H4], the pre-defined-shape series of numbers for a pentagon shape is [Pl, P2, P3, P4]. The correlation value (referred to as BC) between the series of numbers 28 for the target object 10 and the pre-defined-shape series of numbers for a circle shape is: BC = (B1*C1)+ (B2*C2)+ (B3*C3)+ (B4*C4); the correlation value (referred to as BT) between the series of numbers 28 for the target object 10 and the pre-defined-shape series of numbers for a triangle shape is: BT = (B1*T1)+ (B2*T2)+ (B3*T3)+ (B4*T4); the correlation value (referred to as BH) between the series of numbers 28 for the target object 10 and the pre-defined-shape series of numbers for a hexagon shape is: BH = (Bl *H1)+ (B2*H2)+ (B3*H3)+ (B4*H4); the correlation value (referred to as BP) between the series of numbers 28 for the target object 10 and the pre-defined-shape series of numbers for a pentagon shape is: BP= (B1*P1)+ (B2*P2)+ (B3*P3)+ (B4*P4). The degree of similarity between the series of numbers 28 for the target object 10 and the respective pre-defined-shape series of numbers for a circle shape, a triangle shape, a hexagon shape and a pentagon shape can be determined by the respective correlation value.-If the pre-defined-shape series of numbers for a circle shape has a maximum correlation value with the series of numbers 28 for the target object 10, i.e., (BC > BT) & (BC> BH) & (BC > BP), the pre-defined-shape series of numbers for a circle shape has a maximum degree of similarity with the series of numbers 28 for the target object 10, the shape 12 on the target object 10 is determined as a circle shape.- If the pre-defined-shape series of numbers for a triangle shape has a maximum correlation value with the series of numbers 28 for the target object 10, i.e., (BT > BH) & (BT> BC) & (BT > BP), the pre-defined-shape series of numbers for a triangle shape has a maximum degree of similarity with the series of numbers 28 for the target object 10, the shape 12 on the target object 10 is determined as a triangle shape.-If the pre-defined-shape series of numbers for a hexagon shape has a maximum correlation value with the series of numbers 28 for the target object 10, i.e., (BH > BT) & (BH> BC) & (BH > BP), the pre-defined-shape series of numbers for a hexagon shape has a maximum degree of similarity with the series of numbers 28 for the target object 10, the shape 12 on the target object 10 is determined as a hexagon shape.-If the pre-defined-shape series of numbers for a pentagon shape has a maximum correlation value with the series of numbers 28 for the target object 10, i.e., (BP > BT) & (BP > BC) & (BP > BH), the pre-defined-shape series of numbers for a pentagon shape has a maximum degree of similarity with the series of numbers 28 for the target object 10, the shape 12 on the target object 10 is determined as a pentagon shape.
[0058] In another example, normalization can be performed on the series of numbers 28 for the target object 10. If the greatest number in the series of numbers 28 is not a peak point (i.e., the greatest number in the series of numbers 28 corresponds to a first serial index or a last serial index), a degree of similarity between the series of numbers 28 for the target object 10 and the pre-defined-shape series of number 28a for a circle shape is determined as a maximum degree of similarity (e.g., 1). The shape 12 on the target object 10 is determined as the circle shape.
[0059] If the greatest number in the series of numbers 28 is a peak point (i.e., the greatest number in the series of numbers 28 does not correspond to a first serial index or a last serial index), and if the greatest number is not sequenced at the center of the series of numbers 28, the degree of similarity between the series of numbers 28 for the target object 10 and the predefined-shape series of number 28a for a pentagon shape is determined as a maximum degree of similarity (e.g., 1). The shape 12 on the target object 10 is determined as the pentagon shape.
[0060] If the greatest number in the series of numbers 28 is a peak point, and if the greatest number is sequenced at the center of the series of numbers 28, sum of some numbers sequenced before and after the greatest number is computed, e.g., sum of numbers with serial index from (m-n) to (m+n) is computed, where m is the serial index of the greatest number, n is a positive integer.
[0061] If the computed sum is greater than a pre-defined threshold, the degree of similarity between the series of numbers 28 for the target object 10 and the pre-defined-shape series of number 28a for a circle shape is determined as a maximum degree of similarity (e.g., 1). The shape 12 on the target object 10 is determined as the circle shape. If the computed sum is not greater than the pre-defined threshold, the degree of similarity between the series of numbers 28 for the target object 10 and the pre-defined-shape series of number 28a for a hexagon shape is determined as a maximum degree of similarity (e.g., 1). The shape 12 on the target object 10 is determined as the hexagon shape.
[0062] The processor 120 can be configured to generate a plot 26 for the target object 10 based on the series of numbers 28 generated based on the binary image 16. The plot 26 depictsa relationship between each number in the series of numbers 28 and the serial index corresponding to each number.
[0063] FIG. 4 shows an example of a plot 26 for the target object 10 generated based on a series of numbers generated based on the binary image 16 of FIG. 3B. Each number in a series of numbers for the target object 10 is used as y-axis in the plot 26 and a serial index corresponding to each number is used as x-axis in the plot 26. The series of numbers for the target object 10 is generated based on the binary image 16 of FIG. 3B using a lossless data compression algorithm, each number in the series of numbers represents a count 22 of continuous pixels having an intensity of the first value of the binary image 16, and corresponds to a serial index. The plot 26 in FIG. 4 depicts a relationship between each number representing a count 22 of continuous pixels having an intensity of the first value (e.g., continuous white pixels) and the serial index corresponding to each number for the binary image 16 of FIG. 3B.
[0064] In some embodiments, the degree of similarity between the series of numbers 28 for the target object 10 and each of a plurality of pre-defined-shape series of numbers 28a can be determined as a degree of similarity between the plot 26 for the target object 10 and each of a plurality of pre-defined-shape plots 26a. As described above, the plot 26 for the target object 10 can be generated based on the series of numbers 28. Similarly, each of the plurality of predefined-shape plots 26a can be generated based on a corresponding pre-defined-shape series of numbers 28a in the plurality of pre-defined-shape series of numbers 28a. The processor 120 can be configured to generate a pre-defined-shape plot 26a based on a corresponding predefined-shape series of numbers 28a.
[0065] The processor 120 can be configured to determine a degree of similarity between the plot 26 for the target object 10 and each of a plurality of pre-defined-shape plots 26a. The plot 26 for the target object 10 can be compared with each of a plurality of pre-defined-shape plots 26a to determine the respective degree of similarity. The degree of similarity can range from 0 to 1. A degree of similarity between the plot 26 for the target object 10 and each of a plurality of pre-defined-shape plots 26a can be determined using a pattern matching algorithm. A degree of similarity between the plot 26 for the target object 10 and each of a plurality of pre-defined- shape plots 26a can be determined by comparing the area under curve for the plot 26 and the area under curve for each of the plurality of pre-defined-shape plots 26a. A degree of similarity between the plot 26 for the target object 10 and each of a plurality of pre-defined-shape plots 26a can be determined by fitting the curves for the plot 26 and each of the plurality of pre-defined-shape plots 26a into a respective polynomial equation and comparing the polynomial equations.
[0066] The pre-defined-shape plot 26a which has a maximum degree of similarity with the plot 26 for the target object 10 can be determined when a degree of similarity between the plot 26 for the target object 10 and each of a plurality of pre-defined-shape plots 26a are determined. The pre-defined-shape plot 26a, which has a maximum degree of similarity with the plot 26 for the target object 10, corresponds to a pre-defined shape 12a. The shape 12 on the target object 10 can be determined as a pre-defined shape 12a. The pre-defined shape 12a may be referenced to or correspond to a pre-defined-shape plot 26a which has a maximum similarity with the plot 26 for the target object 10. In some embodiments, the shape 12 on the target object 10 can be determined as a pre-defined shape 12a, wherein a pre-defined-shape plot 26a, which corresponds to the pre-defined shape 12a, has a maximum correlation value with the plot 26 for the target object 10.
[0067] In an example, normalization can be performed on the series of numbers 28 for the target object 10 and each of the plurality of pre-defined-shape series of numbers 28a. For performing normalization, each number in the series of numbers 28 is divided by a maximum value in the series of numbers 28, and each number in a pre-defined-shape series of numbers 28a is divided by a maximum value in the pre-defined-shape series of numbers 28a. A plot 26 for the target object 10 is generated based on the series of numbers 28 for the target object 10. A respective pre-defined-shape plot 26a for a circle shape, a triangle shape, a pentagon shape and a hexagon shape is generated based on the pre-defined-shape series of numbers 28a for the circle shape, the triangle shape, the pentagon shape and the hexagon shape, respectively. An area under the curve when the serial index are 10 serial index sequenced at the beginning (referred to as F), an area under the curve when the serial index are 10 serial index sequenced at the center (referred to as M), an area under the curve when the serial index are 10 serial index sequenced at the last (referred to as L) is calculated for the plot 26. A respective area under the curve when the serial index are 10 serial index sequenced at the center (referred to as MC, MH, MT, MP respectively) are calculated for the pre-defined-shape plot 26a for a circle shape, a hexagon shape, a triangle shape and a pentagon shape, respectively.- If F is less than M, L is less than M, and (M / MC) is greater than (M / MH), i.e., (F<M, L<M, (M / MC)>(M / MH), the degree of similarity between the plot 26 for the target object 10 and the pre-defined-shape plot 26a for a circle shape is determined as a maximum degree of similarity (e.g., 1), the shape 12 on the target object 10 is determined as a circle shape.- If F is less than M, L is less than M, and (M / MC) is not greater than (M / MH), i.e., (F<M, L<M, (M / MC) < (M / MH), the degree of similarity between the plot 26 for the target object 10 and the pre-defmed-shape plot 26a for a hexagon shape is determined as a maximum degree of similarity (e.g., 1), the shape 12 on the target object 10 is determined as a hexagon shape.- If F is less than M, M is less than L, and (M / MT) is greater than (M / MP), i.e., (F<M< L, (M / MT)>(M / MP), the degree of similarity between the plot 26 for the target object 10 and the pre-defmed-shape plot 26a for a triangle shape is determined as a maximum degree of similarity (e.g., 1), the shape 12 on the target object 10 is determined as a triangle shape.- If F is less than M, M is less than L, and (M / MT) is not greater than (M / MP), i.e., (F<M< L, (M / MT) < (M / MP), the degree of similarity between the plot 26 for the target object 10 and the pre-defmed-shape plot 26a for a pentagon shape is determined as a maximum degree of similarity (e.g., 1), the shape 12 on the target object 10 is determined as a pentagon shape.
[0068] FIG. 5 shows a shape 12 on the target object 10 determined as a pre-defined shape 12a, wherein the pre-defined shape 12a is referenced to or corresponds to a pre-defmed-shape plot 26a which has a maximum degree of similarity with the plot 26 shown in FIG. 4 for the target object 10.
[0069] A pre-defined-shape series of numbers 28a for a training object 10a can be obtained in a way similar to the way of obtaining the series of numbers 28 for a target object 10 as illustrated above.
[0070] In some embodiments, the processor 120 can be configured to generate a binary image 16a for each of a plurality of training objects 10a based on an image 14a of the training object 10a, each training object 10a corresponding to a pre-defined shape 12a. An intensity of each pixel in each binary image 16a for each training object 10a can be either a first value or a second value, the second value being different from the first value.
[0071] A binary image 16a of each of the plurality of training objects 10a can be obtained based on the image 14a of the training object 10a by: comparing an intensity of each pixel of the image 14a of the training object 10a with a preset threshold value; replacing the intensity of the pixel with the second value (e.g., 0) if the intensity of the pixel in the image 14a of the training object 10a is greater than the preset threshold value; and replacing the intensity of the pixel with the first value (e.g., 255) if the intensity of the pixel in the image 14a of the training object 10a is equal to or less than the preset threshold value. The threshold value can be a valuebetween the first value and the second value. In some embodiments, the binary image 16a may be a black and white image.
[0072] In some embodiments, the processor 120 can be configured to assign unique labels to one or more of the pixels in the binary image 16a. In some embodiments, the processor 12 can be configured to assign labels to all the pixels having an intensity of the first value on the binary image 16a using a clustering algorithm. The clustering algorithm can comprise K- Nearest Neighborhood (KNN) clustering algorithm.
[0073] The processor 120 can be configured to generate a pre-defined-shape series of numbers 28a for each training object 10a based on the binary image 16a of the training object 10a using the lossless data compression algorithm, each number in the pre-defined-shape series of numbers 28a representing a count 22a of continuous pixels having an intensity of the first value of the binary image 16a of the training object 10a and each number in the pre-defined- shape series of numbers 28a corresponding to a serial index.
[0074] FIGs.6A to 6D show an example of an image 14a for each of 4 training objects 10a corresponding to a pre-defined shape 12a of a circle, a triangle, a pentagon, and a hexagon, respectively. FIGs.7A to 7D show an example of a binary image 16a generated based on the image 14a of FIGs.6A to 6D respectively, wherein an intensity of each pixel in each binary image 16a for each training object 10a is either a first value or a second value, the second value being different from the first value. In the binary image 16a of FIGs.7A to 7D, the pixels having an intensity of a first value (e.g., 255) are shown as white color, while the pixels having an intensity of a second value (e.g., 0) are shown as black color. Unique labels can be assigned to the pixels in white color on the binary image 16a using the clustering algorithm, e.g., KNN clustering algorithm.
[0075] The number of continuous pixels having an intensity of the first value (e.g., continuous white pixels) in the binary image 16a of each of the training objects 10a can be counted in a pre -determined sequence to obtain the count of continuous pixels having an intensity of the first value. For example, the pre-determined sequence can be from a first pixel to a last pixel in a direction of EE for each row, and from a first row to a last row in a direction of FF as shown in FIGS. 7A to 7D. The step(s) of counting of the number of continuous pixels having an intensity of the first value (e.g., continuous white pixels) for the binary image 16a of the training object 10a is similar to and / or analogous to the steps of counting the number of continuous pixels having an intensity of the first value for the binary image 16 of the target object 10.
[0076] Using the binary image 16a of FIG. 7 A for example, in the above-mentioned predetermined sequence of counting (e.g., from a first pixel to a last pixel in a direction of EE for each row, and from a first row to a last row in a direction of FF as shown in FIG. 7 A), the first incurrence of continuous white pixels would occur in the first row, and the second incurrence of continuous white pixels would occur in the second row, and the 7?-th incurrence of continuous white pixels would occur in the R -th row (where R represents the row number of pixels in FIG.7A) until the 79thincurrence of continuous white pixels. The 80thincurrence of continuous white pixels would occur from the 80throw to the 86throw. Each of the subsequent incurrence of continuous white pixels after the 80thincurrence would occur in each subsequent row after the 86throw. The count of continuous white pixels in each incurrence of continuous white pixels (i.e., 1stincurrence to last incurrence) is therefore obtained.
[0077] Using the binary image 16a of FIG. 7B for example, in the above-mentioned predetermined sequence of counting (e.g., from a first pixel to a last pixel in a direction of EE for each row, and from a first row to a last row in a direction of FF as shown in FIG. 7B), the first incurrence of continuous white pixels would occur in the first row, and the second incurrence of continuous white pixels would occur in the second row, and the ?-th incurrence of continuous white pixels would occur in the R -th row (where R represents the row number of pixels in FIG.7B) until the (A-2)-thincurrence of continuous white pixels (A represents the total number of rows of the binary image 16a of FIG. 7B). The last occurrence (i.e., the (A-l)-th occurrence) of continuous white pixels would occur in the last 2 rows of the binary image 16a of FIG. 7B. The count of continuous white pixels in each incurrence of continuous white pixels (i.e., 1stincurrence to last incurrence) is therefore obtained.
[0078] Using the binary image 16a of FIG. 7C for example, in the above-mentioned predetermined sequence of counting (e.g., from a first pixel to a last pixel in a direction of EE for each row, and from a first row to a last row in a direction of FF as shown in FIG. 7C), the first incurrence of continuous white pixels would occur in the first row, and the second incurrence of continuous white pixels would occur in the second row, and the 7?-th incurrence of continuous white pixels would occur in the I? -th row (where R represents the row number of pixels in FIG.7C) until the 59thincurrence of continuous white pixels. The 60thincurrence of continuous white pixels would occur from the 60throw to the 61strow. Each of the subsequent incurrence of continuous white pixels after the 60thincurrence would occur in each subsequent row after the 61strow. The count of continuous white pixels in each incurrence of continuous white pixels (i.e., 1stincurrence to last incurrence) is therefore obtained.
[0079] Using the binary image 16a of FIG. 7D for example, in the above-mentioned predetermined sequence of counting (e.g., from a first pixel to a last pixel in a direction of EE for each row, and from a first row to a last row in a direction of FF as shown in FIG. 7D), the first incurrence of continuous white pixels would occur in the first row, and the second incurrence of continuous white pixels would occur in the second row, and the 7?-th incurrence of continuous white pixels would occur in the R -th row (where R represents the row number of pixels in FIG.7D) until the 40thincurrence of continuous white pixels. The 41stincurrence of continuous white pixels would occur from the 41strow to the 126throw. Each of the subsequent incurrence of continuous white pixels after the 41stincurrence would occur in each subsequent row after the 126throw. The count of continuous white pixels in each incurrence of continuous white pixels (i.e., 1stincurrence to last incurrence) is therefore obtained.
[0080] The first incurrence of continuous white pixels corresponds to or assigned with a pixel index / a serial index of 1 ; the second incurrence of continuous white pixels corresponds to or assigned with a pixel index / a serial index of 2; the -th incurrence of continuous white pixels corresponds to or assigned with a pixel index / a serial index of N (N can be an integer).
[0081] It should be appreciated that the pre-determined sequence can be from a first pixel to a last pixel in a direction of FF for each column, and from a first column to a last column in a direction of EE as shown in FIG. 7A to 7D.
[0082] The count of pixels in the first incurrence of continuous pixels having an intensity of the first value (e.g., continuous white pixels) can be used as the number that corresponds to a serial index of 1 ; The count of pixels in the second incurrence of continuous pixels having an intensity of the first value (e.g., continuous white pixels) can be used as the number that corresponds to a serial index of 2; The count of pixels in the 7V-th incurrence of continuous pixels having an intensity of the first value (e.g., continuous white pixels) can be used as the number that corresponds to a serial index of N (N can be an integer As described above, a series of numbers for each training object 10a are generated, each number in the series of numbers corresponds to a serial index and represents a count 22a of continuous positive pixels for a corresponding incurrence of continuous positive pixels. The continuous positive pixels refer to continuous pixels having an intensity of the first value (e.g., continuous white pixels).
[0083] The processor 120 can be configured to generate a pre-defmed-shape plot 26a for each training object 10a based on the corresponding pre-defmed-shape series of numbers 28a for the training object 10a.
[0084] FIGs.8A to 8D show an example of a pre-defined-shape plot 26a depicting a relationship between each number representing the count 22a of continuous pixels having an intensity of the first value (e.g., continuous white pixels) and the serial index corresponding to each number for the binary image 16a of FIGs.7A to 7D, respectively.
[0085] The system 100 can comprise a database 130. The image 14 , the binary image 16, the series of numbers 28 generated based on the binary image 16, the plot 26 for the target object 10, the image 14a, the binary image 16a, the pre-defined-shape series of numbers 28a generated based on the binary image 16a, the plot 26a of each of the training objects 10a, the degree of similarity between the series of numbers 28 for the target object 10 and each of a plurality of pre-defined-shape series of numbers 28a, the degree of similarity between the plot 26 for the target object 10 and each of the plurality of pre-defined-shape plots 26a, the predefined shape 12a corresponding to each of the plurality of pre-defined-shape plots 26a, the shape 12 on the target object 10 can be stored in a local or remote database 130. The database 130 can be a local offline database, or a connected, cloud-based database. The database 130 can comprise a local server and / or a cloud server.
[0086] The processor 120 can be configured to extract shape features 30 from the shape 12 on the target object 10. In some embodiments, the shape features 30 can comprise a centroid of each geometric figure of the shape 12. For example, if the shape 12 on the target object 10 is a triangle, the centroid can be a point in which the three medians of the triangle intersect. A median of a triangle joins a vertex to the midpoint of the opposite side. In some embodiments, the shape features 30 can include, but not limited to a distance between two centroids, centroid row arrangement, etc. The centroid row arrangement refers to arrangement of the centroids in a row.
[0087] FIG.9 shows another example of an image 14 of a target object 10 captured by an image capturing device 110. As shown in FIG. 9, the shape 12 on the target object 10 is a plurality of circles.
[0088] FIG. 10 shows an example of a binary image 16 generated based on the image 14 of FIG. 9. An intensity of each pixel in the binary image 16 of FIG. 10 is either a first value or a second value, the second value being different from the first value. In the binary image 16 of FIG. 10, the pixels having an intensity of a first value (e.g., 255) are shown as white color, while the pixels having an intensity of a second value (e.g., 0) are shown as black color. Unique labels can be assigned to the pixels in white color on the binary image 16 using the clustering algorithm, e.g., KNN clustering algorithm.
[0089] The processor 120 can be configured to generate a series of numbers 28 for the target object 10 based on the binary image 16 of the target object 10 shown in FIG. 10 using a lossless data compression algorithm, each number in the series of numbers 28 representing a count 22 of continuous pixels having an intensity of the first value of the binary image 16 shown in FIG. 10 and each number in the series of numbers 28 corresponding to a serial index. The lossless data compression algorithm can be Run Length Encoding algorithm. The series of numbers 28 generated based on the binary image 16 of FIG. 10 can be generated in a way similar to the way of generating the series of numbers 28 based on the binary image 16 of FIG.3B as illustrated above.
[0090] The processor 120 can be configured to generate a plot 26 for the target object 10 based on the series of numbers 28 generated based on the binary image 16 of FIG. 10. The plot 26 for the target object 10 depicts a relationship between each number representing the count 22 of continuous pixels having an intensity of the first value and the serial index corresponding to each number for the binary image 16 of FIG.10.
[0091] The processor 120 can be configured to determine a degree of similarity between the plot 26 for the target object 10 and each of a plurality of pre-defined-shape plots 26a, each of the plurality of pre-defined-shape plots 26a corresponding to a pre-defined shape 12a.
[0092] FIG. 11 shows a shape 12 on the target object 10 determined as a pre-defined shape 12a, wherein the pre-defined shape 12a is referenced to or corresponds to a pre-defined-shape plot 26a which has a maximum degree of similarity with the plot 26 for the target object 10.
[0093] Shape features 30 can be extracted from the shape 12 on the target object 10 shown in FIG. 11. The extracted shape features 30 can comprise a centroid of each of the plurality of circles on the target object 10, a distance between two centroids of the circles, centroid row arrangement, etc. The centroid row arrangement refers to arrangement of the centroids of the circles in a row.
[0094] The processor 120 can be configured to calibrate extrinsic parameters of a camera based on the extracted shape features 30 and intrinsic parameters of the camera using a calibration algorithm. The calibration algorithm can be Gradient Descent algorithm. The intrinsic parameters of the camera can include a focal length of a lens or a curved mirror in the camera, an optical center / principal point of a lens in the camera, and / or a skew coefficient of the camera. The extrinsic parameters can include Yaw, Pitch and Roll of the camera. The Yaw refers to rotation around a central vertical (normal) axis, the Pitch refers to rotation around acentral horizontal (lateral) axis, and the Roll refers to rotation around a central longitudinal axis.
[0095] FIG. 12 is a flow chart depicting a shape detection method 800 according to some embodiments. The shape detection method 800 can comprise: a step 810 of capturing, by an image capturing device 110, an image 14 of a target object 10; a step 820 of generating, by a processor 120, a binary image 16 of the target object 10 based on the image 14 of the target object 10, wherein an intensity of each pixel in the binary image 16 is either a first value or a second value, the second value being different from the first value; a step 830 of generating, by the processor 120, a series of numbers 28 for the target object 10 based on the binary image 16 using a lossless data compression algorithm, each number in the series of numbers 28 representing a count 22 of continuous pixels having an intensity of the first value of the binary image 16 and each number in the series of numbers 28 corresponding to a serial index; a step 840 of determining, by the processor 120, a degree of similarity between the series of numbers 28 for the target object 10 and each of a plurality of predefined-shape series of numbers 28a, each of the plurality of pre-defined-shape series of numbers 28a corresponding to a pre-defined shape 12a; a step 850 of determining, by the processor 120, a shape 12 on the target object 10 as a pre-defined shape 12a corresponding to a pre-defined-shape series of numbers 28a which has a maximum degree of similarity with the series of numbers 28 for the target object 10.
[0096] The first value can be 255 and the second value can be 0. The lossless data compression algorithm can be Run Length Encoding algorithm.
[0097] The shape detection method 800 can further comprise a step 860 of extracting, by the processor 120, shape features 30 from the shape 12 on the target object 10. The shape features 30 can comprise a centroid of each geometric figure of the shape 12, a distance between two centroids, and / or centroid row arrangement.
[0098] The shape detection method 800 can further comprise a step 870 of calibrating, by the processor 120, extrinsic parameters of a camera based on the extracted shape features 30 and intrinsic parameters of the camera using a calibration algorithm. The calibration algorithm can be Gradient Descent algorithm.
[0099] The degree of similarity between the series of numbers 28 for the target object 10 and each of a plurality of pre-defined-shape series of numbers 28a can be a degree of similarity between a plot 26 for the target object 10 and each of a plurality of pre-defined-shape plots 26a, wherein the plot 26 for the target object 10 can be generated based on the series of numbers 28, wherein each of the plurality of pre-defined-shape plots 26a can be generated based on a corresponding pre-defined-shape series of numbers 28a in the plurality of pre-defined-shape series of numbers 28a.
[0100] The plurality of pre-defined-shape series of numbers 28a can be obtained by: a step 882 of generating, by the processor 120, a binary image 16a for each of a plurality of training objects 10a based on an image 14a of the training object 10a, each training object 10a corresponding to a pre-defined shape 12a, wherein an intensity of each pixel in each binary image 16a for each training object 10a is either a first value or a second value, the second value being different from the first value; a step 884 of generating, by the processor 120, a predefined-shape series of numbers 28a for each training object 10a based on the binary image 16a of the training object 10a using the lossless data compression algorithm, each number in the pre-defined-shape series of numbers 28a representing a count 22a of continuous pixels having an intensity of the first value of the binary image 16a of the training object 10a and each number the pre-defined-shape series of numbers 28a corresponding to a serial index.
[0101] The step 820 of generating a binary image 16 based on the image 14 of the target object 10 can comprise: a step 822 of comparing an intensity of each pixel of the image 14 with a preset threshold value; a step 824 of replacing the intensity of the pixel with the second value if the intensity of the pixel in the image 14 is greater than the preset threshold value; and a step 826 of replacing the intensity of the pixel with the first value if the intensity of the pixel in the image 14 is equal to or less than the preset threshold value.
[0102] A binary image 16a of each of the plurality of training objects 10a can be obtained based on the image 14a of the training object 10a by: comparing an intensity of each pixel of the image 14a of the training object 10a with a preset threshold value; replacing the intensity of the pixel with the second value if the intensity of the pixel in the image 14a of the training object 10a is greater than the preset threshold value; and replacing the intensity of the pixel with the first value if the intensity of the pixel in the image 14a of the training object 10a is equal to or less than the preset threshold value.
[0103] The method and system for shape detection in the present disclosure can be used for extracting shape features from the shape on the target object and for calibrating extrinsicparameters of a camera. The method and system for detecting shape on a target object in the present disclosure are not bound to use target objects of some specific geometry. The shape on the target object can be a regular shape of any geometry such as a circle, an oval, a triangle, a pentagon, a hexagon, etc. The shape on the target object can also be any irregular shape.
[0104] While the disclosure has been particularly shown and described with reference to specific embodiments, it should be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the present disclosure as defined by the appended claims. The scope of the present disclosure is thus indicated by the appended claims and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced.
Claims
CLAIMS1. A shape detection method (800) comprising: a step (810) of capturing, by an image capturing device (110), an image (14) of a target object (10); a step (820) of generating, by a processor (120), a binary image (16) of the target object (10) based on the image (14) of the target object (10), wherein an intensity of each pixel in the binary image (16) is either a first value or a second value, the second value being different from the first value; a step (830) of generating, by the processor (120), a series of numbers (28) for the target object (10) based on the binary image (16) using a lossless data compression algorithm, each number in the series of numbers (28) representing a count (22) of continuous pixels having an intensity of the first value of the binary image (16) and each number in the series of numbers (28) corresponding to a serial index; a step (840) of determining, by the processor (120), a degree of similarity between the series of numbers (28) for the target object (10) and each of a plurality of pre-defined-shape series of numbers (28a), each of the plurality of pre-defined-shape series of numbers (28a) corresponding to a pre -defined shape (12a); a step (850) of determining, by the processor (120), a shape (12) on the target object (10) as a pre-defined shape (12a) corresponding to a pre-defined-shape series of numbers (28a) which has a maximum degree of similarity with the series of numbers (28) for the target object (10).
2. The shape detection method (800) of claim 1, further comprising: a step (860) of extracting, by the processor (120), shape features (30) from the shape (12) on the target object (10), preferably, wherein the shape features (30) comprise a centroid of each geometric figure of the shape (12), a distance between two centroids, and / or centroid row arrangement.
3. The shape detection method (800) of claim 2, further comprising:a step (870) of calibrating, by the processor (120), extrinsic parameters of a camera based on the extracted shape features (30) and intrinsic parameters of the camera using a calibration algorithm, preferably, wherein the calibration algorithm is Gradient Descent algorithm.
4. The shape detection method (800) of any of claims 1 to 3, wherein the degree of similarity between the series of numbers (28) for the target object (10) and each of a plurality of pre-defmed-shape series of numbers (28a) is a degree of similarity between a plot (26) for the target object (10) and each of a plurality of pre-defmed- shape plots (26a), wherein the plot (26) for the target object (10) is generated based on the series of numbers (28), wherein each of the plurality of pre-defined-shape plots (26a) is generated based on a corresponding pre-defmed-shape series of numbers (28a) in the plurality of pre-defmed-shape series of numbers (28a).
5. The shape detection method (800) of any of claims 1 to 4, wherein the plurality of pre-defmed-shape series of numbers (28a) is obtained by: a step (882) of generating, by the processor (120), a binary image (16a) for each of a plurality of training objects (10a) based on an image (14a) of the training object (10a), each training object (10a) corresponding to a pre-defined shape (12a), wherein an intensity of each pixel in each binary image (16a) for each training object (10a) is either a first value or a second value, the second value being different from the first value; a step (884) of generating, by the processor (120), a pre-defined-shape series of numbers (28a) for each training object (10a) based on the binary image (16a) of the training object (10a) using the lossless data compression algorithm, each number in the pre-defined-shape series of numbers (28a) representing a count (22a) of continuous pixels having an intensity of the first value of the binary image (16a) of the training object (10a) and each number in the pre-defined-shape series of numbers (28a) corresponding to a serial index.
6. The shape detection method (800) of any of claims 1 to 5, wherein the step (820) of generating a binary image (16) based on the image (14) of the target object (10) comprising: a step (822) of comparing an intensity of each pixel of the image (14) with a preset threshold value; a step (824) of replacing the intensity of the pixel with the second value if the intensity of the pixel in the image (14) is greater than the preset threshold value; and a step (826) of replacing the intensity of the pixel with the first value if the intensity of the pixel in the image (14) is equal to or less than the preset threshold value.
7. The shape detection method (800) of any of claims 1 to 6, wherein the lossless data compression algorithm is Run Length Encoding algorithm.
8. The shape detection method (800) of any of claims 1 to 7, wherein the first value is 255 and the second value is 0.
9. A shape detection system (100) comprising: an image capturing device (110) configured to capture an image (14) of a target object (10); and a processor (120) connected to the image capturing device (110), wherein the processor (120) is configured to: generate a binary image (16) of the target object (10) based on the image (14) of the target object (10), wherein an intensity of each pixel in the binary image (16) is either a first value or a second value, the second value being different from the first value; generate a series of numbers (28) for the target object (10) based on the binary image (16) using a lossless data compression algorithm, each number in the series of numbers (28) representing a count (22) of continuous pixels having an intensity of the first value of the binary image (16) and each number in the series of numbers (28) corresponding to a serial index; determine a degree of similarity between the series of numbers (28) for the target object (10) and each of a plurality of pre-defined-shape series of numbers (28a),each of the plurality of pre-defined-shape series of numbers (28a) corresponding to a pre-defined shape (12a); determine a shape (12) on the target object (10) as a pre-defined shape (12a) corresponding to a pre-defined-shape series of numbers (28a) which has a maximum degree of similarity with the series of numbers (28) for the target object (10).
10. The shape detection system (100) of claim 9, wherein the processor (120) is configured to: extract shape features (30) from the shape (12) on the target object (10), preferably, wherein the shape features (30) comprise a centroid of each geometric figure of the shape (12), a distance between two centroids, and / or centroid row arrangement.
11. The shape detection system (100) of claim 10, wherein the processor (120) is configured to: calibrate extrinsic parameters of a camera based on the extracted shape features (30) and intrinsic parameters of the camera using a calibration algorithm, preferably, wherein the calibration algorithm is Gradient Descent algorithm.
12. The shape detection system (100) of any of claims 9 to 11, wherein the degree of similarity between the series of numbers (28) for the target object (10) and each of a plurality of pre-defined-shape series of numbers (28a) is a degree of similarity between a plot (26) for the target object (10) and each of a plurality of pre-defined- shape plots (26a), wherein the plot (26) for the target object (10) is generated based on the series of numbers (28), wherein each of the plurality of pre-defined-shape plots (26a) is generated based on a corresponding pre-defined-shape series of numbers (28a) in the plurality of pre-defined-shape series of numbers (28a).
13. The shape detection system (100) of any of claims 9 to 12, wherein the plurality of predefined-shape series of numbers (28a) is obtained by:generating, by the processor (120), a binary image (16a) for each of a plurality of training objects (10a) based on an image (14a) of the training object (10a), each training object (10a) corresponding to a pre-defined shape (12a), wherein an intensity of each pixel in each binary image (16a) for each training object (10a) is either a first value or a second value, the second value being different from the first value; generating, by the processor (120), a pre-defined-shape series of numbers (28a) for each training object (10a) based on the binary image (16a) of the training object (10a) using the lossless data compression algorithm, each number in the pre-defined-shape series of numbers (28a) representing a count (22a) of continuous pixels having an intensity of the first value of the binary image (16a) of the training object (10a) and each number in the predefined-shape series of numbers (28a) corresponding to a serial index.
14. The shape detection system (100) of any of claims 9 to 13, wherein the binary image (16) is generated based on the image (14) of the target object (10) by: comparing an intensity of each pixel of the image (14) with a preset threshold value; replacing the intensity of the pixel with the second value if the intensity of the pixel in the image (14) is greater than the preset threshold value; and replacing the intensity of the pixel with the first value if the intensity of the pixel in the image (14) is equal to or less than the preset threshold value.
15. The shape detection system (100) of any of claims 9 to 14, wherein the lossless data compression algorithm is Run Length Encoding algorithm; and / or wherein the first value is 255 and the second value is 0.
Citation Information
Patent Citations
Augmented reality system
US20180253906A1