CN104976951A - Device and method for identifying image - Google Patents

Device and method for identifying image Download PDF

Info

Publication number
CN104976951A
CN104976951A CN201410167796.XA CN201410167796A CN104976951A CN 104976951 A CN104976951 A CN 104976951A CN 201410167796 A CN201410167796 A CN 201410167796A CN 104976951 A CN104976951 A CN 104976951A
Authority
CN
China
Prior art keywords
image
pixel
diagonal
pixels
length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410167796.XA
Other languages
Chinese (zh)
Inventor
刘纶烽
陈俊宇
林椿富
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inventec Energy Corp
Original Assignee
Inventec Energy Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inventec Energy Corp filed Critical Inventec Energy Corp
Publication of CN104976951A publication Critical patent/CN104976951A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention provides a device and a method for identifying an image. The method has the following steps. First, a first image carrying an object is captured by an image recognition device. Then, the length of the first diagonal line and the length of the second diagonal line of the object are calculated according to the first image. And outputting the identification result when the ratio of the first diagonal length to the second diagonal length is within a first range. The method can help a user to know the shape of the object and the size of the object by capturing the image of the object.

Description

辨识影像的装置及其方法Image recognition device and method

技术领域technical field

本发明涉及一种辨识影像的装置及其方法,特别涉及一种辨识影像中物件的形状及尺寸的辨识影像的装置及其方法。The present invention relates to an image recognition device and method thereof, in particular to an image recognition device and method for recognizing the shape and size of objects in the image.

背景技术Background technique

于组装生产线上,将两物件组装时,测量物件的尺寸及辨识物件的形状是为组装过程中不可或缺的一环。举例来说,于组装玻璃于铝框中时,若是过度挤压造成接合面尖锐突起,或是未完全密合形成锋利的开口,有可能会造成包装人员抑或是于终端客户组立的人员受伤。于另一个例子中,若是模块形状发生变化,于终端客户处与背轨结合时,轻微的情形是勉强组立,造成锁固点有应力残留,经过一段时间有可能造成变形更严重或功能失效;严重的变形甚至连锁固都无法进行,造成客户与制造商本身的损失。In the assembly line, when assembling two objects, measuring the size of the object and identifying the shape of the object is an indispensable part of the assembly process. For example, when assembling the glass into the aluminum frame, if the joint surface is sharply protruded due to excessive extrusion, or the sharp opening is formed due to incomplete sealing, it may cause injury to the packaging personnel or the personnel assembled by the end customer . In another example, if the shape of the module changes, when it is combined with the back rail at the end customer, in a slight case, it is barely assembled, resulting in residual stress at the locking point, which may cause more serious deformation or functional failure after a period of time ; Severe deformation and even chain locks cannot be carried out, causing losses to customers and manufacturers themselves.

然而,于现行人工测量物件的尺寸及目视辨识物件的形状尚具有许多问题。举例来说,测量人员于测量物件上可能会因为看错卷尺刻度或是物件本身形状不容易测量(如物件边角为圆弧形),进而造成辨识物件上因上述误差而有无法组装的情况。且若是对组装生产线上的每个物件均需要使用前述人工方式测量,对于组装生产线的效率的提升亦属困难。However, there are still many problems in the current manual measurement of the size of the object and visual recognition of the shape of the object. For example, the measurer may misread the tape scale or the shape of the object itself is not easy to measure (for example, the corners of the object are arc-shaped) when measuring the object, which may cause the identification of the object to be unable to assemble due to the above errors . Moreover, if each object on the assembly line needs to be measured manually, it will be difficult to improve the efficiency of the assembly line.

发明内容Contents of the invention

有鉴于以上的问题,本发明的目的在于提供一种辨识影像的装置及其方法,通过比较于撷取影像中物件的的像素的数目以判断物件的形状,并通过测量物件的实际尺寸以及影像中物件的像素的数目,得到物件的尺寸,以帮助使用者可仅通过撷取物件的影像即可得知物件的形状以及物件的尺寸。In view of the above problems, the purpose of the present invention is to provide a device and method for identifying images, by comparing the number of pixels of the object in the captured image to determine the shape of the object, and by measuring the actual size of the object and the image The number of pixels in the object is obtained to obtain the size of the object, so as to help the user know the shape and size of the object only by capturing the image of the object.

依据本发明所揭露的辨识影像的方法包括下列步骤:首先利用辨识影像的装置,撷取载有物件的第一影像。接着,依据第一影像,计算物件的第一对角线的长度及第二对角线的长度。以及,当第一对角线长度及第二对角线长度的比值在第一范围内时,输出辨识结果。The image recognition method disclosed in the present invention includes the following steps: firstly, the image recognition device is used to capture the first image of the object. Then, according to the first image, the length of the first diagonal line and the length of the second diagonal line of the object are calculated. And, when the ratio of the length of the first diagonal line to the length of the second diagonal line is within the first range, the identification result is output.

依据本发明所揭露的辨识影像的装置具有影像撷取模块与影像处理模块。所述影像撷取模块用以撷取具有物件的影像。所述影像处理模块耦接影像撷取模块,影像处理模块执行边线检测程序以从影像中获得物件的多个边线的位置,影像处理模块并依据物件的多个边线的位置取得在影像中物件的多个对角线中第一对角线及第二对角线的位置、计算第一对角线及第二对角线的位置上的像素的数目,以及判断第一对角线及第二对角线的像素的数目的比值是否在第一范围内。其中当第一对角线及第二对角线的像素的数目的比值在第一范围内时,输出一辨识结果。The image recognition device disclosed in the present invention has an image capture module and an image processing module. The image capturing module is used for capturing images with objects. The image processing module is coupled to the image capture module, the image processing module executes an edge detection program to obtain the positions of multiple edges of the object from the image, and the image processing module obtains the position of the object in the image according to the positions of the multiple edges of the object The positions of the first diagonal and the second diagonal among the plurality of diagonals, calculating the number of pixels on the positions of the first diagonal and the second diagonal, and judging the first diagonal and the second Whether the ratio of the number of diagonal pixels is within the first range. Wherein when the ratio of the number of pixels of the first diagonal line and the second diagonal line is within the first range, an identification result is output.

综上所述,本发明辨识影像中物件的装置及方法可藉由执行一边线检测程序以得到影像中物件的多个边线、并通过物件的多个边线得到物件的多个对角线,最后再藉由比较于影像中物件的多个对角线的位置上彼此的像素的数目以判断物件的形状,让使用者可通过撷取物件的影像即可得知物件的形状。In summary, the device and method for identifying objects in an image of the present invention can obtain multiple edges of an object in an image by executing an edge detection program, and obtain multiple diagonals of an object through the multiple edges of an object, and finally Then, the shape of the object is judged by comparing the number of pixels on multiple diagonal positions of the object in the image, so that the user can know the shape of the object by capturing the image of the object.

以下结合附图和具体实施例对本发明进行详细描述,但不作为对本发明的限定。The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments, but not as a limitation of the present invention.

附图说明Description of drawings

图1依据本发明一实施例的辨识影像的装置的功能方框图;FIG. 1 is a functional block diagram of an image recognition device according to an embodiment of the present invention;

图2依据本发明一实施例的撷取物件的影像的侧视图;FIG. 2 is a side view of capturing an image of an object according to an embodiment of the present invention;

图3依据本发明一实施例的具有物件的影像的示意图;FIG. 3 is a schematic diagram of an image with an object according to an embodiment of the present invention;

图4依据本发明一实施例的具有物件的部分影像的示意图;FIG. 4 is a schematic diagram of a partial image of an object according to an embodiment of the present invention;

图5依据本发明一实施例的校正辨识影像的装置辨识影像的功能方框图;FIG. 5 is a functional block diagram of image recognition by an apparatus for correcting and recognizing images according to an embodiment of the present invention;

图6依据本发明一实施例的辨识影像的方法的流程图;FIG. 6 is a flowchart of a method for recognizing an image according to an embodiment of the present invention;

图7依据本发明一实施例的校正辨识影像的装置的方法的流程图。FIG. 7 is a flowchart of a method for calibrating an image recognition device according to an embodiment of the present invention.

其中,附图标记Among them, reference signs

10        辨识影像的装置10 Device for identifying images

102       影像撷取模块102 Image capture module

104       影像处理模块104 Image processing module

12        物件12 objects

14        影像14 video

1412      像素1412 pixels

1414      像素1414 pixels

1416      像素1416 pixels

1418      像素1418 pixels

1420      像素1420 pixels

1422      像素1422 pixels

1424      像素1424 pixels

1426      像素1426 pixels

1428      像素1428 pixels

16        平台16 platform

18        标准试片18 standard test pieces

L1、L2、L3、L4  边线L1, L2, L3, L4 Sidelines

DI1、DI2      对角线DI1, DI2 Diagonal

具体实施方式Detailed ways

以下在实施方式中详细叙述本发明的详细特征以及优点,其内容足以使任何熟习相关技艺者了解本发明的技术内容并据以实施,且根据本说明书所揭露的内容、权利要求范围及附图,任何熟习相关技艺者可轻易地理解本发明相关的目的及优点。以下的实施例是进一步详细说明本发明的观点,但非以任何观点限制本发明的范畴。The detailed features and advantages of the present invention are described in detail below in the embodiments, the content of which is sufficient to enable any person familiar with the relevant art to understand the technical content of the present invention and implement it accordingly, and according to the content disclosed in this specification, the scope of claims and the accompanying drawings , anyone skilled in the relevant art can easily understand the related objects and advantages of the present invention. The following examples are to further describe the viewpoints of the present invention in detail, but not to limit the scope of the present invention in any way.

请参阅图1,图1为根据本发明一实施例的辨识影像的装置的功能方框图。如图1所示,辨识影像中物件装置10包含影像撷取模块102及影像处理模块104,其中,影像处理模块104是耦接影像撷取模块102。Please refer to FIG. 1 . FIG. 1 is a functional block diagram of an image recognition device according to an embodiment of the present invention. As shown in FIG. 1 , the device 10 for identifying objects in an image includes an image capture module 102 and an image processing module 104 , wherein the image processing module 104 is coupled to the image capture module 102 .

请一并参阅图1、图2及图3,其中图2为根据本发明一实施例的撷取物件的影像的侧视图,图3为根据本发明一实施例的具有物件的影像的示意图。如图中所示,影像撷取模块102用以撷取具有物件12的影像14。更进一步地说,当使用者欲辨识物件12时,使用者可先行将物件12平行放置于一平台16之上,平台16是放置于辨识影像中物件装置10的下方,使用者再控制影像撷取模块102以撷取其中具有物件12的影像14。实施上,影像撷取模块102可以是但不限于相机镜头、摄影机镜头、网络摄装置镜头或是其他可撷取影像14的适当的摄影设备。Please refer to FIG. 1 , FIG. 2 and FIG. 3 together, wherein FIG. 2 is a side view of capturing an image of an object according to an embodiment of the present invention, and FIG. 3 is a schematic diagram of an image with an object according to an embodiment of the present invention. As shown in the figure, the image capture module 102 is used to capture an image 14 of an object 12 . Furthermore, when the user wants to identify the object 12, the user can first place the object 12 in parallel on a platform 16, and the platform 16 is placed under the object device 10 in the identification image, and then the user controls the image capture. The capture module 102 is used to capture the image 14 having the object 12 therein. In practice, the image capture module 102 can be, but not limited to, a camera lens, a video camera lens, a network camera lens, or other suitable photographic equipment capable of capturing the image 14 .

接着,前述影像处理模块104执行边线检测程序以从影像14中获得物件12的多个边线的位置,影像处理模块104并依据物件12的多个边线L1、L2、L3、L4的位置取得在影像14中物件12的多个对角线中对角线DI1及对角线DI2的位置。举例来说,当影像撷取模块102撷取具有物件12(例如矩形)的影像14后,即将影像14传送至影像处理模块104进行边线检测程序,其边线检测程序的运作方式容后详述。当影像处理模块104通过前述边线检测程序找寻出物件12的边线L1、L2、L3、L4于影像14中的位置后,即通过边线L1与边线L2及边线L4的交点位置,以及边线L3与边线L2及边线L4的交点位置,找出对角线DI1及对角线DI2于影像14中的位置。影像处理模块104可以是但不限于微处理器(micro processor)、图像处理器(graphics processing unit)、中央处理器(central process unit)或是其他适于运算处理的元件,但本发明并不以此为限。Next, the aforementioned image processing module 104 executes the edge detection program to obtain the positions of multiple edges of the object 12 from the image 14, and the image processing module 104 obtains the positions of the multiple edges L1, L2, L3, and L4 of the object 12 in the image. The positions of the diagonal DI1 and the diagonal DI2 among the plurality of diagonals of the object 12 in 14 . For example, after the image capturing module 102 captures the image 14 with the object 12 (such as a rectangle), it sends the image 14 to the image processing module 104 to perform an edge detection procedure. The operation of the edge detection procedure will be described in detail later. After the image processing module 104 finds the positions of the edges L1, L2, L3, and L4 of the object 12 in the image 14 through the above-mentioned edge detection program, it passes through the intersection positions of the edge L1, the edge L2, and the edge L4, and the edge L3 and the edge Find the position of the intersection of L2 and sideline L4, and find out the positions of diagonal line DI1 and diagonal line DI2 in image 14 . The image processing module 104 may be, but not limited to, a micro processor (micro processor), an image processing unit (graphics processing unit), a central processing unit (central process unit) or other elements suitable for computing processing, but the present invention does not refer to This is the limit.

影像处理模块104计算对角线DI1及对角线DI2的位置上的像素的数目,以及判断对角线DI1及对角线DI2的像素的数目的比值是否在第一范围内。当影像处理模块104判断对角线DI1及对角线DI2的像素的数目的比值在第一范围内时,则输出一辨识结果。更进一步地说,当影像处理模块104取得对角线DI1及对角线DI2的位置后,即分别沿着对角线DI1及对角线DI2计算对角线DI1的像素的数目以及对角线DI2的像素的数目。The image processing module 104 calculates the number of pixels on the diagonal line DI1 and the diagonal line DI2 , and determines whether the ratio of the number of pixels on the diagonal line DI1 and the diagonal line DI2 is within a first range. When the image processing module 104 determines that the ratio of the number of pixels on the diagonal line DI1 to the number of pixels on the diagonal line DI2 is within the first range, it outputs an identification result. Furthermore, after the image processing module 104 obtains the positions of the diagonal line DI1 and the diagonal line DI2, it calculates the number of pixels of the diagonal line DI1 and the diagonal line along the diagonal line DI1 and the diagonal line DI2 respectively. The number of pixels of DI2.

接着,于计算得出对角线DI1的像素的数目比对角线DI2的像素的数目后,即将对角线DI1的像素的数目与对角线DI2的像素的数目相除以得到一比例值。若得到的比例值在第一范围内(例如0.9至1.1的范围)时,代表对角线DI1与对角线DI2的像素的数目相等或是差距在可接受的范围内,亦代表对角线DI1与对角线DI2的实际长度相等或是差距在可接受的范围内,此时即输出一辨识结果,此一辨识结果可以是判断辨识的物件12是矩形,或者判断辨识的物件12是五边形、六边形亦或是任何多边形形状,本发明并不以此为限。Next, after calculating the ratio of the number of pixels on the diagonal line DI1 to the number of pixels on the diagonal line DI2, divide the number of pixels on the diagonal line DI1 by the number of pixels on the diagonal line DI2 to obtain a ratio . If the obtained ratio value is within the first range (for example, the range of 0.9 to 1.1), it means that the number of pixels of the diagonal line DI1 and the diagonal line DI2 are equal or the difference is within an acceptable range, which also means that the diagonal line The actual lengths of DI1 and diagonal DI2 are equal or the difference is within an acceptable range. At this time, a recognition result is output. This recognition result can be to judge that the recognized object 12 is a rectangle, or judge that the recognized object 12 is a five-dimensional Polygon, hexagon or any polygonal shape, the present invention is not limited thereto.

请参阅图4,图4为根据本发明一实施例的具有物件的部分影像的示意图。如图4所示,前述边线检测程序是为比较影像14的像素1420与其他像素1412、1418、1420的灰阶度值的差值是否大于门槛值,当影像的像素1420比较其他像素1412、1414、1416、...1428的灰阶度值的差值大于门槛值时,像素1420于影像14中的位置即为物件12的多个边线L1、L2、L3、L4的像素的位置,其中像素1420是相邻于像素142。换句话说,当使用者将物件12平行放置在影像撷取模块102下时,使用者可通过在物件12下方放置一个光源,藉由物件12所放置的像素位置会因为物件12本身遮住部分光线,而比未放置物件12的其他像素位置的亮度为低,再加上于放置物件12的边线位置的像素亮度,会比相邻边线外的像素位置的亮度具有较大差距的特性,来比较影像14中每一个像素与其相邻的像素的灰阶度值的差值。Please refer to FIG. 4 . FIG. 4 is a schematic diagram of a partial image of an object according to an embodiment of the present invention. As shown in FIG. 4 , the above-mentioned edge detection program is to compare whether the difference between the gray scale value of the pixel 1420 of the image 14 and other pixels 1412, 1418, 1420 is greater than the threshold value. , 1416, ... 1428 when the gray scale value difference is greater than the threshold value, the position of the pixel 1420 in the image 14 is the position of the pixels of the multiple edge lines L1, L2, L3, L4 of the object 12, wherein the pixel 1420 is adjacent to pixel 142 . In other words, when the user places the object 12 in parallel under the image capture module 102, the user can place a light source under the object 12, and the pixel position placed by the object 12 will be partially covered by the object 12 itself. Light, and the brightness is lower than other pixel positions where the object 12 is not placed, and the pixel brightness at the edge position where the object 12 is placed will have a larger difference in brightness than the brightness of the pixel positions outside the adjacent edge. The difference between the grayscale values of each pixel in the image 14 and its adjacent pixels is compared.

于此以一例子说明,影像撷取模块102于撷取一物件12(例如五边形)的影像14后,则将具有物件12的影像14传送至影像处理模块104。影像处理模块104则计算影像14中的每一像素的灰阶度值,并以像素1420为中心开始分别与相邻的其他像素1412、1414、1416、...1428计算两灰阶度值的差值是否大于一门槛值(例如是否大于125)。例如像素1420的灰阶度值为255,而相邻于像素1420的左方的像素1412、1418、1424的灰阶度值分别为10、20、50,相邻于像素1420的右方的像素1416、1422、1428的灰阶度值分别为168、175、192,相邻于像素1420的上方的像素1414以及于像素1420的下方的像素1426的灰阶度值分别为245以及252。将像素1420的灰阶度值分别与像素1412、1418、1424的灰阶度相减时,其差值均大于门槛值。而将像素1420的灰阶度值分别与像素1416、1422、1428的灰阶度值以及像素1414、1426的灰阶度值相比均小于门槛值。此时影像处理模块104即可判定像素1420为物件12的左边线。An example is used here to illustrate that after the image capture module 102 captures the image 14 of an object 12 (such as a pentagon), the image 14 with the object 12 is sent to the image processing module 104 . The image processing module 104 calculates the grayscale value of each pixel in the image 14, and starts to calculate the two grayscale values with other adjacent pixels 1412, 1414, 1416, ... 1428 centered on the pixel 1420. Whether the difference is greater than a threshold (for example, greater than 125). For example, the grayscale value of pixel 1420 is 255, and the grayscale values of pixels 1412, 1418, and 1424 adjacent to the left of pixel 1420 are 10, 20, and 50 respectively, and the pixels adjacent to the right of pixel 1420 The grayscale values of 1416, 1422, and 1428 are 168, 175, and 192 respectively, and the grayscale values of the pixel 1414 adjacent to the pixel 1420 above and the pixel 1426 below the pixel 1420 are 245 and 252, respectively. When the grayscale value of pixel 1420 is subtracted from the grayscale values of pixels 1412, 1418, and 1424, the differences are all greater than the threshold value. However, the gray scale value of the pixel 1420 is compared with the gray scale values of the pixels 1416, 1422, 1428 and the gray scale values of the pixels 1414, 1426 respectively, and they are all smaller than the threshold value. At this time, the image processing module 104 can determine that the pixel 1420 is the left line of the object 12 .

不仅如此,为使本发明的边线上的像素的灰阶度值可以与边线外相邻的像素的灰阶度值差距更为明显,本发明的光源数量可以是多个,且此些光源的位置亦不仅可放在物件12的下方,亦可依据使用者状况的需求,放置在多个不同位置上,使本发明的物件12的边线可更精确地取得。Not only that, in order to make the grayscale value of the pixel on the sideline of the present invention more distinct from the grayscale value of adjacent pixels outside the sideline, the number of light sources in the present invention can be multiple, and the number of these light sources The position can not only be placed under the object 12, but also can be placed in multiple different positions according to the needs of the user's situation, so that the edge of the object 12 of the present invention can be obtained more accurately.

除此之外,影像处理模块104更具有接收多个测量数值,其中每一个测量数值是为对应多个边线L1、L2、L3、L4或多个对角线DI1、DI2的实际长度其中之一,以及影像处理模块104更于执行边线检测程序以从影像中获得物件12的多个边线L1、L2、L3、L4的位置后,依据所接收的上述测量数值与对应的此些边线L1、L2、L3、L4或此些对角线DI1、DI2的位置上的像素的数目的一关系式以计算像素142的尺寸。于一实施例中,使用者可预先测量此物件12的边线L1、L2、L3、L4以及两对角线DI1、DI2的实际长度,并将上述测量数值输入至辨识影像中物件装置10中。而影像处理模块104可因前述计算得出的边线L1、L2、L3、L4以及两对角线DI1、DI2的实际长度以及其位置上像素的数目以计算影像的像素的尺寸。In addition, the image processing module 104 is further capable of receiving a plurality of measured values, wherein each measured value corresponds to one of the actual lengths of a plurality of sidelines L1, L2, L3, L4 or a plurality of diagonal lines DI1, DI2 , and the image processing module 104 further executes the edge detection program to obtain the positions of the multiple edges L1, L2, L3, and L4 of the object 12 from the image, according to the received measurement values and the corresponding edges L1, L2 , L3 , L4 or a relational expression of the number of pixels at the positions of these diagonal lines DI1 , DI2 to calculate the size of the pixel 142 . In one embodiment, the user can measure the actual lengths of the edges L1 , L2 , L3 , L4 and the two diagonals DI1 , DI2 of the object 12 in advance, and input the measured values into the device 10 for recognizing objects in images. The image processing module 104 can calculate the pixel size of the image based on the actual lengths of the edges L1 , L2 , L3 , L4 and the two diagonals DI1 , DI2 and the number of pixels at their positions obtained from the aforementioned calculation.

于另一实施例中,当物件12为五边形时,使用者可于撷取五边形的影像前,预先测量此五边形的五个边长以及三个对角线的实际长度,并将上述测量数值输入至辨识影像中物件装置10中。影像处理模块104再依前述边线检测程序得到五边形的5个边长于影像中的位置,于后再依据五个边长的位置得到五边形的3个对角线于影像中的位置。最后,影像处理模块104再根据输入的边长及对角线的实际长度,以及此些边长及对角线于影像中的位置上的像素的数目,即可计算得出影像14的像素的尺寸。In another embodiment, when the object 12 is a pentagon, the user can pre-measure the actual lengths of the five sides and three diagonals of the pentagon before capturing the image of the pentagon, And input the above measurement value into the device 10 for identifying objects in the image. The image processing module 104 then obtains the positions of the five sides of the pentagon in the image according to the aforementioned edge detection procedure, and then obtains the positions of the three diagonals of the pentagon in the image according to the positions of the five sides. Finally, the image processing module 104 can calculate the number of pixels in the image 14 according to the input side length and the actual length of the diagonal line, and the number of pixels at the position of the side length and the diagonal line in the image. size.

前述关系式可以是:The aforementioned relationship can be:

其中,总比值为每一个测量数值与对应的此些边线L1、L2、L3、L4或对应的此些对角线DI1、DI2其中之一的像素的数目的比值相加,测量个数为所接收的多个测量数值的数量。举例来说,当测量到边线L1、L2、L3、L4及两对角线DI1、DI2的实际长度后,影像处理模块104将边线L1的长度除以边线L1上的像素的数目以得到边线L1的比值。之后影像处理模块104再将边线L2的长度除以边线L2上的像素的数目以得到边线L2的比值,其后以此类推,以得到4个边线L1、L2、L3、L4以及2对角线DI1、DI2的比值。处理模块104再行对此6个比值做算术平均数(即将此6个比值相加除以6),来得到影像的像素的尺寸。Wherein, the total ratio is the addition of each measured value to the ratio of the number of pixels corresponding to these sidelines L1, L2, L3, L4 or corresponding to one of these diagonal lines DI1, DI2, and the number of measurements is The number of multiple measurements received. For example, after measuring the actual lengths of the sidelines L1, L2, L3, L4 and the two diagonal lines DI1, DI2, the image processing module 104 divides the length of the sideline L1 by the number of pixels on the sideline L1 to obtain the sideline L1 ratio. Then the image processing module 104 divides the length of the sideline L2 by the number of pixels on the sideline L2 to obtain the ratio of the sideline L2, and so on, to obtain 4 sidelines L1, L2, L3, L4 and 2 diagonal lines The ratio of DI1 and DI2. The processing module 104 then makes an arithmetic mean of the 6 ratios (that is, adds and divides the 6 ratios by 6) to obtain the pixel size of the image.

除前述所述的关系式之外,其关系式亦可以是使用加权平均数的方式以计算像素142的尺寸,关系式如下:In addition to the aforesaid relational expression, the relational expression may also use a weighted average to calculate the size of the pixel 142, and the relational expression is as follows:

其中,总长度为选择性地将此些测量数值以加权形式相加,总像素的数目为将此些测量数值所对应的此些边线或对应的此些对角线的像素的数目相加。更进一步来说,为使得到的像素142的尺寸可以更为精确,处理模块104可对其中某些测量数值给予较高的权重,例如因两对角线DI1,DI2的长度较其他边线L1、L2、L3、L4为长,其两对角线DI1,DI2的像素的数目亦比其他边线L1、L2、L3、L4的像素的数目为多,若给予两对角线的长度较高权重(例如1.4),其计算出的单一像素的误差,会比给没有给予权重而计算出单一像素的误差较小,亦即计算出的单一像素的尺寸会更为精确。Wherein, the total length is the selective addition of these measurement values in a weighted form, and the total number of pixels is the addition of the number of pixels of the side lines or the corresponding diagonal lines corresponding to the measurement values. Furthermore, in order to make the size of the obtained pixel 142 more accurate, the processing module 104 can give higher weights to some of the measured values, for example, because the lengths of the two diagonal lines DI1 and DI2 are longer than those of the other side lines L1, L2, L3, and L4 are long, and the number of pixels on the two diagonal lines DI1, DI2 is also greater than the number of pixels on the other edge lines L1, L2, L3, and L4. If the length of the two diagonal lines is given a higher weight ( For example, 1.4), the error of the calculated single pixel will be smaller than the error of the calculated single pixel without weighting, that is, the calculated size of the single pixel will be more accurate.

除以上所述之外,本发明并不限定需测量出边线L1、L2、L3、L4及两对角线DI1,DI2的全部实际长度才能够加以计算影像14的像素的尺寸,若是仅测量出边线L1、边线L3及对角线DI1,亦可以通过上述两关系式得出影像14的像素的尺寸,本发明于此并不加以限制。In addition to the above, the present invention does not limit the measurement of the entire actual lengths of the sidelines L1, L2, L3, L4 and the two diagonals DI1, DI2 to calculate the pixel size of the image 14. If only the measured The size of the pixels of the image 14 can also be obtained from the sideline L1 , the sideline L3 and the diagonal line DI1 through the above two relational expressions, and the present invention is not limited thereto.

不仅如此,辨识影像中物件装置10可以更包含储存模块106,储存模块106用以储存影像中每一像素的灰阶度值、储存物件12于影像14中边线L1、L2、L3、L4以及对角线DI1、DI2的位置以及储存其上的像素的数目以及所接收的各边线L1、L2、L3、L4以及对角线DI1、DI2的测量数值,并且储存所计算得出的像素142的尺寸以便通过撷取具有下个物件的影像以计算下个物件的尺寸。Not only that, the device 10 for identifying objects in images may further include a storage module 106, the storage module 106 is used to store the gray scale value of each pixel in the image, store the edge lines L1, L2, L3, L4 of the object 12 in the image 14, and compare The positions of the diagonals DI1, DI2 and the number of pixels stored thereon and the received measured values of the respective edges L1, L2, L3, L4 and the diagonals DI1, DI2, and the calculated size of the pixels 142 are stored In order to calculate the size of the next object by capturing the image with the next object.

除前述之外,本发明更具有校正辨识影像的装置10的校正程序,请一并参阅图1以及图5,图5依据本发明一实施例的校正辨识影像的装置辨识影像的功能方框图。如图中所示,影像撷取模块102撷取载有标准试片18的第二影像(未绘于图示)。接着,影像处理模块104则从第二影像中辨识标准试片18的多个边线(未绘于图示)位置,其辨识方式如前所述,故在此不加以赘述。影像处理模块104读取前述第标准试片18的多个边线位置上的像素数目,并于读取完后,影像处理模块104即比对所接收的手动测量标准试片18的多个边线的实际长度与对应的多个像素数目,以算得每一像素(未绘于图示)对应的实际长度。In addition to the above, the present invention further has a correction program of the device 10 for correcting and recognizing images. Please refer to FIG. 1 and FIG. 5 together. FIG. 5 is a functional block diagram of the device for correcting and recognizing images according to an embodiment of the invention. As shown in the figure, the image capturing module 102 captures a second image (not shown) carrying the standard test strip 18 . Next, the image processing module 104 recognizes the positions of a plurality of edges (not shown) of the standard test strip 18 from the second image. The image processing module 104 reads the number of pixels on the plurality of edge positions of the aforementioned first standard test piece 18, and after reading, the image processing module 104 compares the number of pixels of the multiple edge positions of the manually measured standard test piece 18 received. The actual length and the corresponding number of pixels are used to calculate the actual length corresponding to each pixel (not shown in the figure).

当影像处理模块104得到每一像素对应的实际长度后,影像处理模块104则径行发送命令信号至影像撷取模块102,指示影像撷取模块102撷取第三影像(未绘于图示)。影像撷取模块102于撷取到第三影像后,即将第三影像传送至处理模块104进行影像处理,以得到第三影像中标准试片18的多个边线位置上的像素数目。处理模块104则通过前述所计算得到的每一像素对应的实际长度,以及从第三影像中所得到的标准试片18的多个边线位置上的像素数目,计算标准试片18的多个边线的长度。After the image processing module 104 obtains the actual length corresponding to each pixel, the image processing module 104 directly sends a command signal to the image capture module 102 to instruct the image capture module 102 to capture a third image (not shown). After the image capture module 102 captures the third image, it sends the third image to the processing module 104 for image processing, so as to obtain the number of pixels at multiple edge positions of the standard test strip 18 in the third image. The processing module 104 calculates the multiple sidelines of the standard test piece 18 through the actual length corresponding to each pixel obtained from the aforementioned calculation, and the number of pixels on the multiple sideline positions of the standard test piece 18 obtained from the third image. length.

当处理模块104得到上述手动测量标准试片18的多个边线的实际长度,以及通过第三影像与每一像素对应的实际长度所得到计算的多个边线的长度后,处理模块104则判断将前述两长度的比值是否于第二范围(例如0.9至1.1)内,若处理模块104判断其比值在第二范围内时,则处理模块104停止校正程序。若处理模块104判断前述比值不在第二范围内时,则处理模块104会发送一命令信号至影像撷取模块102,指示影像撷取模块102再重新撷取一第四影像(未绘于图示),并重新执行前述校正辨识影像的装置10的校正程序步骤。When the processing module 104 obtains the above-mentioned actual lengths of the multiple edges of the standard test strip 18 manually measured, and the lengths of the multiple edges calculated by the actual length corresponding to each pixel of the third image, the processing module 104 then judges to Whether the ratio of the aforementioned two lengths is within a second range (for example, 0.9 to 1.1), if the processing module 104 determines that the ratio is within the second range, the processing module 104 stops the calibration procedure. If the processing module 104 judges that the aforementioned ratio is not within the second range, the processing module 104 will send a command signal to the image capture module 102, instructing the image capture module 102 to recapture a fourth image (not shown in the figure) ), and re-execute the steps of the calibration procedure of the aforementioned device 10 for calibrating and recognizing images.

为了使所属技术领域具有通常知识者能更了解本发明所述的辨识影像中物件装置,以下搭配本发明的辨识影像中物件方法做进一步的说明。请一并参阅图1、图2及图6,图6为依据本发明一实施例的辨识影像的方法的流程图。如图6所示,于步骤S400中,影像处理模块104接收多个测量数值,其中每一个测量数值是为对应物件12的多个边线或多个对角线的实际长度其中之一。于步骤S402中,影像撷取模块102撷取具有物件12的影像14。于步骤S404中,影像处理模块104执行边线检测程序以从影像14中获得该物件12的多个边线L1、L2、L3、L4的位置。In order to enable those skilled in the art to better understand the device for identifying objects in an image of the present invention, further description will be given below in conjunction with the method for identifying objects in an image of the present invention. Please refer to FIG. 1 , FIG. 2 and FIG. 6 together. FIG. 6 is a flowchart of a method for recognizing an image according to an embodiment of the present invention. As shown in FIG. 6 , in step S400 , the image processing module 104 receives a plurality of measured values, wherein each measured value corresponds to one of the actual lengths of the plurality of edges or the plurality of diagonals of the corresponding object 12 . In step S402 , the image capture module 102 captures the image 14 with the object 12 . In step S404 , the image processing module 104 executes an edge detection program to obtain the positions of a plurality of edges L1 , L2 , L3 , L4 of the object 12 from the image 14 .

于步骤S406中,影像处理模块104依据物件12的多个边线L1、L2、L3、L4的位置取得在影像14中物件12的多个对角线中对角线DI1及对角线DI2的位置,影像处理模块104。于步骤S408中,影像处理模块104计算影像中物件的对角线DI1及对角线DI2的位置上的像素的数目。于步骤S410中,影像处理模块104计算影像中物件12的边线L1、L2、L3、L4的位置上的像素的数目。于步骤S412中,影像处理模块104依据物件12的边线L1、L2、L3、L4及对角线DI1、DI2的位置上的像素的数目,计算影像14的像素的尺寸。于步骤S414中,影像处理模块104判断对角线DI1及对角线DI2的像素的数目比值是否为第一范围内。于步骤S416中,当影像处理模块104判断对角线DI1及对角线DI2的像素的数目比值为第一范围内时,影像处理模块104输出一辨识结果,此辨识结果即判断物件12为矩形。于步骤S418中,当影像处理模块104判断对角线DI1及对角线DI2的像素的数目比值不为第一范围内时,影像处理模块104输出另一辨识结果,此辨识结果及为判断物件12不为矩形。In step S406, the image processing module 104 obtains the positions of the diagonal line DI1 and the diagonal line DI2 among the multiple diagonal lines of the object 12 in the image 14 according to the positions of the multiple edge lines L1, L2, L3, and L4 of the object 12 , the image processing module 104 . In step S408 , the image processing module 104 calculates the number of pixels at the positions of the diagonal line DI1 and the diagonal line DI2 of the object in the image. In step S410 , the image processing module 104 calculates the number of pixels at the positions of the edges L1 , L2 , L3 , and L4 of the object 12 in the image. In step S412 , the image processing module 104 calculates the pixel size of the image 14 according to the number of pixels at the positions of the edges L1 , L2 , L3 , L4 and the diagonals DI1 , DI2 of the object 12 . In step S414 , the image processing module 104 determines whether the ratio of the number of pixels of the diagonal line DI1 and the diagonal line DI2 is within the first range. In step S416, when the image processing module 104 judges that the ratio of the number of pixels of the diagonal line DI1 and the diagonal line DI2 is within the first range, the image processing module 104 outputs a recognition result, which means that the object 12 is determined to be a rectangle . In step S418, when the image processing module 104 judges that the ratio of the number of pixels of the diagonal line DI1 and the diagonal line DI2 is not within the first range, the image processing module 104 outputs another recognition result, which is the judgment object 12 is not a rectangle.

值得注意的是,前述步骤S400、步骤S402、步骤S404以及步骤S406的顺序可以变换,举例来说,本发明可以是先进行步骤S402、步骤S404以及步骤S406之后,再行进行步骤S400的动作。不仅如此,步骤S408以及步骤S410的顺序亦可对调,即可先计算影像14中物件12的边线L1、L2、L3、L4的位置上的像素的数目后,再行计算影像14中物件12的对角线DI1、DI2的位置上的像素的数目,端看使用者需求而定,本发明于此并不加以限制。It is worth noting that the order of the aforementioned steps S400, S402, S404, and S406 can be changed. For example, the present invention can firstly perform the steps S402, S404, and S406, and then perform the actions of the step S400. Moreover, the order of step S408 and step S410 can also be reversed, that is, the number of pixels at the positions of the edges L1, L2, L3, and L4 of the object 12 in the image 14 can be calculated first, and then the number of pixels of the object 12 in the image 14 can be calculated. The number of pixels at the positions of the diagonal lines DI1 and DI2 depends on user requirements, and the present invention is not limited thereto.

接着,请一并参阅图1、图2以及第7图,第7图是依据本发明一实施例的校正辨识影像的装置的方法的流程图。如图中所示,于步骤S500中,影像处理模块104接收手动测量标准试片18的多个边线的实际长度。于步骤S502中,影像撷取模块102撷取载有标准试片18的第二影像(未绘于图示)。于步骤S504中,影像处理模块104读取标准试片18的多个边线(未绘于图示)位置上的多个像素数目。于步骤S506中,影像处理模块104比对标准试片18的多个边线的实际长度与对应的多个像素数目,以算得每一像素(未绘于图示)对应的实际长度。于步骤S508中,影像撷取模块102撷取载有标准试片18的第三影像(未绘于图示)。Next, please refer to FIG. 1 , FIG. 2 and FIG. 7 together. FIG. 7 is a flowchart of a method for calibrating an image recognition device according to an embodiment of the present invention. As shown in the figure, in step S500 , the image processing module 104 receives manual measurement of the actual lengths of the multiple sidelines of the standard test strip 18 . In step S502 , the image capture module 102 captures a second image (not shown) carrying the standard test strip 18 . In step S504 , the image processing module 104 reads a plurality of pixel numbers at positions of a plurality of edge lines (not shown in the figure) of the standard test strip 18 . In step S506 , the image processing module 104 compares the actual lengths of the edges of the standard test strip 18 with the corresponding pixel numbers to calculate the actual length corresponding to each pixel (not shown). In step S508 , the image capturing module 102 captures a third image (not shown in the figure) carrying the standard test strip 18 .

于步骤S510中,影像处理模块104依据第三影像及每一像素对应的实际长度,计算标准试片18的多个边线的长度。于步骤S512中,影像处理模块104判断标准试片18的多个边线的实际长度,与通过第三影像算得的长度的比值,是否在第二范围内。影像处理模块104判断标准试片18的多个边线的实际长度,与通过第三影像算得的长度的比值不在第二范围内时,则径行重新从步骤S500开始执行本发明的影像辨识的方法中,校正辨识影像的装置的方法。于步骤S514中,若影像处理模块104判断标准试片18的多个边线的实际长度,与通过第三影像算得的长度的比值在第二范围内时,则影像处理模块104则径行结束校正程序,其后即开始本发明的影像辨识的方法(步骤S400)。In step S510 , the image processing module 104 calculates the lengths of multiple sidelines of the standard test strip 18 according to the third image and the actual length corresponding to each pixel. In step S512 , the image processing module 104 determines whether the ratio of the actual lengths of the edges of the standard test strip 18 to the lengths calculated from the third image is within the second range. When the image processing module 104 judges that the ratio of the actual lengths of the multiple sidelines of the standard test strip 18 to the lengths calculated by the third image is not within the second range, then the image recognition method of the present invention will be executed again from step S500. , a method for calibrating an image recognition device. In step S514, if the image processing module 104 judges that the ratio of the actual lengths of the multiple sidelines of the standard test strip 18 to the length calculated by the third image is within the second range, the image processing module 104 then proceeds to end the calibration procedure. , and then start the image recognition method of the present invention (step S400).

综上所述,本发明辨识影像中物件装置可藉由执行一边线检测程序以得到影像中物件的多个边线、并通过物件的多个边线得到物件的多个对角线。最后再藉由比较于影像中物件的多个对角线的位置上彼此的像素的数目,让使用者可通过撷取物件的影像即可得知物件的形状。除此之外,本发明更通过测量物件的边线和对角线的实际长度,和于影像中物件的边线和对角线上像素的数目,以得到影像中的像素的尺寸,让使用者不需要测量所有的物件尺寸,仅需测量第一个物件的实际长度,其他后续物件即能直接通过撷取物件的影像,并通过影像的像素尺寸来得到后续物件的边线的实际长度。To sum up, the device for identifying objects in an image of the present invention can obtain multiple edges of the object in the image by executing an edge detection program, and obtain multiple diagonals of the object through the multiple edges of the object. Finally, by comparing the number of pixels on multiple diagonal positions of the object in the image, the user can know the shape of the object by capturing the image of the object. In addition, the present invention obtains the pixel size in the image by measuring the actual length of the sideline and diagonal line of the object, and the number of pixels on the sideline and diagonal line of the object in the image, so that the user can All object sizes need to be measured, only the actual length of the first object needs to be measured, other subsequent objects can directly capture the image of the object, and obtain the actual length of the edge of the subsequent object through the pixel size of the image.

不仅如此,本发明更具有校正辨识影像的装置的校正程序,通过所撷取的第二影像中标准试片的多个边线位置上的多个像素数目,以及手动测量标准试片的多个边线的实际长度,以计算像素对应的实际长度。并通过像素对应的实际长度以及所撷取的第三影像以得到计算出的标准试片的多个边线的长度。最后,再通过处理模块判断手动测量的多个边线的实际长度以及计算出的多个边线的长度的比值,是否大于第二范围,让辨识影像的装置可自行校正而不需通过使用者手动校正,并增加组装生产线的测量物件的精准度。Not only that, the present invention also has a calibration procedure for the device for calibrating and identifying images, through the number of pixels on the multiple edge positions of the standard test piece in the captured second image, and manually measuring the multiple edge lines of the standard test piece to calculate the actual length corresponding to the pixel. And the calculated lengths of multiple sidelines of the standard test piece are obtained through the actual lengths corresponding to the pixels and the captured third image. Finally, the processing module judges whether the ratio between the actual lengths of the manually measured multiple edges and the calculated lengths of the multiple edges is greater than the second range, so that the image recognition device can correct itself without manual correction by the user , and increase the accuracy of measuring objects in the assembly line.

当然,本发明还可有其他多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员当可根据本发明作出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。Of course, the present invention can also have other various embodiments, and those skilled in the art can make various corresponding changes and deformations according to the present invention without departing from the spirit and essence of the present invention, but these corresponding Changes and deformations should belong to the scope of protection of the appended claims of the present invention.

Claims (10)

1.一种辨识影像的方法,其特征在于,包括:1. A method for identifying images, comprising: 利用一辨识影像的装置,撷取载有一物件的一第一影像;capturing a first image containing an object by means of an image recognition device; 依据该第一影像,计算该物件的一第一对角线的长度及一第二对角线的长度;以及calculating the length of a first diagonal and the length of a second diagonal of the object based on the first image; and 当该第一对角线长度及该第二对角线长度的比值在一第一范围内时,输出一辨识结果。When the ratio of the length of the first diagonal line to the length of the second diagonal line is within a first range, an identification result is output. 2.根据权利要求1所述的辨识影像的方法,其特征在于,计算该物件的第一对角线长度及第二对角线长度的步骤包括:2. The image recognition method according to claim 1, wherein the step of calculating the length of the first diagonal and the length of the second diagonal of the object comprises: 执行一边线检测程序以从该第一影像中获得该物件的多个边线的位置;以及Executing an edge detection program to obtain positions of edges of the object from the first image; and 依据该物件的该些边线的位置,取得在该第一影像中该物件的该第一对角线及该第二对角线的位置,并读取该第一对角线及该第二对角线的位置上的像素数目,以算得该物件的该第一对角线长度及该第二对角线长度。Obtaining the positions of the first diagonal and the second diagonal of the object in the first image according to the positions of the edges of the object, and reading the first diagonal and the second pair of diagonals The number of pixels at the position of the diagonal line to calculate the length of the first diagonal line and the length of the second diagonal line of the object. 3.根据权利要求2所述的辨识影像的方法,其特征在于,该边线检测程序为比较该第一影像的一第一像素及一第二像素的灰阶度值的差值是否大于一门槛值,当该第一影像的该第一像素及该第二像素的灰阶度值的差值大于该门槛值时,该第一像素于该第一影像中的位置即为该物件的该些边线的像素的位置,其中该第二像素相邻于该第一像素。3. The image recognition method according to claim 2, wherein the edge detection program is to compare whether the difference between the gray scale values of a first pixel and a second pixel of the first image is greater than a threshold value, when the difference between the grayscale values of the first pixel and the second pixel of the first image is greater than the threshold value, the position of the first pixel in the first image is the The positions of the pixels of the edge, where the second pixel is adjacent to the first pixel. 4.根据权利要求3所述的辨识影像的方法,其特征在于,更包括:4. The method for identifying images according to claim 3, further comprising: 接收多个测量数值,其中每一该测量数值为对应该些边线或该些对角线的实际长度其中之一;以及receiving a plurality of measurements, each of which corresponds to one of the actual lengths of the edges or the diagonals; and 于执行该边线检测程序以从该第一影像中获得该物件的该些边线的位置的步骤后,依据该些测量数值与该些边线及该些对角线的位置的一关系式获得并输出该第一影像的像素的尺寸。After the step of executing the edge detection program to obtain the positions of the edges of the object from the first image, obtain and output according to a relational expression between the measured values and the positions of the edges and the diagonals The pixel size of the first image. 5.根据权利要求4所述的辨识影像的方法,其特征在于,该关系式为:5. The method for identifying images according to claim 4, wherein the relational expression is: 其中,该总比值为该些测量数值与对应的该些边线和该些对角线的像素数目的比值相加,该测量个数为所接收的该测量数值的数量。Wherein, the total ratio is the addition of the ratios of the measured values to the corresponding pixel numbers of the side lines and the diagonal lines, and the measured number is the number of received measured values. 6.根据权利要求4所述的辨识影像的方法,其特征在于,该关系式为:6. The method for identifying images according to claim 4, wherein the relational expression is: 其中,该总长度为选择性地将该些测量数值以加权形式相加,该总像素的数目为将对应的该些边线或对应的该些对角线的像素数目相加。Wherein, the total length is the selective addition of the measured values in a weighted form, and the total number of pixels is the sum of the pixel numbers of the corresponding side lines or the corresponding diagonal lines. 7.根据权利要求1所述的辨识影像的方法,其特征在于,利用该辨识影像的装置,撷取载有该物件的该第一影像的步骤前,包括:7. The image recognition method according to claim 1, characterized in that, before the step of capturing the first image carrying the object by using the image recognition device, the method comprises: 校正该辨识影像的装置,其中该辨识影像的装置的校正程序包括:The device for correcting the image recognition, wherein the calibration procedure of the device for recognizing images includes: (a)接收手动测量一标准试片的多个边线的实际长度;(a) Receive manual measurement of the actual lengths of multiple sidelines of a standard test piece; (b)利用该辨识影像的装置,撷取载有该标准试片的一第二影像;(b) using the image recognition device to capture a second image containing the standard test strip; (c)依据该第二影像,读取该标准试片的该些边线的位置上的多个像素数目;(c) based on the second image, read a plurality of pixel numbers at the positions of the edges of the standard test strip; (d)比对该标准试片的该些边线的实际长度与对应的该些像素数目,以算得每一该像素对应的实际长度;(d) Comparing the actual lengths of the edges of the standard test piece with the corresponding pixel numbers, to calculate the actual length corresponding to each pixel; (e)再次利用该辨识影像的装置,撷取载有该标准试片的一第三影像;(e) reusing the image recognition device to capture a third image containing the standard test strip; (f)依据该第三影像及每一该像素对应的实际长度,计算该标准试片的该些边线的长度;以及(f) calculating the lengths of the sidelines of the standard test piece according to the third image and the corresponding actual length of each pixel; and (g)判断该标准试片的该些边线的实际长度与通过该第三影像算得的长度的比值是否在一第二范围内;(g) judging whether the ratio of the actual length of the edges of the standard test piece to the length calculated by the third image is within a second range; 其中若判断该标准试片的该些边线的实际长度与通过该第三影像算得的长度的比值在该第二范围内时,结束校正程序,若判断该标准试片的该些边线的实际长度与通过该第三影像算得的长度的比值不在该第二范围内时,重复步骤(a)至(g)。Wherein if it is judged that the ratio of the actual lengths of the edges of the standard test piece to the length calculated by the third image is within the second range, the calibration procedure ends, and if the actual length of the edges of the standard test piece is judged When the ratio to the length calculated by the third image is not within the second range, repeat steps (a) to (g). 8.一种辨识影像的装置,其特征在于,包括:8. A device for identifying images, characterized in that it comprises: 一影像撷取模块,用以撷取具有一物件的一影像;以及an image capturing module, used for capturing an image with an object; and 一影像处理模块,耦接该影像撷取模块,该影像处理模块执行一边线检测程序以从该影像中获得该物件的多个边线的位置,该影像处理模块并依据该物件的该些边线的位置取得在该影像中该物件的多个对角线中一第一对角线及一第二对角线的位置、计算该第一对角线及该第二对角线的位置上的像素数目,以及判断该第一对角线及该第二对角线的像素数目的比值是否在一第一范围内;An image processing module, coupled to the image capture module, the image processing module executes an edge detection program to obtain the positions of multiple edges of the object from the image, and the image processing module according to the position of the edges of the object The position obtains the position of a first diagonal and a second diagonal among the multiple diagonals of the object in the image, and calculates the pixels on the position of the first diagonal and the second diagonal number, and judging whether the ratio of the number of pixels of the first diagonal line and the number of pixels of the second diagonal line is within a first range; 其中当该第一对角线及该第二对角线的像素数目的比值在该第一范围内时,输出一辨识结果。Wherein when the ratio of the number of pixels of the first diagonal line and the second diagonal line is within the first range, an identification result is output. 9.根据权利要求8所述的辨识影像的装置,其特征在于,该边线检测程序为比较该影像的一第一像素与一第二像素的灰阶度值的差值是否大于一门槛值,当该影像的该第一像素及该第二像素的灰阶度值的差值大于该门槛值时,该第一像素于该影像中的位置即为该物件的该些边线的像素的位置,其中该第二像素相邻于该第一像素,该影像处理模块接收多个测量数值,其中每一该测量数值为对应该些边线或该些对角线的实际长度其中之一,以及该影像处理模块更于执行该边线检测程序以从该影像中获得该物件的该些边线的位置后,依据该些测量数值与该些边线及该些对角线的位置的一关系式获得并输出该影像的像素的尺寸,其中该关系式为:9. The image recognition device according to claim 8, wherein the edge detection program is to compare whether the difference between the grayscale values of a first pixel and a second pixel of the image is greater than a threshold value, When the difference between the grayscale values of the first pixel and the second pixel of the image is greater than the threshold value, the position of the first pixel in the image is the position of the pixels of the borders of the object, Wherein the second pixel is adjacent to the first pixel, the image processing module receives a plurality of measured values, wherein each of the measured values corresponds to one of the actual lengths of the side lines or the diagonal lines, and the image After the processing module executes the edge detection program to obtain the positions of the edges of the object from the image, it obtains and outputs the The dimensions of the pixels of the image, where the relation is: 其中,该总比值为该些测量数值与对应的该些边线和该些对角线的像素数目的比值相加,该测量个数为所接收的该些测量数值的数量。Wherein, the total ratio is the addition of the ratios of the measured values to the corresponding pixel numbers of the side lines and the diagonal lines, and the measured number is the number of the received measured values. 10.根据权利要求8所述的辨识影像的装置,其特征在于,该边线检测程序为比较该影像的一第一像素与一第二像素的灰阶度值的差值是否大于一门槛值,当该影像的该第一像素及该第二像素的灰阶度值的差值大于该门槛值时,该第一像素于该影像中的位置即为该物件的该些边线的像素的位置,其中该第二像素相邻于该第一像素,该影像处理模块接收多个测量数值,其中每一该测量数值为对应该些边线或该些对角线的实际长度其中之一,以及该影像处理模块更于执行该边线检测程序以从该影像中获得该物件的该些边线的位置后,依据该些测量数值与该些边线及该些对角线的位置的一关系式获得并输出该影像的像素的尺寸,其中该关系式为:10. The image recognition device according to claim 8, wherein the edge detection program is to compare whether the difference between the grayscale values of a first pixel and a second pixel of the image is greater than a threshold value, When the difference between the grayscale values of the first pixel and the second pixel of the image is greater than the threshold value, the position of the first pixel in the image is the position of the pixels of the borders of the object, Wherein the second pixel is adjacent to the first pixel, the image processing module receives a plurality of measured values, wherein each of the measured values corresponds to one of the actual lengths of the side lines or the diagonal lines, and the image After the processing module executes the edge detection program to obtain the positions of the edges of the object from the image, it obtains and outputs the The dimensions of the pixels of the image, where the relation is: 其中,该总长度为选择性地将该些测量数值以加权形式相加,该总像素的数目为将对应的该些边线或对应的该些对角线的像素数目相加。Wherein, the total length is the selective addition of the measured values in a weighted form, and the total number of pixels is the sum of the pixel numbers of the corresponding side lines or the corresponding diagonal lines.
CN201410167796.XA 2014-04-09 2014-04-24 Device and method for identifying image Pending CN104976951A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
TW103113094A TWI507678B (en) 2014-04-09 2014-04-09 Device and method for identifying an object
TW103113094 2014-04-09

Publications (1)

Publication Number Publication Date
CN104976951A true CN104976951A (en) 2015-10-14

Family

ID=54273694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410167796.XA Pending CN104976951A (en) 2014-04-09 2014-04-24 Device and method for identifying image

Country Status (3)

Country Link
JP (1) JP2015201193A (en)
CN (1) CN104976951A (en)
TW (1) TWI507678B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114723655A (en) * 2021-01-06 2022-07-08 纬创资通股份有限公司 Object counting system and object counting method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023195456A1 (en) * 2022-04-04 2023-10-12 京セラ株式会社 Electronic instrument, and method for controlling electronic instrument
CN115482521A (en) * 2022-09-06 2022-12-16 青岛海尔电冰箱有限公司 Image Recognition Method, Storage Medium, System and Equipment for Strip Items

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6319084A (en) * 1986-07-11 1988-01-26 Konica Corp Printing quality evaluating method
JPH01231184A (en) * 1988-03-11 1989-09-14 Oki Electric Ind Co Ltd Detecting device for abnormality of area shape
JPH09329413A (en) * 1996-06-07 1997-12-22 Honda Motor Co Ltd Inspection device and method for assembling of transmission gear assembly shaft
CN1551036A (en) * 2003-04-23 2004-12-01 重机公司 Component identification method and device
CN101191994A (en) * 2006-12-01 2008-06-04 鸿富锦精密工业(深圳)有限公司 Optical look angle measuring systems and its measuring method
JP2013114547A (en) * 2011-11-30 2013-06-10 Canon Inc Image processing device, image processing program, robot apparatus, and image processing method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6137893A (en) * 1996-10-07 2000-10-24 Cognex Corporation Machine vision calibration targets and methods of determining their location and orientation in an image
JP4205004B2 (en) * 2004-03-26 2009-01-07 Sriスポーツ株式会社 Calibration method
CN101672620B (en) * 2008-09-08 2011-01-05 鸿富锦精密工业(深圳)有限公司 Electronic device and method for measuring size of object
US7710558B2 (en) * 2008-09-11 2010-05-04 Litesentry Corporation Automated online measurement of glass part geometry

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6319084A (en) * 1986-07-11 1988-01-26 Konica Corp Printing quality evaluating method
JPH01231184A (en) * 1988-03-11 1989-09-14 Oki Electric Ind Co Ltd Detecting device for abnormality of area shape
JPH09329413A (en) * 1996-06-07 1997-12-22 Honda Motor Co Ltd Inspection device and method for assembling of transmission gear assembly shaft
CN1551036A (en) * 2003-04-23 2004-12-01 重机公司 Component identification method and device
CN101191994A (en) * 2006-12-01 2008-06-04 鸿富锦精密工业(深圳)有限公司 Optical look angle measuring systems and its measuring method
JP2013114547A (en) * 2011-11-30 2013-06-10 Canon Inc Image processing device, image processing program, robot apparatus, and image processing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114723655A (en) * 2021-01-06 2022-07-08 纬创资通股份有限公司 Object counting system and object counting method

Also Published As

Publication number Publication date
JP2015201193A (en) 2015-11-12
TW201538964A (en) 2015-10-16
TWI507678B (en) 2015-11-11

Similar Documents

Publication Publication Date Title
US8121400B2 (en) Method of comparing similarity of 3D visual objects
US11551341B2 (en) Method and device for automatically drawing structural cracks and precisely measuring widths thereof
CN110268221B (en) Cord measuring device and cord measuring method
JP6446329B2 (en) Camera calibration apparatus, camera system, and camera calibration method
CN114387268A (en) Bolt looseness detection method and device
KR20190059639A (en) Apparatus and method for measureing a crack in a concrete surface
WO2014045508A1 (en) Inspection device, inspection method, and inspection program
JPWO2020110560A1 (en) Inspection support equipment for concrete structures, inspection support methods and inspection support programs
TWI468658B (en) Lens test device and method
TWI507678B (en) Device and method for identifying an object
US20190385327A1 (en) Image processing apparatus, image processing method, and image processing program
CN103200349B (en) Scanned image color cast automatic detection method
TW201326735A (en) Method and system for measuring width
CN103063139A (en) Device and method for dimension measurement
CN105787925B (en) Push away the automatic testing method and system for sweeping type optical remote sensing load original image bad line
CN117346652A (en) Device and method for detecting size of reinforced concrete unit element in real time based on machine vision
US12229995B1 (en) Fine calibration parameter validation
CN102567981A (en) Image shooting deviation correction system and method
TWI497062B (en) Optical detection system for central process unit socket and method thereof
KR101692159B1 (en) Edge position detecting apparatus and edge position detecting method
JP2004086712A (en) Image processor
KR101703715B1 (en) The apparatus for measuring camera principal point and the method thereof
TW201939946A (en) Method and system for inspecting display apparatus
KR101475742B1 (en) Apparatus and method for performing photogrammetry
JP2017224024A5 (en)

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20151014

WD01 Invention patent application deemed withdrawn after publication