CN109859262B - Mark point positioning method and system for mobile phone screen - Google Patents

Mark point positioning method and system for mobile phone screen Download PDF

Info

Publication number
CN109859262B
CN109859262B CN201910052604.3A CN201910052604A CN109859262B CN 109859262 B CN109859262 B CN 109859262B CN 201910052604 A CN201910052604 A CN 201910052604A CN 109859262 B CN109859262 B CN 109859262B
Authority
CN
China
Prior art keywords
image
layer
detected
template
angle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910052604.3A
Other languages
Chinese (zh)
Other versions
CN109859262A (en
Inventor
刘暾东
刘磊
高凤强
邵桂芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen University
Original Assignee
Xiamen University
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 Xiamen University filed Critical Xiamen University
Priority to CN201910052604.3A priority Critical patent/CN109859262B/en
Publication of CN109859262A publication Critical patent/CN109859262A/en
Application granted granted Critical
Publication of CN109859262B publication Critical patent/CN109859262B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a method and a system for positioning Mark points on a mobile phone screen. The positioning method comprises the following steps: acquiring a reference image of a mobile phone screen, and selecting a Mark point template image from the reference image to obtain a reference template image; carrying out image preprocessing on the reference template image to obtain a four-layer pyramid template image; rotating the four-layer pyramid template image for 89 times, wherein the four-layer pyramid template image is rotated for one degree each time to obtain a multi-angle four-layer pyramid template image which is rotated for 0-89 degrees; acquiring an image to be detected of a mobile phone screen, performing edge pixel expansion on the image to be detected, and performing image preprocessing on the image to be detected to obtain a four-layer pyramid image to be detected; and matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method to obtain the position coordinate and the template degree with the maximum matching degree. The angle and the coordinate of the Mark point in the image are determined by narrowing the search range layer by layer through multi-angle matching, and the sub-pixel coordinate of the Mark point in the mobile phone screen image can be obtained at the bottommost layer.

Description

Mark point positioning method and system for mobile phone screen
Technical Field
The invention relates to the field, in particular to a method and a system for positioning Mark points on a mobile phone screen.
Background
The function of the visual alignment platform is to achieve precise alignment between two targets. The vision system needs to shoot two objects respectively and select Mark points or characteristic information of edges or corners of the objects. By utilizing a visual alignment technology, deviation between X, Y axes and angle coordinates between two target physical coordinates is realized, and the platform is guided to move to the fitting position by driving the related moving platform, so that visual guide accurate alignment is realized.
At present, in the prior art, commercial vision library algorithms such as Halcon and visionPro vision libraries are mainly adopted for the development work of the detection and the positioning of the Mark point of the mobile phone screen, the commercial vision library algorithms are packaged and not disclosed, and no independent research and development is currently carried out on the positioning algorithm for the Mark point of the mobile phone screen in the market. The algorithm based on the feature points needs to extract the feature points firstly and then calculate coordinates through affine transformation, the processing method is poor in robustness, the detection requirement on the feature points is high, the time spent by the relatively stable feature point detection algorithm is long, the edge detection algorithm needs to extract edges firstly and then calculate the edge matching degree to obtain the position with the maximum matching degree, and then the coordinates at the sub-pixel level are obtained through curved surface fitting, but the robustness of the edge detection algorithm is poor.
Disclosure of Invention
The invention aims to provide a method and a system for positioning Mark points on a mobile phone screen, which can enhance the robustness of a positioning algorithm.
In order to achieve the purpose, the invention provides the following scheme:
a method for positioning Mark points on a mobile phone screen comprises the following steps:
acquiring a reference image and an image to be detected of a mobile phone screen to obtain a reference Mark point template image and an image to be detected;
carrying out image preprocessing on the reference Mark point template image to obtain a four-layer pyramid template image;
rotating the four-layer pyramid template image for 89 times, wherein one degree of rotation is performed each time, so that a multi-angle four-layer pyramid template image with the angle of 0-89 degrees is obtained;
expanding the image to be detected to obtain an expanded image to be detected;
preprocessing the expanded image to be detected to obtain a four-layer pyramid image to be detected;
and matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method to obtain the position coordinate and the template degree with the maximum matching degree.
Optionally, the image preprocessing on the reference Mark point template image to obtain a four-layer pyramid template image specifically includes:
adopting Gaussian smoothing processing on the reference Mark point template image to obtain a Gaussian image, and taking the image as a second-layer template image;
the Gaussian image is subjected to up-sampling, the size of the image is doubled relative to the rows and the columns of the Gaussian image, and a first-layer template image is obtained;
down-sampling the Gaussian image, and reducing the size of the image by one time relative to the rows and columns of the Gaussian image to obtain a third layer of template image;
adopting Gaussian smoothing processing on the third layer of template images to obtain third Gaussian images;
down-sampling the third Gaussian image, and reducing the size of the image by one time relative to the rows and columns of the third Gaussian image to obtain a fourth layer of template image;
the four-layer pyramid template image comprises a first layer template image, a second layer template image, a third layer template image and a fourth layer template image.
Optionally, the rotating the four-layer pyramid template image to obtain a multi-angle four-layer pyramid template image specifically includes:
rotating the image of each layer of the four-layer pyramid template image for 89 times to generate four-layer multi-angle template images of 0-89 degrees, and acquiring the multi-angle four-layer pyramid template images;
optionally, the acquiring the image to be detected and expanding the image to be detected to obtain the expanded image to be detected specifically includes:
performing column expansion on the image to be detected, wherein the column expansion is to expand k pixel points at two ends of each column according to the pixel values of the image edges to obtain a column expansion image to be detected;
and performing line expansion on the column expansion image to be detected, wherein the line expansion is to expand k pixel points at two ends of each line according to the edge pixel values to obtain an expanded image to be detected.
Optionally, the matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by using a normalized cross-correlation matching method, and the obtaining of the position coordinate and the template degree with the maximum matching degree specifically includes:
performing template matching on an image corresponding to each degree in the range of 0-89 degrees of the fourth layer of the multi-angle four-layer pyramid template image in the fourth layer of to-be-detected images in the four layers of pyramid images to be detected by adopting a normalized cross-correlation matching method;
the matching process comprises the steps of horizontally and vertically moving the multi-angle four-layer pyramid image on the four-layer pyramid image to be detected, calculating the matching degree of each position of the four-layer pyramid image to be detected, and obtaining a plurality of matching degree values;
degree of match
Figure BDA0001951301620000031
Wherein S represents the four-layer pyramid image to be measured, T represents the multi-angle four-layer pyramid image, the size of S is N M, and the size of T is N M (N ═ N, M ═ M);
setting the position with the maximum matching value as a fourth best matching position (x4, y 4);
determining the rotation angle of the Mark point in the fourth layer of the current four-layer pyramid image to be detected relative to the reference template image according to the fourth optimal matching position and the corresponding optimal matching template image, and obtaining a fourth angle C4;
matching the multi-angle four-layer pyramid template images at intervals of two degrees in the range of C4 +/-4 degrees in the four-layer pyramid images to be detected according to the fourth angle C4, the third-layer multi-angle template images and the third-layer images to be detected to obtain a plurality of matching values;
selecting the position with the maximum matching value as a third optimal matching position (x3, y 3);
determining the rotation angle of the Mark point in the third layer of the current multi-angle four-layer pyramid image relative to the reference template image according to the third best matching position and the corresponding best matching template image to obtain a third angle C3;
according to the third angle C3, respectively carrying out matching positioning on the second-layer multi-angle template images of the multi-angle four-layer pyramid template images at intervals of 1 degree within the range of C3 +/-2 degrees within the range of coordinates (2 x3 +/-6, 2 y3 +/-6) in the second-layer images of the four-layer pyramid images to be detected, and obtaining the position of the maximum matching degree as a second optimal matching position (x2, y 2);
determining the rotation angle of the Mark points in the second layer of images to be detected of the current multi-angle four-layer pyramid template image relative to the reference template image according to the second optimal matching position and the corresponding optimal matching template image, and obtaining a second angle C2;
according to the second angle C2, respectively carrying out matching positioning on the first multi-angle template image of the multi-angle four-layer pyramid template images at intervals of 1 degree within the range of C2 +/-1 degrees in the range of (2 x2 +/-4, 2 x y2 +/-4) of the first layer image of the four layers of pyramid images to be detected, and obtaining the position of the maximum matching degree as a first optimal matching position (x1, y 1);
and acquiring the coordinates (x1/2-k, y1/2-k) of the Mark point in the original image to be detected before expansion according to the first optimal matching position.
In order to achieve the above object, the present invention further provides the following solutions:
a mobile phone screen Mark point positioning system comprises:
the image acquisition module is used for acquiring a reference image of a mobile phone screen to obtain a reference Mark point template image;
the image preprocessing module is used for preprocessing the image of the reference Mark point to obtain a four-layer pyramid template image;
the image rotation module is used for rotating the four-layer pyramid template image for 89 times, wherein one degree of rotation is performed each time to obtain a multi-angle four-layer pyramid template image with the angle of 0-89 degrees;
the mobile phone comprises a mobile phone screen to-be-detected image acquisition module, an image expansion module and a display module, wherein the mobile phone screen to-be-detected image acquisition module is used for expanding the to-be-detected image to obtain an expanded to-be-detected image;
carrying out image preprocessing on the extended image to be detected to obtain a four-layer pyramid image to be detected;
and the matching module is used for matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method to obtain the position coordinate and the template degree with the maximum matching degree.
Optionally, the image preprocessing module specifically includes:
the second-layer template image acquisition unit is used for taking the reference Mark point template image as a first-layer template image;
the Gaussian smoothing processing unit is used for performing Gaussian smoothing processing on the reference Mark point template image to obtain a Gaussian image;
the first-layer template image acquisition unit is used for up-sampling the Gaussian image, and the size of the image is doubled relative to the rows and columns of the Gaussian image to obtain a first-layer template image;
the third-layer template image acquisition unit is used for performing down-sampling on the Gaussian image, and the size of the image is reduced by one time relative to the rows and the columns of the Gaussian image to obtain a third-layer template image;
the third Gaussian image acquisition unit is used for performing Gaussian smoothing on the third layer of template images to obtain a third Gaussian image;
and the fourth-layer template image acquisition unit is used for performing down-sampling on the third Gaussian image, and the size of the image is reduced by one time relative to the rows and columns of the third Gaussian image to obtain a fourth-layer template image.
Optionally, the image expansion module specifically includes:
the column expansion unit is used for performing column expansion on the image to be detected, wherein the column expansion is to expand k pixel points at two ends of each column according to the pixel values of the image edges to obtain a column expansion image to be detected;
and the line expansion unit is used for performing line expansion on the column expansion image to be detected, wherein the line expansion is to expand k pixel points at two ends of each line according to the edge pixel value to obtain an expanded image to be detected.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects: the invention discloses a method and a system for positioning Mark points on a mobile phone screen. The method comprises the steps of collecting an image to be detected, carrying out edge pixel expansion on the image to be detected, carrying out image preprocessing on the expanded image to be detected to obtain a four-layer pyramid image to be detected, reducing the calculated amount and reducing the search range by utilizing a multi-angle four-layer pyramid template image and region-of-interest mapping, determining the angle and the coordinate of a Mark point in the image to be detected by multi-angle matching and reducing the angle range and the coordinate range layer by layer, and obtaining the sub-pixel coordinate of the Mark point in the image to be detected on a mobile phone screen at the bottom layer.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a flow chart of a Mark point positioning method of a mobile phone screen provided by the invention;
FIG. 2 is a schematic diagram of a four-layer pyramid image provided by the present invention;
FIG. 3 is a schematic diagram of a search area provided by the present invention;
fig. 4 is a schematic diagram of a reference template image provided by the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a method and a system for positioning Mark points on a mobile phone screen, which can enhance the robustness of a positioning algorithm.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As shown in fig. 1, the invention provides a method for positioning Mark points on a mobile phone screen, which comprises the following steps:
step 100: acquiring a reference image of a mobile phone screen to obtain a reference Mark point template image;
step 200: carrying out image preprocessing on the reference Mark point template image, and constructing a four-layer pyramid template image;
step 300: rotating the four-layer pyramid template image for 89 times, wherein one degree of rotation is performed each time, so that a multi-angle four-layer pyramid template image with the angle of 0-89 degrees is obtained;
step 400: acquiring an image to be detected of a mobile phone screen, expanding the image to be detected, and performing image preprocessing on the expanded image to be detected;
step 500: constructing a four-layer pyramid image to be detected from the preprocessed image to be detected;
step 600: and matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method to obtain the position coordinate and the template degree with the maximum matching degree.
The step 200: the step of performing image preprocessing on the reference template image to obtain a four-layer pyramid template image specifically comprises:
as shown in the schematic diagram of the reference template image shown in fig. 4, the reference template image is taken as a second layer template image;
adopting Gaussian smoothing processing on the reference template image to obtain a Gaussian image;
the Gaussian image is subjected to up-sampling, the size of the image is doubled relative to the rows and the columns of the Gaussian image, and a first-layer template image is obtained;
down-sampling the Gaussian image, and reducing the size of the image by one time relative to the rows and columns of the Gaussian image to obtain a third layer of template image;
adopting Gaussian smoothing processing on the third layer of template images to obtain third Gaussian images;
down-sampling the third Gaussian image, and reducing the size of the image by one time relative to the rows and columns of the third Gaussian image to obtain a fourth layer of template image;
as shown in fig. 2, the four-layer pyramid template image includes a first-layer template image 1, a second-layer template image 2, a third-layer template image 3, and a fourth-layer template image 4.
The step 400: expanding the image to be detected to obtain an expanded image to be detected specifically comprises:
performing column expansion on the image to be detected, wherein the column expansion is to expand k pixel points at two ends of each column according to the pixel values of the image edges to obtain a column expansion image to be detected;
and performing line expansion on the column expansion image to be detected, wherein the line expansion is to expand k pixel points at two ends of each line according to the edge pixel values to obtain an expanded image to be detected.
The step 600: matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method, wherein the step of obtaining the position coordinate and the template degree with the maximum matching degree specifically comprises the following steps:
matching the image corresponding to each degree in the range of 0-89 degrees of the fourth layer of the multi-angle four-layer pyramid template image in the fourth layer of the image to be tested of the four layers of pyramid images to be tested by adopting a normalized cross-correlation matching method;
the matching process is to horizontally and vertically move the multi-angle four-layer pyramid template image on the four-layer pyramid image to be detected, calculate the matching degree of each position of the four-layer pyramid image to be detected and obtain a plurality of matching degree values;
degree of match
Figure BDA0001951301620000091
The method comprises the following steps of obtaining a multi-angle four-layer pyramid template image, wherein S represents the four-layer pyramid image to be detected, T represents the multi-angle four-layer pyramid template image, the size of S is N M, and the size of T is N M (N is N, M is M);
setting the position with the maximum matching value as a fourth best matching position (x4, y 4);
determining a rotation angle corresponding to a fourth-layer template image of the multi-angle four-layer pyramid template image according to the fourth best matching position and the corresponding best matching template image to obtain a fourth angle C4;
matching the multi-angle four-layer pyramid template images every two degrees in the range of C4 +/-4 degrees in the four-layer pyramid images to be detected according to the fourth angle C4 and the third layer template images to obtain a plurality of matching values;
as shown in fig. 3, template matching is performed on a third pyramid image of the image to be matched by using template images of every 2 degrees within a range of C4 ± 4 degrees, because the number of rows and columns of the third layer image is twice that of the fourth layer image, the coordinates of the fourth layer best matching position corresponding to the third layer are (2 × x4,2 × y4), template matching is performed only within a range of coordinates (2 × 4 ± 6,2 × y4 ± 6), and the position with the largest matching value is selected as a third best matching position (x3, y 3); determining a rotation angle corresponding to a template image at a third layer of the multi-angle four-layer pyramid template image according to the third best matching position and the corresponding best matching template image to obtain a third angle C3;
as shown in fig. 3, according to the third angle C3, respectively performing matching and positioning on the second layer template image of the multi-angle four-layer pyramid template image at intervals of 1 degree within the range of C3 ± 2 degrees within the range of corresponding second layer coordinates (2 x3 ± 6,2 x y3 ± 6) of the pyramid image to be measured, and obtaining a position of the maximum matching degree as a second optimal matching position (x2, y 2);
determining a rotation angle corresponding to a second-layer template image of the multi-angle four-layer pyramid template image according to the second best matching position and the corresponding best matching template image to obtain a second angle C2;
according to the second angle C2, respectively carrying out matching positioning on the first layer template image of the multi-angle four-layer pyramid template image within the range of corresponding to the first layer coordinate (2 x2 +/-4, 2 y2 +/-4) of the pyramid image to be detected at intervals of 1 degree within the range of C2 +/-1 degrees, and obtaining the position of the maximum matching degree as a first optimal matching position (x1, y 1);
and acquiring the coordinates (x1/2-k, y1/2-k) of the Mark point in the original image to be detected before expansion according to the first optimal matching position.
In order to achieve the above object, the present invention further provides the following solutions:
a mobile phone screen Mark point positioning system comprises:
the image acquisition module is used for acquiring a reference image and a to-be-detected image of a mobile phone screen to obtain a reference Mark point template image and a to-be-detected image;
the image expansion module is used for expanding the image to be detected to obtain an expanded image to be detected;
the image preprocessing module is used for carrying out image preprocessing on the reference Mark point template image to obtain a four-layer pyramid template image and carrying out image preprocessing on the image to be detected to obtain a four-layer pyramid image to be detected;
the image rotation module is used for rotating the four-layer pyramid template image for 89 times, wherein one degree of rotation is performed each time to obtain a multi-angle four-layer pyramid template image with the angle of 0-89 degrees;
and the matching module is used for matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method to obtain the position coordinate and the template degree with the maximum matching degree.
The image expansion module specifically comprises:
the column expansion unit is used for performing column expansion on the image to be detected, wherein the column expansion is to expand k pixel points at two ends of each column according to the pixel values of the image edges to obtain a column expansion image to be detected;
and the line expansion unit is used for performing line expansion on the column expansion image to be detected, wherein the line expansion is to expand k pixel points at two ends of each line according to the edge pixel value to obtain an expanded image to be detected.
The image preprocessing module specifically comprises:
the second-layer template image acquisition unit is used for taking the reference Mark point template image as a second-layer template image;
the Gaussian smoothing processing unit is used for performing Gaussian smoothing processing on the extended reference image to obtain a Gaussian image;
the first-layer template image acquisition unit is used for up-sampling the Gaussian image, and the size of the image is doubled relative to the rows and columns of the Gaussian image to obtain a first-layer template image;
the third-layer template image acquisition unit is used for performing down-sampling on the Gaussian image, and the size of the image is reduced by one time relative to the rows and the columns of the Gaussian image to obtain a third-layer template image;
the third Gaussian image acquisition unit is used for performing Gaussian smoothing on the third layer of template images to obtain a third Gaussian image;
and the fourth-layer template image acquisition unit is used for performing down-sampling on the third Gaussian image, and the size of the image is reduced by one time relative to the rows and columns of the third Gaussian image to obtain a fourth-layer template image.
As shown in fig. 4, an example of an image of a template of reference Mark points. As the template is a rotationally symmetric image, the multi-angle template only needs to establish template images within the range of 0-89 degrees.
The invention has the beneficial effects that:
by the edge pixel expansion, the coordinate positioning of the Mark point in the mobile phone screen image when the edge part is not collected can be realized.
And generating a four-layer image pyramid, wherein the first layer is a sub-pixel image of 0.5 pixel generated by an interpolation algorithm, the second layer is a reference image layer, the third layer is an image of which the row and column of the reference image layer are respectively compressed by one time, the fourth layer is an image of which the row and column of the third layer are respectively compressed by one time, each layer of pyramid image generates a 0-89-degree template image, and the generated images are stored in a computer memory, so that the calculation amount in the later template matching process by a cross-correlation method is reduced, and the algorithm efficiency is higher and more stable.
Roughly matching a template from the top layer to obtain the approximate position and the approximate target rotation angle of a Mark point preliminarily; and then, acquiring more accurate coordinates and Mark point rotation angles of the Mark points layer by layer from the top layer to the bottom layer through the region of interest and the reduced angle range, calculating to the bottom layer position, and finally acquiring the sub-pixel level coordinate accuracy of the Mark points in the image.
The method is applied to the positioning of Mark points in a mobile phone screen, and has the advantages of stable algorithm, high accuracy rate (more than 99%), high speed (200 ten thousand pixels of pictures can be processed within 50 ms), and high precision (the pixel precision is 0.5 pixel).
At the edge of the image, the mean value is randomly increased or decreased by a value in a certain range according to the mean value of pixels near the edge of the reference image to expand the edge pixels of the image, namely, partial rows and columns are increased, so that the Mark points can be positioned when not completely acquired (between 80% and 100%), and the problem of partial shielding at the edge is solved. And secondly, by pre-storing the multi-angle image pyramid template picture, the operation amount of positioning the Mark points in the screen image of the mobile phone through a multi-angle template matching algorithm is greatly reduced. Then, in the process of applying the image pyramid, the most top layer is positioned to the approximate position of the Mark point, and then each layer is only required to be calculated near the mapping position of the upper positioning coordinate in the layer in the process of applying the cross-correlation template matching algorithm, so that the calculation amount of template matching in the 1-3 layers of image pyramids can be reduced.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

Claims (6)

1. A method for positioning Mark points on a mobile phone screen is characterized by comprising the following steps:
acquiring a reference image and an image to be detected of a mobile phone screen to obtain a reference Mark point template image and an image to be detected;
carrying out image preprocessing on the reference Mark point template image to obtain a four-layer pyramid template image;
rotating the four-layer pyramid template image for 89 times, wherein one degree of rotation is performed each time, so that a multi-angle four-layer pyramid template image with the angle of 0-89 degrees is obtained;
expanding the image to be detected to obtain an expanded image to be detected;
preprocessing the expanded image to be detected to obtain a four-layer pyramid image to be detected;
matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method to obtain a position coordinate with the maximum matching degree and a template degree;
the expanding the image to be detected to obtain the expanded image to be detected specifically includes:
performing column expansion on the image to be detected, wherein the column expansion is to expand k pixel points at two ends of each column according to the pixel values of the image edges to obtain a column expansion image to be detected;
performing line expansion on the column expansion image to be detected, wherein the line expansion is to expand k pixel points at two ends of each line according to edge pixel values to obtain an expanded image to be detected;
the step of matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method to obtain the position coordinate and the template degree with the maximum matching degree specifically comprises the following steps:
performing template matching on an image corresponding to each degree in the range of 0-89 degrees of the fourth layer of the multi-angle four-layer pyramid template image in the fourth layer of to-be-detected images in the four layers of pyramid images to be detected by adopting a normalized cross-correlation matching method;
the matching process comprises the steps of horizontally and vertically moving the multi-angle four-layer pyramid image on the four-layer pyramid image to be detected, calculating the matching degree of each position of the four-layer pyramid image to be detected, and obtaining a plurality of matching degree values;
degree of match
Figure 1
The method comprises the following steps of obtaining a multi-angle four-layer pyramid image to be detected, wherein S represents the four-layer pyramid image to be detected, T represents the multi-angle four-layer pyramid image, the size of S is N M, the size of T is N M, N is N, and M is M;
setting the position with the maximum matching value as a fourth best matching position (x4, y 4);
determining the rotation angle of the Mark point in the fourth layer of the current four-layer pyramid image to be detected relative to the reference template image according to the fourth optimal matching position and the corresponding optimal matching template image, and obtaining a fourth angle C4;
matching the third layer multi-angle template image of the multi-angle four-layer pyramid template image every two degrees in the range of C4 +/-4 degrees in the four layers of pyramid images to be detected according to the fourth angle C4 and the third layer of images to be detected to obtain a plurality of matching values;
selecting the position with the maximum matching value as a third optimal matching position (x3, y 3);
determining the rotation angle of the Mark point in the third layer of the current multi-angle four-layer pyramid image relative to the reference template image according to the third best matching position and the corresponding best matching template image to obtain a third angle C3;
according to the third angle C3, respectively carrying out matching positioning on the second-layer multi-angle template images of the multi-angle four-layer pyramid template images at intervals of 1 degree within the range of C3 +/-2 degrees in the range of coordinates (2 x3 +/-6, 2 y3 +/-6) in the second-layer images of the four-layer pyramid images to be detected, and obtaining the coordinates of the maximum matching degree position as a second optimal matching position (x2, y 2);
determining the rotation angle of the Mark points in the second layer of images to be detected of the current multi-angle four-layer pyramid template image relative to the reference template image according to the second optimal matching position and the corresponding optimal matching template image, and obtaining a second angle C2;
according to the second angle C2, respectively carrying out matching positioning on the first multi-angle template image of the multi-angle four-layer pyramid template images at intervals of 1 degree within the range of C2 +/-1 degrees in the range of (2 x2 +/-4, 2 x y2 +/-4) of the first layer image of the four layers of pyramid images to be detected, and obtaining the position of the maximum matching degree as a first optimal matching position (x1, y 1);
and acquiring the coordinates (x1/2-k, y1/2-k) of the Mark point in the original image to be detected before expansion according to the first optimal matching position.
2. The method for positioning Mark points on a mobile phone screen according to claim 1, wherein the step of performing image preprocessing on the reference Mark point template image to obtain a four-layer pyramid template image specifically comprises:
adopting Gaussian smoothing processing on the reference Mark point template image to obtain a Gaussian image, and taking the image as a second-layer template image;
the Gaussian image is subjected to up-sampling, the size of the image is doubled relative to the rows and the columns of the Gaussian image, and a first-layer template image is obtained;
down-sampling the Gaussian image, and reducing the size of the image by one time relative to the rows and columns of the Gaussian image to obtain a third layer of template image;
adopting Gaussian smoothing processing on the third layer of template images to obtain third Gaussian images;
down-sampling the third Gaussian image, and reducing the size of the image by one time relative to the rows and columns of the third Gaussian image to obtain a fourth layer of template image;
the four-layer pyramid template image comprises a first layer template image, a second layer template image, a third layer template image and a fourth layer template image.
3. The method for positioning Mark points on a mobile phone screen according to claim 1, wherein the step of rotating the four-layer pyramid template image to obtain the multi-angle four-layer pyramid template image specifically comprises:
and rotating the image of each layer of the four-layer pyramid template image for 89 times, rotating for one degree every time, generating four-layer multi-angle template images of 0-89 degrees, and acquiring the multi-angle four-layer pyramid template image.
4. A mobile phone screen Mark point positioning system comprises:
the image acquisition module is used for acquiring a reference image of a mobile phone screen to obtain a reference Mark point template image;
the image preprocessing module is used for preprocessing the image of the reference Mark point to obtain a four-layer pyramid template image;
the image rotation module is used for rotating the four-layer pyramid template image for 89 times, wherein one degree of rotation is performed each time to obtain a multi-angle four-layer pyramid template image with the angle of 0-89 degrees;
the mobile phone comprises a mobile phone screen to-be-detected image acquisition module, an image expansion module and a display module, wherein the mobile phone screen to-be-detected image acquisition module is used for expanding the to-be-detected image to obtain an expanded to-be-detected image;
carrying out image preprocessing on the extended image to be detected to obtain a four-layer pyramid image to be detected;
and the matching module is used for matching the multi-angle four-layer pyramid template image with the four-layer pyramid image to be detected by adopting a normalized cross-correlation matching method to obtain the position coordinate and the template degree with the maximum matching degree.
5. The system for positioning Mark points on a mobile phone screen of claim 4, wherein the image preprocessing module specifically comprises:
the second-layer template image acquisition unit is used for taking the reference Mark point template image as a first-layer template image;
the Gaussian smoothing processing unit is used for performing Gaussian smoothing processing on the reference Mark point template image to obtain a Gaussian image;
the first-layer template image acquisition unit is used for up-sampling the Gaussian image, and the size of the image is doubled relative to the rows and columns of the Gaussian image to obtain a first-layer template image;
the third-layer template image acquisition unit is used for performing down-sampling on the Gaussian image, and the size of the image is reduced by one time relative to the rows and the columns of the Gaussian image to obtain a third-layer template image;
the third Gaussian image acquisition unit is used for performing Gaussian smoothing on the third layer of template images to obtain a third Gaussian image;
and the fourth-layer template image acquisition unit is used for performing down-sampling on the third Gaussian image, and the size of the image is reduced by one time relative to the rows and columns of the third Gaussian image to obtain a fourth-layer template image.
6. The system for positioning Mark points on a mobile phone screen of claim 4, wherein the image expansion module specifically comprises:
the column expansion unit is used for performing column expansion on the image to be detected, wherein the column expansion is to expand k pixel points at two ends of each column according to the pixel values of the image edges to obtain a column expansion image to be detected;
and the line expansion unit is used for performing line expansion on the column expansion image to be detected, wherein the line expansion is to expand k pixel points at two ends of each line according to the edge pixel value to obtain an expanded image to be detected.
CN201910052604.3A 2019-01-21 2019-01-21 Mark point positioning method and system for mobile phone screen Active CN109859262B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910052604.3A CN109859262B (en) 2019-01-21 2019-01-21 Mark point positioning method and system for mobile phone screen

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910052604.3A CN109859262B (en) 2019-01-21 2019-01-21 Mark point positioning method and system for mobile phone screen

Publications (2)

Publication Number Publication Date
CN109859262A CN109859262A (en) 2019-06-07
CN109859262B true CN109859262B (en) 2021-02-09

Family

ID=66895391

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910052604.3A Active CN109859262B (en) 2019-01-21 2019-01-21 Mark point positioning method and system for mobile phone screen

Country Status (1)

Country Link
CN (1) CN109859262B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231093A (en) * 2011-06-14 2011-11-02 伍斌 Screen locating control method and device
CN105894036A (en) * 2016-04-19 2016-08-24 武汉大学 Image feature template matching method being applied to detection of mobile phone screen defects
CN107825765A (en) * 2017-09-27 2018-03-23 邓志军 A kind of Mobile phone film and mobile phone positioning method for adhering film
CN108319979A (en) * 2018-02-05 2018-07-24 哈工大机器人(合肥)国际创新研究院 A kind of framing recognition detection method based on scaling and rotation matching
CN108363508A (en) * 2018-01-13 2018-08-03 江南大学 A kind of Mobile phone touch control screen Mark positioning non-contact vision detection method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231093A (en) * 2011-06-14 2011-11-02 伍斌 Screen locating control method and device
CN105894036A (en) * 2016-04-19 2016-08-24 武汉大学 Image feature template matching method being applied to detection of mobile phone screen defects
CN107825765A (en) * 2017-09-27 2018-03-23 邓志军 A kind of Mobile phone film and mobile phone positioning method for adhering film
CN108363508A (en) * 2018-01-13 2018-08-03 江南大学 A kind of Mobile phone touch control screen Mark positioning non-contact vision detection method
CN108319979A (en) * 2018-02-05 2018-07-24 哈工大机器人(合肥)国际创新研究院 A kind of framing recognition detection method based on scaling and rotation matching

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
触摸屏装配中的全自动对位机开发;邢泽惠;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170215;第32页第1段-第38页第2段 *

Also Published As

Publication number Publication date
CN109859262A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
US10484663B2 (en) Information processing apparatus and information processing method
CN108898676B (en) Method and system for detecting collision and shielding between virtual and real objects
CN111126304A (en) Augmented reality navigation method based on indoor natural scene image deep learning
EP3273412B1 (en) Three-dimensional modelling method and device
CN109961399B (en) Optimal suture line searching method based on image distance transformation
JP6500355B2 (en) Display device, display program, and display method
US20180181816A1 (en) Handling Perspective Magnification in Optical Flow Proessing
CN107851196B (en) Image pattern matching method and device
CN107516322B (en) Image object size and rotation estimation calculation method based on log polar space
CN105303514A (en) Image processing method and apparatus
CN107545223B (en) Image recognition method and electronic equipment
CN108074237B (en) Image definition detection method and device, storage medium and electronic equipment
CN107452028B (en) Method and device for determining position information of target image
US10055845B2 (en) Method and image processing system for determining parameters of a camera
CN106296587B (en) Splicing method of tire mold images
CN110415304B (en) Vision calibration method and system
CN115908988B (en) Defect detection model generation method, device, equipment and storage medium
CN105303566B (en) A kind of SAR image azimuth of target method of estimation cut based on objective contour
CN113362441A (en) Three-dimensional reconstruction method and device, computer equipment and storage medium
KR20160146567A (en) Method and device for detecting variable and fast moving object
Boulanger et al. ATIP: A Tool for 3D Navigation inside a Single Image with Automatic Camera Calibration.
EP3825804A1 (en) Map construction method, apparatus, storage medium and electronic device
Zhou et al. Building occlusion detection from ghost images
CN114913308A (en) Camera tracking method, device, equipment and storage medium
CN107133260A (en) The matching and recognition method and device of a kind of landmark image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant