WO2017080294A1 - Board card image splicing method and processing apparatus and system - Google Patents

Board card image splicing method and processing apparatus and system Download PDF

Info

Publication number
WO2017080294A1
WO2017080294A1 PCT/CN2016/098225 CN2016098225W WO2017080294A1 WO 2017080294 A1 WO2017080294 A1 WO 2017080294A1 CN 2016098225 W CN2016098225 W CN 2016098225W WO 2017080294 A1 WO2017080294 A1 WO 2017080294A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
card
partial
board
partial images
Prior art date
Application number
PCT/CN2016/098225
Other languages
French (fr)
Chinese (zh)
Inventor
廖明熙
Original Assignee
广州视源电子科技股份有限公司
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 广州视源电子科技股份有限公司 filed Critical 广州视源电子科技股份有限公司
Publication of WO2017080294A1 publication Critical patent/WO2017080294A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images

Definitions

  • the invention relates to the field of automatic optical detection, in particular to a card image splicing method, a processing device and a system.
  • the board is an important device with data acquisition function and integrated data input/output. It is widely used in many fields such as automation machinery, electronics industry, security monitoring and computer, and the placement and solder joints of components on the board. The quality of the board will affect the overall performance of the board. Therefore, in actual industrial production, the components and solder joints of the board must be tested to eliminate defective or faulty boards.
  • the automatic optical detection system acquires the image of the detected board through a high-precision camera, and combines the image processing technology to analyze the difference between the image of the detected board and the standard board image, thereby detecting the board.
  • the defect is that the system has the advantages of high degree of automation, high accuracy, easy operation, no damage to the board being tested, and thus is widely used for the detection of boards.
  • the automatic optical detection system when the size of some detected boards is large, if the camera is still used for framing, the overall image of the detected board may not be obtained due to the limited field of view of the camera. It even causes the obtained image of the detected board to be distorted, and thus loses more detailed information of the board image, which is not conducive to efficient and accurate detection and analysis of the board.
  • the embodiment of the invention provides a card image splicing method, a processing device and a system, which are respectively:
  • a method for stitching a card image comprising the following steps:
  • each side of each of the partial images is separately cropped to obtain a standard partial image corresponding to each of the partial images;
  • the standard partial images are spliced to form a card image according to the relative positional relationship of each of the standard partial images on the card.
  • a processing device for stitching a card image comprising:
  • An acquiring unit configured to acquire a partial image of a card acquired by the camera device, where the partial image is acquired by the camera device at a fixed distance interval in the same direction, and the partial images adjacent in the same direction have coincidence region;
  • a processing unit configured to perform distortion correction on each of the partial images, and perform trimming on each side of each of the partial images to obtain a standard partial image corresponding to each of the partial images
  • a splicing unit for splicing the standard partial images to form a card image according to the relative positions of the respective partial partial images.
  • a card image splicing system comprising: a platform device, an imaging device, a control device for controlling relative movement of the camera device and the platform device, and the above-mentioned processing device for splicing a card image, the camera device Connected to the processing device,
  • the platform device is configured to carry a board
  • the camera device is configured to collect a partial image of the card
  • the control device is configured to control the camera device to acquire partial images of the card according to a fixed distance interval in the same direction, and the partial images adjacent in the same direction have overlapping regions.
  • the board image splicing method, processing device and system the partial image of the board is collected by the camera device, and the collected adjacent partial images have overlapping regions in the same direction, and each partial image is separately corrected for distortion, for each
  • the edges of a partial image are cropped, and since the edge portion of the partial image after the distortion correction still has distortion, when the cropping is performed, the edge portion of the partial image overlapping region where the distortion occurs is trimmed, and the standard portion obtained after the clipping is obtained.
  • the board image formed according to the standard partial image splicing has high precision, and the board image splicing method and processing device proposed by the present invention and The system is not limited by the size of the board, and for larger boards it is still possible to obtain higher precision images for inspection.
  • the mark obtained after cutting The quasi-local image can be directly spliced to form the card image according to the relative positional relationship on the board without complicated image feature point matching analysis process, and the image cutting process and the splicing process are more simple and efficient, so the present invention
  • the proposed card image splicing method, processing device and system have high image splicing speed and efficiency.
  • FIG. 1 is a schematic flow chart of a method for stitching a card image in one embodiment
  • FIG. 2 is a schematic diagram of a partial image of a board of a camera device
  • FIG. 3 is a schematic diagram of a partial image of a rectangular board captured by a camera device
  • FIG. 5 is a schematic diagram of cropping of a partial image in one embodiment
  • FIG. 6 is a schematic diagram of cropping of a partial image in one embodiment
  • FIG. 7 is a schematic diagram of a camera device collecting partial images of boards at different positions
  • Figure 8 is a schematic view showing a partial image mosaic of the card
  • FIG. 9 is a schematic flow chart of a method for stitching a card image in one embodiment
  • Figure 10 is a schematic view of the position of the marked point
  • FIG. 11 is a schematic structural diagram of a processing apparatus for board image stitching in one embodiment
  • FIG. 12 is a schematic structural diagram of a processing apparatus for board image stitching in one embodiment
  • FIG. 13 is a schematic structural diagram of a card image splicing system in one embodiment.
  • a method for stitching a card image includes the following steps:
  • S100 acquires a partial image of a card acquired by the camera device
  • the camera device is located directly above the card, and the camera device collects the obtained partial images at a fixed distance interval in the same direction.
  • the camera device captures a partial image of the board every other fixed distance interval.
  • Each part of the captured board of the camera is aligned with the partial image of the board acquired last time and along the direction of the AB side of the board until all partial images of the board are collected, such as Figure 3.
  • the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 shown therein are aligned with each other and are along the direction of the AB side of the card; meanwhile, the camera is fixed in the same direction
  • the partial images of the distances collected in the same direction have overlapping areas. Still taking the rectangular board shown in FIG. 3 as an example, the camera device collects the boards in the direction parallel to the AB side of the board.
  • a partial image, and two adjacent partial images have a certain overlapping area, as shown in the coincident area a 2 b 1 c 1 d 2 in FIG. 3 , the size of the overlapping area is the same as that used by the camera when acquiring a partial image.
  • the smaller the distance interval the greater the overlap region of the partial image.
  • the acquisition mode is the same as that of the AB side of the card, and is collected according to the fixed distance interval in the same direction.
  • the fixed distance interval used by the camera to collect partial images along the AB side and the AD side of the card may be different.
  • S110 After performing the distortion correction on each of the partial images, S110 separately trims each side of each of the partial images to obtain a standard partial image corresponding to each of the partial images;
  • the optical system of the camera device does not work accurately on the principle of idealized aperture imaging, so that the object point in the object space is in the image space.
  • the gray interpolation method can be adopted. The basic idea is to first establish a mathematical model of geometric correction, then determine the model parameters by using known conditions, and finally correct the image containing the distortion according to the model. It is usually divided into two steps: image space coordinate transformation.
  • the mapping relationship between image pixel coordinates and object space corresponding point coordinates is established, the unknown parameters in the mapping relationship are solved, and then the pixel coordinates of the image are corrected according to the mapping relationship;
  • the gray value is used to assign the corresponding gray value to the pixel after the spatial transformation, so as to restore the gray value of the original position, thereby realizing the distortion correction of the image.
  • Partial image display of the board before and after distortion correction as shown in Figure 4. Intention, after the distortion correction, the partial image of the board is closer to the real board image.
  • each side of each partial image after the distortion correction is separately cropped to obtain a standard partial image corresponding to each partial image.
  • the edge portion of the partial image will have a large distortion, and the edge portion with distortion is not conducive to the detection and analysis of the board, so each part of the partial image corrected by the distortion is corrected.
  • the cropping is performed separately to remove the edge portion of the partial image, thereby improving the accuracy of the partial image for board detection.
  • different crop widths can be selected according to different lens parameters of the camera device, because they have different The distortion coefficient of the lens device of the lens parameter is different.
  • the size of the edge portion of the distortion may be different, so that the size of the standard partial image obtained by cropping the partial image is different, so the lens parameter of the camera device is used.
  • the processing method of the partial image of the board with different distortion conditions is fully considered.
  • the cutting width of each side is half of the width of the overlapping area corresponding to each side.
  • the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 will be described as an example.
  • the partial image a 1 b 1 c 1 d 1 After cropping, a corresponding standard partial image 1256 is obtained, and after the partial image a 2 b 2 c 2 d 2 is cropped, a corresponding standard partial image 2345 is obtained, and the area a shown in FIG.
  • 2 b 1 c 1 d 2 is a coincident region of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 when the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b
  • the clipping width of 2 c 2 d 2 is half of the width of the coincident region (ie, the length of a 2 b 1 or d 2 c 1 )
  • the standard partial image 1256 and the standard partial image 2345 can be seamlessly stitched. There is no coincident portion between the standard partial image 1256 and the standard partial image 2345.
  • the width of the partial image overlap region is used as the width of each partial image for cropping, which not only ensures that the corresponding standard partial image can form a complete board image, and does not miss any image information of the card, and avoids The image information is repeatedly displayed due to the coincidence between standard partial images, thereby improving the stitching efficiency of the board image.
  • the cutting width of each side of each partial image is the same.
  • the overlapping area of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 is the area a 2 b 1 c 1 d 2 .
  • the overlapping area of the partial image a 1 b 1 c 1 d 1 and the partial image a 4 b 4 c 4 d 4 is the area a 4 b 4 c 1 d 1 , the partial image a 2 b 2 c 2 d 2 and the partial image a 3
  • the overlapping region of b 3 c 3 d 3 is the region a 3 b 3 c 2 d 2
  • the overlapping region of the partial image a 3 b 3 c 3 d 3 with the partial image a 4 b 4 c 4 d 4 is the region a 3 b 4 c 4 d 3
  • the widths of the respective overlapping regions are the same, that is, the lengths of a 4 d 1 , a 2 b 1 , b 3 c 2 and c 4 d 3 are the same.
  • each partial image is cropped with the same cutting width, which facilitates processing all partial images of the card collected by the imaging device, and conveniently controls the distance interval adopted by the imaging
  • S120 splices the standard partial images into a card image according to the relative positions of the respective partial partial images.
  • the camera device Since the camera device collects partial images of the card, it is collected according to a certain order rule. As shown in FIG. 7, after the camera device collects a partial image of the card at a certain position, it moves to the next position and continues to collect.
  • the partial images of the board so the local images obtained by the acquisition have a certain positional relationship with each other, and since each partial image corresponds to only one standard partial image, each standard partial image also has a relative position relationship with each other.
  • the standard partial image may be spliced according to the relative positions of the respective partial partial images, and finally the card image is formed, as shown in FIG. 8 , the partial image splicing diagram of the card, the card image can reflect the card Information on all components, solder joints, etc.
  • the board image formed according to the standard partial image stitching has high precision, and the board image stitching method has no board.
  • the advantage of card size limitation is that for larger size boards it is still possible to obtain higher precision images for inspection.
  • the standard partial images obtained after cutting can be directly spliced to form the board image according to their relative positions on the board, without complicated image feature point matching analysis process, and the partial image cutting process and the splicing process are more simple. It is efficient, so the board image stitching method proposed in this embodiment has higher image stitching speed and efficiency.
  • the boards have a regular shape, so that the board can be aligned with the field of view of the camera to prevent the partial image captured by the camera from being tilted, thereby facilitating image acquisition and simplifying image acquisition.
  • S900 acquires an image of the marked point on the board and performs distortion correction on the image to obtain a first image
  • the board used in this step can be a common board with components.
  • the components on the board are used as marking points.
  • the board used can also be designed with marking points specially designed for this method. Board.
  • the first image of the marked point is a distortion corrected image including the image of the marked point, for example, before the first image of the marked point on the board is acquired by the camera, the image acquired by the camera is first corrected by the camera calibration technique. Distortion, the acquired image is restored to a real plane, thereby providing an undistorted image for board image calibration, improving the accuracy of board image alignment.
  • the S910 acquires the image of the marked point again and performs distortion correction on the image to obtain a second image.
  • the second image includes the mark Distorted image after the image of the point.
  • the xy coordinate system is established with the two adjacent sides of the board. Referring to FIG. 10, it is assumed that the first image S 0 of the marked point is located at the origin O(0, 0) of the coordinate system, and is changed. After the position of the board, the second image S 1 of the marked point moves to the point (x1, y1), and the moving distance of the marked point is
  • S920 Obtain an offset trajectory of the marker point according to the first image and the second image, and calculate an angle between the offset trajectory and an edge of the first image or the second image;
  • AB, BC, CD, and DA are respectively four sides of the second image, and the actual offset of the marked point can be obtained in the coordinate system established in step S910.
  • the offset trajectory of the marker point is calculated in the same manner as the angle between the other sides of the second image.
  • S930 adjusts the position of the camera device or the card according to the angle to make the offset
  • the trajectory is parallel or perpendicular to the sides of the first image or the second image.
  • the position of the camera or the card is adjusted according to the angle, so that the offset trajectory of the marker point is parallel to the AB edge of the second image or the DA side Vertically, for example, by rotating the board to reduce y 1 or the like, the board is finally aligned with the camera.
  • the x-axis direction of the alignment card and the second image of the marked point are taken as an example, but it should be noted that the above method is also fully applicable to the board y.
  • the present invention provides a processing apparatus for board image stitching.
  • the processing apparatus for board image stitching includes an acquisition unit 1100 connected in sequence, and processing. Unit 1110 and splicing unit 1120,
  • the acquiring unit 1100 is configured to acquire a partial image of a card acquired by the camera device, where the partial image is acquired by the camera device at a fixed distance interval in the same direction, and the partial image adjacent in the same direction has Coincident area
  • the processing unit 1110 is configured to perform, after performing distortion correction on each of the partial images, performing trimming on each side of each of the partial images to obtain a standard partial image corresponding to each of the partial images;
  • the splicing unit 1120 is configured to splicing the standard partial images to form a card image according to the relative positions of the respective partial partial images.
  • the acquiring unit 1100 acquires a partial image of the card acquired by the camera device, and the partial image is acquired by the imaging device at a fixed distance interval in the same direction, and the adjacent partial images in the same direction have overlapping regions.
  • the camera device collects a partial image of the card according to a fixed distance interval in the same direction.
  • the partial image of the card captured by the camera device is a partial image obtained by the camera device at a fixed distance interval in the same direction. To illustrate this step in detail, taking the rectangular board shown in Figure 3 as an example, in a direction parallel to one side of the board (such as the AB side), the camera captures a partial image of the board every other fixed distance interval.
  • Each part of the captured board of the camera is aligned with the partial image of the board acquired last time and along the direction of the AB side of the board until all partial images of the board are collected, such as Figure 3.
  • a partial image shown in FIG. 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 are aligned with one another along the direction of the edge AB of the board; while fixing an imaging apparatus according to the same direction
  • the partial images of the distances collected in the same direction have overlapping areas.
  • the camera device collects the boards in the direction parallel to the AB side of the board.
  • the size of the overlapping area is the same as that used by the camera when acquiring a partial image. Fixed distance interval The size is related, and the smaller the distance interval, the larger the overlapping area of the partial image.
  • the acquisition mode is the same as that of the AB side of the card, and is collected according to the fixed distance interval in the same direction.
  • the fixed distance interval used by the camera to collect partial images along the AB side and the AD side of the card may be different.
  • the processing unit 1110 performs distortion correction on the partial image of the board acquired by the acquiring unit 1100, and then trims each side of each partial image to obtain a standard partial image corresponding to each partial image.
  • the optical system of the camera device does not work accurately on the principle of idealized aperture imaging, so that the object point in the object space is in the image space. There is an optical aberration between the actual image point and the ideal image point, which causes image distortion.
  • the processing unit 1110 performs distortion correction on the partial image, the gray interpolation method may be adopted.
  • the basic idea is to first establish a mathematical model of the geometric correction, then determine the model parameters by using known conditions, and finally correct the image containing the distortion according to the model.
  • the method is generally divided into two steps: image space coordinate transformation. Firstly, the mapping relationship between the pixel coordinates of the image and the coordinate of the object corresponding point is established, the unknown parameters in the mapping relationship are solved, and then the coordinates of each pixel of the image are corrected according to the mapping relationship; The gray value of each pixel is determined, and the spatially transformed pixel is given a corresponding gray value to restore the gray value of the original position, thereby realizing distortion correction of the image.
  • the processing unit 1110 respectively trims each side of each partial image after the distortion correction to obtain a standard partial image corresponding to each partial image.
  • the edge portion of the partial image may have a large distortion, and the edge portion with distortion may be disadvantageous for detecting and analyzing the card, so the processing unit 1110 passes the distortion corrected portion.
  • Each side of the image is cropped separately to remove the edge portion of the partial image, thereby improving the partial image for board detection. accuracy.
  • the processing unit 1110 may select different according to different lens parameters of the camera device, in order to ensure that the selected cropping width meets the actual requirements and the board image image splicing efficiency is improved.
  • the clipping width is different because the distortion coefficient of the camera device with different lens parameters is different.
  • the size of the edge portion of the distortion may be different, so that the size of the standard partial image obtained by cropping the partial image is different, so Taking the lens parameters of the camera as the reference and basis of the cutting width, the processing method of the partial image of the board with different distortion conditions is fully considered.
  • the processing unit 1110 when the processing unit 1110 separately trims each side of each partial image, the cutting width of each side of the processing unit 1110 is half of the width of the overlapping area corresponding to each side.
  • the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 will be described as an example.
  • the processing unit 1110 is After the partial image a 1 b 1 c 1 d 1 is cropped, a corresponding standard partial image 1256 is obtained, and after the partial image a 2 b 2 c 2 d 2 is cropped, a corresponding standard partial image 2345 is obtained, as shown in FIG. 5 .
  • the area a 2 b 1 c 1 d 2 is a coincident region of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 when the partial image a 1 b 1 c 1 d 1 and the partial image
  • the cutting width of a 2 b 2 c 2 d 2 is half of the width of the overlapping area (ie, the length of a 2 b 1 or d 2 c 1 )
  • the standard partial image 1256 and the standard partial image 2345 can be seamlessly stitched. At this time, there is no coincident portion between the standard partial image 1256 and the standard partial image 2345.
  • the processing unit 1110 uses the half of the width of the partial image overlap region as the width of the cropping of each partial image, which not only ensures that the corresponding standard partial image can form a complete board image, and does not miss any image information of the board. At the same time, the repeated display of image information due to coincidence between standard partial images is avoided, thereby improving the stitching efficiency of the board image.
  • the processing unit 1110 cuts a partial image of the board acquired by the camera
  • the cutting width of each side of each partial image is the same.
  • the overlapping area of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 is the area a 2 b 1 c 1 d 2 .
  • the overlapping area of the partial image a 1 b 1 c 1 d 1 and the partial image a 4 b 4 c 4 d 4 is the area a 4 b 4 c 1 d 1 , the partial image a 2 b 2 c 2 d 2 and the partial image a 3
  • the overlapping region of b 3 c 3 d 3 is the region a 3 b 3 c 2 d 2
  • the overlapping region of the partial image a 3 b 3 c 3 d 3 with the partial image a 4 b 4 c 4 d 4 is the region a 3 b 4 c 4 d 3
  • the widths of the respective overlapping regions are the same, that is, the lengths of a 4 d 1 , a 2 b 1 , b 3 c 2 and c 4 d 3 are the same.
  • the processing unit 1110 cuts each partial image with the same cropping width, so as to facilitate processing all the partial images of the card captured by the camera device, and at the same time, conveniently control the distance interval adopted by the camera device. It is beneficial to improve the efficiency of board image stitching.
  • the splicing unit 1120 splices the standard partial images into a card image according to the relative positions of the respective partial partial images. Since the camera device collects partial images of the card, it is collected according to a certain order rule, so the partial images obtained by the camera have a certain positional relationship with each other, and each partial image corresponds to only one standard part. The image, and thus the standard partial images also have a relative positional relationship with each other. When the image splicing is performed, the splicing unit 1120 can splicing the standard partial images according to the relative positions of the respective partial partial images, and finally forming a card image, the card The image can reflect all the components, solder joints and other information on the board.
  • the board image formed according to the standard partial image stitching since the distortion of each standard partial image constituting the board image is corrected, the board image formed according to the standard partial image stitching has high precision.
  • the card image splicing system has the advantage that it is not limited by the size of the board, and a higher-precision image can still obtain a higher-precision image for detection.
  • the standard partial images obtained after cutting can be directly spliced to form the board image according to their relative positions on the board, without complicated image feature point matching analysis process, and the image cutting process and the splicing process are more convenient and efficient. Therefore, the processing device for board image stitching proposed in this embodiment has higher image stitching speed and better image stitching effect.
  • the boards have a regular shape, so that the board can be aligned with the field of view of the camera to prevent the partial image captured by the camera from being tilted, thereby facilitating the process of image acquisition and processing.
  • a marker point image acquisition unit 1200, an operation unit 1210, and an adjustment unit 1220, which are sequentially connected for image alignment, are further included. among them
  • the point image acquiring unit 1200 is configured to acquire an image of the mark on the board and perform distortion correction on the image to obtain a first image. After the position of the board is changed, the image of the point is acquired again and The image is corrected for distortion to obtain a second image;
  • the operation unit 1210 is configured to obtain an offset trajectory of the marker point according to the first image and the second image, and calculate a clip of the offset trajectory and an edge of the first image or the second image. angle;
  • the adjusting unit 1220 is configured to adjust a position of the camera device or the board according to the angle, so that the offset track is parallel or perpendicular to an edge of the first image or the second image.
  • the marker point image acquisition unit 1200 acquires an image of the marker point on the acquisition card and performs distortion correction on the image to obtain a first image, and after the position of the card is changed, acquires the image of the marker point again and the image is Perform distortion correction to obtain a second image.
  • the first image and the second image are both distortion-corrected images including the image of the marker point, except that the specific positions of the marker points in the first image and the second image are different.
  • the board can be a regular board with components. In this case, the components on the board are used as marking points.
  • the board can also be a test board with a specific marking point designed for this device.
  • the distortion of the image acquired by the camera is first corrected by the camera calibration technique, and the acquired image is restored to a real plane, thereby providing distortion-free calibration of the board image.
  • the image improves the accuracy of the board image alignment.
  • changing the position of the board point changes the position of the mark point, and then acquiring the second image of the mark point.
  • the xy coordinate system is established with two adjacent sides of the board. Referring to FIG. 6, it is assumed that the first image S 0 of the marked point is located at the origin O(0, 0) of the coordinate system, and is changed.
  • the second image S 1 of the marked point moves to the point (x 1 , y 1 ), and the moving distance of the marked point is
  • the arithmetic unit 1210 obtains an offset trajectory of the marker point from the first image and the second image, and calculates an angle between the offset trajectory and the side of the first image or the second image.
  • AB, BC, CD, and DA are respectively four sides of the second image, and in the above xy coordinate system, the actual offset trajectory of the marked point is obtained as a line segment.
  • the angle ⁇ is the angle between the offset track of the mark point and the AB side of the second image
  • arctan(y 1 /x 1 ).
  • the offset trajectory of the marker point is calculated in the same manner as the angle between the other sides of the second image.
  • the adjusting unit 1220 adjusts the position of the imaging device or the card according to the angle, so that the offset trajectory is parallel or perpendicular to the side of the first image or the second image. After calculating the angle ⁇ between the offset trajectory of the marker point and the AB edge of the second image, the position of the camera or the card is adjusted according to the angle, so that the offset trajectory of the marker point is parallel to the AB edge of the second image or the DA side Vertically, for example, by rotating the board to reduce y 1 or the like, the board is finally aligned with the camera.
  • the offset trajectory of the front and rear marker points can be changed according to the position of the card, and the corresponding offset trajectory and the first image of the marker point can be calculated or The angle between the sides of the second image, and then adjust the position of the camera or the card according to the angle, and finally align the board with the field of view of the camera to prevent the partial image captured by the camera from being tilted, thereby facilitating Simplify the process of image acquisition and processing.
  • the present invention further provides a card image splicing system.
  • the card image splicing system includes a platform device, a camera device, a control device for controlling relative motion of the camera device and the platform device, and a processing device for splicing a card image, wherein the camera device is connected to the processing device, and the control device can be connected to the camera device and the platform device at the same time or only to any one of the two, or can be disposed on the camera device or Above the platform device, therefore, only the control device is connected to the camera device and the platform device at the same time as an example, as shown in FIG.
  • a platform device 1300 configured to carry a board
  • the camera device 1310 is configured to collect a partial image of the card
  • the control device 1320 is configured to control the camera device to collect partial images of the card in a distance interval fixed in the same direction, and the partial images adjacent in the same direction have overlapping regions;
  • the processing device 1330 is configured to form a card image according to the partial image stitching of the card card collected by the camera device 1310.
  • the card is placed on the platform device 1300, the camera device 1310 is opposite to the position of the platform device 1300, and both can perform relative motion under the control of the control device 1320.
  • the control device 1320 enables the camera.
  • the device 1310 collects boards according to distances fixed in the same direction.
  • the partial image of the card that is, the distance between the center points of each of the two adjacent partial images in the same direction is the same, and the adjacent partial images in the same direction have coincident regions.
  • the processing device 1320 obtains a partial image of the card collected by the camera 1300, performs distortion correction and cropping on each partial image, and obtains a corresponding standard partial image, and then splicing each standard partial image to form a card image, the card
  • the image can reflect information of all components, solder joints, and the like on the card; at the same time, the processing device 1320 in this embodiment may further include a point image acquiring unit, an arithmetic unit, and an adjustment for aligning the card with the camera.
  • the marker point image acquisition unit obtains an offset trajectory of the marker point before and after the change of the board position, and after the calculation unit calculates the angle between the corresponding offset trajectory and the edge of the first image or the second image of the marker point,
  • the adjusting unit adjusts the position of the camera device or the card according to the angle, and finally aligns the card with the field of view of the camera device, thereby preventing the partial image captured by the camera device from being tilted, and aligning the card with the field of view of the camera device.
  • the camera 1310 collects various partial images of the board and collects the collected boards.
  • the image processing apparatus 1320 is transmitted to the processing device 1320 is completed respective partial images into the standard images board.
  • the image pickup device 1300 can be realized by an industrial area array CCD having a megapixel
  • the platform device 1310 can be realized by a mechanical motion mechanism such as a mechanical stage, etc.
  • the control device 1330 can utilize a servo control system or the like.
  • the system implementation of tracking mechanical displacement because of the high stability and accuracy of the servo control system, can control the platform device 1300 and the camera device 1310 to achieve high-precision relative motion, thereby achieving high-precision image stitching.
  • the camera device may be calibrated to extract the internal parameters and external parameters of the camera device, thereby obtaining an image between the imaging plane and the real plane.
  • the corresponding relationship provides a reference for the subsequent image distortion correction of the system. Since the distortion of each standard partial image constituting the card image in the embodiment is corrected, the card image formed according to the standard partial image splicing has high precision, and the card image splicing system is not affected by the board. The size of the card is limited, and a larger-sized card can still obtain a higher-precision image for detection.
  • the standard partial image obtained by the processing device 1320 after cropping the partial image can be directly spliced to form the card image according to the relative position on the card, without complicated image feature point matching analysis process, partial image clipping process and The splicing process is simpler and more efficient. Therefore, the card image splicing system proposed in this embodiment has high image splicing speed and efficiency, and is of great significance for actual industrial production.
  • the board image splicing system further includes a control device disposed on the camera device or the platform device to keep the platform device stationary, and the control device controls the camera device according to a fixed distance interval when the camera device collects a partial image. Movement relative to the platform device.
  • the motion of the imaging device is dominant, and the advantage is that the card placed on the platform device can be prevented from randomly moving or slipping.
  • the control device can achieve accurate movement, the camera device can be captured. The accuracy of the partial image.
  • the board image splicing system further includes a control device disposed on the camera device or the platform device to keep the camera device stationary, and the control device controls the platform according to a fixed distance interval when the camera device collects a partial image.
  • the device moves relative to the camera. Since the camera device in general should try to avoid the jitter caused by the external force, so as to avoid blurring of the image, and the movement of the platform device relative to the camera device is not only technically easier to implement, for example, using a servo control system, and moving. The stability and accuracy are good, so that the control device controls the platform device to perform motion, which is more beneficial to improve the quality of the partial image captured by the camera device.

Abstract

Disclosed are a board card image splicing method and processing apparatus and system. The method comprises: acquiring a local image of a board card collected by a camera apparatus (S100); after distortion correction is performed on various local images, respectively tailoring various edges of each of the partial images, so as to obtain standard partial images corresponding to the various partial images (S110); and according to the relative position relationship of the various standard local images on the board card, splicing the standard partial images to form a board card image (S120). The board card image splicing method is not limited by the size of a board card, and a tailored standard local image can be directly spliced according to the relative position relationship thereof on the board card so as to form a board card image, so that the image splicing is simpler and more efficient.

Description

板卡图像拼接方法、处理装置及系统Card image splicing method, processing device and system 技术领域Technical field
本发明涉及自动光学检测领域,特别是涉及一种板卡图像拼接方法、处理装置及系统。The invention relates to the field of automatic optical detection, in particular to a card image splicing method, a processing device and a system.
背景技术Background technique
板卡是一种具有数据采集功能且集数据输入/输出为一体的重要器件,被广泛应用于自动化机械、电子工业、安保监控以及计算机等诸多领域,而板卡上元件的贴装、焊点的质量等都会影响板卡的整体性能,因此在实际的工业生产中,必须对板卡的元件、焊点等进行检测,以剔除存在缺陷或者错误的板卡。在板卡检测技术领域中,自动光学检测系统通过高精度摄像头获取被检测板卡的图像,结合图像处理技术分析被检测板卡的图像与标准板卡图像之间的区别,进而检测出板卡的缺陷,该系统具有自动化程度高、准确性高、易于操作、对被检测板卡无损伤等优点,因此被广泛应用于板卡的检测。但是对于自动光学检测系统而言,当某些被检测的板卡的尺寸较大时,如果仍然使用摄像头进行一次取景,往往会由于摄像头的视野有限而导致无法得到被检测板卡的整体图像,甚至导致获得的被检测板卡的图像发生畸变,进而失去较多的板卡图像细节信息,不利于对板卡进行高效、精准的检测分析。The board is an important device with data acquisition function and integrated data input/output. It is widely used in many fields such as automation machinery, electronics industry, security monitoring and computer, and the placement and solder joints of components on the board. The quality of the board will affect the overall performance of the board. Therefore, in actual industrial production, the components and solder joints of the board must be tested to eliminate defective or faulty boards. In the field of board detection technology, the automatic optical detection system acquires the image of the detected board through a high-precision camera, and combines the image processing technology to analyze the difference between the image of the detected board and the standard board image, thereby detecting the board. The defect is that the system has the advantages of high degree of automation, high accuracy, easy operation, no damage to the board being tested, and thus is widely used for the detection of boards. However, for the automatic optical detection system, when the size of some detected boards is large, if the camera is still used for framing, the overall image of the detected board may not be obtained due to the limited field of view of the camera. It even causes the obtained image of the detected board to be distorted, and thus loses more detailed information of the board image, which is not conducive to efficient and accurate detection and analysis of the board.
发明内容Summary of the invention
基于此,有必要针对自动光学检测系统中较难获得尺寸较大的板卡的整体、无畸变图像问题,提供一种板卡图像拼接方法、处理装置及系统。Based on this, it is necessary to provide a card image splicing method, processing device and system for the overall and undistorted image problem of the large-sized card in the automatic optical detection system.
本发明的实施例提供了一种板卡图像拼接方法、处理装置及系统,分别为:The embodiment of the invention provides a card image splicing method, a processing device and a system, which are respectively:
一种板卡图像拼接方法,包括以下步骤:A method for stitching a card image, comprising the following steps:
获取摄像装置采集的板卡的局部图像,所述局部图像由所述摄像装置按照同一方向上固定的距离间隔采集获得,且在同一方向上相邻的所述局部图像具有重合区域; Acquiring a partial image of the card acquired by the camera device, wherein the partial image is acquired by the camera device at a fixed distance interval in the same direction, and the partial images adjacent in the same direction have a coincident region;
对各个所述局部图像进行畸变校正后,对每一所述局部图像的各个边分别进行裁剪,获得与各个所述局部图像对应的标准局部图像;After performing distortion correction on each of the partial images, each side of each of the partial images is separately cropped to obtain a standard partial image corresponding to each of the partial images;
根据各个所述标准局部图像在所述板卡上的相对位置关系,将所述标准局部图像拼接形成板卡图像。The standard partial images are spliced to form a card image according to the relative positional relationship of each of the standard partial images on the card.
一种用于板卡图像拼接的处理装置,包括:A processing device for stitching a card image, comprising:
获取单元,用于获取摄像装置采集的板卡的局部图像,所述局部图像由所述摄像装置按照同一方向上固定的距离间隔采集获得,且在同一方向上相邻的所述局部图像具有重合区域;An acquiring unit, configured to acquire a partial image of a card acquired by the camera device, where the partial image is acquired by the camera device at a fixed distance interval in the same direction, and the partial images adjacent in the same direction have coincidence region;
处理单元,用于对各个所述局部图像进行畸变校正后,对每一所述局部图像的各个边分别进行裁剪,获得与各个所述局部图像对应的标准局部图像;a processing unit, configured to perform distortion correction on each of the partial images, and perform trimming on each side of each of the partial images to obtain a standard partial image corresponding to each of the partial images;
拼接单元,用于根据各个所述标准局部图像的相对位置,将所述标准局部图像拼接形成板卡图像。a splicing unit for splicing the standard partial images to form a card image according to the relative positions of the respective partial partial images.
一种板卡图像拼接系统,包括平台装置、摄像装置、用于控制所述摄像装置和所述平台装置进行相对运动的控制装置以及上述的用于板卡图像拼接的处理装置,所述摄像装置与所述处理装置连接,A card image splicing system, comprising: a platform device, an imaging device, a control device for controlling relative movement of the camera device and the platform device, and the above-mentioned processing device for splicing a card image, the camera device Connected to the processing device,
所述平台装置用于承载板卡;The platform device is configured to carry a board;
所述摄像装置用于采集板卡的局部图像;The camera device is configured to collect a partial image of the card;
所述控制装置用于控制所述摄像装置按照同一方向上固定的距离间隔采集板卡的局部图像,且在同一方向上相邻的所述局部图像具有重合区域。The control device is configured to control the camera device to acquire partial images of the card according to a fixed distance interval in the same direction, and the partial images adjacent in the same direction have overlapping regions.
上述板卡图像拼接方法、处理装置及系统,通过摄像装置采集板卡的局部图像且所采集的相邻的局部图像在同一方向上具有重合区域,对各个局部图像分别进行畸变校正后,对每一局部图像的各个边进行裁剪,由于畸变校正后的局部图像的边缘部分仍存在失真,因此在进行裁剪时,将局部图像重合区域中发生失真的边缘部分裁剪掉,而裁剪后得到的标准局部图像则恰好能够拼接组成完整的板卡图像。由于组成板卡图像的每一标准局部图像的畸变均得到了校正,因此根据标准局部图像拼接形成的板卡图像具有较高的精度,同时本发明所提出的板卡图像拼接方法、处理装置及系统不受板卡尺寸的限制,对于尺寸较大的板卡仍然能够获得较高精度的图像以用于检测。此外,裁剪后得到的标 准局部图像可按照其在板卡上的相对位置关系直接拼接形成板卡图像,而无需复杂的图像特征点匹配分析过程,图像的裁剪过程和拼接过程都更为简便、高效,因此本发明所提出的板卡图像拼接方法、处理装置及系统具有较高的图像拼接速度和效率。The board image splicing method, processing device and system, the partial image of the board is collected by the camera device, and the collected adjacent partial images have overlapping regions in the same direction, and each partial image is separately corrected for distortion, for each The edges of a partial image are cropped, and since the edge portion of the partial image after the distortion correction still has distortion, when the cropping is performed, the edge portion of the partial image overlapping region where the distortion occurs is trimmed, and the standard portion obtained after the clipping is obtained. The image just happens to be stitched together to form a complete board image. Since the distortion of each standard partial image constituting the image of the board is corrected, the board image formed according to the standard partial image splicing has high precision, and the board image splicing method and processing device proposed by the present invention and The system is not limited by the size of the board, and for larger boards it is still possible to obtain higher precision images for inspection. In addition, the mark obtained after cutting The quasi-local image can be directly spliced to form the card image according to the relative positional relationship on the board without complicated image feature point matching analysis process, and the image cutting process and the splicing process are more simple and efficient, so the present invention The proposed card image splicing method, processing device and system have high image splicing speed and efficiency.
附图说明DRAWINGS
图1为其中一个实施例中一种板卡图像拼接方法的流程示意图;1 is a schematic flow chart of a method for stitching a card image in one embodiment;
图2为摄像装置采集板卡局部图像的示意图;2 is a schematic diagram of a partial image of a board of a camera device;
图3为摄像装置采集矩形板卡的局部图像的示意图;3 is a schematic diagram of a partial image of a rectangular board captured by a camera device;
图4为畸变校正前后板卡的局部图像示意图;4 is a partial image diagram of a board before and after distortion correction;
图5为其中一个具体实施方式中局部图像的裁剪示意图;FIG. 5 is a schematic diagram of cropping of a partial image in one embodiment; FIG.
图6为其中一个具体实施方式中局部图像的裁剪示意图;6 is a schematic diagram of cropping of a partial image in one embodiment;
图7为摄像装置采集不同位置板卡局部图像的示意图;7 is a schematic diagram of a camera device collecting partial images of boards at different positions;
图8为板卡局部图像拼接示意图;Figure 8 is a schematic view showing a partial image mosaic of the card;
图9为其中一个实施例中一种板卡图像拼接方法的流程示意图;9 is a schematic flow chart of a method for stitching a card image in one embodiment;
图10为标记点位置的示意图;Figure 10 is a schematic view of the position of the marked point;
图11为其中一个实施例中一种用于板卡图像拼接的处理装置的结构示意图;FIG. 11 is a schematic structural diagram of a processing apparatus for board image stitching in one embodiment; FIG.
图12为其中一个实施例中一种用于板卡图像拼接的处理装置的结构示意图;12 is a schematic structural diagram of a processing apparatus for board image stitching in one embodiment;
图13为其中一个实施例中一种板卡图像拼接系统的结构示意图。FIG. 13 is a schematic structural diagram of a card image splicing system in one embodiment.
具体实施方式detailed description
下面将结合附图及较佳实施例对本发明的技术方案进行详细描述。The technical solutions of the present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments.
在其中一个实施例中,参见图1所示,一种板卡图像拼接方法,包括如下步骤:In one embodiment, referring to FIG. 1, a method for stitching a card image includes the following steps:
S100获取摄像装置采集的板卡的局部图像;S100 acquires a partial image of a card acquired by the camera device;
在本步骤中,参见图2所示的摄像装置采集板卡局部图像的示意图,摄像 装置位于板卡的正上方,且摄像装置按照同一方向上固定的距离间隔采集获得的局部图像。为详细说明此步骤,以图3所示的矩形板卡为例,在平行于板卡其中一边(如AB边)的方向上,摄像装置每隔一个固定的距离间隔采集一次板卡的局部图像,摄像装置每一次所采集的板卡的局部图像均与上一次所采集的板卡的局部图像对齐且沿着板卡的AB边的方向,直至采集完板卡的所有局部图像,例如图3中所示的局部图像a1b1c1d1和局部图像a2b2c2d2,它们彼此对齐且均沿着板卡的AB边的方向;同时,摄像装置按照同一方向上固定的距离间隔所采集的、在同一方向上相邻的局部图像具有重合区域,仍然以图3所示的矩形板卡为例,摄像装置在平行于板卡的AB边的方向上采集板卡的局部图像,而相邻的两个局部图像具有一定的重合区域,如图3中重合区域a2b1c1d2所示,该重合区域的大小与摄像装置采集局部图像时采用的同一方向上固定的距离间隔的大小相关,距离间隔越小,局部图像的重合区域越大。类似地,当摄像装置沿板卡AD边采集板卡的局部图像时,其采集方式与沿板卡AB边采集方式相同,均为按照同一方向上固定的距离间隔进行采集,这里需指出的是,摄像装置沿板卡AB边和AD边采集局部图像时所采用的固定的距离间隔可以不同。In this step, referring to the schematic diagram of the partial image of the board captured by the camera device shown in FIG. 2, the camera device is located directly above the card, and the camera device collects the obtained partial images at a fixed distance interval in the same direction. To illustrate this step in detail, taking the rectangular board shown in Figure 3 as an example, in a direction parallel to one side of the board (such as the AB side), the camera captures a partial image of the board every other fixed distance interval. Each part of the captured board of the camera is aligned with the partial image of the board acquired last time and along the direction of the AB side of the board until all partial images of the board are collected, such as Figure 3. The partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 shown therein are aligned with each other and are along the direction of the AB side of the card; meanwhile, the camera is fixed in the same direction The partial images of the distances collected in the same direction have overlapping areas. Still taking the rectangular board shown in FIG. 3 as an example, the camera device collects the boards in the direction parallel to the AB side of the board. a partial image, and two adjacent partial images have a certain overlapping area, as shown in the coincident area a 2 b 1 c 1 d 2 in FIG. 3 , the size of the overlapping area is the same as that used by the camera when acquiring a partial image. Fixed distance interval Related to the size, the smaller the distance interval, the greater the overlap region of the partial image. Similarly, when the camera captures a partial image of the card along the AD side of the card, the acquisition mode is the same as that of the AB side of the card, and is collected according to the fixed distance interval in the same direction. The fixed distance interval used by the camera to collect partial images along the AB side and the AD side of the card may be different.
S110对各个所述局部图像进行畸变校正后,对每一所述局部图像的各个边分别进行裁剪,获得与各个所述局部图像对应的标准局部图像;After performing the distortion correction on each of the partial images, S110 separately trims each side of each of the partial images to obtain a standard partial image corresponding to each of the partial images;
在摄像装置的实际工作过程中,由于摄像装置镜头自身的光学设计等原因,摄像装置的光学系统并不是精确地按理想化的小孔成像的原理工作,致使物空间中的物点在像空间所成的实际像点与理想像点之间存在光学像差,进而产生图像畸变。对局部图像进行畸变校正时,可采用灰度插值的方法,其基本思想是先建立几何校正的数学模型,然后利用已知条件确定模型参数,最后根据模型对含有畸变的图像进行校正,该方法通常分为两步:图像空间坐标变换,首先建立图像像素坐标和物空间对应点坐标间的映射关系,求解映射关系中的未知参数,然后根据映射关系对图像各个像素坐标进行校正;确定各个像素的灰度值,将进行空间变换后的像素赋予相应的灰度值,使其恢复原位置的灰度值,进而实现图像的畸变校正。如图4所示的畸变校正前后板卡的局部图像示 意图,畸变校正后,板卡的局部图像更接近真实的板卡图像。In the actual working process of the camera device, due to the optical design of the camera lens itself, the optical system of the camera device does not work accurately on the principle of idealized aperture imaging, so that the object point in the object space is in the image space. There is an optical aberration between the actual image point and the ideal image point, which causes image distortion. When the local image is corrected for distortion, the gray interpolation method can be adopted. The basic idea is to first establish a mathematical model of geometric correction, then determine the model parameters by using known conditions, and finally correct the image containing the distortion according to the model. It is usually divided into two steps: image space coordinate transformation. Firstly, the mapping relationship between image pixel coordinates and object space corresponding point coordinates is established, the unknown parameters in the mapping relationship are solved, and then the pixel coordinates of the image are corrected according to the mapping relationship; The gray value is used to assign the corresponding gray value to the pixel after the spatial transformation, so as to restore the gray value of the original position, thereby realizing the distortion correction of the image. Partial image display of the board before and after distortion correction as shown in Figure 4. Intention, after the distortion correction, the partial image of the board is closer to the real board image.
对畸变校正后的每一局部图像的各个边分别进行裁剪,获得与各个局部图像对应的标准局部图像。板卡的每一局部图像进行畸变校正后,局部图像的边缘部分会有较大的失真,而存在失真的边缘部分不利于对板卡进行检测分析,因此通过对畸变校正后的局部图像的各个边分别进行裁剪,去除局部图像的边缘部分,从而提高局部图像用于板卡检测的准确性。在对畸变校正后的局部图像进行裁剪时,为保证所选取的裁剪宽度既符合实际需求又能够提高板卡图像拼接的效率,可以根据摄像装置不同的镜头参数选取不同的裁剪宽度,因为具有不同镜头参数的摄像装置的畸变系数不同,对局部图像进行畸变校正后,失真的边缘部分的大小可能不同,致使对局部图像进行裁剪后得到的标准局部图像的大小不同,因此以摄像装置的镜头参数作为裁剪宽度的参考和依据,充分考虑了具有不同畸变情况的板卡的局部图像的处理方式。Each side of each partial image after the distortion correction is separately cropped to obtain a standard partial image corresponding to each partial image. After each partial image of the board is corrected for distortion, the edge portion of the partial image will have a large distortion, and the edge portion with distortion is not conducive to the detection and analysis of the board, so each part of the partial image corrected by the distortion is corrected. The cropping is performed separately to remove the edge portion of the partial image, thereby improving the accuracy of the partial image for board detection. In the case of cropping the partial image after distortion correction, in order to ensure that the selected crop width is both in line with actual needs and can improve the efficiency of board image stitching, different crop widths can be selected according to different lens parameters of the camera device, because they have different The distortion coefficient of the lens device of the lens parameter is different. After the distortion correction of the partial image, the size of the edge portion of the distortion may be different, so that the size of the standard partial image obtained by cropping the partial image is different, so the lens parameter of the camera device is used. As a reference and basis for the cutting width, the processing method of the partial image of the board with different distortion conditions is fully considered.
作为一种具体的实施方式,对每一局部图像的各个边分别进行裁剪时,各个边的裁剪宽度为各个边对应的重合区域宽度的一半。这里仅以摄像装置所采集的两幅局部图像——局部图像a1b1c1d1和局部图像a2b2c2d2为例进行说明,参见图5所示,对局部图像a1b1c1d1进行裁剪后,获得对应的标准局部图像1256,对局部图像a2b2c2d2进行裁剪后,获得对应的标准局部图像2345,图5中所示的区域a2b1c1d2为局部图像a1b1c1d1和局部图像a2b2c2d2的重合区域,当局部图像a1b1c1d1和局部图像a2b2c2d2的裁剪宽度为二者重合区域宽度(即a2b1或者d2c1的长度)的一半时,标准局部图像1256和标准局部图像2345恰好能够实现无缝拼接,此时标准局部图像1256和标准局部图像2345之间不存在重合部分。类似地,对于局部图像a1b1c1d1和局部图像a2b2c2d2的其他边的裁剪,也分别将它们与其他局部图像的重合区域宽度的一半作为相应边的裁剪宽度。在本实施方式中,以局部图像重合区域宽度的一半作为各个局部图像进行裁剪的宽度,不仅保证相应的标准局部图像能够组成完整的板卡图像,不会遗漏任何板卡的图像信息,同时避免了由于标准局部图像之间发生重合而导致的图像信息重复显示,从而提高板卡图像的拼接效率。As a specific implementation manner, when each side of each partial image is separately cut, the cutting width of each side is half of the width of the overlapping area corresponding to each side. Here, only two partial images acquired by the imaging device, the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 will be described as an example. Referring to FIG. 5, the partial image a 1 b 1 c 1 d 1 After cropping, a corresponding standard partial image 1256 is obtained, and after the partial image a 2 b 2 c 2 d 2 is cropped, a corresponding standard partial image 2345 is obtained, and the area a shown in FIG. 2 b 1 c 1 d 2 is a coincident region of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 when the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b When the clipping width of 2 c 2 d 2 is half of the width of the coincident region (ie, the length of a 2 b 1 or d 2 c 1 ), the standard partial image 1256 and the standard partial image 2345 can be seamlessly stitched. There is no coincident portion between the standard partial image 1256 and the standard partial image 2345. Similarly, for the cropping of the other edges of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 , the half of the width of the overlapping area of the partial image and the other partial images are respectively cut as the corresponding edges. width. In the present embodiment, the width of the partial image overlap region is used as the width of each partial image for cropping, which not only ensures that the corresponding standard partial image can form a complete board image, and does not miss any image information of the card, and avoids The image information is repeatedly displayed due to the coincidence between standard partial images, thereby improving the stitching efficiency of the board image.
作为一种具体的实施方式,对摄像装置所采集的板卡的局部图像进行裁剪 时,各个局部图像的各个边的裁剪宽度均相同。参见图6所示的板卡局部图像裁剪示意图,其中,局部图像a1b1c1d1与局部图像a2b2c2d2的重合区域为区域a2b1c1d2,局部图像a1b1c1d1与局部图像a4b4c4d4的重合区域为区域a4b4c1d1,局部图像a2b2c2d2与局部图像a3b3c3d3的重合区域为区域a3b3c2d2,局部图像a3b3c3d3与局部图像a4b4c4d4的重合区域为区域a3b4c4d3,各个重合区域的宽度均相同,即a4d1、a2b1、b3c2以及c4d3的长度相同。在本实施方式中,以相同的裁剪宽度对各个局部图像进行裁剪,便于对摄像装置所采集的板卡的所有局部图像进行处理,同时方便对摄像装置所采用的距离间隔进行控制,有利于提高板卡图像拼接的效率。As a specific implementation manner, when the partial image of the board acquired by the image capturing apparatus is cropped, the cutting width of each side of each partial image is the same. Referring to the partial image cropping diagram of the card shown in FIG. 6, the overlapping area of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 is the area a 2 b 1 c 1 d 2 . The overlapping area of the partial image a 1 b 1 c 1 d 1 and the partial image a 4 b 4 c 4 d 4 is the area a 4 b 4 c 1 d 1 , the partial image a 2 b 2 c 2 d 2 and the partial image a 3 The overlapping region of b 3 c 3 d 3 is the region a 3 b 3 c 2 d 2 , and the overlapping region of the partial image a 3 b 3 c 3 d 3 with the partial image a 4 b 4 c 4 d 4 is the region a 3 b 4 c 4 d 3 , the widths of the respective overlapping regions are the same, that is, the lengths of a 4 d 1 , a 2 b 1 , b 3 c 2 and c 4 d 3 are the same. In the embodiment, each partial image is cropped with the same cutting width, which facilitates processing all partial images of the card collected by the imaging device, and conveniently controls the distance interval adopted by the imaging device, which is beneficial to improve The efficiency of board image stitching.
S120根据各个所述标准局部图像的相对位置,将所述标准局部图像拼接形成板卡图像。S120 splices the standard partial images into a card image according to the relative positions of the respective partial partial images.
由于摄像装置在采集板卡的局部图像时,是按照一定的顺序规则进行采集的,如图7所示,摄像装置采集完某一位置的板卡局部图像后,会移动到下一位置继续采集板卡的局部图像,因而其采集获得的局部图像彼此之间具有一定的位置关系,又由于每一局部图像仅对应一张标准局部图像,因而各个标准局部图像彼此间也具有相对位置关系,在进行图像拼接时,可以根据各个标准局部图像的相对位置,将标准局部图像进行拼接,最终形成板卡图像,如图8所示的板卡局部图像拼接示意图,该板卡图像能够反映板卡上所有的元件、焊点等的信息。Since the camera device collects partial images of the card, it is collected according to a certain order rule. As shown in FIG. 7, after the camera device collects a partial image of the card at a certain position, it moves to the next position and continues to collect. The partial images of the board, so the local images obtained by the acquisition have a certain positional relationship with each other, and since each partial image corresponds to only one standard partial image, each standard partial image also has a relative position relationship with each other. When the image is spliced, the standard partial image may be spliced according to the relative positions of the respective partial partial images, and finally the card image is formed, as shown in FIG. 8 , the partial image splicing diagram of the card, the card image can reflect the card Information on all components, solder joints, etc.
由于上述实施例中组成板卡图像的每一标准局部图像的畸变均得到了校正,因此根据标准局部图像拼接形成的板卡图像具有较高的精度,同时该板卡图像拼接方法具有不受板卡尺寸限制的优点,对于尺寸较大的板卡仍然能够获得较高精度的图像以用于检测。此外,裁剪后得到的标准局部图像可按照其在板卡上的相对位置直接拼接形成板卡图像,而无需复杂的图像特征点匹配分析过程,局部图像的裁剪过程和拼接过程都更为简便、高效,因此本实施例所提出的板卡图像拼接方法具有较高的图像拼接速度和效率。Since the distortion of each standard partial image constituting the board image in the above embodiment is corrected, the board image formed according to the standard partial image stitching has high precision, and the board image stitching method has no board. The advantage of card size limitation is that for larger size boards it is still possible to obtain higher precision images for inspection. In addition, the standard partial images obtained after cutting can be directly spliced to form the board image according to their relative positions on the board, without complicated image feature point matching analysis process, and the partial image cutting process and the splicing process are more simple. It is efficient, so the board image stitching method proposed in this embodiment has higher image stitching speed and efficiency.
通常情况下,板卡都具有规则的形状,为使板卡能够与摄像装置的视野对准,以防止摄像装置所采集的局部图像是倾斜的,从而有利于简化图像采集和 处理的过程,因此在本发明所提出的板卡图像拼接方法的其中一个实施例中,获取摄像装置采集的板卡的局部图像步骤的步骤之前,参见图9所示的流程示意图,还可以包括以下进行图像对准的步骤:Generally, the boards have a regular shape, so that the board can be aligned with the field of view of the camera to prevent the partial image captured by the camera from being tilted, thereby facilitating image acquisition and simplifying image acquisition. The process of processing, and therefore, in one of the embodiments of the card image splicing method proposed by the present invention, before the step of acquiring the partial image of the card acquired by the camera device, referring to the flow diagram shown in FIG. 9, the method may further include The following steps for image alignment:
S900获取板卡上标记点的图像并对该图像进行畸变校正,得到第一图像;S900 acquires an image of the marked point on the board and performs distortion correction on the image to obtain a first image;
在本步骤中所使用的板卡可以是带有元件的普通板卡,此时以板卡上的元件作为标记点,所使用的板卡也可以是专为此方法而设计有标记点的测试板卡。标记点的第一图像为包括标记点的图像在内的、畸变校正后的图像,例如在利用摄像机获取板卡上标记点的第一图像之前,首先通过摄像机标定技术校正摄像机所获取的图像的畸变,使所获取的图像还原为真实的平面,从而为板卡图像校准提供无畸变的图像,提高板卡图像对准的准确性。The board used in this step can be a common board with components. In this case, the components on the board are used as marking points. The board used can also be designed with marking points specially designed for this method. Board. The first image of the marked point is a distortion corrected image including the image of the marked point, for example, before the first image of the marked point on the board is acquired by the camera, the image acquired by the camera is first corrected by the camera calibration technique. Distortion, the acquired image is restored to a real plane, thereby providing an undistorted image for board image calibration, improving the accuracy of board image alignment.
S910在所述板卡的位置改变后,再次获取所述标记点的图像并对该图像进行畸变校正,得到第二图像;After the position of the board is changed, the S910 acquires the image of the marked point again and performs distortion correction on the image to obtain a second image.
获取板卡上标记点的第一图像后,改变板卡的位置即改变标记点的位置,再次获取标记点的图像并对该图像进行畸变校正,得到第二图像,即第二图像为包括标记点的图像在内的、畸变校正后的图像。在改变板卡的位置时,以板卡相邻的两条边建立x-y坐标系,参见图10所示,假设标记点的第一图像S0位于坐标系的原点O(0,0),改变板卡的位置后,标记点的第二图像S1移动至点(x1,y1),此时标记点的移动距离为
Figure PCTCN2016098225-appb-000001
After acquiring the first image of the marked point on the board, changing the position of the board, that is, changing the position of the marked point, acquiring the image of the marked point again and performing distortion correction on the image to obtain a second image, that is, the second image includes the mark Distorted image after the image of the point. When changing the position of the board, the xy coordinate system is established with the two adjacent sides of the board. Referring to FIG. 10, it is assumed that the first image S 0 of the marked point is located at the origin O(0, 0) of the coordinate system, and is changed. After the position of the board, the second image S 1 of the marked point moves to the point (x1, y1), and the moving distance of the marked point is
Figure PCTCN2016098225-appb-000001
S920根据所述第一图像和所述第二图像获得标记点的偏移轨迹,计算所述偏移轨迹与所述第一图像或者所述第二图像的边的夹角;S920: Obtain an offset trajectory of the marker point according to the first image and the second image, and calculate an angle between the offset trajectory and an edge of the first image or the second image;
以图10所示的标记点的第二图像为例,AB、BC、CD、DA分别为第二图像的四条边,在步骤S910中所建立的坐标系下,可获得标记点的实际偏移轨迹为线段
Figure PCTCN2016098225-appb-000002
由于很难一次性使标记点沿着板卡的x轴完全平行地运动,实际上
Figure PCTCN2016098225-appb-000003
与x轴可能存在一定的夹角α,夹角α即为标记点的偏移轨迹与第二图像的AB边的夹角,根据标记点S0和S1的具体坐标可计算出夹角α在数值上等于α=arctan(y1/x1)。这里仅以第二图像的AB边为例进行说明,基于同样的原理,标记点的偏移轨迹与第二图像其他各个边的夹角的计算方法相同。
Taking the second image of the marked point shown in FIG. 10 as an example, AB, BC, CD, and DA are respectively four sides of the second image, and the actual offset of the marked point can be obtained in the coordinate system established in step S910. The track is a line segment
Figure PCTCN2016098225-appb-000002
Since it is difficult to move the marker point completely parallel along the x-axis of the card, in practice
Figure PCTCN2016098225-appb-000003
There may be a certain angle α with the x-axis, and the angle α is the angle between the offset track of the mark point and the AB side of the second image, and the angle α can be calculated according to the specific coordinates of the mark points S 0 and S 1 . It is numerically equal to α=arctan(y 1 /x 1 ). Here, only the AB side of the second image is taken as an example. Based on the same principle, the offset trajectory of the marker point is calculated in the same manner as the angle between the other sides of the second image.
S930根据所述夹角调节所述摄像装置或者所述板卡的位置,使所述偏移 轨迹与所述第一图像或者所述第二图像的边平行或者垂直。S930 adjusts the position of the camera device or the card according to the angle to make the offset The trajectory is parallel or perpendicular to the sides of the first image or the second image.
计算标记点的偏移轨迹与第二图像的AB边的夹角α后,根据夹角调节摄像装置或者板卡的位置,使标记点的偏移轨迹与第二图像的AB边平行或者DA边垂直,例如,通过转动板卡来减小y1等,最终将板卡与摄像装置对准。在对本实施例中对各个步骤进行详细描述时,仅以对准板卡的x轴方向、标记点的第二图像为例进行说明,但应当指出的是上述方法也完全适用于板卡的y轴方向或者利用标记点的第一图像的对准。After calculating the angle α between the offset trajectory of the marker point and the AB edge of the second image, the position of the camera or the card is adjusted according to the angle, so that the offset trajectory of the marker point is parallel to the AB edge of the second image or the DA side Vertically, for example, by rotating the board to reduce y 1 or the like, the board is finally aligned with the camera. In the detailed description of each step in the embodiment, only the x-axis direction of the alignment card and the second image of the marked point are taken as an example, but it should be noted that the above method is also fully applicable to the board y. The axial direction or the alignment of the first image using the marked points.
相应地,本发明提供了一种用于板卡图像拼接的处理装置,在其中一个实施例中,参见图11所示,用于板卡图像拼接的处理装置包括依次连接的获取单元1100、处理单元1110和拼接单元1120,Correspondingly, the present invention provides a processing apparatus for board image stitching. In one embodiment, referring to FIG. 11, the processing apparatus for board image stitching includes an acquisition unit 1100 connected in sequence, and processing. Unit 1110 and splicing unit 1120,
获取单元1100,用于获取摄像装置采集的板卡的局部图像,所述局部图像由所述摄像装置按照同一方向上固定的距离间隔采集获得,且在同一方向上相邻的所述局部图像具有重合区域;The acquiring unit 1100 is configured to acquire a partial image of a card acquired by the camera device, where the partial image is acquired by the camera device at a fixed distance interval in the same direction, and the partial image adjacent in the same direction has Coincident area
处理单元1110,用于对各个所述局部图像进行畸变校正后,对每一所述局部图像的各个边分别进行裁剪,获得与各个所述局部图像对应的标准局部图像;The processing unit 1110 is configured to perform, after performing distortion correction on each of the partial images, performing trimming on each side of each of the partial images to obtain a standard partial image corresponding to each of the partial images;
拼接单元1120,用于根据各个所述标准局部图像的相对位置,将所述标准局部图像拼接形成板卡图像。The splicing unit 1120 is configured to splicing the standard partial images to form a card image according to the relative positions of the respective partial partial images.
下面将对各个单元进行详细描述:Each unit will be described in detail below:
(1)获取单元1100获取摄像装置采集的板卡的局部图像,局部图像由摄像装置按照同一方向上固定的距离间隔采集获得,且在同一方向上相邻的局部图像具有重合区域。其中,摄像装置按照同一方向上固定的距离间隔采集板卡的局部图像,这里摄像装置所采集的板卡的局部图像,是摄像装置按照同一方向上固定的距离间隔采集获得的局部图像。为详细说明此步骤,以图3所示的矩形板卡为例,在平行于板卡其中一边(如AB边)的方向上,摄像装置每隔一个固定的距离间隔采集一次板卡的局部图像,摄像装置每一次所采集的板卡的局部图像均与上一次所采集的板卡的局部图像对齐且沿着板卡的AB边的方 向,直至采集完板卡的所有局部图像,例如图3中所示的局部图像a1b1c1d1和局部图像a2b2c2d2,它们彼此对齐且均沿着板卡的AB边的方向;同时,摄像装置按照同一方向上固定的距离间隔所采集的、在同一方向上相邻的局部图像具有重合区域,仍然以图3所示的矩形板卡为例,摄像装置在平行于板卡的AB边的方向上采集板卡的局部图像,而相邻的两个局部图像具有一定的重合区域,如图3中重合区域a2b1c1d2所示,该重合区域的大小与摄像装置采集局部图像时采用的同一方向上固定的距离间隔的大小相关,距离间隔越小,局部图像的重合区域越大。类似地,当摄像装置沿板卡AD边采集板卡的局部图像时,其采集方式与沿板卡AB边采集方式相同,均为按照同一方向上固定的距离间隔进行采集,这里需指出的是,摄像装置沿板卡AB边和AD边采集局部图像时所采用的固定的距离间隔可以不同。(1) The acquiring unit 1100 acquires a partial image of the card acquired by the camera device, and the partial image is acquired by the imaging device at a fixed distance interval in the same direction, and the adjacent partial images in the same direction have overlapping regions. The camera device collects a partial image of the card according to a fixed distance interval in the same direction. The partial image of the card captured by the camera device is a partial image obtained by the camera device at a fixed distance interval in the same direction. To illustrate this step in detail, taking the rectangular board shown in Figure 3 as an example, in a direction parallel to one side of the board (such as the AB side), the camera captures a partial image of the board every other fixed distance interval. Each part of the captured board of the camera is aligned with the partial image of the board acquired last time and along the direction of the AB side of the board until all partial images of the board are collected, such as Figure 3. a partial image shown in FIG. 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 , and both are aligned with one another along the direction of the edge AB of the board; while fixing an imaging apparatus according to the same direction The partial images of the distances collected in the same direction have overlapping areas. Still taking the rectangular board shown in FIG. 3 as an example, the camera device collects the boards in the direction parallel to the AB side of the board. a partial image, and two adjacent partial images have a certain overlapping area, as shown in the coincident area a 2 b 1 c 1 d 2 in FIG. 3 , the size of the overlapping area is the same as that used by the camera when acquiring a partial image. Fixed distance interval The size is related, and the smaller the distance interval, the larger the overlapping area of the partial image. Similarly, when the camera captures a partial image of the card along the AD side of the card, the acquisition mode is the same as that of the AB side of the card, and is collected according to the fixed distance interval in the same direction. The fixed distance interval used by the camera to collect partial images along the AB side and the AD side of the card may be different.
(2)处理单元1110对获取单元1100所获取到的板卡的局部图像进行畸变校正后,对每一局部图像的各个边分别进行裁剪,获得与各个局部图像对应的标准局部图像。在摄像装置的实际工作过程中,由于摄像装置镜头自身的光学设计等原因,摄像装置的光学系统并不是精确地按理想化的小孔成像的原理工作,致使物空间中的物点在像空间所成的实际像点与理想像点之间存在光学像差,进而产生图像畸变。处理单元1110对局部图像进行畸变校正时,可采用灰度插值的方法,其基本思想是先建立几何校正的数学模型,然后利用已知条件确定模型参数,最后根据模型对含有畸变的图像进行校正,该方法通常分为两步:图像空间坐标变换,首先建立图像像素坐标和物方对应点坐标间的映射关系,求解映射关系中的未知参数,然后根据映射关系对图像各个像素坐标进行校正;确定各个像素的灰度值,将进行空间变换后的像素赋予相应的灰度值,使其恢复原位置的灰度值,进而实现图像的畸变校正。(2) The processing unit 1110 performs distortion correction on the partial image of the board acquired by the acquiring unit 1100, and then trims each side of each partial image to obtain a standard partial image corresponding to each partial image. In the actual working process of the camera device, due to the optical design of the camera lens itself, the optical system of the camera device does not work accurately on the principle of idealized aperture imaging, so that the object point in the object space is in the image space. There is an optical aberration between the actual image point and the ideal image point, which causes image distortion. When the processing unit 1110 performs distortion correction on the partial image, the gray interpolation method may be adopted. The basic idea is to first establish a mathematical model of the geometric correction, then determine the model parameters by using known conditions, and finally correct the image containing the distortion according to the model. The method is generally divided into two steps: image space coordinate transformation. Firstly, the mapping relationship between the pixel coordinates of the image and the coordinate of the object corresponding point is established, the unknown parameters in the mapping relationship are solved, and then the coordinates of each pixel of the image are corrected according to the mapping relationship; The gray value of each pixel is determined, and the spatially transformed pixel is given a corresponding gray value to restore the gray value of the original position, thereby realizing distortion correction of the image.
处理单元1110对畸变校正后的每一局部图像的各个边分别进行裁剪,获得与各个局部图像对应的标准局部图像。板卡的每一局部图像进行畸变校正后,局部图像的边缘部分会有较大的失真,而存在失真的边缘部分不利于对板卡进行检测分析,因此处理单元1110通过对畸变校正后的局部图像的各个边分别进行裁剪,去除局部图像的边缘部分,从而提高局部图像用于板卡检测的 准确性。在处理单元1110对畸变校正后的局部图像进行裁剪时,为保证所选取的裁剪宽度既符合实际需求又能够提高板卡图像拼接的效率,处理单元1110可以根据摄像装置不同的镜头参数选取不同的裁剪宽度,因为具有不同镜头参数的摄像装置的畸变系数不同,对局部图像进行畸变校正后,失真的边缘部分的大小可能不同,致使对局部图像进行裁剪后得到的标准局部图像的大小不同,因此以摄像装置的镜头参数作为裁剪宽度的参考和依据,充分考虑了具有不同畸变情况的板卡的局部图像的处理方式。The processing unit 1110 respectively trims each side of each partial image after the distortion correction to obtain a standard partial image corresponding to each partial image. After each partial image of the card is subjected to distortion correction, the edge portion of the partial image may have a large distortion, and the edge portion with distortion may be disadvantageous for detecting and analyzing the card, so the processing unit 1110 passes the distortion corrected portion. Each side of the image is cropped separately to remove the edge portion of the partial image, thereby improving the partial image for board detection. accuracy. When the processing unit 1110 performs the cropping of the distortion-corrected partial image, the processing unit 1110 may select different according to different lens parameters of the camera device, in order to ensure that the selected cropping width meets the actual requirements and the board image image splicing efficiency is improved. The clipping width is different because the distortion coefficient of the camera device with different lens parameters is different. After the distortion correction of the partial image, the size of the edge portion of the distortion may be different, so that the size of the standard partial image obtained by cropping the partial image is different, so Taking the lens parameters of the camera as the reference and basis of the cutting width, the processing method of the partial image of the board with different distortion conditions is fully considered.
作为一种具体的实施方式,处理单元1110对每一局部图像的各个边分别进行裁剪时,处理单元1110各个边的裁剪宽度为各个边对应的重合区域宽度的一半。这里仅以摄像装置所采集的两幅局部图像——局部图像a1b1c1d1和局部图像a2b2c2d2为例进行说明,参见图5所示,处理单元1110对局部图像a1b1c1d1进行裁剪后,获得对应的标准局部图像1256,对局部图像a2b2c2d2进行裁剪后,获得对应的标准局部图像2345,图5中所示的区域a2b1c1d2为局部图像a1b1c1d1和局部图像a2b2c2d2的重合区域,当局部图像a1b1c1d1和局部图像a2b2c2d2的裁剪宽度为二者重合区域宽度(即a2b1或者d2c1的长度)的一半时,标准局部图像1256和标准局部图像2345恰好能够实现无缝拼接,此时标准局部图像1256和标准局部图像2345之间不存在重合部分。类似地,对于局部图像a1b1c1d1和局部图像a2b2c2d2的其他边的裁剪,也分别将它们与其他局部图像的重合区域宽度的一半作为相应边的裁剪宽度。在本实施方式中,处理单元1110以局部图像重合区域宽度的一半作为各个局部图像进行裁剪的宽度,不仅保证相应的标准局部图像能够组成完整的板卡图像,不会遗漏任何板卡的图像信息,同时避免了由于标准局部图像之间发生重合而导致的图像信息重复显示,从而提高板卡图像的拼接效率。As a specific implementation manner, when the processing unit 1110 separately trims each side of each partial image, the cutting width of each side of the processing unit 1110 is half of the width of the overlapping area corresponding to each side. Here, only two partial images acquired by the imaging device, the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 will be described as an example. Referring to FIG. 5, the processing unit 1110 is After the partial image a 1 b 1 c 1 d 1 is cropped, a corresponding standard partial image 1256 is obtained, and after the partial image a 2 b 2 c 2 d 2 is cropped, a corresponding standard partial image 2345 is obtained, as shown in FIG. 5 . The area a 2 b 1 c 1 d 2 is a coincident region of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 when the partial image a 1 b 1 c 1 d 1 and the partial image When the cutting width of a 2 b 2 c 2 d 2 is half of the width of the overlapping area (ie, the length of a 2 b 1 or d 2 c 1 ), the standard partial image 1256 and the standard partial image 2345 can be seamlessly stitched. At this time, there is no coincident portion between the standard partial image 1256 and the standard partial image 2345. Similarly, for the cropping of the other edges of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 , the half of the width of the overlapping area of the partial image and the other partial images are respectively cut as the corresponding edges. width. In the present embodiment, the processing unit 1110 uses the half of the width of the partial image overlap region as the width of the cropping of each partial image, which not only ensures that the corresponding standard partial image can form a complete board image, and does not miss any image information of the board. At the same time, the repeated display of image information due to coincidence between standard partial images is avoided, thereby improving the stitching efficiency of the board image.
作为一种具体的实施方式,处理单元1110对摄像装置所采集的板卡的局部图像进行裁剪时,各个局部图像的各个边的裁剪宽度均相同。参见图4所示的板卡局部图像裁剪示意图,其中,局部图像a1b1c1d1与局部图像a2b2c2d2的重合区域为区域a2b1c1d2,局部图像a1b1c1d1与局部图像a4b4c4d4的重合区域为区域a4b4c1d1,局部图像a2b2c2d2与局部图像a3b3c3d3的重合区域为区域a3b3c2d2, 局部图像a3b3c3d3与局部图像a4b4c4d4的重合区域为区域a3b4c4d3,各个重合区域的宽度均相同,即a4d1、a2b1、b3c2以及c4d3的长度相同。在本实施方式中,处理单元1110以相同的裁剪宽度对各个局部图像进行裁剪,便于对摄像装置所采集的板卡的所有局部图像进行处理,同时方便对摄像装置所采用的距离间隔进行控制,有利于提高板卡图像拼接的效率。As a specific implementation manner, when the processing unit 1110 cuts a partial image of the board acquired by the camera, the cutting width of each side of each partial image is the same. Referring to the partial image cropping diagram of the card shown in FIG. 4, the overlapping area of the partial image a 1 b 1 c 1 d 1 and the partial image a 2 b 2 c 2 d 2 is the area a 2 b 1 c 1 d 2 . The overlapping area of the partial image a 1 b 1 c 1 d 1 and the partial image a 4 b 4 c 4 d 4 is the area a 4 b 4 c 1 d 1 , the partial image a 2 b 2 c 2 d 2 and the partial image a 3 The overlapping region of b 3 c 3 d 3 is the region a 3 b 3 c 2 d 2 , and the overlapping region of the partial image a 3 b 3 c 3 d 3 with the partial image a 4 b 4 c 4 d 4 is the region a 3 b 4 c 4 d 3 , the widths of the respective overlapping regions are the same, that is, the lengths of a 4 d 1 , a 2 b 1 , b 3 c 2 and c 4 d 3 are the same. In the embodiment, the processing unit 1110 cuts each partial image with the same cropping width, so as to facilitate processing all the partial images of the card captured by the camera device, and at the same time, conveniently control the distance interval adopted by the camera device. It is beneficial to improve the efficiency of board image stitching.
(3)拼接单元1120根据各个标准局部图像的相对位置,将标准局部图像拼接形成板卡图像。由于摄像装置在采集板卡的局部图像时,是按照一定的顺序规则进行采集的,因而其采集获得的局部图像彼此之间具有一定的位置关系,又由于每一局部图像仅对应一张标准局部图像,因而各个标准局部图像彼此间也具有相对位置关系,拼接单元1120在进行图像拼接时,可以根据各个标准局部图像的相对位置,将标准局部图像进行拼接,最终形成板卡图像,该板卡图像能够反映板卡上所有的元件、焊点等信息。(3) The splicing unit 1120 splices the standard partial images into a card image according to the relative positions of the respective partial partial images. Since the camera device collects partial images of the card, it is collected according to a certain order rule, so the partial images obtained by the camera have a certain positional relationship with each other, and each partial image corresponds to only one standard part. The image, and thus the standard partial images also have a relative positional relationship with each other. When the image splicing is performed, the splicing unit 1120 can splicing the standard partial images according to the relative positions of the respective partial partial images, and finally forming a card image, the card The image can reflect all the components, solder joints and other information on the board.
在上述用于板卡图像拼接的处理装置的实施例中,由于组成板卡图像的每一标准局部图像的畸变均得到了校正,因此根据标准局部图像拼接形成的板卡图像具有较高的精度,同时该板卡图像拼接系统具有不受板卡尺寸限制的优点,对于尺寸较大的板卡仍然能够获得较高精度的图像以用于检测。此外,裁剪后得到的标准局部图像可按照其在板卡上的相对位置直接拼接形成板卡图像,而无需复杂的图像特征点匹配分析过程,图像的裁剪过程和拼接过程都更为简便、高效,因此本实施例所提出的用于板卡图像拼接的处理装置具有较高的图像拼接速度和较好的图像拼接效果。In the above embodiment of the processing apparatus for board image stitching, since the distortion of each standard partial image constituting the board image is corrected, the board image formed according to the standard partial image stitching has high precision. At the same time, the card image splicing system has the advantage that it is not limited by the size of the board, and a higher-precision image can still obtain a higher-precision image for detection. In addition, the standard partial images obtained after cutting can be directly spliced to form the board image according to their relative positions on the board, without complicated image feature point matching analysis process, and the image cutting process and the splicing process are more convenient and efficient. Therefore, the processing device for board image stitching proposed in this embodiment has higher image stitching speed and better image stitching effect.
通常情况下,板卡都具有规则的形状,为使板卡能够与摄像装置的视野对准,以防止摄像装置所采集的局部图像是倾斜的,从而有利于简化图像采集和处理的过程,因此在本发明所提出的用于板卡图像拼接的处理装置中,参见图12所示,还包括用于图像对准的、依次连接的标记点图像获取单元1200、运算单元1210和调节单元1220,其中Generally, the boards have a regular shape, so that the board can be aligned with the field of view of the camera to prevent the partial image captured by the camera from being tilted, thereby facilitating the process of image acquisition and processing. In the processing apparatus for board image stitching proposed by the present invention, as shown in FIG. 12, a marker point image acquisition unit 1200, an operation unit 1210, and an adjustment unit 1220, which are sequentially connected for image alignment, are further included. among them
标记点图像获取单元1200,用于获取板卡上标记点的图像并对该图像进行畸变校正,得到第一图像,在所述板卡的位置改变后,再次获取所述标记点的图像并对该图像进行畸变校正,得到第二图像; The point image acquiring unit 1200 is configured to acquire an image of the mark on the board and perform distortion correction on the image to obtain a first image. After the position of the board is changed, the image of the point is acquired again and The image is corrected for distortion to obtain a second image;
运算单元1210,用于根据所述第一图像和所述第二图像获得所述标记点的偏移轨迹,计算所述偏移轨迹与所述第一图像或者所述第二图像的边的夹角;The operation unit 1210 is configured to obtain an offset trajectory of the marker point according to the first image and the second image, and calculate a clip of the offset trajectory and an edge of the first image or the second image. angle;
调节单元1220,用于根据所述夹角调节所述摄像装置或者所述板卡的位置,使所述偏移轨迹与所述第一图像或者所述第二图像的边平行或者垂直。The adjusting unit 1220 is configured to adjust a position of the camera device or the board according to the angle, so that the offset track is parallel or perpendicular to an edge of the first image or the second image.
下面将对各个单元进行详细描述:Each unit will be described in detail below:
(1)标记点图像获取单元1200获取获取板卡上标记点的图像并对该图像进行畸变校正,得到第一图像,并在板卡的位置改变后,再次获取标记点的图像并对该图像进行畸变校正,得到第二图像。这里的第一图像和第二图像均为包括标记点的图像在内的、畸变校正后的图像,只是在第一图像和第二图像中标记点的具体位置不同。板卡可以是带有元件的普通板卡,此时则以板卡上的元件作为标记点,板卡也可以是专为此装置而设计的、带有特定标记点的测试板卡。例如在利用摄像机获取板卡上标记点的第一图像之前,首先通过摄像机标定技术校正摄像机所获取的图像的畸变,使所获取的图像还原为真实的平面,从而为板卡图像校准提供无畸变的图像,提高板卡图像对准的准确性。获取板卡标记点的第一图像后,改变板卡的位置即改变标记点的位置,再获取标记点的第二图像。在改变板卡的位置时,以板卡相邻的两条边建立x-y坐标系,参见图6所示,假设标记点的第一图像S0位于坐标系的原点O(0,0),改变板卡的位置后,标记点的第二图像S1移动至点(x1,y1),此时标记点的移动距离为
Figure PCTCN2016098225-appb-000004
(1) The marker point image acquisition unit 1200 acquires an image of the marker point on the acquisition card and performs distortion correction on the image to obtain a first image, and after the position of the card is changed, acquires the image of the marker point again and the image is Perform distortion correction to obtain a second image. Here, the first image and the second image are both distortion-corrected images including the image of the marker point, except that the specific positions of the marker points in the first image and the second image are different. The board can be a regular board with components. In this case, the components on the board are used as marking points. The board can also be a test board with a specific marking point designed for this device. For example, before the first image of the marked point on the board is acquired by the camera, the distortion of the image acquired by the camera is first corrected by the camera calibration technique, and the acquired image is restored to a real plane, thereby providing distortion-free calibration of the board image. The image improves the accuracy of the board image alignment. After obtaining the first image of the board mark point, changing the position of the board point changes the position of the mark point, and then acquiring the second image of the mark point. When changing the position of the board, the xy coordinate system is established with two adjacent sides of the board. Referring to FIG. 6, it is assumed that the first image S 0 of the marked point is located at the origin O(0, 0) of the coordinate system, and is changed. After the position of the board, the second image S 1 of the marked point moves to the point (x 1 , y 1 ), and the moving distance of the marked point is
Figure PCTCN2016098225-appb-000004
(2)运算单元1210根据第一图像和第二图像获得标记点的偏移轨迹,计算偏移轨迹与第一图像或者第二图像的边的夹角。以图10所示的标记点的第二图像为例,AB、BC、CD、DA分别为第二图像的四条边,在上述x-y坐标系下,可获得标记点的实际偏移轨迹为线段
Figure PCTCN2016098225-appb-000005
由于很难一次性使标记点沿着板卡的x轴完全平行地运动,实际上
Figure PCTCN2016098225-appb-000006
与x轴可能存在一定的夹角α,夹角α即为标记点的偏移轨迹与第二图像的AB边的夹角,根据标记点S0和S1的具体坐标可计算出夹角α在数值上等于α=arctan(y1/x1)。这里仅以第二图像的AB边为例进行说明,基于同样的原理,标记点的偏移轨迹与第二图像其他各个边的夹角的计算方法相同。
(2) The arithmetic unit 1210 obtains an offset trajectory of the marker point from the first image and the second image, and calculates an angle between the offset trajectory and the side of the first image or the second image. Taking the second image of the marked point shown in FIG. 10 as an example, AB, BC, CD, and DA are respectively four sides of the second image, and in the above xy coordinate system, the actual offset trajectory of the marked point is obtained as a line segment.
Figure PCTCN2016098225-appb-000005
Since it is difficult to move the marker point completely parallel along the x-axis of the card, in practice
Figure PCTCN2016098225-appb-000006
There may be a certain angle α with the x-axis, and the angle α is the angle between the offset track of the mark point and the AB side of the second image, and the angle α can be calculated according to the specific coordinates of the mark points S 0 and S 1 . It is numerically equal to α=arctan(y 1 /x 1 ). Here, only the AB side of the second image is taken as an example. Based on the same principle, the offset trajectory of the marker point is calculated in the same manner as the angle between the other sides of the second image.
(3)调节单元1220根据夹角调节摄像装置或者板卡的位置,使偏移轨迹与第一图像或者第二图像的边平行或者垂直。计算标记点的偏移轨迹与第二图像的AB边的夹角α后,根据夹角调节摄像装置或者板卡的位置,使标记点的偏移轨迹与第二图像的AB边平行或者DA边垂直,例如,通过转动板卡来减小y1等,最终将板卡与摄像装置对准。在对本实施例中对各个步骤进行详细描述时,仅以对准板卡的x轴方向、标记点的第二图像为例进行说明,但应当指出的是板卡图像对准装置所采用的方法也完全适用于板卡的y轴方向或者利用标记点的第一图像的对准。通过上述标记点图像获取单元1200、运算单元1210和调节单元1220的协同作用,能够根据板卡位置改变前后标记点的偏移轨迹情况,计算出相应的偏移轨迹与标记点的第一图像或者第二图像的边的夹角,进而根据夹角调整摄像装置或者板卡的位置,最终使板卡与摄像装置的视野对准,以防止摄像装置所采集的局部图像是倾斜的,从而有利于简化图像采集和处理的过程。(3) The adjusting unit 1220 adjusts the position of the imaging device or the card according to the angle, so that the offset trajectory is parallel or perpendicular to the side of the first image or the second image. After calculating the angle α between the offset trajectory of the marker point and the AB edge of the second image, the position of the camera or the card is adjusted according to the angle, so that the offset trajectory of the marker point is parallel to the AB edge of the second image or the DA side Vertically, for example, by rotating the board to reduce y 1 or the like, the board is finally aligned with the camera. In the detailed description of each step in the embodiment, only the x-axis direction of the alignment card and the second image of the marked point are taken as an example, but it should be noted that the method used by the card image alignment device It is also fully applicable to the y-axis direction of the board or the alignment of the first image using the marked points. Through the synergy of the above-mentioned marker point image acquisition unit 1200, the operation unit 1210, and the adjustment unit 1220, the offset trajectory of the front and rear marker points can be changed according to the position of the card, and the corresponding offset trajectory and the first image of the marker point can be calculated or The angle between the sides of the second image, and then adjust the position of the camera or the card according to the angle, and finally align the board with the field of view of the camera to prevent the partial image captured by the camera from being tilted, thereby facilitating Simplify the process of image acquisition and processing.
同时,本发明还提供了一种板卡图像拼接系统,在其中一个实施例中,板卡图像拼接系统包括平台装置、摄像装置、用于控制摄像装置和平台装置进行相对运动的控制装置以及用于板卡图像拼接的处理装置,其中,摄像装置与处理装置连接,而控制装置既可以与摄像装置和平台装置同时连接或者仅与二者之中的任意一个连接,也可以设置于摄像装置或者平台装置之上,因此这里仅以控制装置同时连接摄像装置和平台装置为例进行说明,参见图13所示,Meanwhile, the present invention further provides a card image splicing system. In one embodiment, the card image splicing system includes a platform device, a camera device, a control device for controlling relative motion of the camera device and the platform device, and a processing device for splicing a card image, wherein the camera device is connected to the processing device, and the control device can be connected to the camera device and the platform device at the same time or only to any one of the two, or can be disposed on the camera device or Above the platform device, therefore, only the control device is connected to the camera device and the platform device at the same time as an example, as shown in FIG.
平台装置1300,用于承载板卡;a platform device 1300, configured to carry a board;
摄像装置1310,用于采集板卡的局部图像;The camera device 1310 is configured to collect a partial image of the card;
控制装置1320,用于控制摄像装置按照同一方向上固定的距离间隔采集板卡的局部图像,且在同一方向上相邻的局部图像具有重合区域;The control device 1320 is configured to control the camera device to collect partial images of the card in a distance interval fixed in the same direction, and the partial images adjacent in the same direction have overlapping regions;
处理装置1330,用于根据所述摄像装置1310采集的板卡的局部图像拼接形成板卡图像。The processing device 1330 is configured to form a card image according to the partial image stitching of the card card collected by the camera device 1310.
在本实施例中,板卡置于平台装置1300之上,摄像装置1310与平台装置1300的位置相对,并且二者在控制装置1320的控制下能够进行相对运动,具体地,控制装置1320使摄像装置1310按照同一方向上固定的距离间隔采集板 卡的局部图像,即在同一方向上每相邻的两个局部图像的中心点之间的距离是相同的,并且在同一方向上相邻的局部图像具有重合区域。处理装置1320获取摄像装置1300所采集的板卡的局部图像,对各个局部图像分别进行畸变校正和裁剪后,得到相应的标准局部图像,再将各个标准局部图像拼接形成板卡图像,该板卡图像能够反映板卡上所有的元件、焊点等的信息;同时,本实施例中的处理装置1320可以还包括用于将板卡与摄像装置对准的标记点图像获取单元、运算单元和调节单元,其中标记点图像获取单元获得板卡位置改变前后标记点的偏移轨迹情况,经运算单元计算出相应的偏移轨迹与标记点的第一图像或者第二图像的边的夹角后,调节单元根据夹角调整摄像装置或者板卡的位置,最终使板卡与摄像装置的视野对准,从而避免摄像装置所采集的局部图像是倾斜的,在将板卡与摄像装置的视野对准后,在控制装置1320的控制下,摄像装置1310采集板卡的各个局部图像,并将采集到的局部图像发送至处理装置1320,处理装置1320完成将各个标准局部图像拼接成板卡图像。在本实施例中,摄像装置1300可以利用具有百万像素的工业面阵CCD实现,而平台装置1310可以利用机械运动机构如机械载物台等实现,控制装置1330则可以利用伺服控制系统等能够跟踪机械位移的系统实现,由于伺服控制系统具有较高的稳定性和精确性,因而能够控制平台装置1300与摄像装置1310实现高精度的相对运动,从而实现高精度的图像拼接。作为一种可选的实施方式,在摄像装置1310获取板卡的局部图像之前,可以对摄像装置进行标定,以求取出摄像装置的内部参数和外部参数,从而获得成像平面与真实平面之间的对应关系,为系统后续的图像畸变校正提供原因参考。由于在本实施例中组成板卡图像的每一标准局部图像的畸变均得到了校正,因此根据标准局部图像拼接形成的板卡图像具有较高的精度,同时该板卡图像拼接系统不受板卡尺寸的限制,对于尺寸较大的板卡仍然能够获得较高精度的图像以用于检测。此外,处理装置1320对局部图像进行裁剪后得到的标准局部图像可按照其在板卡上的相对位置直接拼接形成板卡图像,而无需复杂的图像特征点匹配分析过程,局部图像的裁剪过程和拼接过程都更为简便、高效,因此本实施例所提出的板卡图像拼接系统具有较高的图像拼接速度和效率,对于实际工业生产具有重要意义。 In this embodiment, the card is placed on the platform device 1300, the camera device 1310 is opposite to the position of the platform device 1300, and both can perform relative motion under the control of the control device 1320. Specifically, the control device 1320 enables the camera. The device 1310 collects boards according to distances fixed in the same direction. The partial image of the card, that is, the distance between the center points of each of the two adjacent partial images in the same direction is the same, and the adjacent partial images in the same direction have coincident regions. The processing device 1320 obtains a partial image of the card collected by the camera 1300, performs distortion correction and cropping on each partial image, and obtains a corresponding standard partial image, and then splicing each standard partial image to form a card image, the card The image can reflect information of all components, solder joints, and the like on the card; at the same time, the processing device 1320 in this embodiment may further include a point image acquiring unit, an arithmetic unit, and an adjustment for aligning the card with the camera. a unit, wherein the marker point image acquisition unit obtains an offset trajectory of the marker point before and after the change of the board position, and after the calculation unit calculates the angle between the corresponding offset trajectory and the edge of the first image or the second image of the marker point, The adjusting unit adjusts the position of the camera device or the card according to the angle, and finally aligns the card with the field of view of the camera device, thereby preventing the partial image captured by the camera device from being tilted, and aligning the card with the field of view of the camera device. After that, under the control of the control device 1320, the camera 1310 collects various partial images of the board and collects the collected boards. The image processing apparatus 1320 is transmitted to the processing device 1320 is completed respective partial images into the standard images board. In the present embodiment, the image pickup device 1300 can be realized by an industrial area array CCD having a megapixel, and the platform device 1310 can be realized by a mechanical motion mechanism such as a mechanical stage, etc., and the control device 1330 can utilize a servo control system or the like. The system implementation of tracking mechanical displacement, because of the high stability and accuracy of the servo control system, can control the platform device 1300 and the camera device 1310 to achieve high-precision relative motion, thereby achieving high-precision image stitching. As an optional implementation manner, before the camera device 1310 acquires a partial image of the card, the camera device may be calibrated to extract the internal parameters and external parameters of the camera device, thereby obtaining an image between the imaging plane and the real plane. The corresponding relationship provides a reference for the subsequent image distortion correction of the system. Since the distortion of each standard partial image constituting the card image in the embodiment is corrected, the card image formed according to the standard partial image splicing has high precision, and the card image splicing system is not affected by the board. The size of the card is limited, and a larger-sized card can still obtain a higher-precision image for detection. In addition, the standard partial image obtained by the processing device 1320 after cropping the partial image can be directly spliced to form the card image according to the relative position on the card, without complicated image feature point matching analysis process, partial image clipping process and The splicing process is simpler and more efficient. Therefore, the card image splicing system proposed in this embodiment has high image splicing speed and efficiency, and is of great significance for actual industrial production.
作为一种具体的实施方式,板卡图像拼接系统还包括设置于摄像装置或者平台装置上的控制装置,保持平台装置不动,控制装置根据摄像装置采集局部图像时的固定的距离间隔控制摄像装置相对于平台装置运动。在本实施方式中,以摄像装置的运动为主,其优势在于能够防止放置于平台装置上的板卡发生随机移动或者滑落,同时,由于控制装置可以实现精确的移动,因此能够保障摄像装置采集局部图像的准确性。As a specific implementation manner, the board image splicing system further includes a control device disposed on the camera device or the platform device to keep the platform device stationary, and the control device controls the camera device according to a fixed distance interval when the camera device collects a partial image. Movement relative to the platform device. In the present embodiment, the motion of the imaging device is dominant, and the advantage is that the card placed on the platform device can be prevented from randomly moving or slipping. At the same time, since the control device can achieve accurate movement, the camera device can be captured. The accuracy of the partial image.
作为另一种具体的实施方式,板卡图像拼接系统还包括设置于摄像装置或者平台装置上的控制装置,保持摄像装置不动,控制装置根据摄像装置采集局部图像时的固定的距离间隔控制平台装置相对于摄像装置运动。由于一般情况下的摄像装置应尽量避免由外力而引起的抖动,以免造成图像的模糊,同时平台装置相对于摄像装置进行运动不仅在技术上更容易实现,例如利用伺服控制系统实现,而且运动的稳定性和精确性都较好,因而控制装置控制平台装置进行运动更有利于提高摄像装置采集的局部图像的质量。As another specific implementation manner, the board image splicing system further includes a control device disposed on the camera device or the platform device to keep the camera device stationary, and the control device controls the platform according to a fixed distance interval when the camera device collects a partial image. The device moves relative to the camera. Since the camera device in general should try to avoid the jitter caused by the external force, so as to avoid blurring of the image, and the movement of the platform device relative to the camera device is not only technically easier to implement, for example, using a servo control system, and moving. The stability and accuracy are good, so that the control device controls the platform device to perform motion, which is more beneficial to improve the quality of the partial image captured by the camera device.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments may be arbitrarily combined. For the sake of brevity of description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be considered as the scope of this manual.
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。 The above-described embodiments are merely illustrative of several embodiments of the present invention, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the invention. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the invention. Therefore, the scope of the invention should be determined by the appended claims.

Claims (10)

  1. 一种板卡图像拼接方法,其特征在于,包括以下步骤:A card image splicing method, comprising the steps of:
    获取摄像装置采集的板卡的局部图像,所述局部图像由所述摄像装置按照同一方向上固定的距离间隔采集获得,且在同一方向上相邻的所述局部图像具有重合区域;Acquiring a partial image of the card acquired by the camera device, wherein the partial image is acquired by the camera device at a fixed distance interval in the same direction, and the partial images adjacent in the same direction have a coincident region;
    对各个所述局部图像进行畸变校正后,对每一所述局部图像的各个边分别进行裁剪,获得与各个所述局部图像对应的标准局部图像;After performing distortion correction on each of the partial images, each side of each of the partial images is separately cropped to obtain a standard partial image corresponding to each of the partial images;
    根据各个所述标准局部图像在所述板卡上的相对位置关系,将所述标准局部图像拼接形成板卡图像。The standard partial images are spliced to form a card image according to the relative positional relationship of each of the standard partial images on the card.
  2. 根据权利要求1所述的板卡图像拼接方法,其特征在于,The board image splicing method according to claim 1, wherein
    对每一所述局部图像的各个边分别进行裁剪时,各个边的裁剪宽度为各个边对应的重合区域宽度的一半。When each side of each of the partial images is cropped, the cutting width of each side is half of the width of the overlapping area corresponding to each side.
  3. 根据权利要求1或2所述的板卡图像拼接方法,其特征在于,The card image splicing method according to claim 1 or 2, wherein
    所述局部图像的各个边的裁剪宽度均相同。The trim widths of the respective sides of the partial image are the same.
  4. 根据权利要求1或2所述的板卡图像拼接方法,其特征在于,在获取摄像装置采集的板卡的局部图像步骤之前,还包括以下步骤:The card image splicing method according to claim 1 or 2, further comprising the following steps before the step of acquiring a partial image of the card acquired by the camera device:
    获取板卡上标记点的图像并对该图像进行畸变校正,得到第一图像;Obtaining an image of the marked point on the board and performing distortion correction on the image to obtain a first image;
    在所述板卡的位置改变后,再次获取所述标记点的图像并对该图像进行畸变校正,得到第二图像;After the position of the board is changed, acquiring an image of the marked point and performing distortion correction on the image to obtain a second image;
    根据所述第一图像和所述第二图像获得所述标记点的偏移轨迹,计算所述偏移轨迹与所述第一图像或者所述第二图像的边的夹角;Obtaining an offset trajectory of the marker point according to the first image and the second image, and calculating an angle between the offset trajectory and an edge of the first image or the second image;
    根据所述夹角调节所述摄像装置或者所述板卡的位置,使所述偏移轨迹与所述第一图像或者所述第二图像的边平行或者垂直。Adjusting a position of the imaging device or the card according to the included angle such that the offset trajectory is parallel or perpendicular to an edge of the first image or the second image.
  5. 一种用于板卡图像拼接的处理装置,其特征在于,包括:A processing device for splicing a card image, comprising:
    获取单元,用于获取摄像装置采集的板卡的局部图像,所述局部图像由所述摄像装置按照同一方向上固定的距离间隔采集获得,且在同一方向上相邻的所述局部图像具有重合区域;An acquiring unit, configured to acquire a partial image of a card acquired by the camera device, where the partial image is acquired by the camera device at a fixed distance interval in the same direction, and the partial images adjacent in the same direction have coincidence region;
    处理单元,用于对各个所述局部图像进行畸变校正后,对每一所述局部图 像的各个边分别进行裁剪,获得与各个所述局部图像对应的标准局部图像;a processing unit, configured to perform distortion correction on each of the partial images, for each of the partial maps Each side of the image is separately cropped to obtain a standard partial image corresponding to each of the partial images;
    拼接单元,用于根据各个所述标准局部图像的相对位置,将所述标准局部图像拼接形成板卡图像。a splicing unit for splicing the standard partial images to form a card image according to the relative positions of the respective partial partial images.
  6. 根据权利要求5所述的用于板卡图像拼接的处理装置,其特征在于,A processing apparatus for board image stitching according to claim 5, wherein
    所述处理单元使各个边的裁剪宽度为各个边对应的重合区域宽度的一半。The processing unit makes the cutting width of each side half of the width of the overlapping area corresponding to each side.
  7. 根据权利要求5或6所述的用于板卡图像拼接的处理装置,其特征在于,还包括依次连接的标记点图像获取单元、运算单元和调节单元,The processing device for stitching a card image according to claim 5 or 6, further comprising a point image acquiring unit, an arithmetic unit and an adjusting unit connected in sequence,
    所述标记点图像获取单元,用于获取板卡上标记点的图像并对该图像进行畸变校正,得到第一图像,并且在所述板卡的位置改变后,再次获取所述标记点的图像并对该图像进行畸变校正,得到第二图像;The marker point image acquisition unit is configured to acquire an image of a marker point on the card and perform distortion correction on the image to obtain a first image, and acquire an image of the marker point again after the position of the card is changed. And performing distortion correction on the image to obtain a second image;
    所述运算单元,用于根据所述第一图像和所述第二图像获得所述标记点的偏移轨迹,计算所述偏移轨迹与所述第一图像或者所述第二图像的边的夹角;The operation unit is configured to obtain an offset trajectory of the marker point according to the first image and the second image, and calculate the offset trajectory and an edge of the first image or the second image Angle
    所述调节单元,用于根据所述夹角调节所述摄像装置或者所述板卡的位置,使所述偏移轨迹与所述第一图像或者所述第二图像的边平行或者垂直。The adjusting unit is configured to adjust a position of the camera device or the board according to the angle, so that the offset track is parallel or perpendicular to an edge of the first image or the second image.
  8. 一种板卡图像拼接系统,其特征在于,包括平台装置、摄像装置、用于控制所述摄像装置和所述平台装置进行相对运动的控制装置以及如权利要求5至7中任一项所述的用于板卡图像拼接的处理装置,所述摄像装置与所述处理装置连接,A card image splicing system, comprising: a platform device, an imaging device, a control device for controlling relative movement of the camera device and the platform device, and the method of any one of claims 5 to 7 a processing device for stitching a card image, the camera device being connected to the processing device,
    所述平台装置用于承载板卡;The platform device is configured to carry a board;
    所述摄像装置用于采集板卡的局部图像;The camera device is configured to collect a partial image of the card;
    所述控制装置用于控制所述摄像装置按照同一方向上固定的距离间隔采集板卡的局部图像,且在同一方向上相邻的所述局部图像具有重合区域。The control device is configured to control the camera device to acquire partial images of the card according to a fixed distance interval in the same direction, and the partial images adjacent in the same direction have overlapping regions.
  9. 根据权利要求8所述的板卡图像拼接系统,其特征在于,The card image splicing system according to claim 8, wherein
    所述平台装置保持不动,所述控制装置根据所述距离间隔控制所述摄像装置相对于所述平台装置运动。The platform device remains stationary, and the control device controls movement of the camera device relative to the platform device in accordance with the distance interval.
  10. 根据权利要求8所述的板卡图像拼接系统,其特征在于,The card image splicing system according to claim 8, wherein
    所述摄像装置保持不动,所述控制装置根据所述距离间隔控制所述平台装置相对于所述摄像装置运动。 The camera device remains stationary, and the control device controls movement of the platform device relative to the camera device according to the distance interval.
PCT/CN2016/098225 2015-11-09 2016-09-06 Board card image splicing method and processing apparatus and system WO2017080294A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510760104.7A CN105335931A (en) 2015-11-09 2015-11-09 Board card image stitching method, processing device and system
CN201510760104.7 2015-11-09

Publications (1)

Publication Number Publication Date
WO2017080294A1 true WO2017080294A1 (en) 2017-05-18

Family

ID=55286441

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/098225 WO2017080294A1 (en) 2015-11-09 2016-09-06 Board card image splicing method and processing apparatus and system

Country Status (2)

Country Link
CN (1) CN105335931A (en)
WO (1) WO2017080294A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11361535B2 (en) * 2018-08-08 2022-06-14 Google Llc Multi-angle object recognition

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335931A (en) * 2015-11-09 2016-02-17 广州视源电子科技股份有限公司 Board card image stitching method, processing device and system
CN106645203A (en) * 2017-02-13 2017-05-10 广州视源电子科技股份有限公司 Image capturing method and device
CN109242762A (en) * 2018-08-27 2019-01-18 北京铂石空间科技有限公司 Image-recognizing method, device, storage medium and electronic equipment
CN109685845B (en) * 2018-11-26 2023-04-07 普达迪泰(天津)智能装备科技有限公司 POS system-based real-time image splicing processing method for FOD detection robot
CN110977154A (en) * 2019-12-05 2020-04-10 苏州领鹿智能科技有限公司 Positioning marking method suitable for large breadth
CN111583118B (en) * 2020-05-13 2023-09-29 创新奇智(北京)科技有限公司 Image stitching method and device, storage medium and electronic equipment
CN116469318A (en) * 2022-01-05 2023-07-21 Tcl华星光电技术有限公司 Tiled display, driving method and tiled display device
CN114638824B (en) * 2022-05-11 2022-08-23 成都数联云算科技有限公司 Fusion method, device, equipment and medium for collecting images based on AOI equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1320254A1 (en) * 2001-12-12 2003-06-18 MV Research Limited An image processing system
CN2769896Y (en) * 2005-01-06 2006-04-05 电子科技大学 High-precision splitting registrating apparatus for infrared circuit fault detector
CN1862597A (en) * 2005-05-13 2006-11-15 英赛特半导体有限公司 Method of registering and aligning multiple images
CN103369192A (en) * 2012-03-31 2013-10-23 深圳市振华微电子有限公司 Method and device for Full-hardware splicing of multichannel video images
CN105335931A (en) * 2015-11-09 2016-02-17 广州视源电子科技股份有限公司 Board card image stitching method, processing device and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334266B (en) * 2008-07-18 2010-07-14 北京优纳科技有限公司 Circuit board defect off-line checking method based on large-capacity image storage technology
CN102680495B (en) * 2011-03-15 2016-09-07 上海赫立电子科技有限公司 Automatic optical detection device and method
CN102873420B (en) * 2012-09-28 2015-03-11 廖怀宝 Method for positioning Mark points of PCB (printed circuit board) by image matching
US11176635B2 (en) * 2013-01-25 2021-11-16 Cyberoptics Corporation Automatic programming of solder paste inspection system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1320254A1 (en) * 2001-12-12 2003-06-18 MV Research Limited An image processing system
CN2769896Y (en) * 2005-01-06 2006-04-05 电子科技大学 High-precision splitting registrating apparatus for infrared circuit fault detector
CN1862597A (en) * 2005-05-13 2006-11-15 英赛特半导体有限公司 Method of registering and aligning multiple images
CN103369192A (en) * 2012-03-31 2013-10-23 深圳市振华微电子有限公司 Method and device for Full-hardware splicing of multichannel video images
CN105335931A (en) * 2015-11-09 2016-02-17 广州视源电子科技股份有限公司 Board card image stitching method, processing device and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11361535B2 (en) * 2018-08-08 2022-06-14 Google Llc Multi-angle object recognition
US20220309781A1 (en) * 2018-08-08 2022-09-29 Google Llc Multi-Angle Object Recognition
US11605221B2 (en) 2018-08-08 2023-03-14 Google Llc Multi-angle object recognition
US20230215126A1 (en) * 2018-08-08 2023-07-06 Google Llc Multi-Angle Object Recognition
US11961271B2 (en) 2018-08-08 2024-04-16 Google Llc Multi-angle object recognition

Also Published As

Publication number Publication date
CN105335931A (en) 2016-02-17

Similar Documents

Publication Publication Date Title
WO2017080294A1 (en) Board card image splicing method and processing apparatus and system
CN102376089B (en) Target correction method and system
WO2012053521A1 (en) Optical information processing device, optical information processing method, optical information processing system, and optical information processing program
Albarelli et al. Robust camera calibration using inaccurate targets
EP1031812A2 (en) Measurement apparatus
CN106780623A (en) A kind of robotic vision system quick calibrating method
CN106485758B (en) Unmanned aerial vehicle camera calibration device, calibration method and assembly line calibration implementation method
JP5432835B2 (en) How to calibrate the camera
JP2008014940A (en) Camera calibration method for camera measurement of planar subject and measuring device applying same
CN108429908B (en) Camera module testing method, device, equipment and medium
CN113538583A (en) Method for accurately positioning position of workpiece on machine tool and vision system
CN108716890A (en) A kind of high-precision size detecting method based on machine vision
CN114331924B (en) Large workpiece multi-camera vision measurement method
CN108805940B (en) Method for tracking and positioning zoom camera in zooming process
JP2017138288A (en) Image measurement device and program
CN211374003U (en) Lens testing device
CN110415269A (en) A kind of target tracking algorism under dynamic static background
WO2019085004A1 (en) Video splicing apparatus and method
CN110640303B (en) High-precision vision positioning system and positioning calibration method thereof
CN113838137A (en) Method and system for acquiring correction mark position based on TFT-LCD
JP2014060324A (en) Calculation device, transfer robot system, and calculation method
JP3696336B2 (en) How to calibrate the camera
JP3855244B2 (en) Three-dimensional image recognition device using a microscope
US10516822B2 (en) Method and device for merging images of calibration devices
TWI504859B (en) Method for photographing and piecing together the images of an object

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16863472

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16863472

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16863472

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 29/01/2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16863472

Country of ref document: EP

Kind code of ref document: A1