Image registration method, image registration device, printer and storage medium

文档序号:1954764 发布日期:2021-12-10 浏览:19次 中文

阅读说明:本技术 图像配准方法、装置、印刷机和存储介质 (Image registration method, image registration device, printer and storage medium ) 是由 张蓬 陈华慧 于 2021-09-10 设计创作,主要内容包括:本申请提供一种图像配准方法、装置、印刷机和存储介质,该方法中,通过获取包括N乘以M个样点的待配准图像,并对待配准图像进行双向投影,得到待配准图像的第一水平向量和第一垂直向量,并根据第一水平向量、第一垂直向量和预设标准图像,确定第一相关系数集合和第二相关系数集合,之后根据第一相关系数集合和第二相关系数集合,对待配准图像进行配准,得到目标配准位置。该技术方案中,通过将待配准图像水平方向上的样点和垂直方向上的样点进行投影处理,大大减少了在印刷检测时针对图像配准的耗时,提高了图像配准的效率。(The method comprises the steps of obtaining an image to be registered including N times M sampling points, conducting two-way projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered, determining a first correlation coefficient set and a second correlation coefficient set according to the first horizontal vector, the first vertical vector and a preset standard image, and conducting registration on the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position. According to the technical scheme, the sample points in the horizontal direction and the sample points in the vertical direction of the image to be registered are subjected to projection processing, so that time consumption of image registration during printing detection is greatly reduced, and the image registration efficiency is improved.)

1. An image registration method, comprising:

acquiring an image to be registered, wherein the image to be registered comprises N times M sampling points, and N and M are positive integers;

performing bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector, wherein the first horizontal vector is a vector of M sampling points of the image to be registered in the horizontal direction and a vector with the length of N, and the first vertical vector is a vector of N sampling points of the image to be registered in the vertical direction and a vector with the length of M;

determining a first correlation coefficient set and a second correlation coefficient set according to the first horizontal vector, the first vertical vector and a preset standard image, wherein the first correlation coefficient set is a set of correlation coefficients of horizontal deviation positions of the image to be registered and the preset standard image, and the second correlation coefficient set is a set of correlation coefficients of vertical deviation positions of the image to be registered and the preset standard image;

and registering the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position.

2. The method of claim 1, wherein prior to said determining a first set of correlation coefficients and a second set of correlation coefficients from said first horizontal vector, said first vertical vector and a preset standard image, the method further comprises:

acquiring the preset standard image;

and carrying out two-way projection on the preset standard image to obtain a second horizontal vector and a second vertical vector of the preset standard image, wherein the second horizontal vector is the vector of M sampling points of the preset standard image in the horizontal direction and the vector of which the constituent length is N, and the second vertical vector is the vector of N sampling points of the preset standard image in the vertical direction and the vector of which the constituent length is M.

3. The method of claim 1 or 2, wherein the bi-directional projection comprises: horizontal projection and vertical projection;

correspondingly, the performing bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered includes:

performing horizontal projection on the image to be registered to obtain the first horizontal vector;

and carrying out vertical projection on the image to be registered to obtain the first vertical vector.

4. The method of claim 2, wherein determining a first set of correlation coefficients and a second set of correlation coefficients according to the first horizontal vector, the first vertical vector and a preset standard image comprises:

determining a first correlation coefficient set of a horizontal deviation position of the image to be registered and the preset standard image according to the first horizontal vector and the second horizontal vector, wherein the first correlation coefficient set comprises: the correlation coefficient of the horizontal deviation position with the vector length of S;

determining a second correlation coefficient set of the vertical deviation position of the image to be registered and the preset standard image according to the first vertical vector and the second vertical vector, wherein the second correlation coefficient set comprises: the vector length is the correlation coefficient of the vertical deviation position of L.

5. The method according to claim 4, wherein the determining a first set of correlation coefficients of the horizontal deviation position of the image to be registered from the preset standard image according to the first horizontal vector and the second horizontal vector comprises:

translating the first horizontal vector along the second horizontal vector to obtain a first element and a second element which have the length S and are coincident with each other;

and obtaining a correlation coefficient of the horizontal deviation with the vector length S according to the first element and the second element which are overlapped with each other and have the vector length S.

6. The method according to claim 4, wherein the determining a second set of correlation coefficients of the vertical deviation position of the image to be registered from the preset standard image according to the first vertical vector and the second vertical vector comprises:

translating the first vertical vector along the second vertical vector to obtain a third element and a fourth element which have the vector length L and are mutually coincident;

and obtaining a correlation coefficient of the vertical deviation with the vector length L according to the third element and the fourth element which are overlapped with each other and have the vector length L.

7. The method according to claim 4, wherein the registering the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position comprises:

determining a first position where a maximum value in the first correlation coefficient set is located according to the correlation coefficient of the horizontal deviation with the vector length of S;

determining a second position where a maximum value in the second correlation coefficient set is located according to the correlation coefficient of the vertical deviation with the vector length L;

determining a first target position of a first target sampling point of the image to be registered according to the first position and the second position;

and registering the image to be registered according to the first target position to obtain the target registration position.

8. An image registration apparatus, comprising: the device comprises an acquisition module, a processing module, a determination module and a registration module;

the acquisition module is used for acquiring an image to be registered, wherein the image to be registered comprises N times M sampling points, and N and M are positive integers greater than or equal to 1;

the processing module is configured to perform bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered, where the first horizontal vector is a vector sum of M sampling points of the image to be registered in a horizontal direction, and the first vertical vector is a vector sum of N sampling points of the image to be registered in a vertical direction;

the determining module is configured to determine a first correlation coefficient set and a second correlation coefficient set according to the first horizontal vector, the first vertical vector and a preset standard image, where the first correlation coefficient set is a set of correlation coefficients of horizontal deviation positions of the image to be registered and the preset standard image, and the second correlation coefficient set is a set of correlation coefficients of vertical deviation positions of the image to be registered and the preset standard image;

the registration module is configured to register the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position.

9. A printing press, comprising: a processor, a memory and computer program instructions stored on the memory and executable on the processor, wherein the processor when executing the computer program instructions implements the image registration method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, are configured to implement the image registration method according to any one of claims 1 to 7.

Technical Field

The present application relates to the field of image processing, and in particular, to an image registration method, an image registration apparatus, a printing press, and a storage medium.

Background

Image registration of a printing press is a process of matching two or more images acquired at different times, different sensors (imaging devices), or under different conditions (weather, illuminance, camera position and angle, etc.), and is the basis of subsequent image comparison.

In the prior art, the image registration method may be based on direct matching of gray scale and color of an image, specifically, taking registration of an image to be registered and a standard image as an example, the image to be registered may be moved from left to right based on the standard image, and differences are made one by one based on each sampling point of a pixel on the image to be registered and each sampling point of a pixel on the standard image, so as to obtain a position where the difference and the minimum point are located, thereby completing image registration.

However, when the images are registered by the above method, when the pixels of the images are too high, the number of compared sampling points is too large, so that the registration efficiency is low, and the requirement of real-time printing by a high-speed printer is difficult to meet.

Disclosure of Invention

The embodiment of the application provides an image registration method, an image registration device, a printing machine and a storage medium, which are used for solving the problem of low image registration efficiency in the prior art.

In a first aspect, an embodiment of the present application provides an image registration method, including:

acquiring an image to be registered, wherein the image to be registered comprises N times M sampling points, and N and M are positive integers;

performing bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered, wherein the first horizontal vector is the vector sum of M sampling points of the image to be registered in the horizontal direction, and the first vertical vector is the vector sum of N sampling points of the image to be registered in the vertical direction;

determining a first correlation coefficient set and a second correlation coefficient set according to the first horizontal vector, the first vertical vector and a preset standard image, wherein the first correlation coefficient set is a set of correlation coefficients of horizontal deviation positions of the image to be registered and the preset standard image, and the second correlation coefficient set is a set of correlation coefficients of vertical deviation positions of the image to be registered and the preset standard image;

and registering the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position.

In a possible design of the first aspect, before the determining a first set of correlation coefficients and a second set of correlation coefficients according to the first horizontal vector, the first vertical vector, and a preset standard image, the method further includes:

acquiring the preset standard image;

and carrying out bidirectional projection on the preset standard image to obtain a second horizontal vector and a second vertical vector of the preset standard image, wherein the second horizontal vector is the vector sum of M sampling points of the preset standard image in the horizontal direction, and the second vertical vector is the vector sum of N sampling points of the preset standard image in the vertical direction.

In another possible design of the first aspect, the bidirectional projection includes: horizontal projection and vertical projection;

correspondingly, the performing bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered includes:

performing horizontal projection on the image to be registered to obtain the first horizontal vector;

and carrying out vertical projection on the image to be registered to obtain the first vertical vector.

In yet another possible design of the first aspect, the determining a first set of correlation coefficients and a second set of correlation coefficients according to the first horizontal vector, the first vertical vector, and a preset standard image includes:

determining a first correlation coefficient set of a horizontal deviation position of the image to be registered and the preset standard image according to the first horizontal vector and the second horizontal vector, wherein the first correlation coefficient set comprises: the correlation coefficient of the horizontal deviation position with the vector length of S;

determining a second correlation coefficient set of the vertical deviation position of the image to be registered and the preset standard image according to the first vertical vector and the second vertical vector, wherein the second correlation coefficient set comprises: the vector length is the correlation coefficient of the vertical deviation position of L.

Optionally, the determining, according to the first horizontal vector and the second horizontal vector, a first correlation coefficient set of a horizontal deviation position between the image to be registered and the preset standard image includes:

translating the first horizontal vector along the second horizontal vector to obtain a first element and a second element which have the length S and are coincident with each other;

and obtaining a correlation coefficient of the horizontal deviation with the vector length S according to the first element and the second element which are overlapped with each other and have the vector length S.

Optionally, the determining, according to the first vertical vector and the second vertical vector, a second correlation coefficient set of a vertical deviation position of the image to be registered and the preset standard image includes:

translating the first vertical vector along the second vertical vector to obtain a third element and a fourth element which have the length L of the vector and are overlapped with each other;

and obtaining a correlation coefficient of the vertical deviation with the vector length L according to the third element and the fourth element which are overlapped with each other and have the vector length L.

In yet another possible design of the first aspect, the registering the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position includes:

determining a first position where a maximum value in the first correlation coefficient set is located according to the correlation coefficient of the horizontal deviation with the vector length of S;

determining a second position where a maximum value in the second correlation coefficient set is located according to the correlation coefficient of the vertical deviation with the vector length L;

determining a first target position of a first target sampling point of the image to be registered according to the first position and the second position;

and registering the image to be registered according to the first target position to obtain the target registration position.

In a second aspect, an embodiment of the present application provides an image registration apparatus, including: the device comprises an acquisition module, a processing module, a determination module and a registration module;

the acquisition module is used for acquiring an image to be registered, wherein the image to be registered comprises N times M sampling points, and N and M are positive integers greater than or equal to 1;

the processing module is configured to perform bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered, where the first horizontal vector is a vector sum of M sampling points of the image to be registered in a horizontal direction, and the first vertical vector is a vector sum of N sampling points of the image to be registered in a vertical direction;

the determining module is configured to determine a first correlation coefficient set and a second correlation coefficient set according to the first horizontal vector, the first vertical vector and a preset standard image, where the first correlation coefficient set is a set of correlation coefficients of horizontal deviation positions of the image to be registered and the preset standard image, and the second correlation coefficient set is a set of correlation coefficients of vertical deviation positions of the image to be registered and the preset standard image;

the registration module is configured to register the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position.

In a possible design of the second aspect, the obtaining module is further configured to obtain the preset standard image;

the processing module is further configured to perform bidirectional projection on the preset standard image to obtain a second horizontal vector and a second vertical vector of the preset standard image, where the second horizontal vector is a vector sum of M sampling points of the preset standard image in the horizontal direction, and the second vertical vector is a vector sum of N sampling points of the preset standard image in the vertical direction.

In another possible design of the second aspect, the bidirectional projection includes: horizontal projection and vertical projection;

correspondingly, the processing module performs bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered, and is specifically configured to:

performing horizontal projection on the image to be registered to obtain the first horizontal vector;

and carrying out vertical projection on the image to be registered to obtain the first vertical vector.

In yet another possible design of the second aspect, the determining module is specifically configured to:

determining a first correlation coefficient set of a horizontal deviation position of the image to be registered and the preset standard image according to the first horizontal vector and the second horizontal vector, wherein the first correlation coefficient set comprises: the correlation coefficient of the horizontal deviation position with the vector length of S;

determining a second correlation coefficient set of the vertical deviation position of the image to be registered and the preset standard image according to the first vertical vector and the second vertical vector, wherein the second correlation coefficient set comprises: the vector length is the correlation coefficient of the vertical deviation position of L.

Optionally, the determining module is configured to determine, according to the first horizontal vector and the second horizontal vector, a first correlation coefficient set of a horizontal deviation position between the image to be registered and the preset standard image, and specifically configured to:

translating the first horizontal vector along the second horizontal vector to obtain a first element and a second element which have the length S and are coincident with each other;

and obtaining a correlation coefficient of the horizontal deviation with the vector length S according to the first element and the second element which are overlapped with each other and have the vector length S.

Optionally, the determining module is configured to determine, according to the first vertical vector and the second vertical vector, a second correlation coefficient set of a vertical deviation position between the image to be registered and the preset standard image, and specifically configured to:

translating the first vertical vector along the second vertical vector to obtain a third element and a fourth element which have the length L of the vector and are overlapped with each other;

and according to the third element and the fourth element which are overlapped with each other and have the vector length L, the correlation coefficient of the vertical deviation with the vector length L is obtained.

In yet another possible design of the second aspect, the registration module is specifically configured to:

determining a first position where a maximum value in the first correlation coefficient set is located according to the correlation coefficient of the horizontal deviation with the vector length of S;

determining a second position where a maximum value in the second correlation coefficient set is located according to the correlation coefficient of the vertical deviation with the vector length L;

determining a first target position of a first target sampling point of the image to be registered according to the first position and the second position;

and registering the image to be registered according to the first target position to obtain the target registration position.

In a third aspect, an embodiment of the present application provides a printing press, including: a processor, a memory;

the memory stores computer-executable instructions;

the processor executes the computer-executable instructions to cause the printer to perform the image registration method as described above in the first aspect and in various possible designs.

In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions for implementing the image registration method as described in the first aspect and various possible designs described above when executed by a processor.

In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, is configured to implement the image registration method as described in the first aspect and in various possible designs.

According to the image registration method, the image registration device, the printing machine and the storage medium, the image to be registered is obtained by multiplying N by M sampling points, the image to be registered is subjected to bidirectional projection to obtain a first horizontal vector and a first vertical vector of the image to be registered, a first correlation coefficient set and a second correlation coefficient set are determined according to the first horizontal vector, the first vertical vector and a preset standard image, and then the image to be registered is subjected to registration according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position. According to the technical scheme, the sample points in the horizontal direction and the sample points in the vertical direction of the image to be registered are subjected to projection processing, so that time consumption of image registration during printing detection is greatly reduced, and the image registration efficiency is improved.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.

Fig. 1 is a schematic flowchart of a first embodiment of an image registration method provided in an embodiment of the present application;

fig. 2 is a schematic flowchart of a second embodiment of an image registration method according to an embodiment of the present application;

fig. 3 is a schematic flowchart of a third embodiment of an image registration method according to an embodiment of the present application;

fig. 4 is a schematic structural diagram of an image registration apparatus provided in an embodiment of the present application;

fig. 5 is a schematic structural diagram of a printing press according to an embodiment of the present application.

With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.

Detailed Description

Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

Before introducing the embodiments of the present application, the terms and background of the present application are explained first:

pixel: an indivisible unit or element in an image. Indivisible means that it cannot be cut into smaller units or elements, which exist as a single color cell. Each dot matrix image contains a certain number of pixels that determine the size of the image to be presented on the screen.

Sampling point Dot: the sample may be the smallest display unit of hardware equipment, and the pixel may be either one sample or a collection of samples. When the scanner scans an image, each sample point of the scanner corresponds to each pixel of the formed image, so that the dot Per Inch (Dots Per inc, DPI) value set during scanning is equal to the pixel density (Pixels Per inc, PPI) value of the scanned formed image, and the two can be marked with equal numbers.

Image registration: the process of matching and superposing two or more images acquired at different times and different sensors (imaging devices) or under different conditions (weather, illumination, camera shooting position and angle and the like) is the basis of the comparison of subsequent images.

In the prior art, a commonly used image registration method may include:

1. direct registration based on gray scale and color;

2. registration of specific printed indicia patterns;

3. edge-based registration;

4. registration based on feature extraction, such as Scale-invariant feature transform (SIFT), etc.;

5. image transform based registration, such as Fast Fourier Transform (FFT).

In the above scheme, the direct registration based on the gray scale and the color is a method of comparing sample points Dot (one pixel represents one sample point) in pixels of the image to be registered with sample points in pixels of the standard image one by one, so that the image registration is realized with low efficiency.

For other image registration methods, all pixels also need to be processed, so that the data volume is high, and the processing efficiency is low.

Further, in practical use, it is difficult to meet the real-time processing requirements of high-speed printers due to the low processing efficiency described above.

In order to solve the technical problems, the technical conception process of the inventor is as follows: in the prior art, a mode of comparing sampling points on an image to be registered with sampling points on a standard image one by one is adopted, the calculated amount is large, if the points on the image to be registered and the standard image are connected into a vector in a vertical direction and a vector in a horizontal direction, then lines in all directions of the image to be registered and the standard image are determined by correlation coefficients, and a matching position of a two-dimensional space can be determined by finding the vector in the vertical direction and the vector in the horizontal direction with large correlation coefficients, so that image registration is completed.

The technical solution of the present application will be described in detail by specific examples. It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.

Fig. 1 is a schematic flowchart of a first embodiment of an image registration method according to an embodiment of the present application.

And step 11, acquiring an image to be registered.

The image to be registered comprises N times M sampling points, and N and M are positive integers.

In the scheme, when the printer is used for image registration, images are collected through internal scanning, and the collected images are images to be registered.

Optionally, the image to be registered is composed of a number of single-color cells, i.e. pixels, which themselves represent the sampling points.

It should be understood that the embodiments of the present application do not limit the style, color, and the like of the image to be registered. For example, when the image to be registered is a circle, the number of sampling points included in the image to be registered may include: the number of the corresponding sample points in M rows and N columns should be changed correspondingly.

And step 12, performing bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered.

The first horizontal vector is a vector of M sampling points of the image to be registered in the horizontal direction and a vector with the length of N, and the first vertical vector is a vector of N sampling points of the image to be registered in the vertical direction and a vector with the length of M.

In the scheme, when the printer is used for printing, because the paper runs stably and the camera focal length and the light source are stable, the acquired image has good quality, small deformation, low noise and small integral translation range, and therefore, the accuracy is higher in the step of performing bidirectional projection on the image to be registered, and the registration result can be improved.

In this step, it is known that the image to be registered includes N times M samples, and taking a rectangle as an example, the number of samples on the horizontal side is N, and the number of samples on the vertical side is M, that is, the rectangle includes N rows and M columns of samples.

Alternatively, the bi-directional projection may include a horizontal projection and a vertical projection.

That is, in one possible implementation, a first horizontal vector may be obtained by performing horizontal projection on an image to be registered; and performing vertical projection on the image to be registered to obtain a first vertical vector.

Specifically, the image to be registered is horizontally projected to obtain a first horizontal vector H1, the length of the image to be registered is considered to be N (the height of the image to be registered), the image to be registered is vertically projected to obtain a first vertical vector V1, and the length of the image to be registered is considered to be M (the width of the image to be registered).

And step 13, determining a first correlation coefficient set and a second correlation coefficient set according to the first horizontal vector, the first vertical vector and a preset standard image.

The first set of correlation coefficients is a set of correlation coefficients of horizontal deviation positions of the image to be registered and the preset standard image, and the second set of correlation coefficients is a set of correlation coefficients of vertical deviation positions of the image to be registered and the preset standard image.

In this scheme, the preset standard image is a pre-stored template image, and may be a reference image preset by a user, where the preset standard image has been subjected to similar processing to the image to be registered (the result is a second horizontal vector and a second vertical vector of the preset standard image), specifically:

the processing similar to the step 12 above for the preset standard image may include two steps:

step 1, acquiring a preset standard image.

The preset standard image may be the most standard image selected by the user among the several images.

And 2, performing bidirectional projection on the preset standard image to obtain a second horizontal vector and a second vertical vector of the preset standard image.

The second horizontal vector H0 is a vector of M samples of the preset standard image in the horizontal direction and constitutes a length N, and the second vertical vector V0 is a vector of N samples of the preset standard image in the vertical direction and constitutes a length M.

In step 13, the image to be registered is translated on the preset standard image, an overlapping region of the two images is acquired, and the correlation coefficient between the horizontal vector and the vertical vector is determined for the first horizontal vector and the first vertical vector of the image to be registered in the overlapping region and the second horizontal vector and the second vertical vector of the preset standard image.

In one possible implementation, the second horizontal vector translates along the first horizontal vector within a range, which may form a portion where H0 overlaps H1; translation of the second vertical vector along the first vertical vector over a range may form a portion of V0 overlapping V1.

Among them, the portion where H0 overlaps with H1 corresponds to an element (first element) of H0 and an element (second element) of H1, and the portion where V0 overlaps with V1 corresponds to an element (third element) of V0 and an element (fourth element) of V1.

Further, the determination of the correlation coefficient is performed on the element of H0 and the element of H1, or the element of V0 and the element of V1, which can be obtained by formulas such as euclidean distance, manhattan distance, chebyshev distance, minkowski distance, mahalanobis distance, normalized euclidean distance, cosine of included angle, hamming distance, jackard similarity coefficient, correlation distance, information entropy, and the like.

For example, the cosine of the included angle between the element in the second horizontal vector and the element in the first horizontal vector is processed to obtain a correlation coefficient, which is recorded as the correlation coefficient of the horizontal deviation position; and performing included angle cosine processing on the elements in the second vertical vector and the elements in the first vertical vector to obtain another correlation coefficient, and recording the correlation coefficient as a correlation coefficient of a vertical deviation position.

The larger the correlation is, the higher the correlation coefficient is, for example, the value after the cosine processing of the included angle may be between 0 and 1.

Optionally, after determining element correlation coefficients in all the second horizontal vectors and the first horizontal vectors, and in all the second vertical vectors and the first vertical vectors, a first correlation coefficient set may be obtained, and a correlation coefficient of a horizontal deviation position of the image to be registered and the preset standard image is recorded; a second set of correlation coefficients can be obtained, and the correlation coefficients of the vertical deviation positions of the image to be registered and the preset standard image are recorded.

And step 14, registering the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position.

In this step, the correlation coefficient of each horizontal deviation position in the first correlation coefficient set represents the correlation between a second horizontal vector and a first horizontal vector, and the correlation coefficient of each vertical deviation position in the second correlation coefficient set represents the correlation between a second vertical vector and a first vertical vector, so that the horizontal deviation position and the vertical deviation position of the best image registration of the image to be registered can be determined according to the judgment of the correlation sizes on the horizontal line and the vertical line.

Further, according to the horizontal deviation position and the vertical deviation position of the optimal image registration, the registration of the image to be registered is completed, and the target registration position is obtained.

The image registration method provided by the embodiment of the application obtains an image to be registered including N times M sampling points, performs bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered, determines a first correlation coefficient set and a second correlation coefficient set according to the first horizontal vector, the first vertical vector and a preset standard image, and then performs registration on the image to be registered according to the first correlation coefficient set and the second correlation coefficient set to obtain a target registration position. In the method, the sampling points in the horizontal direction and the sampling points in the vertical direction of the image to be registered are subjected to projection processing, so that the time consumption of image registration during printing detection is greatly reduced, and the image registration efficiency is improved.

On the basis of the foregoing embodiment, fig. 2 is a schematic flowchart of a second embodiment of an image registration method provided in the embodiment of the present application. As shown in fig. 2, the step 13 can be implemented by:

and step 21, determining a first correlation coefficient set of the horizontal deviation position of the image to be registered and the preset standard image according to the first horizontal vector and the second horizontal vector.

Wherein the first set of correlation coefficients comprises: the vector length is the correlation coefficient of the horizontal deviation position of S.

In this step, the second horizontal vector is translated along the first horizontal vector within a certain range, so as to form the overlapped parts of H0 and H1, and two elements of each overlapped part are input into a vector calculation formula (such as an included angle cosine formula), so as to obtain a correlation coefficient of the horizontal deviation with the vector length S.

Optionally, the step may be specifically implemented by the following two steps:

and step 1, translating the first horizontal vector along the second horizontal vector to obtain a first element and a second element which have the length S and are coincident with each other.

When the image to be registered and the preset standard image are rectangles, N and M are the edges of the two images respectively, and the number of sample points on each edge, so that when the first horizontal vector translates along the second horizontal vector, a first element and a second element which are coincident with each other can be obtained.

And 2, obtaining a correlation coefficient of the horizontal deviation with the vector length S according to the first element and the second element which are overlapped with each other and have the vector length S.

The embodiment of the present application takes an included angle cosine formula as an example for detailed description, and specifically, a calculation formula of a correlation coefficient of a horizontal deviation position is as follows:

wherein x isiAnd yiThe vector length is a first element and a second element which are coincident with each other, and the value of i is 1, 2, 3.

That is, the first element and the second element are portions where the first horizontal vector and the second horizontal vector coincide with each other during the translation.

Specifically, the first correlation coefficient set cos (θ 1) ═ coorH1,coorH2...coorHXIn which, coorHXIs the correlation coefficient of the X horizontal deviation position.

And step 22, determining a second correlation coefficient set of the vertical deviation position of the image to be registered and the preset standard image according to the first vertical vector and the second vertical vector.

Wherein the second set of correlation coefficients comprises: the vector length is the correlation coefficient of the vertical deviation position of L.

In this step, the second vertical vector is translated along the first vertical vector within a certain range, so as to form overlapped parts of V0 and V1, and two elements of each overlapped part are input into a vector calculation formula (such as an included angle cosine formula) to obtain a second correlation coefficient of the vertical deviation position.

Optionally, the step may be specifically implemented by the following two steps:

and step 1, translating the first vertical vector along the second vertical vector to obtain a third element and a fourth element which have the length L and are coincident with each other.

The specific execution of this process refers to step 21 described above.

That is, the third element and the fourth element are portions where the first vertical vector and the second vertical vector coincide with each other during the translation.

And 2, obtaining a correlation coefficient of the vertical deviation with the vector length L according to the third element and the fourth element which are overlapped with each other and have the vector length L.

The embodiment of the present application details by taking an included angle cosine formula as an example, and specifically, a calculation formula of a correlation coefficient of a vertical deviation position is as follows:

wherein, ajAnd bjThe vector length is L, the first element and the second element are coincident, and j takes a value of 1, 2, 3.

For example, the second set of correlation coefficients cos (θ 2) ═ { coorH1,coorH2...coorHYTherein, coorHYIs the correlation coefficient of the Y-th vertical deviation position.

It should be understood that the execution order of step 21 and step 22 is not limited in this embodiment.

According to the image registration method provided by the embodiment of the application, a first correlation coefficient set of the horizontal deviation position of the image to be registered and the preset standard image is determined according to the first horizontal vector and the second horizontal vector, and a second correlation coefficient set of the vertical deviation position of the image to be registered and the preset standard image is determined according to the first vertical vector and the second vertical vector. In the method, a foundation is provided for subsequently improving the efficiency and accuracy of image registration through the determination of the first correlation coefficient set and the second correlation coefficient set.

On the basis of the foregoing embodiment, fig. 3 is a schematic flowchart of a third embodiment of an image registration method provided in the embodiment of the present application. As shown in fig. 3, the step 14 can be implemented by:

and step 31, determining a first position where the maximum value in the first correlation coefficient set is located according to the correlation coefficient of the horizontal deviation with the vector length of S.

In this step, in the first correlation coefficient set, the maximum value among the correlation coefficients of the horizontal deviation positions, for example, the correlation coefficient of the xth horizontal deviation position, that is, the first position, is found.

The maximum value represents the combination of the row where the sampling point with the highest correlation is located when the image to be registered and the preset standard image move in the horizontal direction and the two images are overlapped.

And step 32, determining a second position where the maximum value in the second correlation coefficient set is located according to the correlation coefficient of the vertical deviation with the vector length of L.

In this step, in the second set of correlation coefficients, the maximum value of the correlation coefficients of the vertical deviation position, for example, the correlation coefficient of the Y-th horizontal deviation position, i.e., the second position, is found.

The maximum value represents the combination of the columns where the sampling points with the highest correlation are located when the image to be registered and the preset standard image move in the vertical direction and the two images are overlapped.

And step 33, determining a first target position where a first target sampling point of the image to be registered is located according to the first position and the second position.

In this step, according to the row and column where the sample with the highest correlation is located, a first target sample of the image to be registered can be determined.

And step 34, registering the image to be registered according to the first target position to obtain a target registration position.

In this step, the highest similarity between a certain sampling point in the preset standard image and a certain sampling point in the image to be registered is found, and based on this, the preset standard image is used for registering the image to be registered to obtain the target registration position.

In addition, based on the average value of the queue of the correlation coefficients of the vertical deviation and the horizontal deviation, when the average value is smaller than a certain threshold, it can be preliminarily determined whether the image to be registered has a significant printing error.

In addition to registration, the location of a significant typographical error can be preliminarily determined by searching for smaller values in the queue of vertical and horizontal deviation correlation coefficients.

According to the image registration method provided by the embodiment of the application, a first position where a maximum value in a first correlation coefficient set is located is determined according to a correlation coefficient of a horizontal deviation position with a vector length of S, a second position where the maximum value in a second correlation coefficient set is located is determined according to a correlation coefficient of a vertical deviation position with a vector length of L, a first target position where a first target sampling point of an image to be registered is located is determined according to the first position and the second position, and finally the image to be registered is registered according to the first target position to obtain a target registration position. The method starts from the maximum value of the correlation coefficient of the horizontal direction and the vertical direction of the image, so that the position of the maximum correlation of the image registration is accurately and quickly positioned.

On the basis of the above method embodiment, fig. 4 is a schematic structural diagram of an image registration apparatus provided in the embodiment of the present application. As shown in fig. 4, the image registration apparatus includes: an acquisition module 41, a processing module 42, a determination module 43 and a registration module 44;

an obtaining module 41, configured to obtain an image to be registered, where the image to be registered includes N times M sampling points, and N and M are positive integers greater than or equal to 1;

the processing module 42 is configured to perform bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered, where the first horizontal vector is a vector sum of M sampling points of the image to be registered in the horizontal direction, and the first vertical vector is a vector sum of N sampling points of the image to be registered in the vertical direction;

a determining module 43, configured to determine a first correlation coefficient set and a second correlation coefficient set according to the first horizontal vector, the first vertical vector, and the preset standard image, where the first correlation coefficient set is a set of correlation coefficients of horizontal deviation positions of the image to be registered and the preset standard image, and the second correlation coefficient set is a set of correlation coefficients of vertical deviation positions of the image to be registered and the preset standard image;

and the registration module 44 is configured to register the image to be registered according to the first correlation coefficient set and the second correlation coefficient set, so as to obtain a target registration position.

In a possible design of the embodiment of the present application, the obtaining module 41 is further configured to obtain a preset standard image;

the processing module 42 is further configured to perform bidirectional projection on the preset standard image to obtain a second horizontal vector and a second vertical vector of the preset standard image, where the second horizontal vector is a vector sum of M sampling points of the preset standard image in the horizontal direction, and the second vertical vector is a vector sum of N sampling points of the preset standard image in the vertical direction.

In another possible design of the embodiment of the present application, the bidirectional projection includes: horizontal projection and vertical projection;

correspondingly, the processing module 42 performs bidirectional projection on the image to be registered to obtain a first horizontal vector and a first vertical vector of the image to be registered, and is specifically configured to:

carrying out horizontal projection on an image to be registered to obtain a first horizontal vector;

and carrying out vertical projection on the image to be registered to obtain a first vertical vector.

In yet another possible design of the embodiment of the present application, the determining module 43 is specifically configured to:

according to the first horizontal vector and the second horizontal vector, determining a first correlation coefficient set of the horizontal deviation position of the image to be registered and the preset standard image, wherein the first correlation coefficient set comprises: the correlation coefficient of the horizontal deviation position with the vector length of S;

according to the first vertical vector and the second vertical vector, determining a second correlation coefficient set of the vertical deviation position of the image to be registered and the preset standard image, wherein the second correlation coefficient set comprises: the vector length is the correlation coefficient of the vertical deviation position of L.

Optionally, the determining module 43 determines, according to the first horizontal vector and the second horizontal vector, a first correlation coefficient set of a horizontal deviation position between the image to be registered and the preset standard image, and is specifically configured to:

translating the first horizontal vector along the second horizontal vector to obtain a first element and a second element which have the length S and are mutually coincident;

and obtaining a correlation coefficient of the horizontal deviation with the vector length S according to the first element and the second element which are overlapped with each other and have the vector length S.

Optionally, the determining module 43 determines, according to the first vertical vector and the second vertical vector, a second correlation coefficient set of the vertical deviation position of the image to be registered and the preset standard image, and is specifically configured to:

translating the first vertical vector along the second vertical vector to obtain a third element and a fourth element which have the length L of the vector and are mutually coincident;

and obtaining a correlation coefficient of the vertical deviation with the vector length L according to the third element and the fourth element which are overlapped with each other and have the vector length L.

In yet another possible design of the embodiment of the present application, the registration module 44 is specifically configured to:

determining a first position where a maximum value in the first correlation coefficient set is located according to the correlation coefficient of the horizontal deviation with the vector length of S;

determining a second position where a maximum value in the second correlation coefficient set is located according to the correlation coefficient of the vertical deviation with the vector length L;

determining a first target position where a first target sampling point of the image to be registered is located according to the first position and the second position;

and registering the image to be registered according to the first target position to obtain a target registration position.

The image registration apparatus provided in the embodiment of the present application may be used to execute the technical solution corresponding to the image registration method in the above embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.

It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.

Fig. 5 is a schematic structural diagram of a printing press according to an embodiment of the present application. As shown in fig. 5, the printer may include: a processor 50, a memory 51, and computer program instructions stored on the memory 51 and executable on the processor 50.

The processor 50 executes computer-executable instructions stored by the memory 51, causing the processor 50 to perform the scheme in the above-described embodiments. The processor 50 may be a general-purpose processor including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.

Optionally, the printing press may further include: a transceiver 52.

The memory 51 and the transceiver 52 are connected to the processor 50 via a system bus and communicate with each other, and the memory 51 is used for storing computer program instructions.

The transceiver 52 is used for communication with other devices, and the transceiver 52 constitutes a communication interface.

Optionally, in terms of hardware implementation, the obtaining module 41 in the embodiment shown in fig. 4 corresponds to the transceiver 52 in this embodiment.

The system bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.

The printing machine provided by the embodiment of the application can be used for executing the technical scheme corresponding to the image registration method in the embodiment, the implementation principle and the technical effect are similar, and details are not repeated here.

The embodiment of the application further provides a chip for running the instructions, and the chip is used for executing the technical scheme of the image registration method in the embodiment.

The embodiment of the present application further provides a computer-readable storage medium, where a computer instruction is stored in the computer-readable storage medium, and when the computer instruction runs on a computer, the computer is caused to execute the technical solution of the image registration method in the foregoing embodiment.

The embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program is used for executing the technical solution of the image registration method in the foregoing embodiment when being executed by a processor.

The computer-readable storage medium described above may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.

It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于振动传感器的视觉3D点云数据的补偿装置及补偿方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!