CN114743086A - A kind of line sequence identification detection method and system - Google Patents
A kind of line sequence identification detection method and system Download PDFInfo
- Publication number
- CN114743086A CN114743086A CN202210453187.5A CN202210453187A CN114743086A CN 114743086 A CN114743086 A CN 114743086A CN 202210453187 A CN202210453187 A CN 202210453187A CN 114743086 A CN114743086 A CN 114743086A
- Authority
- CN
- China
- Prior art keywords
- area
- measured
- image
- tested
- value
- 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.)
- Withdrawn
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 24
- 238000000034 method Methods 0.000 claims abstract description 14
- 238000004590 computer program Methods 0.000 claims description 6
- 230000032258 transport Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 4
- 239000003086 colorant Substances 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
本发明涉及线序检测技术领域,尤其涉及一种线序识别检测方法及系统,其中方法包括:将标准电缆放置于背景板上,对其采集图像,并去背景得到参考图像;将参考图像中像素点划分出若干连续区域,并进行排序,作为参考值;待测电缆运动至背景板上时,对其拍照,并去背景得到待测图像;将待测图像中像素点划分为若干待测区域,将若干待测区域沿待测图像中顺序进行排序,对每一待测区域内像素点取平均R值、G值、B值,作为待测值;将排序后待测区域按照顺序与对应的连续区域进行比较,若待测值与参考值的差值小于预定阈值,则判断该待测区域与连续区域颜色相同;若存在与连续区域颜色不同的待测区域,则判断电缆线序不合格。
The invention relates to the technical field of line sequence detection, in particular to a line sequence identification detection method and system, wherein the method comprises: placing a standard cable on a background board, collecting an image of it, and removing the background to obtain a reference image; The pixel points are divided into several continuous areas and sorted as reference values; when the cable to be tested moves to the background plate, take a picture of it, and remove the background to obtain the image to be tested; divide the pixels in the image to be tested into several to be tested area, sort a number of areas to be measured along the order in the image to be measured, and take the average R value, G value, and B value for the pixels in each area to be measured as the measured value; The corresponding continuous areas are compared. If the difference between the value to be measured and the reference value is less than the predetermined threshold, it is judged that the color of the area to be measured and the continuous area are the same; Failed.
Description
技术领域technical field
本发明涉及线序检测技术领域,尤其涉及一种线序识别检测方法及系统。The invention relates to the technical field of line sequence detection, in particular to a line sequence identification detection method and system.
背景技术Background technique
汽车线束是汽车电路的网络主体,连接汽车的电气电子部件并使之发挥功能,线束是指由铜材冲至而成的接触件端子与电线电缆压接后,外面再塑压绝缘体或外加金属壳等,以线束捆扎形成连接电路的组件。随着汽车功能的增加,电子控制技术的普遍应用,电气件越来越多,汽车上的电路数量与线束数量显著增加,汽车线束的设计与布局成为汽车生产过程中十分重要的组成部分。The automobile wiring harness is the network main body of the automobile circuit, connecting the electrical and electronic components of the automobile and making it function. Shells, etc., are bundled with wire harnesses to form components that connect circuits. With the increase of automobile functions, the widespread application of electronic control technology, and the increasing number of electrical components, the number of circuits and wiring harnesses on the automobile has increased significantly. The design and layout of automobile wiring harnesses have become a very important part of the automobile production process.
线束与线束之间、线束与电气件之间的连接,采用联插件或线耳,联插件由塑料制成,分有插头和插座,线束与线束之间用联插件相接,线束与电气件之间的连接用联插件或线耳。The connection between the wiring harness and the wiring harness, between the wiring harness and the electrical parts, adopts the connector or the wire lug, the connector is made of plastic, and there are plugs and sockets. The connection between the plug-ins or line lugs.
车用线束电线颜色的用途有规定,不同颜色的电线连接着不同的电子元件,因此联插件处的线束必须按照规定顺序排列,如果顺序混淆,将会导致电路连接出错,甚至导致线路短路,引起严重后果。There are regulations for the color of the wires of the vehicle wiring harness. Different colors of wires are connected to different electronic components, so the wiring harnesses at the connector must be arranged in the specified order. If the order is confused, it will lead to circuit connection errors and even lead to short circuits. Serious consequences.
鉴于上述问题的存在,本设计人基于从事此类产品工程应用多年丰富的实务经验及专业知识,并配合学理的运用,积极加以研究创新,以期创设一种线序识别检测方法及系统,使其更具有实用性。In view of the existence of the above problems, the designer, based on years of rich practical experience and professional knowledge in the application of such product engineering, and with the application of academic theory, actively researches and innovates, in order to create a line sequence identification and detection method and system, so that more practical.
公开于该背景技术部分的信息仅仅旨在加深对本发明的总体背景技术的理解,而不应当被视为承认或以任何形式暗示该信息构成已为本领域技术人员所公知的现有技术。The information disclosed in this Background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art.
发明内容SUMMARY OF THE INVENTION
本发明提供了一种线序识别检测方法及系统,从而有效解决背景技术中的问题。The present invention provides a line sequence identification and detection method and system, thereby effectively solving the problems in the background art.
为了达到上述目的,本发明所采用的技术方案是:一种线序识别检测方法,包括:In order to achieve the above purpose, the technical solution adopted in the present invention is: a line sequence identification detection method, comprising:
将标准电缆放置于背景板上,且保持各线束之间平行,对其采集图像,并去背景得到参考图像;Place the standard cable on the background plate and keep the wires parallel to each other, collect an image of it, and remove the background to obtain a reference image;
将参考图像中像素点划分出若干连续区域,并按照线序对若干连续区域进行排序,对每一连续区域内像素点取平均R值、G值、B值,作为参考值;Divide the pixels in the reference image into several continuous areas, sort the several continuous areas according to the line order, and take the average R value, G value, and B value of the pixels in each continuous area as the reference value;
待测电缆运动至背景板上时,对其拍照,并去背景得到待测图像;When the cable to be tested moves to the background plate, take a picture of it, and remove the background to get the image to be tested;
将待测图像中像素点划分为若干待测区域,将若干待测区域沿待测图像中顺序进行排序,对每一待测区域内像素点取平均R值、G值、B值,作为待测值;Divide the pixel points in the image to be measured into several areas to be measured, sort the several areas to be measured along the order in the image to be measured, and take the average R value, G value, and B value for the pixels in each area to be measured, as the value to be measured. measured value;
将排序后待测区域按照顺序与对应的连续区域进行比较,若待测值与参考值的差值小于预定阈值,则判断该待测区域与连续区域颜色相同;Comparing the sorted area to be measured with the corresponding continuous area in order, if the difference between the measured value and the reference value is less than a predetermined threshold, it is determined that the color of the to-be-measured area and the continuous area are the same;
若存在与连续区域颜色不同的待测区域,则判断电缆线序不合格。If there is an area to be tested with a color different from that of the continuous area, the cable sequence is judged to be unqualified.
进一步地,所述去背景包括如下步骤:Further, the background removal comprises the steps:
对背景板拍照,得到第一图像;Taking pictures of the background plate to obtain the first image;
拍摄电缆位于背景板上的图像,得到第二图像;Take an image of the cable on the background plate to get a second image;
将第二图像与第一图像中像素点集合的并集减去交集,得到去背景后的像素点的集合。The intersection is subtracted from the union of the pixel point set in the second image and the first image to obtain the set of pixel points after the background has been removed.
进一步地,在背景板上设置定位区域,当待测电缆运动至背景板上时,采集的第二图像中定位区域颜色和/或亮度与第一图像中定位区域不同时,对第二图像整体的颜色和/或亮度进行填充,再进行去背景。Further, a positioning area is set on the background plate, and when the cable to be tested moves to the background plate, when the color and/or brightness of the positioning area in the collected second image is different from the positioning area in the first image, the entire second image will be affected. The color and/or brightness is filled, and then the background is removed.
进一步地,所述将参考图像中像素点划分出若干连续区域和所述将待测图像中像素点划分为若干待测区域中,包括如下步骤:Further, dividing the pixels in the reference image into several continuous areas and dividing the pixels in the image to be measured into several areas to be measured includes the following steps:
步骤一:遍历图像中每一像素点,以其中一像素点作为起始点,建立第一像素点集合,将起始点坐标放入第一像素点集合;Step 1: Traverse each pixel in the image, take one of the pixels as the starting point, establish a first pixel set, and put the coordinates of the starting point into the first pixel set;
步骤二:在起始点四周的8个像素点区域若存在像素点,则判断该像素点与起始点为相邻像素点,将该像素点坐标放入第一像素点集合;Step 2: If there is a pixel point in the 8 pixel point area around the starting point, then judge that the pixel point and the starting point are adjacent pixel points, and put the pixel point coordinates into the first pixel point set;
步骤三:直至图像剩余像素点中,不存在与第一像素点集合中任一像素点为相邻像素点的像素点;Step 3: Until the remaining pixel points of the image, there is no pixel point that is adjacent to any pixel point in the first pixel point set;
步骤四:在图像剩余像素点中,以其中任一像素点作为起始点,建立第二像素点集合,将起始点坐标放入第二像素点集合中;Step 4: In the remaining pixels of the image, use any one of the pixel points as the starting point to establish a second pixel point set, and put the coordinates of the starting point into the second pixel point set;
重复步骤二至四,直至将图像中像素点划分为若干像素点集合,作为若干连续区域或若干待测区域。Steps 2 to 4 are repeated until the pixels in the image are divided into several pixel sets, which are used as several continuous areas or several areas to be measured.
进一步地,所述将排序后待测区域按照顺序与对应的连续区域进行比较前,先对连续区域和待测区域数量进行比较,若待测区域m小于连续区域n,则判断线序不合格;若待测区域m大于连续区域n,则去除像素点数量最少的待测区域,另m=m-1,直至m=n。Further, before the sequenced area to be measured is compared with the corresponding continuous area in order, the continuous area and the number of the area to be measured are compared first, and if the area to be measured m is less than the continuous area n, the line sequence is judged to be unqualified. ; If the area to be measured m is greater than the continuous area n, remove the area to be measured with the smallest number of pixels, and m=m-1 until m=n.
进一步地,所述将若干待测区域沿待测图像中顺序进行排序前,先对每一待测区域进行纠偏,包括如下步骤:Further, before the sequence of the several regions to be tested is sorted along the order in the image to be tested, the deviation of each region to be tested is first corrected, including the following steps:
将待测区域中任意两距离大于预设值的像素点进行连线,并计算连线的斜率,得到该待测区域的斜率范围;Connect any two pixel points whose distance is greater than the preset value in the area to be measured, and calculate the slope of the connection to obtain the range of the slope of the area to be measured;
判断所述斜率范围内的斜率中值;determining the median slope value within the slope range;
将该待测区域整体进行旋转,直至所述斜率中值旋转至0。The entire region to be measured is rotated until the median value of the slope is rotated to 0.
进一步地,所述将若干待测区域沿待测图像中顺序进行排序时,将旋转后的待测区域按图像Y轴排序成1至m和m至1,将待测区域按照1至m和m至1分别与对应的连续区域进行比较,若其中一顺序的对应待测区域与连续区域颜色相同,则判断电缆线序合格。Further, when sorting a number of areas to be measured along the order in the image to be measured, the rotated areas to be measured are sorted into 1 to m and m to 1 according to the Y axis of the image, and the areas to be measured are sorted according to 1 to m and 1 to 1. M to 1 are respectively compared with the corresponding continuous areas. If the corresponding area to be tested in one sequence is the same color as the continuous area, it is judged that the cable sequence is qualified.
进一步地,所述预设值至少为电缆中电线宽度所占像素点数量的两倍。Further, the preset value is at least twice the number of pixels occupied by the width of the wires in the cable.
进一步地,所述将该待测区域整体进行旋转时,旋转点为该待测区域内坐标x+y最小的像素点。Further, when the entire area to be measured is rotated, the rotation point is the pixel point with the smallest coordinate x+y in the area to be measured.
本发明中还包括一种线序识别检测系统,包括:The present invention also includes a line sequence identification detection system, comprising:
输送组件、背景板、相机、存储器、处理器,及存储在存储器上并可在处理器上运行的计算机程序,所述处理器与相机电连接,所述输送组件对待测电缆进行运输,待测电缆运动至背景板处时,所述相机对其进行拍照,所述处理器执行所述计算机程序时,实现如上述的方法。A conveying assembly, a background plate, a camera, a memory, a processor, and a computer program stored on the memory and running on the processor, the processor is electrically connected to the camera, the conveying assembly transports the cable to be measured, and the to-be-measured cable is transported. When the cable moves to the background plate, the camera takes a picture of it, and when the processor executes the computer program, the above method is implemented.
本发明的有益效果为:本发明通过先将标准电缆进行采集图像,得到标准电缆中每一电线顺序的颜色,进行参考,然后对待测电缆采集图像,去背景后得到待测图像,待测图像中有若干待测区域,代表着待测电缆中的若干电线,将其按照顺序逐一与对应的连续区域进行比较,如果待测值和参考值的差值小于预定阈值,则判断这两个颜色相同,如果全部的待测区域与对应的连续区域的颜色相同,则说明待测电缆电线的线序合格,通过对比待测区域和连续区域内像素点的平均R值、G值、B值,检测更准确。The beneficial effects of the present invention are as follows: the present invention first collects images of the standard cable, obtains the color of each wire sequence in the standard cable, makes reference, then collects the image of the cable to be tested, and removes the background to obtain the image to be tested. There are several areas to be measured, which represent several wires in the cable to be measured. Compare them with the corresponding continuous areas one by one in order. If the difference between the measured value and the reference value is less than the predetermined threshold, judge the two colors. The same, if all the areas to be tested and the corresponding continuous areas have the same color, it means that the line sequence of the cables and wires to be tested is qualified. detection is more accurate.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments described in the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本发明中方法的流程图。Figure 1 is a flow chart of the method of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments.
如图1所示:一种线序识别检测方法,包括:As shown in Figure 1: a line sequence identification detection method, including:
将标准电缆放置于背景板上,且保持各线束之间平行,对其采集图像,并去背景得到参考图像;Place the standard cable on the background plate and keep the wires parallel to each other, collect an image of it, and remove the background to obtain a reference image;
将参考图像中像素点划分出若干连续区域,并按照线序对若干连续区域进行排序,对每一连续区域内像素点取平均R值、G值、B值,作为参考值;Divide the pixels in the reference image into several continuous areas, sort the several continuous areas according to the line order, and take the average R value, G value, and B value of the pixels in each continuous area as the reference value;
待测电缆运动至背景板上时,对其拍照,并去背景得到待测图像;When the cable to be tested moves to the background plate, take a picture of it, and remove the background to get the image to be tested;
将待测图像中像素点划分为若干待测区域,将若干待测区域沿待测图像中顺序进行排序,对每一待测区域内像素点取平均R值、G值、B值,作为待测值;Divide the pixel points in the image to be measured into several areas to be measured, sort the several areas to be measured along the order in the image to be measured, and take the average R value, G value, and B value for the pixels in each area to be measured, as the value to be measured. measured value;
将排序后待测区域按照顺序与对应的连续区域进行比较,若待测值与参考值的差值小于预定阈值,则判断该待测区域与连续区域颜色相同;Comparing the sorted area to be measured with the corresponding continuous area in order, if the difference between the measured value and the reference value is less than a predetermined threshold, it is determined that the color of the to-be-measured area and the continuous area are the same;
若存在与连续区域颜色不同的待测区域,则判断电缆线序不合格。If there is an area to be tested with a color different from that of the continuous area, the cable sequence is judged to be unqualified.
通过先将标准电缆进行采集图像,得到标准电缆中每一电线顺序的颜色,进行参考,然后对待测电缆采集图像,去背景后得到待测图像,待测图像中有若干待测区域,代表着待测电缆中的若干电线,将其按照顺序逐一与对应的连续区域进行比较,如果待测值和参考值的差值小于预定阈值,则判断这两个颜色相同,如果全部的待测区域与对应的连续区域的颜色相同,则说明待测电缆电线的线序合格,通过对比待测区域和连续区域内像素点的平均R值、G值、B值,检测更准确。By first collecting images of the standard cable, the color of each wire in the standard cable is obtained for reference, and then the image of the cable to be tested is collected, and the image to be measured is obtained after removing the background. Several wires in the cable to be tested are compared with the corresponding continuous areas one by one in order. If the difference between the tested value and the reference value is less than the predetermined threshold, it is judged that the two colors are the same. If the color of the corresponding continuous area is the same, it means that the line sequence of the cable to be tested is qualified. By comparing the average R value, G value, and B value of the pixel points in the area to be tested and the continuous area, the detection is more accurate.
在本实施例中,去背景包括如下步骤:In this embodiment, removing the background includes the following steps:
对背景板拍照,得到第一图像;Taking pictures of the background plate to obtain the first image;
拍摄电缆位于背景板上的图像,得到第二图像;Take an image of the cable on the background plate to get a second image;
将第二图像与第一图像中像素点集合的并集减去交集,得到去背景后的像素点的集合。The intersection is subtracted from the union of the pixel point set in the second image and the first image to obtain the set of pixel points after the background has been removed.
通过将第二图像与第一图像中像素点集合的并集减去交集,判断出第二图像和第一图像中的差别之处,将差别之处提取出来即为待测电缆,减少后续处理的像素点的数量,提高处理效率。By subtracting the intersection of the set of pixel points in the second image and the first image, the difference between the second image and the first image is determined, and the difference is extracted to be the cable to be tested, reducing subsequent processing. The number of pixels to improve processing efficiency.
有时由于环境光的变化,会导致对待测电缆进行拍照时,图像的亮度和颜色会与参考图像存在差别,从而影响后续的识别精度,所以在背景板上设置定位区域,当待测电缆运动至背景板上时,采集的第二图像中定位区域颜色和/或亮度与第一图像中定位区域不同时,对第二图像整体的颜色和/或亮度进行填充,再进行去背景。Sometimes due to changes in ambient light, when the cable to be tested is photographed, the brightness and color of the image will be different from the reference image, which will affect the subsequent recognition accuracy. Therefore, a positioning area is set on the background plate. On the background plate, when the color and/or brightness of the location area in the captured second image is different from the location area in the first image, fill in the overall color and/or brightness of the second image, and then remove the background.
在本实施例中,将参考图像中像素点划分出若干连续区域和将待测图像中像素点划分为若干待测区域中,包括如下步骤:In this embodiment, dividing the pixels in the reference image into several continuous areas and dividing the pixels in the image to be measured into several areas to be measured includes the following steps:
步骤一:遍历图像中每一像素点,以其中一像素点作为起始点,建立第一像素点集合,将起始点坐标放入第一像素点集合;Step 1: Traverse each pixel in the image, take one of the pixels as the starting point, establish a first pixel set, and put the coordinates of the starting point into the first pixel set;
步骤二:在起始点四周的8个像素点区域若存在像素点,则判断该像素点与起始点为相邻像素点,将该像素点坐标放入第一像素点集合;Step 2: If there is a pixel point in the 8 pixel point area around the starting point, then judge that the pixel point and the starting point are adjacent pixel points, and put the pixel point coordinates into the first pixel point set;
步骤三:直至图像剩余像素点中,不存在与第一像素点集合中任一像素点为相邻像素点的像素点;Step 3: Until the remaining pixel points of the image, there is no pixel point that is adjacent to any pixel point in the first pixel point set;
步骤四:在图像剩余像素点中,以其中任一像素点作为起始点,建立第二像素点集合,将起始点坐标放入第二像素点集合中;Step 4: In the remaining pixels of the image, use any one of the pixel points as the starting point to establish a second pixel point set, and put the coordinates of the starting point into the second pixel point set;
重复步骤二至四,直至将图像中像素点划分为若干像素点集合,作为若干连续区域或若干待测区域。Steps 2 to 4 are repeated until the pixels in the image are divided into several pixel sets, which are used as several continuous areas or several areas to be measured.
将图像中相邻的像素点放入一个像素点集合中,将其作为一个连续区域或者一个待测区域,从而方便后续对颜色和线序进行判断。The adjacent pixels in the image are put into a pixel set, which is regarded as a continuous area or a to-be-measured area, so as to facilitate the subsequent judgment of color and line order.
合格的电缆中,待测区域应该与连续区域的数量相同,如果待测区域数量小于连续区域数量,则说明待测电缆电线数量少了,则肯定不合格,有时对待测电缆拍照时,图像中可能会存在噪声,所以待测区域数量会多于连续区域的数量,所以在将排序后待测区域按照顺序与对应的连续区域进行比较前,先对连续区域和待测区域数量进行比较,若待测区域m小于连续区域n,则判断线序不合格,无需再进行后续的颜色对比,减少处理量;若待测区域m大于连续区域n,则去除像素点数量最少的待测区域,另m=m-1,直至m=n如果待测区域的数量多于连续区域,则说明图像中存在噪声,通过每次将像素点数量最少的待测区域去除,从而无需对图像进行平均值降噪或者高斯降噪,增加处理速度。In a qualified cable, the number of areas to be tested should be the same as the number of continuous areas. If the number of areas to be tested is less than the number of continuous areas, it means that the number of cables and wires to be tested is small, and it is definitely unqualified. There may be noise, so the number of areas to be tested will be more than the number of continuous areas. Therefore, before comparing the sorted areas to be measured with the corresponding continuous areas in order, first compare the number of continuous areas and the number of areas to be measured. If the area to be measured m is smaller than the continuous area n, the line sequence is judged to be unqualified, and subsequent color comparison is not required to reduce the processing load; if the area to be measured m is greater than the continuous area n, the area to be measured with the smallest number of pixels is removed, and m=m-1, until m=n. If the number of areas to be measured is more than the continuous area, it means that there is noise in the image. By removing the area to be measured with the smallest number of pixels each time, there is no need to reduce the average value of the image. Noise or Gaussian noise reduction to increase processing speed.
在对待测电缆进行拍照时,待测电缆中电线并不一定会相互平行,可能会对后续的排序产生干扰,从而影响线序的判断,所以在将若干待测区域沿待测图像中顺序进行排序前,先对每一待测区域进行纠偏,包括如下步骤:When taking pictures of the cable to be tested, the wires in the cable to be tested are not necessarily parallel to each other, which may interfere with the subsequent sorting, thereby affecting the judgment of the line sequence. Before sorting, correct the deviation of each area to be tested, including the following steps:
将待测区域中任意两距离大于预设值的像素点进行连线,并计算连线的斜率,得到该待测区域的斜率范围;Connect any two pixel points whose distance is greater than the preset value in the area to be measured, and calculate the slope of the connection to obtain the range of the slope of the area to be measured;
判断斜率范围内的斜率中值,该斜率中值会接近待测电缆中电线的长度延伸方向;Determine the median slope value within the slope range, which will be close to the length extension direction of the wires in the cable to be tested;
所以将该待测区域整体进行旋转,直至斜率中值旋转至0,来将待测区域都旋转至大致为水平,从而在排序时,不会产生偏差。Therefore, the entire area to be measured is rotated until the median value of the slope is rotated to 0, so that the area to be measured is rotated to be approximately horizontal, so that there is no deviation during sorting.
其中,将若干待测区域沿待测图像中顺序进行排序时,将旋转后的待测区域按图像Y轴排序成1至m和m至1,将待测区域按照1至m和m至1分别与对应的连续区域进行比较,若其中一顺序的对应待测区域与连续区域颜色相同,则判断电缆线序合格。Among them, when sorting a number of areas to be measured along the order in the image to be measured, the rotated areas to be measured are sorted into 1 to m and m to 1 according to the Y-axis of the image, and the areas to be measured are sorted according to 1 to m and m to 1 They are compared with the corresponding continuous areas respectively. If the corresponding area to be tested in one order is the same color as the continuous area, it is judged that the cable sequence is qualified.
由于待测电缆在背景板上可能处于翻转的状态,所以导致线序与标准的线序相反,所以在排序时,将将待测区域按照1至m和m至1分别与对应的连续区域进行比较,如果其中一个顺序合格,则判断待测电缆的线序合格。Since the cable to be tested may be in an inverted state on the background board, the line sequence is opposite to the standard line sequence. Therefore, when sorting, the test area will be 1 to m and m to 1 respectively and the corresponding continuous area. Compare, if one of the sequences is qualified, judge that the line sequence of the cable to be tested is qualified.
在本实施例中,预设值至少为电缆中电线宽度所占像素点数量的两倍。In this embodiment, the preset value is at least twice the number of pixels occupied by the width of the wires in the cable.
如果待测区域中将两个相邻的像素点进行连线,可能会使斜率与电线长度延伸方向偏移较大,从而对待测区域旋转角度产生较大的偏差,所以两个像素点的距离预设值至少为电缆中电线宽度所占像素点数量的两倍。If two adjacent pixels are connected in the area to be measured, it may cause a large deviation between the slope and the extension direction of the length of the wire, resulting in a large deviation in the rotation angle of the area to be measured. The default value is at least twice the number of pixels the width of the wires in the cable occupies.
作为上述实施例的优选,将该待测区域整体进行旋转时,旋转点为该待测区域内坐标x+y最小的像素点。As a preference of the above embodiment, when the entire region to be tested is rotated, the rotation point is the pixel point with the smallest coordinate x+y in the region to be tested.
在对待测区域进行旋转时,都取待测区域中最靠近图像中左下角的像素点为旋转点,保证旋转后待测区域为待测电缆中电线的顺序,从而保证检测的精度。When the area to be tested is rotated, the pixel point closest to the lower left corner of the image in the area to be tested is taken as the rotation point to ensure that the area to be tested is the order of the wires in the cable to be tested after rotation, thereby ensuring the accuracy of detection.
本实施例中还包括一种线序识别检测系统,包括:This embodiment also includes a line sequence identification detection system, including:
输送组件、背景板、相机、存储器、处理器,及存储在存储器上并可在处理器上运行的计算机程序,处理器与相机电连接,输送组件对待测电缆进行运输,待测电缆运动至背景板处时,相机对其进行拍照,处理器执行计算机程序时,实现如上述的方法。Conveying component, background plate, camera, memory, processor, and a computer program stored on the memory and running on the processor, the processor is electrically connected to the camera, the conveying component transports the cable to be tested, and the cable to be tested moves to the background When it is at the board, the camera takes a picture of it, and when the processor executes the computer program, the above-mentioned method is implemented.
在本发明的描述中,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。“多个”的含义是两个或两个以上,除非另有明确具体的限定。In the description of the present invention, the terms "first" and "second" are only used for the purpose of description, and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature. "Plurality" means two or more, unless expressly specifically limited otherwise.
在本发明中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”、“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the present invention, unless otherwise expressly specified and limited, the terms "installed", "connected", "connected", "fixed" and other terms should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection , or integrated; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of the two elements or the interaction relationship between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必针对相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structure, material or feature is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any description of a process or method in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a specified logical function or step of the process , and the scope of the preferred embodiments of the invention includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present invention belong.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,“计算机可读介质”可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in flowcharts or otherwise described herein, for example, may be considered an ordered listing of executable instructions for implementing the logical functions, may be embodied in any computer-readable medium, For use with, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions from an instruction execution system, apparatus, or apparatus) or equipment. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or apparatus. More specific examples (non-exhaustive list) of computer readable media include the following: electrical connections with one or more wiring (electronic devices), portable computer disk cartridges (magnetic devices), random access memory (RAM), Read Only Memory (ROM), Erasable Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Compact Disc Read Only Memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program may be printed, as the paper or other medium may be optically scanned, for example, followed by editing, interpretation, or other suitable medium as necessary process to obtain the program electronically and then store it in computer memory.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that various parts of the present invention may be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or a combination of the following techniques known in the art: Discrete logic circuits, ASICs with suitable combinational logic gates, Programmable Gate Arrays (PGA), Field Programmable Gate Arrays (FPGA), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。Those skilled in the art can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the program can be stored in a computer-readable storage medium. When executed, one or a combination of the steps of the method embodiment is included.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, and the like. Although the embodiments of the present invention have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present invention. Embodiments are subject to variations, modifications, substitutions and variations.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210453187.5A CN114743086A (en) | 2022-04-24 | 2022-04-24 | A kind of line sequence identification detection method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210453187.5A CN114743086A (en) | 2022-04-24 | 2022-04-24 | A kind of line sequence identification detection method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114743086A true CN114743086A (en) | 2022-07-12 |
Family
ID=82284234
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210453187.5A Withdrawn CN114743086A (en) | 2022-04-24 | 2022-04-24 | A kind of line sequence identification detection method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114743086A (en) |
-
2022
- 2022-04-24 CN CN202210453187.5A patent/CN114743086A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109239075B (en) | Battery detection method and device | |
US11580664B2 (en) | Deep learning-based method and device for calculating overhang of battery | |
CN113610774A (en) | Glass scratch defect detection method, system, device and storage medium | |
CN116843627A (en) | Yarn breakage detection method, device, equipment and storage medium for fiberglass cloth-covered binding yarn | |
CN116468680A (en) | Component reverse pole defect detection method, system, equipment and storage medium | |
CN115775244A (en) | Coil winding detection method and device, electronic equipment and storage medium | |
WO2024216965A1 (en) | Image processing method, point cloud generation method, and image processing apparatus | |
CN118351097A (en) | Method and device for detecting glue path quality, electronic equipment and storage medium | |
CN118154586A (en) | Intelligent connector crack defect detection method based on machine vision | |
US12099017B2 (en) | Inspection system, inspection method, and inspection program | |
CN114743086A (en) | A kind of line sequence identification detection method and system | |
CN115829951A (en) | Scanning electron microscope image defect classification method and device based on design layout | |
CN114494118A (en) | Method for detecting width of target object and method for detecting length of target object | |
CN118392834A (en) | A detection method for integrated circuit transparent flexible substrate | |
CN116580023B (en) | Method, equipment and storage medium for monitoring surface hairball of carbon fiber yarn | |
CN115861315B (en) | Defect detection method and device | |
CN116957969A (en) | Image enhancement method, device, equipment and medium under non-uniform illumination | |
CN114140671B (en) | Classification method and device of high-resolution chip images based on multi-scale fusion | |
CN115345824A (en) | Machine vision-based LED patch polarity detection method and system and storage medium | |
CN116993654A (en) | Camera module defect detection method, device, equipment, storage medium and product | |
CN116558777A (en) | Method and system for testing optical fiber continuity | |
CN114926419A (en) | Visual inspection method, device, equipment and medium for injection molding part burrs | |
CN118823019B (en) | A method and system for detecting appearance and structure of automobile wiring harness | |
CN114240800A (en) | Coding camera image enhancement method and device for scattering scene | |
CN118052861B (en) | Zero plane acquisition method, system, medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20220712 |
|
WW01 | Invention patent application withdrawn after publication |