Search

CN-116029906-B - Penicillin bottle image stitching method based on cylindrical correction and weighted fusion

CN116029906BCN 116029906 BCN116029906 BCN 116029906BCN-116029906-B

Abstract

The invention provides a penicillin bottle image stitching method based on cylindrical correction and weighted fusion, and relates to the field of image processing. The penicillin bottle image stitching method based on cylindrical correction and weighted fusion comprises the steps of collecting cylindrical label images, carrying out distortion correction on the cylindrical label images in the horizontal direction and the vertical direction respectively to obtain label images with approximate planes, roughly estimating an image overlapping area, carrying out image registration on the estimated overlapping area, carrying out feature extraction on the image of the overlapping area, carrying out feature rough matching, removing mismatching points, sorting according to Euclidean distance ratio of nearest neighbors of feature points to nearest neighbors, and finally realizing feature matching of the images, and carrying out image fusion on the images after feature matching. The method solves the problems that the traditional gradual-in gradual-out fusion algorithm adopts linear weighted fusion, the splicing line is obvious after the image fusion, and the ghost phenomenon is easy to occur.

Inventors

  • WANG MIN
  • WU JIA
  • LI CHENG
  • SUN SHUO

Assignees

  • 南京信息工程大学

Dates

Publication Date
20260508
Application Date
20230210

Claims (8)

  1. 1. The penicillin bottle image stitching method based on cylindrical correction and weighted fusion is characterized by comprising the following steps of: Collecting a cylindrical label image; respectively carrying out distortion correction on the cylindrical tag image in the horizontal direction and the vertical direction to obtain an approximate plane tag image; roughly estimating an image overlapping region, and then carrying out image registration on the estimated overlapping region; Extracting features of the images in the overlapping area, performing feature coarse matching, removing mismatching points, and sequencing according to Euclidean distance ratio of nearest neighbors and secondary neighbors of the feature points to finally realize feature matching of the images; Image fusion is carried out on the images with the matched features; The image fusion of the image after feature matching specifically comprises the following steps: the first row of the image in the overlapping area is regarded as a splice line, each pixel point value is taken as an intensity value, and the column number of the image is the point where the splice line is located; calculating the intensity value of the current pixel point from the first row, comparing the intensity value of the pixel points at the left, middle and right positions of the next row, wherein the column number of the pixel point with the minimum intensity value is the point of the splicing line, and Wherein, the , Obtaining the difference of the intensity values between the pixels ; Repeating the operation, counting one with the smallest intensity value as the optimal splicing line, and obtaining the left and right boundaries L and R of the circumscribed rectangle of the optimal splicing; For two images , The following operations are performed: wherein the weight value And The method comprises the following steps: , 。
  2. 2. the penicillin bottle image stitching method based on cylindrical correction and weighted fusion according to claim 1, wherein the cylindrical label image is collected, and particularly the cylindrical label image is collected from four directions through four cameras respectively.
  3. 3. The penicillin bottle image stitching method based on cylindrical correction and weighted fusion according to claim 2, wherein the distortion correction is performed on cylindrical label images in the horizontal direction and the vertical direction respectively to obtain approximately planar label images, and the method specifically comprises the following steps: The radius of the input cylindrical label is recorded as R, the abscissa of the label image pixel is recorded as x, and the input cylindrical label can pass Obtaining coordinates of horizontally corrected image pixels ; The distance between the camera lens and the image plane is recorded as f, the distance between the image plane and the object plane is recorded as d1, and the horizontal central value of the image is The coordinates of each point in the horizontal direction of the image are x, Is the coordinate of the vertical direction of the image, through Obtaining the ordinate of the corrected image 。
  4. 4. The penicillin bottle image stitching method based on cylindrical correction and weighted fusion according to claim 3, wherein the roughly estimating the image overlapping area and then performing image registration on the estimated overlapping area comprises the following steps: Recording and inputting two images as , Then: fourier transform is performed to obtain: Wherein, the And Is that And Fourier transform of (a); Obtaining Complex conjugate of (2) And get And Cross power spectrum of (c) ; A normalized power spectrum is defined and a power spectrum is determined, ; Solving the inverse Fourier transform of the normalized power spectrum to obtain a two-dimensional impulse function, The horizontal and vertical coordinate values obtained when the impulse function is maximum are the displacement of the image in the horizontal direction, namely the overlapping area of the image , 。
  5. 5. The penicillin bottle image splicing method based on cylindrical correction and weighted fusion according to claim 4, wherein the characteristic extraction is carried out on the overlapped area image, the characteristic rough matching is carried out, the mismatching points are removed, and the characteristic matching of the image is finally realized by sequencing according to the Euclidean distance ratio of the nearest neighbor of the characteristic point to the nearest neighbor, and the method is characterized in that: And carrying out feature extraction on the images in the overlapped area by adopting a SURF algorithm, carrying out feature rough matching by adopting a FLANN quick matching algorithm, removing mismatching points according to a random sampling consistency algorithm, and sequencing according to the Euclidean distance ratio of the nearest neighbor and the secondary neighbor of the feature points to finally realize feature matching of the images.
  6. 6. A system for performing the cylinder correction and weighted fusion based penicillin bottle image stitching method as claimed in any one of claims 1-5, comprising: the image acquisition module is used for acquiring a cylindrical label image; the image correction module is used for respectively carrying out distortion correction on the cylindrical label image in the horizontal direction and the vertical direction to obtain an approximate plane label image; the image registration module is used for roughly estimating the image overlapping area and then carrying out image registration on the estimated overlapping area; a feature extraction module for extracting features of the overlapped region image, The feature matching module is used for carrying out feature rough matching, removing mismatching points, and sequencing according to the Euclidean distance ratio of the nearest neighbor and the next nearest neighbor of the feature points to finally realize feature matching of the images; and the image fusion module is used for carrying out image fusion on the images with the matched features.
  7. 7. A computer readable storage medium storing one or more programs, wherein the one or more programs comprise instructions, which when executed by a computing device, cause the computing device to perform any of the methods of claims 1-5.
  8. 8. A computing device, comprising: One or more processors, memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing any of the methods of claims 1-5.

Description

Penicillin bottle image stitching method based on cylindrical correction and weighted fusion Technical Field The invention relates to the technical field of image processing, in particular to a penicillin bottle image stitching method based on cylindrical correction and weighted fusion. Background Intravenous drip medicines are important components of medical transfusion, and in actual work, medical staff need to strictly follow the regulation system of a hospital, strictly execute the check system and obey the aseptic operation rules. In order to improve the working efficiency, the machine gradually replaces manual dispensing at the present stage, and the machine vision is gradually applied to medicine bottle information management to reduce the workload of medical staff. The first step in realizing the management of the label information of the medicine bottle is to acquire a complete label information image. Because of limitation of the curved surface shape of the medicine bottle and the shooting visual angle of the camera, a complete label image cannot be obtained at one time through shooting, and therefore, the pictures with different angles obtained through shooting are usually subjected to image stitching to obtain the complete label image. The curved surface label acquisition method adopted at the present stage is mainly obtained by shooting through a linear array camera, and has good hardware requirements and high consumption cost. Therefore, the penicillin bottle image splicing method based on cylindrical correction and weighted fusion is provided, a complete curved surface label unfolding image can be obtained through shooting by a common industrial camera, and a foundation is laid for the next step of medicine bottle information identification and management. Disclosure of Invention (One) solving the technical problems Aiming at the defects of the prior art, the invention provides a penicillin bottle image splicing method based on cylindrical correction and weighted fusion, which solves the problems that the traditional gradual-in gradual-out fusion algorithm adopts linear weighted fusion, the splicing line is obvious after image fusion, and the ghost phenomenon is easy to occur. (II) technical scheme In order to achieve the above purpose, the invention is realized by the following technical scheme: In a first aspect, a penicillin bottle image stitching method based on cylindrical correction and weighted fusion is provided, including: Collecting a cylindrical label image; respectively carrying out distortion correction on the cylindrical tag image in the horizontal direction and the vertical direction to obtain an approximate plane tag image; roughly estimating an image overlapping region, and then carrying out image registration on the estimated overlapping region; Extracting features of the images in the overlapping area, performing feature rough matching, removing mismatching points, and sequencing according to Euclidean distance ratio of nearest neighbors and secondary neighbors of the feature points to finally realize feature matching of the images; And carrying out image fusion on the images with the matched features. Preferably, the cylindrical label image is collected, specifically, the cylindrical label image is collected from four directions through four cameras respectively. Preferably, the distortion correction is performed on the cylindrical label image in the horizontal direction and the vertical direction respectively to obtain an approximately planar label image, which specifically includes: The radius of the input cylindrical label is recorded as R, the abscissa of the label image pixel is recorded as x, and the input cylindrical label can pass Obtaining coordinates x' of the horizontally corrected image pixels; The distance from the camera lens to the image plane is recorded as f, the distance from the image plane to the object plane is recorded as d1, the image horizontal center value is center_x, the coordinates of each point in the image horizontal direction are x, h b are the coordinates in the image vertical direction, and the image is obtained by The ordinate h f of the corrected image is obtained. Preferably, the roughly estimating the image overlapping area and then performing image registration on the estimated overlapping area specifically includes: Note that the two images are input as I 1(x,y),I2 (x, y), then: I1(x,y)=I2(x-Δx,y-Δy) fourier transform is performed to obtain: Wherein, the AndIs the fourier transform of I 1 (x, y) and I 2 (x, y); Obtaining Complex conjugate of (2)And getAndCross power spectrum of (c) A normalized power spectrum is defined and a power spectrum is determined, And (3) obtaining the inverse Fourier transform of the normalized power spectrum to obtain a two-dimensional impulse function, wherein delta (x-deltax, y-deltay) =F -1[e-j2π(uΔx+vΔy), and the horizontal coordinate value obtained when the impulse function is maximum is the displaceme