[go: up one dir, main page]

WO2019100407A1 - Positioning of terminal screen based on transformation relation of coordinates of marking graphic points in pattern - Google Patents

Positioning of terminal screen based on transformation relation of coordinates of marking graphic points in pattern Download PDF

Info

Publication number
WO2019100407A1
WO2019100407A1 PCT/CN2017/113216 CN2017113216W WO2019100407A1 WO 2019100407 A1 WO2019100407 A1 WO 2019100407A1 CN 2017113216 W CN2017113216 W CN 2017113216W WO 2019100407 A1 WO2019100407 A1 WO 2019100407A1
Authority
WO
WIPO (PCT)
Prior art keywords
coordinate
screen
pattern
image
logo
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.)
Ceased
Application number
PCT/CN2017/113216
Other languages
French (fr)
Chinese (zh)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to PCT/CN2017/113216 priority Critical patent/WO2019100407A1/en
Priority to CN201780089459.5A priority patent/CN110506252B/en
Publication of WO2019100407A1 publication Critical patent/WO2019100407A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/042Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means by opto-electronic means

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, and a terminal for positioning a terminal screen.
  • touch-screen terminals such as mobile phones and tablets
  • users have higher requirements for the sensitivity of the touch screen of the terminal.
  • the user can simulate the user's click and slide operation on the touch screen terminal through a device such as a robot arm, thereby completing the touch screen accuracy and sensitivity test through the test device, and according to the test result.
  • the touch screen terminal is improved.
  • the industrial camera can process the image of the captured terminal to achieve the positioning of the terminal screen boundary, and then find the intersection according to the identified four boundaries to determine the corner point of the terminal screen, and finally from the collected Position the terminal screen in the image and pass the positioning result to the robot arm. That is, a click, a slide, or the like is performed on a certain point of the captured image, and the robot arm performs a click and slide measurement on the position of the terminal screen corresponding to the point.
  • the terminal screen area and the non-terminal screen area in the image are mainly divided according to the threshold, and the threshold size is different, which often affects the positioning result of the boundary. Therefore, the above implementation process cannot be accurately located.
  • the boundary of the terminal screen so that the mechanical arm cannot accurately simulate the actual click, slide, and the like of the user.
  • the position where the robot arm performs the click operation on the terminal screen does not correspond to the position that the user actually tries to click. This affects the entire testing process and ultimately makes the test results less accurate.
  • the embodiment of the invention provides a method, a device and a terminal for positioning a terminal screen, which can solve the problem that the terminal screen positioning accuracy is low.
  • an embodiment of the present invention provides a method for locating a terminal screen.
  • the method is applied to a terminal such as a test device.
  • the method includes: acquiring a first image, then determining a conversion relationship between the first coordinate and the second coordinate, and determining an area of the screen in the first image according to the conversion relationship.
  • the first image is an image of the photographed terminal, the photographed terminal is provided with a screen, and the screen displays a pattern, the pattern includes a regularly distributed logo graphic; the first coordinate is used to indicate the position of the logo graphic on the screen, The two coordinates are used to indicate the position of the logo graphic in the first image.
  • the terminal screen area and the non-terminal screen area are divided according to the threshold, and the embodiment of the present invention can effectively determine the coordinate conversion relationship between the screen and the image of the terminal, and then determine the terminal according to the conversion relationship.
  • the area of the screen is divided according to the threshold, and the embodiment of the present invention can effectively determine the coordinate conversion relationship between the screen and the image of the terminal, and then determine the terminal according to the conversion relationship.
  • determining an area of the screen in the first image according to the conversion relationship may be implemented as: determining a fourth coordinate according to the conversion relationship and the third coordinate, and determining the fourth coordinate in the first image
  • the area where the corresponding corner points are formed by the end points is the area of the screen in the first image.
  • the third coordinate is used to indicate the position of each corner point on the screen in the screen
  • the fourth coordinate is used to indicate the position of each corner point in the first image.
  • the embodiment of the invention can accurately locate the corner position of the terminal screen in the image by means of coordinate conversion, and then accurately determine the edge of the screen according to the position of the four corner points, thereby accurately positioning the terminal screen in the image.
  • the pattern includes at least three logo patterns.
  • the industrial camera is shooting the image of the mobile phone, it is very likely that the lens of the industrial camera is not completely parallel with the screen of the mobile phone, that is, the image is taken at a certain angle, so that the image obtained has some distortion, that is, the original rectangular mobile phone screen is very It may be a regular or irregular quadrangle.
  • two points can determine a straight line, and three points can determine a plane.
  • the image is distorted and an attempt is made to determine the area where the screen of the mobile phone is located in the image, it can be regarded as determining a plane.
  • the process so at least the position of 3 points needs to be determined before the plane can be derived.
  • the position of each point may correspond to a logo pattern. Therefore, in the embodiment of the present invention, the number of the logo patterns in the pattern may be set to be greater than or equal to three.
  • the regular distribution includes the center point equidistance of the logo pattern distributed in a matrix in rows and columns. Taking the logo pattern as a circle, that is, the distance between every two adjacent centers in the lateral direction is the same, and the distance between every two adjacent centers in the longitudinal direction is the same.
  • the flag pattern may be distributed according to other rules, and is not limited to the rule in which the spacing between the center points of two adjacent flag patterns in the same direction is equal, or may be in the same direction.
  • the step size of the variability setting the position of each of the logo patterns, for example, in the same direction, the distance between the center point of the first logo pattern and the second logo pattern is X, and the second logo pattern and the The spacing between the three logo patterns is 2X, and so on, for each additional logo pattern, the increased spacing between the logo pattern and the adjacent previous logo pattern is increased by X; or, in the same direction, The distance between the center point of one logo graphic and the second logo graphic is X, and the distance between the second logo graphic and the third logo graphic is X+2, and so on, each additional logo graphic The spacing between the added logo pattern and the adjacent previous logo pattern is increased by 2, etc., and is not limited herein.
  • the variability step size may be a function in which an independent variable changes continuously, and may be other implementation forms, which is not limited herein.
  • the logo pattern includes a regular logo pattern and a special logo pattern.
  • the regular logo graphics are identical, the special logo graphics are different from the conventional logo graphics, and the special logo graphics are used to distinguish the orientation of the terminal when shooting.
  • the area of a special logo graphic can be significantly larger or smaller than a conventional logo graphic in a pattern.
  • the logo pattern is black, and the area of the pattern other than the logo pattern is white.
  • the image obtained after the industrial camera is taken is an image with gray scale, if there are only two colors of black and white in the pattern, the imaging effect will be better.
  • the color of the pattern is not limited, and the arrangement pattern of the other colors can be clearly distinguished.
  • the logo pattern is dark, and the rest is light color.
  • each of the logo patterns in the pattern may also be a circle, an ellipse or the like, and the shape of the center point is not affected even if the deformation occurs, and the shape of the logo pattern is not limited herein.
  • the resolution of the pattern is the same as the resolution of the screen.
  • the resolution of the pattern can also be proportional to the resolution of the screen, that is, the screen of the mobile phone can generate a pattern with the same resolution or proportional to the resolution of the screen of the mobile phone according to the resolution of the screen of the mobile phone.
  • the resolution of the pattern can be 1280*720 or A*B, where A is the product of 1280 and the first ratio, and B is 720.
  • the first ratio and the second ratio may be the same or different.
  • the first ratio and the second ratio are positive, and the logo pattern in the pattern is distributed according to a certain rule. The pattern is displayed on the phone display.
  • an embodiment of the present invention provides a method for locating a terminal screen.
  • the method includes: the terminal displays the pattern through the screen, the industrial camera acquires the first image and determines the second coordinate, the testing device acquires the first coordinate and the second coordinate, and determines a conversion relationship between the first coordinate and the second coordinate, and according to Convert the relationship to determine the area of the screen in the first image.
  • the pattern comprises a regularly distributed logo graphic
  • the first coordinate is used to indicate the position of the logo graphic in the screen
  • the second coordinate is used to indicate the position of the logo graphic in the first image
  • the first image is an image of the photographed terminal.
  • the method further includes: the testing device acquires the fifth coordinate, and converts the fifth coordinate according to the conversion relationship, to obtain The sixth coordinate is then sent to the robotic arm; the robotic arm performs an operation at the position of the sixth coordinate in the first image in response to the message sent by the test device.
  • the fifth coordinate is used to indicate the position to be tested on the screen
  • the sixth coordinate is used to indicate the position of the position to be tested in the first image.
  • an embodiment of the present invention provides a terminal cleaning apparatus.
  • the device can implement the functions implemented by the terminal in the foregoing method embodiments, and the functions can be implemented by using hardware or by executing corresponding software through hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • an embodiment of the present invention provides a terminal.
  • the structure of the terminal includes a display screen, a memory, one or more processors, a plurality of applications, and one or more programs; wherein the one or more programs are stored in the memory; the one Or the plurality of processors, when executing the one or more programs, causing the terminal to implement the method of any of the first aspect and its various possible designs.
  • an embodiment of the present invention provides a readable storage medium, including instructions.
  • the terminal is caused to perform the method of any of the above first aspects and its various possible designs.
  • an embodiment of the present invention provides a computer program product, the computer program product comprising software code for performing the method of any of the above first aspects and various possible designs thereof.
  • FIG. 1 is a schematic structural diagram of a first terminal according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a process of photographing a mobile phone by an industrial camera according to an embodiment of the present invention
  • FIG. 3 is an image of a mobile phone photographed by a first industrial camera according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a pattern according to an embodiment of the present invention.
  • FIG. 5 is an image of a mobile phone photographed by a second industrial camera according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a dot location for testing a screen sensitivity of a mobile phone according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of a straight line fitting to determine a screen area of a mobile phone according to an embodiment of the present invention.
  • FIG. 8 is a first black and white image after processing according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a main interface of a mobile phone according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of establishing a two-dimensional coordinate system on a screen of a mobile phone according to an embodiment of the present invention.
  • FIG. 11 is a second processed black and white image according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a device for positioning a terminal screen according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of a second terminal according to an embodiment of the present invention.
  • the embodiments of the present invention may be used in a terminal, which may include a notebook computer, a smart phone, an industrial camera, a test device, a virtual reality (VR) device, an augmented reality (AR), an in-vehicle device, Devices such as smart wearable devices.
  • the terminal is provided with at least a display screen, an input device and a processor.
  • the terminal 100 includes a processor 101, a memory 102, a camera 103, an RF circuit 104, an audio circuit 105, and a speaker.
  • the display screen 110 is composed of at least a touch panel 111 as an input device and a display panel 112 as an output device. It should be noted that the terminal structure shown in FIG. 1 does not constitute a limitation on the terminal, and may include more or less components than those illustrated, or combine some components, or split some components, or different. The component arrangement is not limited herein.
  • the components of the terminal 100 will be specifically described below with reference to FIG. 1 :
  • the radio frequency (RF) circuit 104 can be used for receiving and transmitting information during the transmission or reception of information or during a call. For example, if the terminal 100 is a mobile phone, the terminal 100 can receive the downlink information sent by the base station through the RF circuit 104. Thereafter, it is transmitted to the processor 101 for processing; in addition, data related to the uplink is transmitted to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • LNA Low Noise Amplifier
  • RF circuitry 104 can also communicate with the network and other devices via wireless communication.
  • the wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), and the like.
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • E-mail Short Messaging Service
  • the memory 102 can be used to store software programs and modules, and the processor 101 executes various functional applications and data processing of the terminal 100 by running software programs and modules stored in the memory 102.
  • the memory 102 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (for example, a sound playing function, an image playing function, etc.); and the storage data area may be Data (such as audio data, video data, etc.) created in accordance with the use of the terminal 100 is stored.
  • memory 102 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • Other input devices 109 can be used to receive input numeric or character information, as well as to generate key signal inputs related to user settings and function control of terminal 100.
  • other input devices 109 may include, but are not limited to, a physical keyboard, function keys (eg, volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, light rats (light mice are touches that do not display visual output) a sensitive surface, or a touch-sensitive surface formed by a touch screen One or more of the extensions).
  • Other input devices 109 may also include sensors built into the terminal 100, such as gravity sensors, acceleration sensors, etc., and the terminal 100 may also use parameters detected by the sensors as input data.
  • the display screen 110 can be used to display information input by the user or information provided to the user as well as various menus of the terminal 100, and can also accept user input.
  • the display panel 112 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 111 is also called a touch screen or a touch sensitive screen.
  • the contact or non-contact operation of the user on or near the user may be collected (for example, the user may use any suitable object or accessory such as a finger or a stylus on the touch panel 111 or in the vicinity of the touch panel 111, or Including the somatosensory operation; the operation includes a single point control operation, a multi-point control operation and the like, and drives the corresponding connection device according to a preset program.
  • the touch panel 111 may further include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation and posture of the user, and detects a signal brought by the touch operation, and transmits a signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts the signal into the processor 101.
  • the information that can be processed is transmitted to the processor 101, and the commands sent from the processor 101 can also be received and executed.
  • the touch panel 111 can be implemented by using various types such as resistive, capacitive, infrared, and surface acoustic waves, and the touch panel 111 can be implemented by any technology developed in the future.
  • the touch panel 111 can cover the display panel 112, and the user can cover the display panel 112 according to the content displayed by the display panel 112 (including but not limited to a soft keyboard, a virtual mouse, a virtual button, an icon, etc.).
  • the touch panel 111 operates on or near the touch panel 111. After detecting the operation thereon or nearby, the touch panel 111 transmits to the processor 101 to determine the user input, and then the processor 101 provides the display panel 112 according to the user input. Corresponding visual output.
  • the touch panel 111 and the display panel 112 are used as two independent components to implement the input and output functions of the terminal 100 in FIG. 1, in some embodiments, the touch panel 111 may be integrated with the display panel 112. To implement the input and output functions of the terminal 100.
  • the RF circuit 104, the speaker 106, and the microphone 107 provide an audio interface between the user and the terminal 100.
  • the audio circuit 105 can transmit the converted audio data to the speaker 106 for conversion to the sound signal output.
  • the microphone 107 can convert the collected sound signal into a signal, which is received by the audio circuit 105.
  • the audio data is then converted to audio data, and the audio data is output to the RF circuit 104 for transmission to a device such as another terminal, or the audio data is output to the memory 102 for the processor 101 to perform further processing in conjunction with the content stored in the memory 102.
  • the camera 103 can acquire image frames in real time and transmit them to the processor 101 for processing, and store the processed results to the memory 102 and/or present the processed results to the user via the display panel 112.
  • the processor 101 is the control center of the terminal 100, connecting various portions of the entire terminal 100 using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 102, and recalling data stored in the memory 102.
  • the various functions and processing data of the terminal 100 are executed to perform overall monitoring of the terminal 100.
  • the processor 101 may include one or more processing units; the processor 101 may further integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface (User Interface, UI) And the application, etc., the modem processor mainly handles wireless communication. It can be understood that the above modem processor may not be integrated into the processor 101.
  • the terminal 100 may also include a power source 114 (eg, a battery) that supplies power to the various components, implemented in the present invention.
  • a power source 114 eg, a battery
  • the power source 114 can be logically coupled to the processor 101 through a power management system to manage functions such as charging, discharging, and power consumption through the power management system.
  • the terminal 100 may further include a Bluetooth module and the like, and details are not described herein again.
  • the technical solution of the embodiment of the present invention is described by taking the terminal 100 shown in FIG. 1 as a mobile phone and an industrial camera as an example.
  • the industrial camera can be regarded as a part of the test equipment.
  • the industrial camera can transmit the image of the photographed mobile phone to the test equipment, and the test equipment analyzes and processes the same.
  • the mobile phone can also generate itself.
  • the detected data is transmitted to the test device, and the test device performs subsequent operations such as positioning the mobile phone screen.
  • an industrial camera is used to capture an included image of the handset, which is then processed by an industrial camera and/or mobile phone to locate the screen area of the handset. It should be noted that the method is also applicable to the positioning of the peripheral contour of the mobile phone or the positioning of a specific area of the mobile phone screen, which is not limited herein.
  • FIG. 2 a schematic diagram of a process of photographing a mobile phone by an industrial camera.
  • the mobile phone 202 is placed in the placement area of the test device, and the plane of the lens 201 of the industrial camera is parallel to the plane of the mobile phone 202.
  • an industrial camera can be regarded as a part of a test device, that is, an industrial camera and a placement area, and other components together constitute a test device, and of course, the industrial camera can also be separately set with the test device, and then Industrial cameras can transmit the captured images to test equipment or other devices such as mobile phones for processing, or industrial cameras can transfer the processed images to test equipment or pass them to test equipment through other devices such as mobile phones. This is not limited.
  • an image of a cell phone shot for an industrial camera As shown in Figure 3, an image of a cell phone shot for an industrial camera. Among them, the image obtained after the industrial camera is taken is a grayscale image, and the image is only used as a possible shooting example, and is not limited as an image obtained after the shooting.
  • the angle of the mobile phone, the distance between the mobile phone and the industrial camera, the angle of view of the industrial camera relative to the mobile phone, etc. will affect the image, that is, the image of the mobile phone shot by the industrial camera is different according to the actual shooting. Different, it is not limited here.
  • the industrial camera in the process of actually shooting a mobile phone image, it is likely that the industrial camera is not due to the unsmooth placement of the test device or the plane of the placement area and the plane of the lens of the industrial camera.
  • the plane of the vertical mobile phone is photographed, so that there is a certain error in the screen area of the mobile phone.
  • the screen area of the mobile phone is rectangular in the case of normal shooting, and the current quadrangle due to distortion is irregular or regular.
  • the graphics presented on the phone screen after distortion will also be affected by the actual shape of the screen area of the phone.
  • a screen with a resolution equal to or proportional to the resolution of the screen of the mobile phone may be generated according to the resolution of the screen of the mobile phone, for example, the resolution of the screen of the mobile phone.
  • the resolution of the pattern can be 1280*720 or A*B, where A is the product of 1280 and the first ratio, and B is the product of 720 and the second ratio.
  • a ratio and a second ratio may be the same or different.
  • the first ratio and the second ratio are positive values
  • the logo graphic in the pattern is distributed according to a certain rule and displayed on the mobile phone display screen. in.
  • the rule is distributed with a plurality of logo patterns that are circular.
  • the logo graphic includes a regular logo graphic and a special logo graphic.
  • the conventional logo graphic is completely identical, and the special logo graphic is used to distinguish the orientation of the mobile phone, and the area of the special logo graphic is obviously larger than that in the pattern.
  • Regular logo graphics are used to distinguish the orientation of the mobile phone, and the area of the special logo graphic is obviously larger than that in the pattern.
  • the equidistant equidistant spacing of each circular marking pattern in the pattern is distributed in a matrix according to rows and columns, that is, the spacing of every two adjacent centers in the lateral direction is the same, and the spacing of each two adjacent centers in the longitudinal direction is the same.
  • the circle in the pattern is black, and the portion of the pattern other than the logo pattern is white.
  • each of the logo patterns in the pattern may also be an ellipse or the like, and the shape of the center point is not affected even if the deformation occurs, and the shape of the logo pattern is not limited herein.
  • the rule distribution referred to in the embodiment of the present invention is not limited to the rule in which the spacing between the center points of two adjacent flag patterns in the same direction is equal, and may be in the same direction according to the variability.
  • Step size setting the position of each logo graphic, for example, in the same direction, the distance between the center point of the first logo graphic and the second logo graphic is X, and the second logo graphic and the third logo
  • the spacing between the graphics is 2X, and so on
  • the spacing between the increased logo pattern and the adjacent previous logo graphic is increased by X; or, in the same direction, the first logo
  • the distance between the graphic and the center point of the second logo graphic is X
  • the distance between the second logo graphic and the third logo graphic is X+2, and so on.
  • the increase is increased.
  • the spacing between the logo pattern and the adjacent previous logo pattern is increased by 2, etc., and is not limited herein.
  • the variability step size may be a function in which an independent variable changes continuously, and may be other implementation forms, which is not limited herein.
  • the pattern is presented in black and white, that is, the logo pattern is black, and the rest is white.
  • the image obtained after the industrial camera is taken is an image with gray scale, if there are only two colors of black and white in the pattern, the imaging effect will be better.
  • the color of the pattern is not limited, and the arrangement pattern of the other colors can be clearly distinguished.
  • the logo pattern is dark, and the rest is light color.
  • the special logo graphics in the pattern one or more may be set, the purpose of which is to distinguish the direction in which the mobile phone is placed. The specific method of differentiation will be presented later and will not be repeated here.
  • the special logo pattern and other logo patterns are distinguished by adjusting the size of the logo graphic, which is not limited herein.
  • the process of generating a pattern may be performed by a mobile phone, or generated by an industrial camera, a test device, or other device according to the resolution of the mobile phone screen, and the generated pattern is transmitted to the mobile phone for full screen of the mobile phone. It is shown here that the position, manner, and the like of the generated pattern are not limited.
  • the generated pattern can be regarded as a picture with a resolution of 1280*720.
  • the distribution of the logo graphics in the pattern can be 15*15, that is, the horizontal and vertical distributions are 15 logo graphics, then the horizontal direction (the direction of the edge corresponding to 1280 pixels in the mobile phone screen) is 15 each of the 15 logo graphics.
  • the spacing between the center points of each of the two logo images in the 15 logo images is 45, and is close to the lateral edge of the screen of the mobile phone.
  • the vertical distance from the center point of the logo pattern to the lateral edge is also 45, which is 45 pixels.
  • the vertical distance of the special logo graphic from the lateral edge of the screen is 45, and the vertical distance from the longitudinal edge of the screen is 80.
  • the distance referred to herein refers to the distance from the center point to the edge of the logo graphic.
  • the location of the special logo graphic is closer to the coordinate origin of the mobile phone screen (a corner point of the mobile phone screen, that is, the intersection formed by the intersection of two adjacent sides of the mobile phone screen), and the corner point is taken as the coordinate origin, the horizontal side of the mobile phone screen On
  • the direction away from the origin is the positive direction of the x-axis in the two-dimensional coordinate system
  • the direction away from the origin on the longitudinal side of the screen of the mobile phone is the positive direction of the y-axis in the two-dimensional coordinate system
  • the coordinates of the corner point as the origin are (0) , 0)
  • the coordinates of the center point of the special logo graphic is (80, 45).
  • the position of each point may correspond to a logo pattern. Therefore, in the embodiment of the present invention, the number of the logo patterns in the pattern may be set to be greater than or equal to three. It should be noted that, in consideration of at least one special logo pattern in the pattern to distinguish the direction in which the mobile phone is placed, in the embodiment of the present invention, in order to ensure that the direction of the mobile phone can be effectively distinguished, the flag is determined as accurately as possible.
  • the accuracy of the resource occupancy and the coordinate conversion relationship can be weighed according to the current actual requirements, so as to determine how many flag patterns are configured in the current pattern to be used, which is not limited herein.
  • the mobile phone screen displays a pattern of regular distribution determined according to the resolution, and the industrial camera is perpendicular to the mobile phone, and the mobile phone image obtained after the mobile phone is photographed.
  • the interference pattern may be an external environmental factor such as illumination, or a rule that the industrial camera lens is not clean, or the mobile phone display screen is not clean, or irregular regions or points. It can be known from the acquired images that all the logo patterns included in the pattern may not be collected by the industrial camera, for example, 205 shown in FIG. 5, which means that the image captured by the industrial camera may only include a part. Logo graphic. It is also because of this that the more logo patterns are included in the pattern, the more accurate the processing results obtained after processing the collected images.
  • the center point coordinates of all the logo patterns located at the lateral center position in the longitudinal direction are determined, and the determined straight line of each center point coordinate is used as the symmetry axis of the two-part logo pattern in the lateral direction, through the symmetry
  • the way of comparison determines the coordinates of the center point of the missing or incomplete mark graphic in the pattern.
  • the center point coordinates of all the logo patterns located at the lateral center position in the longitudinal direction are determined, that is, the center point coordinates of the two logo patterns are determined in each horizontal line, and then the two lines belonging to the same horizontal line are
  • the center point coordinates of the logo patterns are used as a group to determine the midpoint of the line segment between the center point coordinates of the two logo patterns belonging to the same horizontal line, and the straight line of all the midpoints obtained thereafter is used as the horizontal two-part logo pattern.
  • the axis of symmetry also determines the coordinates of the center point of the missing or incomplete mark pattern in the pattern by symmetric alignment.
  • the above implementation manners are also applicable to the vertical and oblique items.
  • the specific implementation manner may refer to the horizontal determination manner, and details are not described herein.
  • the manner of calculating the coordinates of the center point of the missing or incomplete mark pattern is not limited to the above-mentioned several examples, and may be other calculation methods based on the pattern distribution rule, and will not be described herein.
  • the number of special logo graphics can be set to multiple, or directly on the screen of the mobile phone.
  • the origin of the coordinate is the starting point, and the parameters such as the area or radius of the logo graphic are incremented or decremented in a diffused manner, so that although there is no unique or multiple special logo graphics in the pattern, the graphics in the pattern are intuitively displayed.
  • the change rule is seen, so that it is convenient to distinguish the position of the coordinate origin of the mobile phone screen in the image, which is not limited herein.
  • determining the central point set of the logo pattern on the image pixel coordinates may be performed on a mobile phone, an industrial camera, a test device, or other devices, and is not limited herein.
  • the mobile phone can be set by any one of the mobile phone, the industrial camera, the test device and other devices according to the central point set of the logo graphic on the pixel coordinates of the image, the central point set of the logo graphic on the pixel coordinates of the screen, and the two coordinate systems.
  • the position of the origin of the central coordinate, the coordinates of each center point in the image and the coordinates of each center point in the pattern are in one-to-one correspondence, thereby determining the point coordinate conversion relationship of each of the logo patterns in the different coordinate systems in the pattern, that is, the function relationship, to obtain the mobile phone
  • the position coordinates of the corner point of the screen in the image is a predefined range
  • the resolution of the mobile phone screen is 1280*720
  • the coordinates of the four corner points of the mobile phone screen may be (0, 0), (1280, 0), (0, 720), and (1280, 720), respectively.
  • the position coordinates of the above four corner points in the image are determined, thereby locating the positions of the four corner points of the mobile phone screen in the image, and then establishing the connection between the adjacent two corner points. Line to determine the location of the phone screen in the image.
  • the position of any point in the screen of the mobile phone can be converted into the position corresponding to the arbitrary point in the image, thereby realizing the subsequent detection of the sensitivity of the screen of the mobile phone, the click operation, and the like. Not limited.
  • the content to be recognized is often a specific icon or text, and therefore the requirement for recognition accuracy is not high.
  • the accuracy test often does not have a specific icon template to match, so how to take a device with a shooting function such as an industrial camera In the captured images, it is particularly important to realize the recognition of the specific position of the mobile phone screen.
  • the test for the sensitivity of the touch screen that is, the touch test on the screen of the mobile phone, that is, whether there is a difference between the position of the finger press and the point actually sensed by the mobile phone, thereby judging whether the touch screen is good or bad.
  • the dot positions 1 to 9 shown in FIG. 6 are distances with respect to the boundary line of the mobile phone screen. It can be seen that the determination accuracy of the screen boundary is very high.
  • the position of the mobile phone on the test equipment may be the same or different each time, and on the same type of test equipment, the screen size of the mobile phone placed each time may be the same or different.
  • the mobile phone screen is non-directional, then for a mobile phone with 1080*1920 pixels, if the user tries to click (500,500) and the mobile phone is placed in the forward direction, the (500,500) point can be accurately obtained. If the phone is placed in the reverse position, the user should actually click on the point (1080-500, 1920-500), which will cause a large error between the actual click position and the position the user is trying to click.
  • the technical solution provided by the embodiment of the present invention can also reduce the process of manually recognizing the screen of the mobile phone through visual.
  • the manner of distinguishing the orientation of the screen of the mobile phone can be implemented by referring to the difference of the logo pattern in the drawing mentioned above, and details are not described herein.
  • the mobile phone screen 206 includes a mobile phone bright screen area and a black border 208 surrounded by four mobile phone bright screen area edges 207, wherein the boundary between the mobile phone bright screen area and the black screen 208 of the mobile phone screen 206 is attached.
  • the four boundaries of the mobile phone screen can be fitted by visual algorithm fitting, and the intersections obtained by the four boundaries are the four corner points of the mobile phone screen.
  • the pixel shown in FIG. 3 needs to be enlarged, wherein the gray image shown in FIG. 7 can be obtained by taking the corner of the mobile phone screen at the lower right of FIG. 3 as an example. Then, by means of straight line fitting, a black and white image is obtained, thereby determining the boundary contour of the screen of the mobile phone, and then determining the position of the corner point.
  • the straight line fitting method is mainly to set a threshold value, and then the gray image is generated by referring to the set threshold value to generate a black and white image, and then combined with the irregular edge in the black and white image to fit a straight line.
  • the difference in threshold size settings will also affect the final difference in the boundaries of the phone screen.
  • the straight line fitting method can determine the position of the corner point, it is difficult to fit an accurate straight line. For example, for a mobile phone screen, it is possible to fit the rectangular screen area to no. A regular quadrilateral area that affects the positioning of the corner points.
  • the pattern is generated in combination with the pixels of the screen of the mobile phone in the manner mentioned above, and then the mobile phone is displayed in full screen when the mobile phone is photographed.
  • the more the number of the logo patterns in the pattern the stronger the robustness of the algorithm for determining the coordinate transformation relationship of other arbitrary points obtained by using the least squares method to calculate the conversion relationship.
  • the device that generates the pattern can be connected to the mobile phone using a Universal Serial Bus (USB) to establish a communication connection between the mobile phone and the device that generates the pattern, thereby generating the pattern device.
  • USB Universal Serial Bus
  • the mobile phone After determining the pixel of the mobile phone screen and generating the pattern, push the pattern to the mobile phone, and the mobile phone can The pattern is stored in the local storage area, after which the phone can automatically display the pattern in full screen to prepare for testing.
  • the image sensor of the industrial camera when an industrial camera captures an image, can be parallel to the screen of the mobile phone.
  • the size of the field of view is adapted to the size of the mobile phone, which is not limited herein.
  • the image sensor includes, but is not limited to, one of the following: a Charge Coupled Device (CCD), and a Complementary Metal-Oxide-Semiconductor (CMOS).
  • CCD Charge Coupled Device
  • CMOS Complementary Metal-Oxide-Semiconductor
  • the image captured by the industrial camera is a grayscale image.
  • the collected grayscale image may be processed in advance.
  • the maximum inter-class variance method (OSTU) is used to segment the image in combination with a preset or a currently automatically generated threshold to obtain a black and white image.
  • the grayscale image shown in Fig. 5 taken by the industrial camera is processed to obtain a black and white image as shown in Fig. 8.
  • the device for image processing such as a mobile phone, an industrial camera, a test device, or other device, can acquire the screen area of the mobile phone by means of contour extraction.
  • the edge of the screen area of the mobile phone is likely to have irregularities such as burrs, so in order to ensure that the acquired screen area of the mobile phone completely includes the screen of the mobile phone, the front contour can be extracted.
  • the resulting maximum contour is processed to find the smallest rectangle circumscribing the maximum contour to initially determine the extent of the screen area of the handset.
  • the range of the initially determined screen area of the mobile phone can be used as the range of each of the logo patterns in the search pattern to be collected from the image captured by the industrial camera.
  • the outline information that is, the outline information of each of the logo patterns in the image, is extracted in the initially determined area of the screen of the mobile phone.
  • the contour information includes, but is not limited to, at least one of the following: an area, a radius, and the like of the logo pattern. Then, according to the contour information, the process of filtering out the invalid contour is performed on each of the flag patterns that can be displayed in the image, thereby filtering out the invalid flag pattern caused by illumination or the like.
  • the manner of restoring the incomplete logo pattern may be based on the definition of the logo graphic itself. For example, if the current logo graphic is circular, it can be triggered from the definition of the circle, and the distance from the center point to any point in the periphery is completely equal.
  • the figure is a logo pattern in the pattern of the embodiment of the present invention, so that the circular contour is complemented according to the principle. The specific implementation manner can refer to the prior art, and details are not described herein.
  • the center point coordinates of the missing logo pattern can be determined according to the relationship between the center point coordinates of the existing logo pattern, and then the contour information of other logo patterns is combined to determine the missing
  • the outline features of the logo graphic such as the radius of the circle, etc., thereby restoring the missing logo pattern.
  • the center point coordinates of the missing or incomplete flag graphic may be directly determined according to the relative relationship between the coordinates of the center points of the existing flag patterns.
  • the complete logo graphic does not need to restore the missing logo graphic.
  • each of the logo patterns can be further processed, for example, a random sample consistency algorithm (Random Sample Consensus, RANSAC) is used to perform round extraction, that is, to detect a circular contour.
  • RANSAC Random Sample Consensus
  • the position of each point from the center of the circle is filtered to remove the point with large deviation on the circular contour, and then the least squares fitting is performed according to the unfiltered point, thereby obtaining the finely processed flag graphic parameter such as radius. .
  • the relative position of the largest circle and the other rounds may be determined in combination with the logo pattern parameter, thereby determining the mobile phone.
  • the positive direction of the screen according to the positive direction, the coordinates of the center point of each logo graphic in the image captured by the mobile phone screen and the industrial camera, the coordinates of each point on the two coordinate systems are one-to-one correspondence, and then the minimum two can be passed.
  • Multiplication calculates the transformation relationship between the two point coordinate sets, that is, calculates the rotation translation scaling transformation matrix.
  • the conversion relationship can be combined to calculate the position of each mobile phone screen corner point in the image, and the positive direction of the mobile phone screen can be determined. Then, through the position of the four corner points, four boundary lines of the mobile phone screen can be fitted in the image to determine the area of the screen of the mobile phone. In addition, according to the conversion relationship, it is also possible to determine the position in the image after any conversion on the screen of the mobile phone.
  • the pattern may be generated according to the resolution of the screen of the mobile phone, and the implementation manner may be repeatedly executed, thereby obtaining another conversion relationship, and then comparing the two conversion relationships. Pairing, adjusting, and thus a more accurate conversion method, that is, the conversion relationship that is ultimately used to determine the correspondence between the two coordinate systems. It should be noted that as the number of times of re-determining the conversion relationship increases, the resulting conversion relationship is more accurate. Of course, it is also possible to detect one or more positions on the screen of the mobile phone by using the current conversion relationship, thereby judging whether the currently obtained conversion relationship is accurate, and fine-tuning the conversion relationship according to the actual situation, etc., Give a brief description.
  • the embodiment of the present invention can be effectively applied to the automatic positioning of the screen of the mobile phone, so that the dot-dash line similar to the designated position in the screen of the mobile phone, the accurate acquisition of the icon position, and the like can be more accurately positioned.
  • the pattern is generated based on the pixels of the screen of the mobile phone, the implementation adopted by the embodiment of the present invention can be effectively applied to the detection of the electronic device having the display screen, such as a mobile phone or a tablet computer of each model.
  • the placement direction of the device such as the mobile phone waiting for testing on the testing device is not limited, which means that the probability of the detection process being affected by the environment is low, thereby Improve the accuracy of the entire inspection process.
  • the screen of the mobile phone is likely to be the origin of the coordinate system of the mobile phone screen due to the process error of the bonding, but the point coordinate conversion provided by the embodiment of the present invention is adopted.
  • the implementation of the method can effectively avoid the errors caused by the above problems.
  • the problem of the light leakage of the mobile phone screen, the quality of the captured image, and the like may affect the testing process more or less.
  • the implementation scheme provided by the embodiment of the present invention excludes the influence of the processing process of the screen boundary of the mobile phone, and the pattern is The more the number of logo patterns in the more, the richer the information used to determine the conversion relationship, the more accurate the determined conversion relationship will be, thereby improving the point in the image that fits the position corresponding to the coordinate system of the mobile phone screen.
  • the precision of the coordinates is The more the number of logo patterns in the more, the richer the information used to determine the conversion relationship, the more accurate the determined conversion relationship will be, thereby improving the point in the image that fits the position corresponding to the coordinate system of the mobile phone screen. The precision of the coordinates.
  • the mobile phone can switch the interface presented by the mobile phone screen, for example, closing the current full-screen display and presenting the main interface of the mobile phone, as shown in FIG.
  • the test device can pre-acquire the location that the user actually needs to click when clicking the calendar icon, that is, the calendar icon is on the mobile phone screen.
  • the display position on the top In the embodiment of the present invention, referring to the implementation manner of positioning the mobile phone screen, the corner point on the upper left side of the mobile phone screen shown in FIG. 9 is also a two-dimensional coordinate system.
  • the origin, the two-dimensional coordinate system based on the screen of the mobile phone is established, wherein the established coordinate system is the same as the two-dimensional coordinate system established on the screen of the mobile phone when the screen of the mobile phone is positioned, and the resolution of the screen of the mobile phone is still 1280*720.
  • the coordinates of the center point of the calendar icon that is, the point coordinates (288, 213) shown in FIG. 10 are obtained.
  • the user if the user attempts to click the calendar icon during the actual operation, the user needs to generate a click operation on the corresponding point in the two-dimensional coordinate system (288, 213). This means that the above point coordinates (288, 213) are used as input to the test equipment.
  • the black-and-white image obtained by processing the grayscale image of the mobile phone captured by the industrial camera is calculated based on the previously obtained conversion relationship, and the coordinates of the point (288, 213) are calculated in the two-dimensional coordinate system shown in FIG. Corresponding point coordinates, ie (1620, 532).
  • the test device can determine the position of the click operation that the robot arm needs to perform in the image collected by the industrial camera according to the input point coordinates (288, 213) and the obtained conversion relationship.
  • the robot arm is controlled to perform a click operation at a point of coordinates (1620, 532).
  • the mobile phone may pre-set each icon presented in the interface that needs to be tested on the screen of the mobile phone.
  • the coordinates are sent to the test device.
  • the coordinates of the icon sent by the previously received mobile phone can be directly input, and the coordinate is obtained by means of coordinate conversion.
  • the position of the icon in the image, and the coordinates indicating the position of the icon in the image are transmitted to the robot arm for the robot arm to perform a click operation on the corresponding coordinates in the image.
  • the conversion relationship of the coordinates of the point between the screen of the mobile phone and the image of the mobile phone taken by the industrial camera can be effectively determined, and the conversion relationship can not only locate the screen angle of the mobile phone in the image.
  • the position of the point can further locate the area of the screen of the mobile phone.
  • the position of any point or multiple points in the screen of the mobile phone can be located in the image.
  • a positioning device of the terminal screen may be disposed in the terminal, and the positioning device of the terminal screen includes a hardware structure and/or a software module corresponding to each function in order to implement the above functions.
  • the present invention can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
  • the embodiment of the present invention may divide the function module of the positioning device of the terminal screen according to the above method example.
  • each function module may be divided according to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.
  • the positioning device 30 of the terminal screen includes an acquisition module 31 and a determination module 32.
  • the obtaining module 31 is configured to support the positioning device 30 of the terminal screen to complete the acquisition of the first image;
  • the determining module 32 is configured to support the positioning device 30 of the terminal screen to determine the conversion relationship between the first coordinate and the second coordinate, and according to the conversion. The relationship implements an area in which the terminal screen is located in the first image.
  • the positioning device 30 of the terminal screen may further include a storage module 33 for storing program codes and data of the terminal, and a communication module 34 for supporting the positioning device 30 of the terminal screen and the positioning device of the terminal screen.
  • Terminal for example, data interaction between modules in a test device, and/or support for communication between the test device and other devices such as cell phones, industrial cameras, and/or other processes for the techniques described herein .
  • the determining module 32 can be implemented as a processor or a controller, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), and an application specific integrated circuit (Application- Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor may also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like.
  • the communication module 34 can be implemented as a transceiver, a transceiver circuit, or a communication interface or the like.
  • the storage module 33 can be implemented as a memory.
  • the terminal 40 includes a processor 41, a transceiver 42, a memory 43, and a bus 44.
  • the processor 41, the transceiver 42 and the memory 43 are connected to each other through a bus 44.
  • the bus 44 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Wait.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 13, but it does not mean that there is only one bus or one type of bus.
  • the steps of a method or algorithm described in connection with the present disclosure may be implemented in a hardware, or may be implemented by a processor executing software instructions.
  • the software instructions may be composed of corresponding software modules, which may be stored in a random access memory (RAM), a flash memory, a read only memory (ROM), an erasable programmable read only memory ( Erasable Programmable ROM (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Register, Hard Disk, Mobile Hard Disk, Compact Disc Read-Only Memory (CD-ROM), or any of those well known in the art.
  • RAM random access memory
  • ROM read only memory
  • EPROM erasable programmable read only memory
  • EEPROM Electrically Erasable Programmable Read Only Memory
  • register Hard Disk
  • Mobile Hard Disk Mobile Hard Disk
  • CD-ROM Compact Disc Read-Only Memory
  • Other forms of storage media are coupled to the processor to enable the processor to read information from, and write information to, the storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

A method for positioning a terminal screen based on a transformation relation of coordinates of marking graphic points in a pattern, for solving the problem of low positioning accuracy of the terminal screen. The method comprises: obtaining a first image; determining a transformation relation between a first coordinate and a second coordinate; and determining an area of a screen in the first image according to the transformation relation. The first image is a photographed image of a terminal which is provided with a screen for displaying a pattern, and the pattern comprises regularly distributed marking graphics. The first coordinate is used for representing the position of the marking graphic on the screen, and the second coordinate is used for representing the position of the marking graphic in the first image.

Description

基于图样中标志图形点坐标的转换关系定位终端屏幕Positioning the terminal screen based on the conversion relationship of the coordinates of the marked graphic points in the pattern 技术领域Technical field

本申请涉及图像处理技术领域,尤其涉及一种终端屏幕的定位方法、装置及终端。The present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, and a terminal for positioning a terminal screen.

背景技术Background technique

随手手机、平板电脑等触屏终端的普及,用户对于终端触屏的灵敏度等也有了更高的要求。目前为了给用户提供更加优质的触屏体验,可以通过机械臂等设备模拟用户对触屏终端的点击、滑动等操作,从而通过测试设备完成触屏准确度、灵敏度等测试,并依据测试结果对触屏终端进行改进。With the popularity of touch-screen terminals such as mobile phones and tablets, users have higher requirements for the sensitivity of the touch screen of the terminal. At present, in order to provide users with a better touch screen experience, the user can simulate the user's click and slide operation on the touch screen terminal through a device such as a robot arm, thereby completing the touch screen accuracy and sensitivity test through the test device, and according to the test result. The touch screen terminal is improved.

在实际测试过程中,工业相机可以将拍摄的终端的图像进行处理,以实现终端屏幕边界的定位,之后依据识别出的4条边界找到交点,以确定终端屏幕的角点,最终从采集到的图像中定位终端屏幕,并将定位结果传递至机械臂。即,对拍摄的图像某一点实施点击、滑动等操作,机械臂会在该点对应的终端屏幕的位置进行点击、滑动实测。由于图像处理过程中,主要是依据阈值对图像中的终端屏幕区域和非终端屏幕区域进行划分,而阈值大小的不同,往往会影响到边界的定位结果,因此,上述实现过程往往不能准确定位出终端屏幕的边界,从而使机械臂无法准确模拟出用户的实际点击、滑动等操作,以点击操作为例,即机械臂在终端屏幕上执行点击操作的位置与用户实际试图点击的位置不对应,从而影响整个测试过程,最终使测试结果准确度较低。In the actual test process, the industrial camera can process the image of the captured terminal to achieve the positioning of the terminal screen boundary, and then find the intersection according to the identified four boundaries to determine the corner point of the terminal screen, and finally from the collected Position the terminal screen in the image and pass the positioning result to the robot arm. That is, a click, a slide, or the like is performed on a certain point of the captured image, and the robot arm performs a click and slide measurement on the position of the terminal screen corresponding to the point. In the process of image processing, the terminal screen area and the non-terminal screen area in the image are mainly divided according to the threshold, and the threshold size is different, which often affects the positioning result of the boundary. Therefore, the above implementation process cannot be accurately located. The boundary of the terminal screen, so that the mechanical arm cannot accurately simulate the actual click, slide, and the like of the user. Taking the click operation as an example, the position where the robot arm performs the click operation on the terminal screen does not correspond to the position that the user actually tries to click. This affects the entire testing process and ultimately makes the test results less accurate.

发明内容Summary of the invention

本发明实施例提供一种终端屏幕的定位方法、装置及终端,能够解决终端屏幕定位准确率较低的问题。The embodiment of the invention provides a method, a device and a terminal for positioning a terminal screen, which can solve the problem that the terminal screen positioning accuracy is low.

第一方面,本发明实施例提供一种终端屏幕的定位方法。该方法应用于一种诸如测试设备的终端。该方法包括:获取第一图像,之后确定第一坐标与第二坐标之间的转换关系,并根据转换关系,确定第一图像中屏幕的区域。其中,第一图像为拍摄的终端的图像,被拍摄的终端设置有屏幕,且该屏幕显示图样,该图样包括规则分布的标志图形;第一坐标用于表示标志图形在屏幕上的位置,第二坐标用于表示标志图形在第一图像中的位置。相比较于现有技术中依据阈值对图像中的终端屏幕区域和非终端屏幕区域进行划分,本发明实施例可以有效确定终端屏幕与图像之间的坐标转换关系,之后依据该转换关系确定出终端屏幕的区域。In a first aspect, an embodiment of the present invention provides a method for locating a terminal screen. The method is applied to a terminal such as a test device. The method includes: acquiring a first image, then determining a conversion relationship between the first coordinate and the second coordinate, and determining an area of the screen in the first image according to the conversion relationship. The first image is an image of the photographed terminal, the photographed terminal is provided with a screen, and the screen displays a pattern, the pattern includes a regularly distributed logo graphic; the first coordinate is used to indicate the position of the logo graphic on the screen, The two coordinates are used to indicate the position of the logo graphic in the first image. Compared with the threshold image in the prior art, the terminal screen area and the non-terminal screen area are divided according to the threshold, and the embodiment of the present invention can effectively determine the coordinate conversion relationship between the screen and the image of the terminal, and then determine the terminal according to the conversion relationship. The area of the screen.

在一种可能的设计中,根据转换关系,确定第一图像中屏幕的区域,可以实现为:根据转换关系及第三坐标,确定第四坐标,并在第一图像中,确定以第四坐标对应的各个角点的位置为端点所构成的区域为屏幕在第一图像中的区域。其中,第三坐标用于表示屏幕上各个角点在屏幕中的位置,第四坐标用于表示各个角点在第一图像中的位置。本发明实施例可以采用坐标转换的方式,准确定位出图像中终端屏幕的角点位置,之后依据4个角点的位置准确确定屏幕边缘,从而在图像中准确定位终端屏幕。 In a possible design, determining an area of the screen in the first image according to the conversion relationship may be implemented as: determining a fourth coordinate according to the conversion relationship and the third coordinate, and determining the fourth coordinate in the first image The area where the corresponding corner points are formed by the end points is the area of the screen in the first image. The third coordinate is used to indicate the position of each corner point on the screen in the screen, and the fourth coordinate is used to indicate the position of each corner point in the first image. The embodiment of the invention can accurately locate the corner position of the terminal screen in the image by means of coordinate conversion, and then accurately determine the edge of the screen according to the position of the four corner points, thereby accurately positioning the terminal screen in the image.

在一种可能的设计中,图样包括至少三个标志图形。考虑到工业相机在拍摄手机的图像的过程中,很可能工业相机的镜头与手机屏幕并非完全平行,即呈一定角度进行拍摄,这样得到的图像会存在一定失真,即原本呈矩形的手机屏幕很可能呈规则或是不规则的四边形。一般情况下,两点可以确定一条直线,三点可以确定一个平面,而在本发明实施例中,若图像存在失真,且试图确定图像中手机屏幕所在的区域,则可以被视为确定一个平面的过程,因此至少需要确定3个点的位置才可以推算出这个平面。而每个点的位置可以对应出一个标志图形,因此,在本发明实施例中,可以设置图样中标志图形的数量为大于或是等于3个。In one possible design, the pattern includes at least three logo patterns. Considering that the industrial camera is shooting the image of the mobile phone, it is very likely that the lens of the industrial camera is not completely parallel with the screen of the mobile phone, that is, the image is taken at a certain angle, so that the image obtained has some distortion, that is, the original rectangular mobile phone screen is very It may be a regular or irregular quadrangle. In general, two points can determine a straight line, and three points can determine a plane. In the embodiment of the present invention, if the image is distorted and an attempt is made to determine the area where the screen of the mobile phone is located in the image, it can be regarded as determining a plane. The process, so at least the position of 3 points needs to be determined before the plane can be derived. The position of each point may correspond to a logo pattern. Therefore, in the embodiment of the present invention, the number of the logo patterns in the pattern may be set to be greater than or equal to three.

在一种可能的设计中,规则分布包括标志图形的中心点等间距按行、列呈矩阵式分布。以标志图形为圆为例,即横向上每两个相邻圆心的间距相同,纵向上每两个相邻圆心的间距相同。此外,在本发明实施例中标志图形还可以按照其他规则分布,不限于上述同一方向上相邻两个标志图形的中心点之间的间距相等的规则,还可以为在同一方向上,按照具有可变性的步长,设置各个标志图形位置的情况,比如,在同一方向上,第一个标志图形与第二个标志图形的中心点之间的间距为X,而第二个标志图形与第三个标志图形之间的间距为2X,以此类推,每增加一个标志图形,该增加的而标志图形与相邻的前一个标志图形之间的间距增加X;或者,在同一方向上,第一个标志图形与第二个标志图形的中心点之间的间距为X,而第二个标志图形与第三个标志图形之间的间距为X+2,以此类推,每增加一个标志图形,该增加的标志图形与相邻的前一个标志图形之间的间距增加2等,在此不予限定。当然,上述具有可变性的步长可以为一个自变量不断发生变化的函数,也可以为其他实现形式,在此不予限定。In one possible design, the regular distribution includes the center point equidistance of the logo pattern distributed in a matrix in rows and columns. Taking the logo pattern as a circle, that is, the distance between every two adjacent centers in the lateral direction is the same, and the distance between every two adjacent centers in the longitudinal direction is the same. In addition, in the embodiment of the present invention, the flag pattern may be distributed according to other rules, and is not limited to the rule in which the spacing between the center points of two adjacent flag patterns in the same direction is equal, or may be in the same direction. The step size of the variability, setting the position of each of the logo patterns, for example, in the same direction, the distance between the center point of the first logo pattern and the second logo pattern is X, and the second logo pattern and the The spacing between the three logo patterns is 2X, and so on, for each additional logo pattern, the increased spacing between the logo pattern and the adjacent previous logo pattern is increased by X; or, in the same direction, The distance between the center point of one logo graphic and the second logo graphic is X, and the distance between the second logo graphic and the third logo graphic is X+2, and so on, each additional logo graphic The spacing between the added logo pattern and the adjacent previous logo pattern is increased by 2, etc., and is not limited herein. Of course, the variability step size may be a function in which an independent variable changes continuously, and may be other implementation forms, which is not limited herein.

在一种可能的设计中,标志图形包括常规标志图形和特殊标志图形,常规标志图形完全相同,特殊标志图形异于常规标志图形,且特殊标志图形用于区分终端在拍摄时的放置方向。比如,特殊标志图形的面积可以明显大于或是小于图样中的常规标志图形。In one possible design, the logo pattern includes a regular logo pattern and a special logo pattern. The regular logo graphics are identical, the special logo graphics are different from the conventional logo graphics, and the special logo graphics are used to distinguish the orientation of the terminal when shooting. For example, the area of a special logo graphic can be significantly larger or smaller than a conventional logo graphic in a pattern.

在一种可能的设计中,标志图形为黑色,图样中除标志图形以外的区域为白色。考虑到工业相机拍摄后得到的图像为有灰度的图像,因此若图样中仅存在黑白两个颜色,那么成像效果会更好。由此可见,对于图样的颜色不予限定,可以为其他色彩区分较为明显的配置方式,比如,标志图形为深色,其余部分为浅色等。In one possible design, the logo pattern is black, and the area of the pattern other than the logo pattern is white. Considering that the image obtained after the industrial camera is taken is an image with gray scale, if there are only two colors of black and white in the pattern, the imaging effect will be better. It can be seen that the color of the pattern is not limited, and the arrangement pattern of the other colors can be clearly distinguished. For example, the logo pattern is dark, and the rest is light color.

在一种可能的设计中,标志图形因拍摄角度的变化而发生形变后,标志图形的中心点位置不变。需要说明的是,图样中的各个标志图形还可以为诸如圆形、椭圆等,即便发生形变,也不会影响中心点位置的图形,在此对于标志图形的形状不予限定。In a possible design, after the logo pattern is deformed due to a change in the shooting angle, the center point position of the logo pattern does not change. It should be noted that each of the logo patterns in the pattern may also be a circle, an ellipse or the like, and the shape of the center point is not affected even if the deformation occurs, and the shape of the logo pattern is not limited herein.

在一种可能的设计中,图样的分辨率与屏幕的分辨率相同。当然,图样的分辨率也可以与屏幕的分辨率成一定比例,即手机屏幕上可以根据手机屏幕的分辨率,生成一张分辨率与手机屏幕的分辨率相同或是成比例的图样。比如,手机屏幕的分辨率为1280*720,那么图样的分辨率可以为1280*720或是A*B,其中,A的取值为1280与第一比例的乘积,B的取值为720与第二比例的乘积,第一比例与第二比例可以相同或是不同,在本发明实施例中,第一比例与第二比例的取值为正数,且图样中的标志图形按照一定规则分布的图样,并显示在手机显示屏中。 In one possible design, the resolution of the pattern is the same as the resolution of the screen. Of course, the resolution of the pattern can also be proportional to the resolution of the screen, that is, the screen of the mobile phone can generate a pattern with the same resolution or proportional to the resolution of the screen of the mobile phone according to the resolution of the screen of the mobile phone. For example, if the resolution of the mobile phone screen is 1280*720, then the resolution of the pattern can be 1280*720 or A*B, where A is the product of 1280 and the first ratio, and B is 720. In the second aspect, the first ratio and the second ratio may be the same or different. In the embodiment of the present invention, the first ratio and the second ratio are positive, and the logo pattern in the pattern is distributed according to a certain rule. The pattern is displayed on the phone display.

第二方面,本发明实施例提供一种终端屏幕的定位方法。该方法包括:终端通过屏幕显示图样,工业相机获取第一图像并确定第二坐标,测试设备获取第一坐标与第二坐标,并确定第一坐标与第二坐标之间的转换关系,并根据转换关系,确定第一图像中屏幕的区域。其中,图样包括规则分布的标志图形,第一坐标用于表示标志图形在屏幕中的位置;第二坐标用于表示标志图形在第一图像中的位置,第一图像为拍摄的终端的图像。In a second aspect, an embodiment of the present invention provides a method for locating a terminal screen. The method includes: the terminal displays the pattern through the screen, the industrial camera acquires the first image and determines the second coordinate, the testing device acquires the first coordinate and the second coordinate, and determines a conversion relationship between the first coordinate and the second coordinate, and according to Convert the relationship to determine the area of the screen in the first image. Wherein, the pattern comprises a regularly distributed logo graphic, the first coordinate is used to indicate the position of the logo graphic in the screen; the second coordinate is used to indicate the position of the logo graphic in the first image, and the first image is an image of the photographed terminal.

在一种可能的设计中,在测试设备确定第一坐标与第二坐标之间的转换关系之后,该方法进一步包括:测试设备获取第五坐标,并按照转换关系对第五坐标进行转换,得到第六坐标,之后向机械臂发送;机械臂响应于测试设备发送的消息,在第一图像中第六坐标的位置执行操作。其中,第五坐标用于表示屏幕上的待测试位置,第六坐标用于表示待测试位置在第一图像中的位置。In a possible design, after the testing device determines the conversion relationship between the first coordinate and the second coordinate, the method further includes: the testing device acquires the fifth coordinate, and converts the fifth coordinate according to the conversion relationship, to obtain The sixth coordinate is then sent to the robotic arm; the robotic arm performs an operation at the position of the sixth coordinate in the first image in response to the message sent by the test device. The fifth coordinate is used to indicate the position to be tested on the screen, and the sixth coordinate is used to indicate the position of the position to be tested in the first image.

第三方面,本发明实施例提供一种终端清理装置。该装置可以实现上述方法实施例中终端所实现的功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个上述功能相应的模块。In a third aspect, an embodiment of the present invention provides a terminal cleaning apparatus. The device can implement the functions implemented by the terminal in the foregoing method embodiments, and the functions can be implemented by using hardware or by executing corresponding software through hardware. The hardware or software includes one or more modules corresponding to the above functions.

第四方面,本发明实施例提供一种终端。该终端的结构中包括显示屏,存储器,一个或多个处理器,多个应用程序,以及一个或多个程序;其中,所述一个或多个程序被存储在所述存储器中;所述一个或多个处理器在执行所述一个或多个程序时,使得该终端实现第一方面及其各种可能的设计中任意一项所述的方法。In a fourth aspect, an embodiment of the present invention provides a terminal. The structure of the terminal includes a display screen, a memory, one or more processors, a plurality of applications, and one or more programs; wherein the one or more programs are stored in the memory; the one Or the plurality of processors, when executing the one or more programs, causing the terminal to implement the method of any of the first aspect and its various possible designs.

第五方面,本发明实施例提供一种可读存储介质,包括指令。当该指令在终端上运行时,使得该终端执行上述第一方面及其各种可能的设计中任意一项所述的方法。In a fifth aspect, an embodiment of the present invention provides a readable storage medium, including instructions. When the instruction is run on the terminal, the terminal is caused to perform the method of any of the above first aspects and its various possible designs.

第六方面,本发明实施例提供一种计算机程序产品,该计算机程序产品包括软件代码,该软件代码用于执行上述第一方面及其各种可能的设计中任意一项所述的方法。In a sixth aspect, an embodiment of the present invention provides a computer program product, the computer program product comprising software code for performing the method of any of the above first aspects and various possible designs thereof.

附图说明DRAWINGS

图1为本发明实施例提供的第一种终端结构示意图;FIG. 1 is a schematic structural diagram of a first terminal according to an embodiment of the present disclosure;

图2为本发明实施例提供的一种工业相机对手机进行拍摄的过程示意图;2 is a schematic diagram of a process of photographing a mobile phone by an industrial camera according to an embodiment of the present invention;

图3为本发明实施例提供的第一种工业相机拍摄的手机的图像;3 is an image of a mobile phone photographed by a first industrial camera according to an embodiment of the present invention;

图4为本发明实施例提供的一种图样示意图;4 is a schematic diagram of a pattern according to an embodiment of the present invention;

图5为本发明实施例提供的第二种工业相机拍摄的手机的图像;FIG. 5 is an image of a mobile phone photographed by a second industrial camera according to an embodiment of the present invention; FIG.

图6为本发明实施例提供的一种用于测试手机屏幕灵敏度的打点位置的示意图;FIG. 6 is a schematic diagram of a dot location for testing a screen sensitivity of a mobile phone according to an embodiment of the present invention; FIG.

图7为本发明实施例提供的一种直线拟合以确定手机屏幕区域的示意图;FIG. 7 is a schematic diagram of a straight line fitting to determine a screen area of a mobile phone according to an embodiment of the present invention; FIG.

图8为本发明实施例提供的第一种处理后的黑白图像;FIG. 8 is a first black and white image after processing according to an embodiment of the present invention; FIG.

图9为本发明实施例提供的一种手机主界面的示意图;FIG. 9 is a schematic diagram of a main interface of a mobile phone according to an embodiment of the present invention;

图10为本发明实施例提供的一种在手机屏幕建立二维坐标系的示意图;FIG. 10 is a schematic diagram of establishing a two-dimensional coordinate system on a screen of a mobile phone according to an embodiment of the present invention; FIG.

图11为本发明实施例提供的第二种处理后的黑白图像;FIG. 11 is a second processed black and white image according to an embodiment of the present invention;

图12为本发明实施例提供的一种终端屏幕的定位装置的结构示意图;FIG. 12 is a schematic structural diagram of a device for positioning a terminal screen according to an embodiment of the present invention;

图13为本发明实施例提供的第二种终端结构示意图。FIG. 13 is a schematic structural diagram of a second terminal according to an embodiment of the present invention.

附图标记说明:Description of the reference signs:

201-工业相机的镜头;201- lens of industrial camera;

202-手机; 202-phone;

203-测试设备的放置区;203 - the placement area of the test equipment;

204-图样中的特殊标志图形;204-Special logo pattern in the pattern;

205-干扰图形;205-interference pattern;

206-手机屏幕;206-phone screen;

207-手机亮屏区域的边沿。207 - The edge of the bright area of the phone.

具体实施方式Detailed ways

本发明实施例可以用于一种终端,该终端可以包括笔记本电脑、智能手机、工业相机、测试设备、虚拟现实(Virtual Reality,VR)设备、增强现实技术(Augmented Reality,AR)、车载设备、智能可穿戴设备等设备。该终端至少设置有显示屏、输入设备和处理器,以终端100为例,如图1所示,该终端100中包括处理器101、存储器102、摄像头103、RF电路104、音频电路105、扬声器106、话筒107、输入设备108、其他输入设备109、显示屏110、触控面板111、显示面板112、输出设备113、以及电源114等部件。其中,显示屏110至少由作为输入设备的触控面板111和作为输出设备的显示面板112组成。需要说明的是,图1中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置,在此不做限定。The embodiments of the present invention may be used in a terminal, which may include a notebook computer, a smart phone, an industrial camera, a test device, a virtual reality (VR) device, an augmented reality (AR), an in-vehicle device, Devices such as smart wearable devices. The terminal is provided with at least a display screen, an input device and a processor. Taking the terminal 100 as an example, as shown in FIG. 1 , the terminal 100 includes a processor 101, a memory 102, a camera 103, an RF circuit 104, an audio circuit 105, and a speaker. 106, a microphone 107, an input device 108, other input devices 109, a display screen 110, a touch panel 111, a display panel 112, an output device 113, and a power source 114. The display screen 110 is composed of at least a touch panel 111 as an input device and a display panel 112 as an output device. It should be noted that the terminal structure shown in FIG. 1 does not constitute a limitation on the terminal, and may include more or less components than those illustrated, or combine some components, or split some components, or different. The component arrangement is not limited herein.

下面结合图1对终端100的各个构成部件进行具体的介绍:The components of the terminal 100 will be specifically described below with reference to FIG. 1 :

射频(Radio Frequency,RF)电路104可用于收发信息或通话过程中,信号的接收和发送,比如,若该终端100为手机,那么该终端100可以通过RF电路104,将基站发送的下行信息接收后,传送给处理器101处理;另外,将涉及上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路104还可以通过无线通信与网络和其他设备通信。该无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE)、电子邮件、短消息服务(Short Messaging Service,SMS)等。The radio frequency (RF) circuit 104 can be used for receiving and transmitting information during the transmission or reception of information or during a call. For example, if the terminal 100 is a mobile phone, the terminal 100 can receive the downlink information sent by the base station through the RF circuit 104. Thereafter, it is transmitted to the processor 101 for processing; in addition, data related to the uplink is transmitted to the base station. Generally, RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 104 can also communicate with the network and other devices via wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), and the like.

存储器102可用于存储软件程序以及模块,处理器101通过运行存储在存储器102的软件程序以及模块,从而执行终端100的各种功能应用以及数据处理。存储器102可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如,声音播放功能、图象播放功能等)等;存储数据区可存储根据终端100的使用所创建的数据(比如,音频数据、视频数据等)等。此外,存储器102可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 102 can be used to store software programs and modules, and the processor 101 executes various functional applications and data processing of the terminal 100 by running software programs and modules stored in the memory 102. The memory 102 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (for example, a sound playing function, an image playing function, etc.); and the storage data area may be Data (such as audio data, video data, etc.) created in accordance with the use of the terminal 100 is stored. Moreover, memory 102 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

其他输入设备109可用于接收输入的数字或字符信息,以及产生与终端100的用户设置以及功能控制有关的键信号输入。具体地,其他输入设备109可包括但不限于物理键盘、功能键(比如,音量控制按键、开关按键等)、轨迹球、鼠标、操作杆、光鼠(光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面 的延伸)等中的一种或多种。其他输入设备109还可以包括终端100内置的传感器,比如,重力传感器、加速度传感器等,终端100还可以将传感器所检测到的参数作为输入数据。Other input devices 109 can be used to receive input numeric or character information, as well as to generate key signal inputs related to user settings and function control of terminal 100. Specifically, other input devices 109 may include, but are not limited to, a physical keyboard, function keys (eg, volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, light rats (light mice are touches that do not display visual output) a sensitive surface, or a touch-sensitive surface formed by a touch screen One or more of the extensions). Other input devices 109 may also include sensors built into the terminal 100, such as gravity sensors, acceleration sensors, etc., and the terminal 100 may also use parameters detected by the sensors as input data.

显示屏110可用于显示由用户输入的信息或提供给用户的信息以及终端100的各种菜单,还可以接受用户输入。此外,显示面板112可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板112;触控面板111,也称为触摸屏、触敏屏等,可收集用户在其上或附近的接触或者非接触操作(比如,用户使用手指、触笔等任何适合的物体或附件在触控面板111上或在触控面板111附近的操作,也可以包括体感操作;该操作包括单点控制操作、多点控制操作等操作类型),并根据预先设定的程式驱动相应的连接装置。需要说明的是,触控面板111还可以包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位、姿势,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成处理器101能够处理的信息,再传送给处理器101,并且,还能接收处理器101发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板111,也可以采用未来发展的任何技术实现触控面板111。一般情况下,触控面板111可覆盖显示面板112,用户可以根据显示面板112显示的内容(该显示内容包括但不限于软键盘、虚拟鼠标、虚拟按键、图标等),在显示面板112上覆盖的触控面板111上或者附近进行操作,触控面板111检测到在其上或附近的操作后,传送给处理器101以确定用户输入,随后处理器101根据用户输入,在显示面板112上提供相应的视觉输出。虽然在图1中,触控面板111与显示面板112是作为两个独立的部件来实现终端100的输入和输出功能,但是在某些实施例中,可以将触控面板111与显示面板112集成,以实现终端100的输入和输出功能。The display screen 110 can be used to display information input by the user or information provided to the user as well as various menus of the terminal 100, and can also accept user input. The display panel 112 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. The touch panel 111 is also called a touch screen or a touch sensitive screen. Etc., the contact or non-contact operation of the user on or near the user may be collected (for example, the user may use any suitable object or accessory such as a finger or a stylus on the touch panel 111 or in the vicinity of the touch panel 111, or Including the somatosensory operation; the operation includes a single point control operation, a multi-point control operation and the like, and drives the corresponding connection device according to a preset program. It should be noted that the touch panel 111 may further include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation and posture of the user, and detects a signal brought by the touch operation, and transmits a signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts the signal into the processor 101. The information that can be processed is transmitted to the processor 101, and the commands sent from the processor 101 can also be received and executed. In addition, the touch panel 111 can be implemented by using various types such as resistive, capacitive, infrared, and surface acoustic waves, and the touch panel 111 can be implemented by any technology developed in the future. In general, the touch panel 111 can cover the display panel 112, and the user can cover the display panel 112 according to the content displayed by the display panel 112 (including but not limited to a soft keyboard, a virtual mouse, a virtual button, an icon, etc.). The touch panel 111 operates on or near the touch panel 111. After detecting the operation thereon or nearby, the touch panel 111 transmits to the processor 101 to determine the user input, and then the processor 101 provides the display panel 112 according to the user input. Corresponding visual output. Although the touch panel 111 and the display panel 112 are used as two independent components to implement the input and output functions of the terminal 100 in FIG. 1, in some embodiments, the touch panel 111 may be integrated with the display panel 112. To implement the input and output functions of the terminal 100.

RF电路104、扬声器106,话筒107可提供用户与终端100之间的音频接口。音频电路105可将接收到的音频数据转换后的信号,传输到扬声器106,由扬声器106转换为声音信号输出;另一方面,话筒107可以将收集的声音信号转换为信号,由音频电路105接收后转换为音频数据,再将音频数据输出至RF电路104以发送给诸如另一终端的设备,或者将音频数据输出至存储器102,以便处理器101结合存储器102中存储的内容进行进一步的处理。另外,摄像头103可以实时采集图像帧,并传送给处理器101处理,并将处理后的结果存储至存储器102和/或将处理后的结果通过显示面板112呈现给用户。The RF circuit 104, the speaker 106, and the microphone 107 provide an audio interface between the user and the terminal 100. The audio circuit 105 can transmit the converted audio data to the speaker 106 for conversion to the sound signal output. On the other hand, the microphone 107 can convert the collected sound signal into a signal, which is received by the audio circuit 105. The audio data is then converted to audio data, and the audio data is output to the RF circuit 104 for transmission to a device such as another terminal, or the audio data is output to the memory 102 for the processor 101 to perform further processing in conjunction with the content stored in the memory 102. In addition, the camera 103 can acquire image frames in real time and transmit them to the processor 101 for processing, and store the processed results to the memory 102 and/or present the processed results to the user via the display panel 112.

处理器101是终端100的控制中心,利用各种接口和线路连接整个终端100的各个部分,通过运行或执行存储在存储器102内的软件程序和/或模块,以及调用存储在存储器102内的数据,执行终端100的各种功能和处理数据,从而对终端100进行整体监控。需要说明的是,处理器101可以包括一个或多个处理单元;处理器101还可以集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面(User Interface,UI)和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器101中。The processor 101 is the control center of the terminal 100, connecting various portions of the entire terminal 100 using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 102, and recalling data stored in the memory 102. The various functions and processing data of the terminal 100 are executed to perform overall monitoring of the terminal 100. It should be noted that the processor 101 may include one or more processing units; the processor 101 may further integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface (User Interface, UI) And the application, etc., the modem processor mainly handles wireless communication. It can be understood that the above modem processor may not be integrated into the processor 101.

终端100还可以包括给各个部件供电的电源114(比如,电池),在本发明实施 例中,电源114可以通过电源管理系统与处理器101逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。The terminal 100 may also include a power source 114 (eg, a battery) that supplies power to the various components, implemented in the present invention. In an example, the power source 114 can be logically coupled to the processor 101 through a power management system to manage functions such as charging, discharging, and power consumption through the power management system.

此外,图1中还存在未示出的部件,比如,终端100还可以包括蓝牙模块等,在此不再赘述。In addition, there is also a component that is not shown in FIG. 1 . For example, the terminal 100 may further include a Bluetooth module and the like, and details are not described herein again.

下面,以图1中所示的终端100为手机及工业相机为例,对本发明实施例的技术方案进行阐述。其中,工业相机可以被视为测试设备的一部分,对于测试设备而言,工业相机可以将拍摄到的手机的图像传递至测试设备,由测试设备进行分析处理,同理,手机也可以将自身产生或是检测到的数据传递至测试设备,供测试设备完成后续对手机屏幕的定位等操作。In the following, the technical solution of the embodiment of the present invention is described by taking the terminal 100 shown in FIG. 1 as a mobile phone and an industrial camera as an example. Among them, the industrial camera can be regarded as a part of the test equipment. For the test equipment, the industrial camera can transmit the image of the photographed mobile phone to the test equipment, and the test equipment analyzes and processes the same. Similarly, the mobile phone can also generate itself. Or the detected data is transmitted to the test device, and the test device performs subsequent operations such as positioning the mobile phone screen.

在本发明实施例中,工业相机用于拍摄包括的手机图像,之后通过工业相机和/或手机对该图像进行处理,以定位手机的屏幕区域。需要说明的是,该方法同样适用于对手机外围轮廓的定位,或是对手机屏幕呈现的某一特定区域的定位,在此不予限定。In an embodiment of the invention, an industrial camera is used to capture an included image of the handset, which is then processed by an industrial camera and/or mobile phone to locate the screen area of the handset. It should be noted that the method is also applicable to the positioning of the peripheral contour of the mobile phone or the positioning of a specific area of the mobile phone screen, which is not limited herein.

如图2所示,为工业相机对手机进行拍摄的过程示意图。其中,手机202被放置于测试设备的放置区,工业相机的镜头201所在平面与手机202所在平面平行。需要说明的是,在本发明实施例中,工业相机可以被视为测试设备的一部分,即工业相机与放置区,以及其他部件共同构成测试设备,当然工业相机也可以与测试设备单独设置,之后工业相机可以将采集到的图像传递给测试设备或是手机等其他设备上进行处理,或者,工业相机可以将处理后的图像传递给测试设备,或是通过手机等其他设备传递给测试设备,在此不予限定。As shown in FIG. 2, a schematic diagram of a process of photographing a mobile phone by an industrial camera. Wherein, the mobile phone 202 is placed in the placement area of the test device, and the plane of the lens 201 of the industrial camera is parallel to the plane of the mobile phone 202. It should be noted that, in the embodiment of the present invention, an industrial camera can be regarded as a part of a test device, that is, an industrial camera and a placement area, and other components together constitute a test device, and of course, the industrial camera can also be separately set with the test device, and then Industrial cameras can transmit the captured images to test equipment or other devices such as mobile phones for processing, or industrial cameras can transfer the processed images to test equipment or pass them to test equipment through other devices such as mobile phones. This is not limited.

如图3所示,为工业相机拍摄的手机的图像。其中,工业相机拍摄后得到的图像为灰度图像,该图像仅作为一种可能的拍摄示例,并不作为对拍摄后得到的图像的限定。As shown in Figure 3, an image of a cell phone shot for an industrial camera. Among them, the image obtained after the industrial camera is taken is a grayscale image, and the image is only used as a possible shooting example, and is not limited as an image obtained after the shooting.

在实际拍摄过程中,手机的放置角度、手机与工业相机之间的距离、工业相机相对于手机的取景角度等都会对该图像产生影响,即工业相机拍摄的手机的图像根据实际拍摄的不同而不同,在此不予限定。也就意味着,在实际在拍摄手机图像的过程中,很可能由于测试设备的放置区不平滑、或是放置区所在平面与工业相机的镜头所在平面呈一定角度等,而导致工业相机并不是垂直手机所在平面进行拍摄,从而使拍摄出的图像中,手机屏幕区域存在一定误差,比如,手机屏幕区域在正常拍摄的情况下呈矩形,而当前因畸变呈不规则或是规则的四边形等。此外,畸变后手机屏幕所呈现的图形也会受到手机屏幕区域实际形状的影响。In the actual shooting process, the angle of the mobile phone, the distance between the mobile phone and the industrial camera, the angle of view of the industrial camera relative to the mobile phone, etc., will affect the image, that is, the image of the mobile phone shot by the industrial camera is different according to the actual shooting. Different, it is not limited here. In other words, in the process of actually shooting a mobile phone image, it is likely that the industrial camera is not due to the unsmooth placement of the test device or the plane of the placement area and the plane of the lens of the industrial camera. The plane of the vertical mobile phone is photographed, so that there is a certain error in the screen area of the mobile phone. For example, the screen area of the mobile phone is rectangular in the case of normal shooting, and the current quadrangle due to distortion is irregular or regular. In addition, the graphics presented on the phone screen after distortion will also be affected by the actual shape of the screen area of the phone.

在本发明实施例中,如图4所示,手机屏幕上可以根据手机屏幕的分辨率,生成一张分辨率与手机屏幕的分辨率相同或是成比例的图样,比如,手机屏幕的分辨率为1280*720,那么图样的分辨率可以为1280*720或是A*B,其中,A的取值为1280与第一比例的乘积,B的取值为720与第二比例的乘积,第一比例与第二比例可以相同或是不同,在本发明实施例中,第一比例与第二比例的取值为正数,且图样中的标志图形按照一定规则分布,并显示在手机显示屏中。在图样中,规则分布着多个为圆形的标志图形。标志图形包括常规标志图形和特殊标志图形。其中,常规标志图形完全形同,特殊标志图形用于区分手机放置方向,该特殊标志图形的面积明显大于图样中的 常规标志图形。In the embodiment of the present invention, as shown in FIG. 4, a screen with a resolution equal to or proportional to the resolution of the screen of the mobile phone may be generated according to the resolution of the screen of the mobile phone, for example, the resolution of the screen of the mobile phone. For 1280*720, the resolution of the pattern can be 1280*720 or A*B, where A is the product of 1280 and the first ratio, and B is the product of 720 and the second ratio. A ratio and a second ratio may be the same or different. In the embodiment of the present invention, the first ratio and the second ratio are positive values, and the logo graphic in the pattern is distributed according to a certain rule and displayed on the mobile phone display screen. in. In the pattern, the rule is distributed with a plurality of logo patterns that are circular. The logo graphic includes a regular logo graphic and a special logo graphic. Wherein, the conventional logo graphic is completely identical, and the special logo graphic is used to distinguish the orientation of the mobile phone, and the area of the special logo graphic is obviously larger than that in the pattern. Regular logo graphics.

在本发明实施例中,图样中各个圆形标志图形的圆心等间距按行、列呈矩阵式分布,即横向上每两个相邻圆心的间距相同,纵向上每两个相邻圆心的间距相同。此外,图样中圆形为黑色,图样中除标志图形以外的部分为白色。需要说明的是,图样中的各个标志图形还可以为诸如椭圆等,即便发生形变,也不会影响中心点位置的图形,在此对于标志图形的形状不予限定。In the embodiment of the present invention, the equidistant equidistant spacing of each circular marking pattern in the pattern is distributed in a matrix according to rows and columns, that is, the spacing of every two adjacent centers in the lateral direction is the same, and the spacing of each two adjacent centers in the longitudinal direction is the same. In addition, the circle in the pattern is black, and the portion of the pattern other than the logo pattern is white. It should be noted that each of the logo patterns in the pattern may also be an ellipse or the like, and the shape of the center point is not affected even if the deformation occurs, and the shape of the logo pattern is not limited herein.

另外,在本发明实施例中所指的规则分布,不限于上述同一方向上相邻两个标志图形的中心点之间的间距相等的规则,还可以为在同一方向上,按照具有可变性的步长,设置各个标志图形位置的情况,比如,在同一方向上,第一个标志图形与第二个标志图形的中心点之间的间距为X,而第二个标志图形与第三个标志图形之间的间距为2X,以此类推,每增加一个标志图形,该增加的而标志图形与相邻的前一个标志图形之间的间距增加X;或者,在同一方向上,第一个标志图形与第二个标志图形的中心点之间的间距为X,而第二个标志图形与第三个标志图形之间的间距为X+2,以此类推,每增加一个标志图形,该增加的而标志图形与相邻的前一个标志图形之间的间距增加2等,在此不予限定。In addition, the rule distribution referred to in the embodiment of the present invention is not limited to the rule in which the spacing between the center points of two adjacent flag patterns in the same direction is equal, and may be in the same direction according to the variability. Step size, setting the position of each logo graphic, for example, in the same direction, the distance between the center point of the first logo graphic and the second logo graphic is X, and the second logo graphic and the third logo The spacing between the graphics is 2X, and so on, for each additional logo graphic, the spacing between the increased logo pattern and the adjacent previous logo graphic is increased by X; or, in the same direction, the first logo The distance between the graphic and the center point of the second logo graphic is X, and the distance between the second logo graphic and the third logo graphic is X+2, and so on. For each additional logo graphic, the increase is increased. The spacing between the logo pattern and the adjacent previous logo pattern is increased by 2, etc., and is not limited herein.

当然,上述具有可变性的步长可以为一个自变量不断发生变化的函数,也可以为其他实现形式,在此不予限定。另外,对于图样中颜色的分布情况,在本发明实施例中,图样采用黑白相间的形式呈现,即标志图形为黑色,其余部分为白色。考虑到工业相机拍摄后得到的图像为有灰度的图像,因此若图样中仅存在黑白两个颜色,那么成像效果会更好。由此可见,对于图样的颜色不予限定,可以为其他色彩区分较为明显的配置方式,比如,标志图形为深色,其余部分为浅色等。Of course, the variability step size may be a function in which an independent variable changes continuously, and may be other implementation forms, which is not limited herein. In addition, for the distribution of colors in the pattern, in the embodiment of the present invention, the pattern is presented in black and white, that is, the logo pattern is black, and the rest is white. Considering that the image obtained after the industrial camera is taken is an image with gray scale, if there are only two colors of black and white in the pattern, the imaging effect will be better. It can be seen that the color of the pattern is not limited, and the arrangement pattern of the other colors can be clearly distinguished. For example, the logo pattern is dark, and the rest is light color.

此外,对于图样中的特殊标志图形,可以设置为一个甚至多个,其目的在于区分手机放置的方向。具体区分方式会在后文提出,在此不予赘述。在本发明实施例中,通过对标志图形大小的调整,来区分特殊标志图形和其他标志图形,在此不予限定。In addition, for the special logo graphics in the pattern, one or more may be set, the purpose of which is to distinguish the direction in which the mobile phone is placed. The specific method of differentiation will be presented later and will not be repeated here. In the embodiment of the present invention, the special logo pattern and other logo patterns are distinguished by adjusting the size of the logo graphic, which is not limited herein.

另外,在本发明实施例中,生成图样的过程可以由手机执行,或是在工业相机、测试设备或是其他设备根据手机屏幕的分辨率生成,并将生成的图样传递给手机,供手机全屏显示,在此对于生成图样的位置、方式等不予限定。In addition, in the embodiment of the present invention, the process of generating a pattern may be performed by a mobile phone, or generated by an industrial camera, a test device, or other device according to the resolution of the mobile phone screen, and the generated pattern is transmitted to the mobile phone for full screen of the mobile phone. It is shown here that the position, manner, and the like of the generated pattern are not limited.

以规则分布的图样为例,若手机屏幕的分辨率为1280*720,那么生成的图样可以被视为分辨率为1280*720的图片。例如,图样中标志图形的分布可以为15*15,即横向和纵向分布均为15个标志图形,那么横向(手机屏幕中1280个像素点对应的边所在方向)15个标志图形中每两个标志图形中心点之间的间距为80,且靠近手机屏幕纵向边缘的标志图形的中心点到该纵向边缘的垂直距离也为80,即80个像素点,其中,80个像素点的计算方式为1280/(15+1)=80,纵向(手机屏幕中720个像素点对应的边所在方向)15个标志图像中每两个标志图形中心点之间的间距为45,且靠近手机屏幕横向边缘的标志图形的中心点到该横向边缘的垂直距离也为45,即45个像素点。其中,以特殊标志图形为例,特殊标志图形距离屏幕横向边缘的垂直距离为45,距离屏幕纵向边缘的垂直距离为80,此处所指的距离是指标志图形的中心点到边缘的距离。若特殊标志图形所在位置更靠近手机屏幕的坐标原点(手机屏幕的一个角点,即手机屏幕两条相邻的边相交后形成的交点),且以该角点为坐标原点,手机屏幕横向边上 远离该原点的方向为二维坐标系中x轴的正方向,手机屏幕纵向边上远离该原点的方向为二维坐标系中y轴的正方向,则在作为原点的角点坐标为(0,0)时,该特殊标志图形的中心点坐标为(80,45)。以此类推,可以得到图样在手机屏幕呈现时,各个标志图形的中心点的坐标。Taking a regularly distributed pattern as an example, if the resolution of the mobile phone screen is 1280*720, the generated pattern can be regarded as a picture with a resolution of 1280*720. For example, the distribution of the logo graphics in the pattern can be 15*15, that is, the horizontal and vertical distributions are 15 logo graphics, then the horizontal direction (the direction of the edge corresponding to 1280 pixels in the mobile phone screen) is 15 each of the 15 logo graphics. The distance between the center points of the logo graphics is 80, and the vertical distance from the center point of the logo pattern near the longitudinal edge of the screen of the mobile phone to the longitudinal edge is also 80, that is, 80 pixels, wherein 80 pixels are calculated as 1280/(15+1)=80, portrait (the direction of the edge corresponding to 720 pixels in the screen of the mobile phone) The spacing between the center points of each of the two logo images in the 15 logo images is 45, and is close to the lateral edge of the screen of the mobile phone. The vertical distance from the center point of the logo pattern to the lateral edge is also 45, which is 45 pixels. For example, taking the special logo graphic as an example, the vertical distance of the special logo graphic from the lateral edge of the screen is 45, and the vertical distance from the longitudinal edge of the screen is 80. The distance referred to herein refers to the distance from the center point to the edge of the logo graphic. If the location of the special logo graphic is closer to the coordinate origin of the mobile phone screen (a corner point of the mobile phone screen, that is, the intersection formed by the intersection of two adjacent sides of the mobile phone screen), and the corner point is taken as the coordinate origin, the horizontal side of the mobile phone screen On The direction away from the origin is the positive direction of the x-axis in the two-dimensional coordinate system, and the direction away from the origin on the longitudinal side of the screen of the mobile phone is the positive direction of the y-axis in the two-dimensional coordinate system, and the coordinates of the corner point as the origin are (0) , 0), the coordinates of the center point of the special logo graphic is (80, 45). By analogy, the coordinates of the center point of each logo graphic when the pattern is presented on the screen of the mobile phone can be obtained.

由此可见,在图样中存在的各个标志图形可以被视为标志图形集合,记为P={P1,P2,…,Pn},其中,n为大于或等于3的整数,而各个标志图形的中心点坐标可以被视为标志图形在屏幕像素坐标上的中心点集合,记为Ps={Ps1,Ps2,…,Psn}。需要说明的是,考虑到工业相机在拍摄手机的图像的过程中,很可能工业相机的镜头与手机屏幕并非完全平行,即呈一定角度进行拍摄,这样得到的图像会存在一定失真,即原本呈矩形的手机屏幕很可能呈规则或是不规则的四边形。一般情况下,两点可以确定一条直线,三点可以确定一个平面,而在本发明实施例中,若图像存在失真,且试图确定图像中手机屏幕所在的区域,则可以被视为确定一个平面的过程,因此至少需要确定3个点的位置才可以推算出这个平面。而每个点的位置可以对应出一个标志图形,因此,在本发明实施例中,可以设置图样中标志图形的数量为大于或是等于3个。需要说明的是,考虑到图样中至少存在一个特殊标志图形,以区分手机的放置方向,在本发明实施例中,为了在确保能够有效区分手机放置方向的情况下,尽可能准确地确定出标志图形的中心点分别在手机屏幕及工业相机拍摄的图像中的坐标转换关系,还至少需要两个标志图形的中心点坐标对(即同一个中心点分别在手机屏幕及工业相机拍摄的图像中的坐标)作为初始参数进行计算。需要说明的是,图样中标志图形的数量越多,则得出的坐标转换关系越准确,而图样中标志图形的数量越少,则占用的用于计算坐标转换关系的资源越少。因此,在本发明实施例中,可以结合当前实际需求,权衡资源占用情况及坐标转换关系的准确度,从而确定出当前所要采用的图样中配置多少个标志图形,在此不予限定。It can be seen that each of the logo patterns existing in the pattern can be regarded as a set of logo graphics, denoted as P={P1, P2, . . . , Pn}, where n is an integer greater than or equal to 3, and each of the logo graphics The center point coordinates can be regarded as a set of center points of the logo pattern on the screen pixel coordinates, denoted as Ps={Ps1, Ps2, ..., Psn}. It should be noted that, in view of the process of shooting an image of a mobile phone by an industrial camera, it is likely that the lens of the industrial camera is not completely parallel with the screen of the mobile phone, that is, the image is taken at a certain angle, and thus the obtained image may have a certain distortion, that is, the original image is present. Rectangular phone screens are likely to be regular or irregular quads. In general, two points can determine a straight line, and three points can determine a plane. In the embodiment of the present invention, if the image is distorted and an attempt is made to determine the area where the screen of the mobile phone is located in the image, it can be regarded as determining a plane. The process, so at least the position of 3 points needs to be determined before the plane can be derived. The position of each point may correspond to a logo pattern. Therefore, in the embodiment of the present invention, the number of the logo patterns in the pattern may be set to be greater than or equal to three. It should be noted that, in consideration of at least one special logo pattern in the pattern to distinguish the direction in which the mobile phone is placed, in the embodiment of the present invention, in order to ensure that the direction of the mobile phone can be effectively distinguished, the flag is determined as accurately as possible. The coordinate point of the center point of the graphic in the image captured by the mobile phone screen and the industrial camera respectively, and at least the center point coordinate pair of the two logo figures (that is, the same center point in the image taken by the mobile phone screen and the industrial camera respectively) Coordinates are calculated as initial parameters. It should be noted that the more the number of the logo patterns in the pattern, the more accurate the coordinate transformation relationship is obtained, and the fewer the number of the logo patterns in the pattern, the less resources are occupied for calculating the coordinate conversion relationship. Therefore, in the embodiment of the present invention, the accuracy of the resource occupancy and the coordinate conversion relationship can be weighed according to the current actual requirements, so as to determine how many flag patterns are configured in the current pattern to be used, which is not limited herein.

如图5所示,手机屏幕显示根据分辨率确定的规则分布的图样,工业相机垂直于手机,对手机进行拍摄后得到的手机图像。其中,在拍摄得到的灰度图像中,不仅包括标志图形,还可以包括干扰图形。在本发明实施例中,干扰图形可以为光照等外界环境因素,或是工业相机的镜头不干净,或是手机显示屏不干净等原因所产生的规则或是不规则的区域、点等。由采集到的图像可以知道,图样中包括的所有标志图形未必能被工业相机全部采集到,例如图5所示的205,也就意味着,工业相机所拍摄得到的图像中很可能仅包括部分标志图形。也正是因为如此,图样中包括的标志图形越多,最终经过对采集到的图像进行处理后所得到的处理结果越精确。As shown in FIG. 5, the mobile phone screen displays a pattern of regular distribution determined according to the resolution, and the industrial camera is perpendicular to the mobile phone, and the mobile phone image obtained after the mobile phone is photographed. Wherein, in the captured grayscale image, not only the logo graphic but also the interference graphic may be included. In the embodiment of the present invention, the interference pattern may be an external environmental factor such as illumination, or a rule that the industrial camera lens is not clean, or the mobile phone display screen is not clean, or irregular regions or points. It can be known from the acquired images that all the logo patterns included in the pattern may not be collected by the industrial camera, for example, 205 shown in FIG. 5, which means that the image captured by the industrial camera may only include a part. Logo graphic. It is also because of this that the more logo patterns are included in the pattern, the more accurate the processing results obtained after processing the collected images.

在如图5所示图像的基础上,以手机屏幕的分辨率为基础,建立二维坐标系,确定出该图像中各个标志图形的中心点坐标。需要说明的是,由于该图像中存在干扰图形,因此很可能出现部分标志图形不能准确确定的情况,而不能准确确定的各个标志图形的中心点坐标也很难从采集到的图像中确定。在本发明实施例中,可以结合已有标志图形的中心点坐标,推算出缺失或是不完整的标志图形的中心点坐标,之后得到标志图形在图像像素坐标上的中心点集合,记为Pc={Pc1,Pc2,…,Pcn}。Based on the image shown in FIG. 5, based on the resolution of the mobile phone screen, a two-dimensional coordinate system is established to determine the center point coordinates of each of the logo patterns in the image. It should be noted that, since there is an interference pattern in the image, it is likely that some of the flag patterns cannot be accurately determined, and the center point coordinates of the individual flag patterns that cannot be accurately determined are also difficult to determine from the collected images. In the embodiment of the present invention, the center point coordinates of the missing or incomplete flag pattern can be calculated by combining the coordinates of the center point of the existing logo pattern, and then the center point set of the logo pattern on the pixel coordinates of the image is obtained, which is recorded as Pc. ={Pc1,Pc2,...,Pcn}.

推算缺失或是不完整的标志图形的中心点坐标的方式可以如下至少一项:The way to calculate the coordinates of the center point of a missing or incomplete marker graphic can be as follows:

根据横向、纵向,或是斜向已确定的标志图形的中心点坐标,计算出相邻两个标 志图形的中心点坐标在横、纵两个方向上的增、减幅度,或是增、减规则,之后推算出图样中缺失或是不完整的标志图形的中心点坐标;Calculate the adjacent two targets according to the horizontal, vertical, or diagonal coordinates of the center point of the identified logo pattern. The coordinates of the center point of the graph are increased or decreased in the horizontal and vertical directions, or the increment and decrement rules, and then the coordinates of the center point of the missing or incomplete logo pattern in the pattern are derived;

若横向的标志图形数量为奇数,则确定纵向上所有位于横向中心位置的标志图形的中心点坐标,并将确定的各个中心点坐标所在的直线作为横向上两部分标志图形的对称轴,通过对称比对的方式确定图样中缺失或是不完整的标志图形的中心点坐标。If the number of the horizontal logo patterns is an odd number, the center point coordinates of all the logo patterns located at the lateral center position in the longitudinal direction are determined, and the determined straight line of each center point coordinate is used as the symmetry axis of the two-part logo pattern in the lateral direction, through the symmetry The way of comparison determines the coordinates of the center point of the missing or incomplete mark graphic in the pattern.

其中,若横向的标志图形数量为奇数,则确定纵向上所有位于横向中心位置的标志图形的中心点坐标,即在每一横行确定两个标志图形的中心点坐标,之后将属于同一横行的两个标志图形的中心点坐标作为一组,确定出该属于同一横行的两个标志图形的中心点坐标之间线段的中点,之后将得到的所有中点所在的直线作为横向上两部分标志图形的对称轴,同样通过对称比对的方式确定图样中缺失或是不完整的标志图形的中心点坐标。Wherein, if the number of the horizontal logo patterns is an odd number, the center point coordinates of all the logo patterns located at the lateral center position in the longitudinal direction are determined, that is, the center point coordinates of the two logo patterns are determined in each horizontal line, and then the two lines belonging to the same horizontal line are The center point coordinates of the logo patterns are used as a group to determine the midpoint of the line segment between the center point coordinates of the two logo patterns belonging to the same horizontal line, and the straight line of all the midpoints obtained thereafter is used as the horizontal two-part logo pattern. The axis of symmetry also determines the coordinates of the center point of the missing or incomplete mark pattern in the pattern by symmetric alignment.

需要说明的是,上述实现方式同样适用于纵向及斜项,具体实现方式可参考横向确定的方式,在此不予赘述。另外,推算缺失或是不完整的标志图形的中心点坐标的方式不仅限于上述几种例举的情况,还可以为其他基于图样分布规律而得出的推算方式,在此不予赘述。It should be noted that the above implementation manners are also applicable to the vertical and oblique items. The specific implementation manner may refer to the horizontal determination manner, and details are not described herein. In addition, the manner of calculating the coordinates of the center point of the missing or incomplete mark pattern is not limited to the above-mentioned several examples, and may be other calculation methods based on the pattern distribution rule, and will not be described herein.

考虑到图样在经过拍摄后可能存在失真、缺失或是不完整等情况,因此,为了确保能够准确确定出手机的放置方向,特殊标志图形的数量可以设置为多个,或者,直接以手机屏幕的坐标原点为起始点,以扩散的方式递增或是递减标志图形的面积或半径等参数,从而使图样中虽然不存在唯一或是多个的特殊标志图形,但图样中的各个图形呈现出可直观看到的变化规律,从而便于区分手机屏幕的坐标原点在图像中的位置,在此不予限定。Considering that the pattern may be distorted, missing or incomplete after being photographed, in order to ensure that the orientation of the mobile phone can be accurately determined, the number of special logo graphics can be set to multiple, or directly on the screen of the mobile phone. The origin of the coordinate is the starting point, and the parameters such as the area or radius of the logo graphic are incremented or decremented in a diffused manner, so that although there is no unique or multiple special logo graphics in the pattern, the graphics in the pattern are intuitively displayed. The change rule is seen, so that it is convenient to distinguish the position of the coordinate origin of the mobile phone screen in the image, which is not limited herein.

需要说明的是,上述确定标志图形在图像像素坐标上的中心点集合的操作,可以在手机、工业相机、测试设备或是其他设备上进行,在此不予限定。It should be noted that the operation of determining the central point set of the logo pattern on the image pixel coordinates may be performed on a mobile phone, an industrial camera, a test device, or other devices, and is not limited herein.

之后,可以由手机、工业相机、测试设备和其他设备中的任意一个设备,根据标志图形在图像像素坐标上的中心点集合、标志图形在屏幕像素坐标上的中心点集合,以及两个坐标系中坐标原点的位置,将图像中各个中心点坐标与图样中各个中心点坐标一一对应,从而确定图样中各个标志图形的在不同坐标系中的点坐标转换关系,即函数关系,以得到手机屏幕角点在图像中的位置坐标。After that, it can be set by any one of the mobile phone, the industrial camera, the test device and other devices according to the central point set of the logo graphic on the pixel coordinates of the image, the central point set of the logo graphic on the pixel coordinates of the screen, and the two coordinate systems. The position of the origin of the central coordinate, the coordinates of each center point in the image and the coordinates of each center point in the pattern are in one-to-one correspondence, thereby determining the point coordinate conversion relationship of each of the logo patterns in the different coordinate systems in the pattern, that is, the function relationship, to obtain the mobile phone The position coordinates of the corner point of the screen in the image.

其中,以手机屏幕的分辨率为1280*720为例,则手机屏幕的4个角点的坐标可以分别为(0,0)、(1280,0)、(0,720)和(1280,720)。之后可以依据计算得到的函数关系,确定上述4个角点在图像中的位置坐标,从而在图像中定位手机屏幕的4个角点的位置,之后通过建立相邻两个角点之间的连线,以确定出手机屏幕在图像中的位置。同样的,通过上述计算得到的点坐标转换关系,能够将手机屏幕中任意点的位置转换为图像中该任意点对应的位置,从而实现后续对手机屏幕敏感度、点击操作等的检测,在此不予限定。For example, the resolution of the mobile phone screen is 1280*720, and the coordinates of the four corner points of the mobile phone screen may be (0, 0), (1280, 0), (0, 720), and (1280, 720), respectively. Then, according to the calculated function relationship, the position coordinates of the above four corner points in the image are determined, thereby locating the positions of the four corner points of the mobile phone screen in the image, and then establishing the connection between the adjacent two corner points. Line to determine the location of the phone screen in the image. Similarly, through the point coordinate conversion relationship obtained by the above calculation, the position of any point in the screen of the mobile phone can be converted into the position corresponding to the arbitrary point in the image, thereby realizing the subsequent detection of the sensitivity of the screen of the mobile phone, the click operation, and the like. Not limited.

下面结合一个示例对本发明实施例所要阐述的方案进行更进一步地描述。The solution to be described in the embodiments of the present invention will be further described below in conjunction with an example.

在对诸如手机等终端进行屏幕检测的过程中,往往因为需要识别的内容为特定的图标或是文字,因此,对于识别精度的要求并不高。并且,对于用户的使用过程而言,用户也很难保证点击操作能够很准确地落在应用图标的中心点位置。但是,对于手机 触摸屏的精准度测试等,则需要较高的精度,且与对应用图标的识别过程相比,精准度测试往往不存在特定图标模板进行匹配,所以,如何从诸如工业相机等具备拍摄功能的设备所拍摄的图像中,实现手机屏幕特定位置的识别,显得尤为重要。In the process of performing screen detection on a terminal such as a mobile phone, the content to be recognized is often a specific icon or text, and therefore the requirement for recognition accuracy is not high. Moreover, for the user's use process, it is difficult for the user to ensure that the click operation can accurately fall to the center point position of the application icon. But for the phone The accuracy of the touch screen, etc., requires higher precision, and compared with the recognition process of the application icon, the accuracy test often does not have a specific icon template to match, so how to take a device with a shooting function such as an industrial camera In the captured images, it is particularly important to realize the recognition of the specific position of the mobile phone screen.

如图6所示,为对触摸屏敏感度的测试,即对手机屏幕的触摸测试,也就是测试手指按压位置和手机实际感应到的点位是否存在差异,从而判断触摸屏的好坏。在本发明实施例中,图6所示的打点位置1至9是相对于手机屏幕4条边界线的距离。由此可见,对于屏幕边界的确定精度要求很高。As shown in FIG. 6, the test for the sensitivity of the touch screen, that is, the touch test on the screen of the mobile phone, that is, whether there is a difference between the position of the finger press and the point actually sensed by the mobile phone, thereby judging whether the touch screen is good or bad. In the embodiment of the present invention, the dot positions 1 to 9 shown in FIG. 6 are distances with respect to the boundary line of the mobile phone screen. It can be seen that the determination accuracy of the screen boundary is very high.

另外,对于测试设备而言,手机在测试设备上每次的放置位置可能相同或是不同,并且,在同一型号的测试设备上,每次放置的手机的屏幕尺寸也可能相同或是不同。比如,倘若手机屏幕是无方向性的,那么针对像素为1080*1920的手机而言,若用户试图点击(500,500)这个点,且手机正向放置,则可以准确获取到(500,500)这个点,若手机处于倒向放置,则用户实际应该点击的位置为(1080-500,1920-500)这个点,这样一来就会使实际的点击位置与用户试图点击的位置产生较大误差。因此,为了解决手机屏幕定位的问题,采用本发明实施例提供的技术方案,还能够减少人工通过视觉来识别手机屏幕的过程。具体区分手机屏幕放置方向的方式,可以参考前文提及的借助图样中标志图形的不同来实现,在此不予赘述。In addition, for the test equipment, the position of the mobile phone on the test equipment may be the same or different each time, and on the same type of test equipment, the screen size of the mobile phone placed each time may be the same or different. For example, if the mobile phone screen is non-directional, then for a mobile phone with 1080*1920 pixels, if the user tries to click (500,500) and the mobile phone is placed in the forward direction, the (500,500) point can be accurately obtained. If the phone is placed in the reverse position, the user should actually click on the point (1080-500, 1920-500), which will cause a large error between the actual click position and the position the user is trying to click. Therefore, in order to solve the problem of the screen positioning of the mobile phone, the technical solution provided by the embodiment of the present invention can also reduce the process of manually recognizing the screen of the mobile phone through visual. The manner of distinguishing the orientation of the screen of the mobile phone can be implemented by referring to the difference of the logo pattern in the drawing mentioned above, and details are not described herein.

在将手机置于测试设备的放置区域后,若手机处于亮屏状态,则通过工业相机对手机进行拍摄,得到如图3所示的图像。其中,手机屏幕的边界即为手机屏幕206中手机亮屏区域的边沿207。由图3可知,手机屏幕206包括4条手机亮屏区域边沿207所围成的手机亮屏区域和黑边208,其中,手机亮屏区域和手机屏幕206贴合的黑边208之间的边界非常明显,可以通过视觉算法拟合的方式,拟合出手机屏幕的4条边界,而这4条边界所相交得到的交点即手机屏幕的4个角点。After the mobile phone is placed in the placement area of the test device, if the mobile phone is in a bright state, the mobile phone is photographed by an industrial camera, and an image as shown in FIG. 3 is obtained. The border of the mobile phone screen is the edge 207 of the bright screen area of the mobile phone screen 206. As can be seen from FIG. 3, the mobile phone screen 206 includes a mobile phone bright screen area and a black border 208 surrounded by four mobile phone bright screen area edges 207, wherein the boundary between the mobile phone bright screen area and the black screen 208 of the mobile phone screen 206 is attached. Obviously, the four boundaries of the mobile phone screen can be fitted by visual algorithm fitting, and the intersections obtained by the four boundaries are the four corner points of the mobile phone screen.

在视觉算法拟合的过程中,需要对图3所示的图像进行像素点的放大,其中,以图3右下方手机屏幕的角点为例,可以得到如图7所示的灰度图像,之后通过直线拟合的方式,得到黑白分明的图像,从而确定手机屏幕的边界轮廓,进而确定角点的位置。In the process of visual algorithm fitting, the pixel shown in FIG. 3 needs to be enlarged, wherein the gray image shown in FIG. 7 can be obtained by taking the corner of the mobile phone screen at the lower right of FIG. 3 as an example. Then, by means of straight line fitting, a black and white image is obtained, thereby determining the boundary contour of the screen of the mobile phone, and then determining the position of the corner point.

需要说明的是,由于直线拟合的方式主要是通过设置一个阈值,之后将灰度图像参考已设定的阈值生成黑白图像,进而结合黑白图像中不规则的边缘来拟合成直线。另外,阈值大小设置的不同,也会影响最终确定出的手机屏幕边界的不同。由图7可以知道,采用直线拟合的方式虽然能确定出角点的位置,但很难拟合出准确的直线,比如,对于手机屏幕而言,很可能将矩形的屏幕区域拟合成不规则的四边形区域,从而影响角点的定位。It should be noted that the straight line fitting method is mainly to set a threshold value, and then the gray image is generated by referring to the set threshold value to generate a black and white image, and then combined with the irregular edge in the black and white image to fit a straight line. In addition, the difference in threshold size settings will also affect the final difference in the boundaries of the phone screen. As can be seen from Fig. 7, although the straight line fitting method can determine the position of the corner point, it is difficult to fit an accurate straight line. For example, for a mobile phone screen, it is possible to fit the rectangular screen area to no. A regular quadrilateral area that affects the positioning of the corner points.

在本发明实施例中,采用前文提及的方式,结合手机屏幕的像素,生成图样,之后在对手机进行拍摄时,使手机全屏显示该图样。其中,图样中标志图形的数量越多,则使用最小二乘法计算转换关系后得到的用于确定其他任意点坐标转换关系的算法的鲁棒性越强。In the embodiment of the present invention, the pattern is generated in combination with the pixels of the screen of the mobile phone in the manner mentioned above, and then the mobile phone is displayed in full screen when the mobile phone is photographed. The more the number of the logo patterns in the pattern, the stronger the robustness of the algorithm for determining the coordinate transformation relationship of other arbitrary points obtained by using the least squares method to calculate the conversion relationship.

另外,在图样生成的过程中,生成图样的设备可以使用通用串行总线(Universal Serial Bus,USB)与手机连接,以建立手机与生成图样的设备之间的通信连接,从而在生成图样的设备确定手机屏幕像素且生成图样后,将图样推送至手机,手机可以将 该图样存储在本地存储区域,之后手机可以自动全屏显示该图样,以做好测试准备。In addition, during the pattern generation process, the device that generates the pattern can be connected to the mobile phone using a Universal Serial Bus (USB) to establish a communication connection between the mobile phone and the device that generates the pattern, thereby generating the pattern device. After determining the pixel of the mobile phone screen and generating the pattern, push the pattern to the mobile phone, and the mobile phone can The pattern is stored in the local storage area, after which the phone can automatically display the pattern in full screen to prepare for testing.

在本发明实施例中,工业相机采集图像时,可以使工业相机的图像传感器与手机屏幕平行,至于工业相机的物距,则以视野大小适应手机的尺寸为准,在此不予限定。其中,上述图像传感器包括但不仅限于如下中的一项:电荷藕合器件图像传感器(Charge Coupled Device,CCD)、互补金属氧化物半导体(Complementary Metal-Oxide-Semiconductor,CMOS)。In the embodiment of the present invention, when an industrial camera captures an image, the image sensor of the industrial camera can be parallel to the screen of the mobile phone. As for the object distance of the industrial camera, the size of the field of view is adapted to the size of the mobile phone, which is not limited herein. The image sensor includes, but is not limited to, one of the following: a Charge Coupled Device (CCD), and a Complementary Metal-Oxide-Semiconductor (CMOS).

需要说明的是,工业相机所拍摄到的图像为灰度图像,为了减少后续灰度图像给识别过程带来的误差,在本发明实施例中,可以预先对采集到的灰度图像进行处理,比如,采用最大类间方差法(OSTU),结合预设或是当前自动生成的阈值对图像进行分割,从而得到黑白分明的图像。即将工业相机拍摄出的图5所示的灰度图像经过处理后,得到如图8所示的黑白图像。It should be noted that the image captured by the industrial camera is a grayscale image. In order to reduce the error caused by the subsequent grayscale image to the recognition process, in the embodiment of the present invention, the collected grayscale image may be processed in advance. For example, the maximum inter-class variance method (OSTU) is used to segment the image in combination with a preset or a currently automatically generated threshold to obtain a black and white image. The grayscale image shown in Fig. 5 taken by the industrial camera is processed to obtain a black and white image as shown in Fig. 8.

之后,用于进行图像处理的设备,比如,手机、工业相机、测试设备或是其他设备,可以通过轮廓提取的方式获取手机屏幕区域。考虑到经过OSTU自动阈值分割所得到的图像中,手机屏幕区域的边缘很可能存在诸如毛边等凹凸不平的情况,因此为了保证获取到的手机屏幕区域完全包括手机屏幕,可以通过对前面轮廓提取后得到的最大轮廓进行处理,以找到与该最大轮廓外接的最小矩形,从而初步确定手机屏幕区域的范围。Then, the device for image processing, such as a mobile phone, an industrial camera, a test device, or other device, can acquire the screen area of the mobile phone by means of contour extraction. Considering the image obtained by the OSTU automatic threshold segmentation, the edge of the screen area of the mobile phone is likely to have irregularities such as burrs, so in order to ensure that the acquired screen area of the mobile phone completely includes the screen of the mobile phone, the front contour can be extracted. The resulting maximum contour is processed to find the smallest rectangle circumscribing the maximum contour to initially determine the extent of the screen area of the handset.

为了方便对图像中各个标志图形的点坐标进行确定,在本发明实施例中,可以将初步确定的手机屏幕区域的范围作为查找图样中各个标志图形的范围,以从工业相机所采集的图像中初步确定的手机屏幕区域内提取轮廓信息,即该图像中各个标志图形的轮廓信息。其中,轮廓信息包括但不仅限于如下中的至少一项:标志图形的面积、半径等。之后根据轮廓信息对该图像中所能够显示出的各个标志图形进行滤除无效轮廓的处理,从而滤除因光照等原因而产生的无效标志图形。In order to facilitate the determination of the point coordinates of each of the logo patterns in the image, in the embodiment of the present invention, the range of the initially determined screen area of the mobile phone can be used as the range of each of the logo patterns in the search pattern to be collected from the image captured by the industrial camera. The outline information, that is, the outline information of each of the logo patterns in the image, is extracted in the initially determined area of the screen of the mobile phone. The contour information includes, but is not limited to, at least one of the following: an area, a radius, and the like of the logo pattern. Then, according to the contour information, the process of filtering out the invalid contour is performed on each of the flag patterns that can be displayed in the image, thereby filtering out the invalid flag pattern caused by illumination or the like.

之后可以需选择性地恢复缺失或是不完整的标志图形,以确定出已缺失或是不完整的标志图形的中心点坐标。需要说明的是,恢复不完整标志图形的方式可以是基于标志图形本身的定义出发,比如,当前标志图形为圆形,那么可以从圆的定义触发,从中心点到周边任何一点的距离完全相等的图形即为本发明实施例图样中的标志图形,从而依据这个原理将圆形的轮廓补充完整,具体实现方式可以参照现有技术,在此不予赘述。恢复缺失的标志图形的方式,则可以先依据已有标志图形的中心点坐标之间的关系,确定出缺失的标志图形的中心点坐标,之后结合其他标志图形的轮廓信息,确定出已缺失的标志图形的轮廓特征,比如,圆的半径大小等,从而恢复已缺失的标志图形。当然在本发明实施例中,也可以直接依据已经存在的各个标志图形的中心点坐标之间的相对关系,确定出已缺失或是不完整的标志图形的中心点坐标,而并不需要补足不完整的标志图形,也无需复原出已缺失的标志图形。It is then necessary to selectively recover missing or incomplete flag graphics to determine the center point coordinates of the missing or incomplete marker graphic. It should be noted that the manner of restoring the incomplete logo pattern may be based on the definition of the logo graphic itself. For example, if the current logo graphic is circular, it can be triggered from the definition of the circle, and the distance from the center point to any point in the periphery is completely equal. The figure is a logo pattern in the pattern of the embodiment of the present invention, so that the circular contour is complemented according to the principle. The specific implementation manner can refer to the prior art, and details are not described herein. To restore the missing logo pattern, the center point coordinates of the missing logo pattern can be determined according to the relationship between the center point coordinates of the existing logo pattern, and then the contour information of other logo patterns is combined to determine the missing The outline features of the logo graphic, such as the radius of the circle, etc., thereby restoring the missing logo pattern. Of course, in the embodiment of the present invention, the center point coordinates of the missing or incomplete flag graphic may be directly determined according to the relative relationship between the coordinates of the center points of the existing flag patterns. The complete logo graphic does not need to restore the missing logo graphic.

在对该图像进行处理之后,可以选择性地对各个标志图形进行进一步的处理,比如,逐个对圆形轮廓进行随机抽样一致性算法(Random Sample Consensus,RANSAC)进行圆提取,即检测圆形轮廓上各个点距离圆心的位置,通过比对,滤除圆形轮廓上偏差较大的点,之后依据未滤除的点进行最小二乘法拟合,从而得到诸如半径等精细处理后的标志图形参数。 After the image is processed, each of the logo patterns can be further processed, for example, a random sample consistency algorithm (Random Sample Consensus, RANSAC) is used to perform round extraction, that is, to detect a circular contour. The position of each point from the center of the circle is filtered to remove the point with large deviation on the circular contour, and then the least squares fitting is performed according to the unfiltered point, thereby obtaining the finely processed flag graphic parameter such as radius. .

在本发明实施例中,为了有效定位手机屏幕的正方向,若图样为图4所示的图像,则可以结合标志图形参数,确定出最大圆形与其他各个圆形的相对位置,从而确定手机屏幕的正方向,再依据这个正方向、各个标志图形在手机屏幕及工业相机所采集的图像中分别的中心点坐标,将两个坐标系上的各个点坐标一一对应,之后可以通过最小二乘法计算两个点坐标集合之间的转换关系,即计算旋转平移缩放转换矩阵。In the embodiment of the present invention, in order to effectively locate the positive direction of the screen of the mobile phone, if the pattern is the image shown in FIG. 4, the relative position of the largest circle and the other rounds may be determined in combination with the logo pattern parameter, thereby determining the mobile phone. The positive direction of the screen, according to the positive direction, the coordinates of the center point of each logo graphic in the image captured by the mobile phone screen and the industrial camera, the coordinates of each point on the two coordinate systems are one-to-one correspondence, and then the minimum two can be passed. Multiplication calculates the transformation relationship between the two point coordinate sets, that is, calculates the rotation translation scaling transformation matrix.

其中,上文所提及的诸如最小二乘法等算法为现有技术,可以参考现有技术中的实现条件、计算方式等,在此不予赘述。The above-mentioned algorithms, such as the least squares method, are prior art, and reference may be made to the implementation conditions, calculation methods, and the like in the prior art, and details are not described herein.

在准确确定出转换关系之后,在已知手机屏幕角点坐标的情况下,可以结合转换关系,计算出各个手机屏幕角点在该图像中的位置,且能够确定出手机屏幕的正方向。之后通过4个角点的位置,可以在该图像中拟合出手机屏幕的4条边界线,从而确定手机屏幕的区域。此外,依据该转换关系,还能够确定出手机屏幕上任意一点经过转换后,在该图像中的位置。After accurately determining the conversion relationship, in the case of knowing the corner coordinates of the mobile phone screen, the conversion relationship can be combined to calculate the position of each mobile phone screen corner point in the image, and the positive direction of the mobile phone screen can be determined. Then, through the position of the four corner points, four boundary lines of the mobile phone screen can be fitted in the image to determine the area of the screen of the mobile phone. In addition, according to the conversion relationship, it is also possible to determine the position in the image after any conversion on the screen of the mobile phone.

为了进一步保证转换关系的可靠性,在本发明实施例中,还可以重新依据手机屏幕的分辨率生成图样,并重复执行上述实现方式,从而得到另一个转换关系,之后将两个转换关系进行比对、调整,从而得出更加准确的转换方式,即最终用于确定两个坐标系之间对应关系的转换关系。需要说明的是,随着重新确定转换关系的次数的增多,使最终得到的转换关系更加准确。当然,也可以通过采用当前转换关系对手机屏幕上的某一个或是多个位置进行检测,从而判断当前得到的转换关系是否准确,并结合实际情况,对该转换关系进行微调等,在此不予赘述。In order to further ensure the reliability of the conversion relationship, in the embodiment of the present invention, the pattern may be generated according to the resolution of the screen of the mobile phone, and the implementation manner may be repeatedly executed, thereby obtaining another conversion relationship, and then comparing the two conversion relationships. Pairing, adjusting, and thus a more accurate conversion method, that is, the conversion relationship that is ultimately used to determine the correspondence between the two coordinate systems. It should be noted that as the number of times of re-determining the conversion relationship increases, the resulting conversion relationship is more accurate. Of course, it is also possible to detect one or more positions on the screen of the mobile phone by using the current conversion relationship, thereby judging whether the currently obtained conversion relationship is accurate, and fine-tuning the conversion relationship according to the actual situation, etc., Give a brief description.

由此可见,本发明实施例可以有效应用于手机屏幕的自动定位,使类似于手机屏幕内指定位置的打点划线、图标位置的准确获取等都能够更加准确的定位。另外,由于图样是基于手机屏幕的像素生成的,因此,本发明实施例所采用的实现方式能够有效适用于各个机型的手机、平板电脑等具备显示屏的电子设备的检测。并且,在本发明实施例所提供的实现方式中,对于诸如手机等待测试的设备在测试设备上的放置方向,并不做限定,也就意味着,检测过程受环境影响的几率较低,从而提高整个检测过程的实现精度。It can be seen that the embodiment of the present invention can be effectively applied to the automatic positioning of the screen of the mobile phone, so that the dot-dash line similar to the designated position in the screen of the mobile phone, the accurate acquisition of the icon position, and the like can be more accurately positioned. In addition, since the pattern is generated based on the pixels of the screen of the mobile phone, the implementation adopted by the embodiment of the present invention can be effectively applied to the detection of the electronic device having the display screen, such as a mobile phone or a tablet computer of each model. Moreover, in the implementation manner provided by the embodiment of the present invention, the placement direction of the device such as the mobile phone waiting for testing on the testing device is not limited, which means that the probability of the detection process being affected by the environment is low, thereby Improve the accuracy of the entire inspection process.

以手机为例,通常情况下,手机屏幕很可能由于贴合的工艺误差,而使手机屏幕的角点不一定就是手机屏幕所在坐标系的原点,但采用本发明实施例所提供的点坐标转换的实现方式,就可以有效避免因上述问题而引起的误差。此外,由于手机屏幕漏光、采集图像的质量等问题也会或多或少对测试过程产生影响,而采用本发明实施例所提供的实现方案,则排除了手机屏幕边界加工工艺的影响,且图样中的标志图形的数量越多,则用于确定转换关系的信息越丰富,也就会使确定出的转换关系更加精确,从而提高在图像中拟合出与手机屏幕所在坐标系对应位置的点坐标的精度。Taking a mobile phone as an example, in general, the screen of the mobile phone is likely to be the origin of the coordinate system of the mobile phone screen due to the process error of the bonding, but the point coordinate conversion provided by the embodiment of the present invention is adopted. The implementation of the method can effectively avoid the errors caused by the above problems. In addition, the problem of the light leakage of the mobile phone screen, the quality of the captured image, and the like may affect the testing process more or less. However, the implementation scheme provided by the embodiment of the present invention excludes the influence of the processing process of the screen boundary of the mobile phone, and the pattern is The more the number of logo patterns in the more, the richer the information used to determine the conversion relationship, the more accurate the determined conversion relationship will be, thereby improving the point in the image that fits the position corresponding to the coordinate system of the mobile phone screen. The precision of the coordinates.

比如,在得到转换关系后,手机可以将手机屏幕呈现的界面进行切换,例如,关闭当前全屏显示的图样,呈现手机的主界面,如图9所示。For example, after obtaining the conversion relationship, the mobile phone can switch the interface presented by the mobile phone screen, for example, closing the current full-screen display and presenting the main interface of the mobile phone, as shown in FIG.

若当前试图模拟用户点击日历图标的操作,从而检测手机屏幕中日历图标所在区域的敏感度,那么,测试设备可以预先获取用户在点击日历图标时,实际需要点击的位置,即日历图标在手机屏幕上的显示位置。在本发明实施例中,参照对手机屏幕进行定位所采取的实现方式,同样以图9所示的手机屏幕左上方的角点为二维坐标系的 原点,建立基于手机屏幕的二维坐标系,其中,建立得到的坐标系与手机屏幕定位时在手机屏幕上建立的二维坐标系相同,手机屏幕的分辨率仍为1280*720。按照日历图标中心点在手机屏幕中的显示位置,以及已经建立好的二维坐标系,得到日历图标中心点坐标,即如图10所示的点坐标(288,213)。也就意味着,用户在实际操作过程中,若试图点击日历图标,则需要在该二维坐标系中的(288,213)对应的点上产生点击操作。也就意味着,上述点坐标(288,213)作为测试设备的输入。If the current attempt to simulate the user's click on the calendar icon to detect the sensitivity of the area of the calendar icon in the mobile phone screen, the test device can pre-acquire the location that the user actually needs to click when clicking the calendar icon, that is, the calendar icon is on the mobile phone screen. The display position on the top. In the embodiment of the present invention, referring to the implementation manner of positioning the mobile phone screen, the corner point on the upper left side of the mobile phone screen shown in FIG. 9 is also a two-dimensional coordinate system. The origin, the two-dimensional coordinate system based on the screen of the mobile phone is established, wherein the established coordinate system is the same as the two-dimensional coordinate system established on the screen of the mobile phone when the screen of the mobile phone is positioned, and the resolution of the screen of the mobile phone is still 1280*720. According to the display position of the center point of the calendar icon in the screen of the mobile phone, and the established two-dimensional coordinate system, the coordinates of the center point of the calendar icon, that is, the point coordinates (288, 213) shown in FIG. 10 are obtained. In other words, if the user attempts to click the calendar icon during the actual operation, the user needs to generate a click operation on the corresponding point in the two-dimensional coordinate system (288, 213). This means that the above point coordinates (288, 213) are used as input to the test equipment.

如图11所示,为工业相机拍摄到的手机的灰度图像经过处理后得到的黑白图像,基于之前得到的转换关系,计算(288,213)这个点坐标在图11所示的二维坐标系中对应的点坐标,即(1620,532)。也就意味着,测试设备可以根据输入的点坐标(288,213)及得到的转换关系,确定机械臂在上述工业相机采集到的图像中需要执行的点击操作的位置。对于机械臂而言,在测试设备完成上述转换关系的计算之后,会控制机械臂在坐标为(1620,532)的点上执行点击操作。As shown in FIG. 11, the black-and-white image obtained by processing the grayscale image of the mobile phone captured by the industrial camera is calculated based on the previously obtained conversion relationship, and the coordinates of the point (288, 213) are calculated in the two-dimensional coordinate system shown in FIG. Corresponding point coordinates, ie (1620, 532). In other words, the test device can determine the position of the click operation that the robot arm needs to perform in the image collected by the industrial camera according to the input point coordinates (288, 213) and the obtained conversion relationship. For the robot arm, after the test device completes the calculation of the above conversion relationship, the robot arm is controlled to perform a click operation at a point of coordinates (1620, 532).

需要说明的是,由于转换关系在确定时已经考虑到了手机放置方向会发生改变的情况,因此,得到的转换关系中已经完成了手机放置方向的转换,也就意味着,无论手机是采取怎样的方向进行放置,一旦确定转换关系之后,在手机放置位置不发生改变,且工业相机采集图像时与手机的相对位置不发生改变,则在后续根据手机屏幕上的一点找到图像中的一点的过程中,就可以直接套用已有的转换关系,而无需进行其他操作。另外,为了方便对手机屏幕上各个位置执行点击操作,减少手机与测试设备之间的数据交互,在本发明实施例中,手机可以预先将需要进行测试的界面中呈现的各个图标在手机屏幕上的坐标发送至测试设备,待测试设备需要某一图标在手机屏幕上的坐标时,可以直接将之前接收到的手机发送的该某一图标的坐标作为输入,通过坐标转换的方式得到该某一图标在图像中的位置,并将用于表示该某一图标在图像中的位置的坐标传递给机械臂,供机械臂在图像中对应的坐标上实现点击操作。It should be noted that since the conversion relationship has already taken into consideration that the direction in which the mobile phone is placed will change, the conversion relationship of the mobile phone has been completed in the obtained conversion relationship, which means that no matter what the mobile phone is taking. Positioning is performed. Once the conversion relationship is determined, the position of the mobile phone does not change, and the relative position of the mobile phone when the industrial camera captures the image does not change, then in the process of finding a point in the image according to a point on the screen of the mobile phone. , you can directly apply the existing conversion relationship without any other operations. In addition, in order to facilitate performing a click operation on each position on the screen of the mobile phone, and reducing data interaction between the mobile phone and the test device, in the embodiment of the present invention, the mobile phone may pre-set each icon presented in the interface that needs to be tested on the screen of the mobile phone. The coordinates are sent to the test device. When the device to be tested needs the coordinates of an icon on the screen of the mobile phone, the coordinates of the icon sent by the previously received mobile phone can be directly input, and the coordinate is obtained by means of coordinate conversion. The position of the icon in the image, and the coordinates indicating the position of the icon in the image are transmitted to the robot arm for the robot arm to perform a click operation on the corresponding coordinates in the image.

由此可见,利用图样中的各个标志图形,可以有效确定出手机屏幕与工业相机拍摄的手机的图像之间点坐标的转换关系,而借助该转换关系不仅能够在该图像中定位出手机屏幕角点的位置,进一步地还可以定位出手机屏幕的区域,同样的,依据该转换关系,还能够在该图像中定位出手机屏幕中的任意一点或是多点的位置。It can be seen that by using each of the logo patterns in the pattern, the conversion relationship of the coordinates of the point between the screen of the mobile phone and the image of the mobile phone taken by the industrial camera can be effectively determined, and the conversion relationship can not only locate the screen angle of the mobile phone in the image. The position of the point can further locate the area of the screen of the mobile phone. Similarly, according to the conversion relationship, the position of any point or multiple points in the screen of the mobile phone can be located in the image.

在上述终端中可以设置有终端屏幕的定位装置,终端屏幕的定位装置为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。A positioning device of the terminal screen may be disposed in the terminal, and the positioning device of the terminal screen includes a hardware structure and/or a software module corresponding to each function in order to implement the above functions. Those skilled in the art will readily appreciate that the present invention can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.

本发明实施例可以根据上述方法示例对终端屏幕的定位装置进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。 The embodiment of the present invention may divide the function module of the positioning device of the terminal screen according to the above method example. For example, each function module may be divided according to each function, or two or more functions may be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.

如图12所示,为上述实施例中所涉及的终端屏幕的定位装置的一种可能的结构示意图。终端屏幕的定位装置30包括:获取模块31和确定模块32。其中,获取模块31用于支持终端屏幕的定位装置30完成第一图像的获取;确定模块32用于支持终端屏幕的定位装置30确定第一坐标与第二坐标之间的转换关系,以及依据转换关系实现在第一图像中定位终端屏幕的区域。在本发明实施例中,终端屏幕的定位装置30还可以包括存储模块33,用于存储终端的程序代码和数据;通信模块34,用于支持终端屏幕的定位装置30与终端屏幕的定位装置所在的终端,比如,测试设备中各个模块之间进行数据交互,和/或支持该测试设备与诸如手机、工业相机等其他设备之间的通信;和/或用于本文所描述的技术的其它过程。As shown in FIG. 12, it is a possible structural diagram of the positioning device of the terminal screen involved in the above embodiment. The positioning device 30 of the terminal screen includes an acquisition module 31 and a determination module 32. The obtaining module 31 is configured to support the positioning device 30 of the terminal screen to complete the acquisition of the first image; the determining module 32 is configured to support the positioning device 30 of the terminal screen to determine the conversion relationship between the first coordinate and the second coordinate, and according to the conversion. The relationship implements an area in which the terminal screen is located in the first image. In the embodiment of the present invention, the positioning device 30 of the terminal screen may further include a storage module 33 for storing program codes and data of the terminal, and a communication module 34 for supporting the positioning device 30 of the terminal screen and the positioning device of the terminal screen. Terminal, for example, data interaction between modules in a test device, and/or support for communication between the test device and other devices such as cell phones, industrial cameras, and/or other processes for the techniques described herein .

其中,确定模块32可以实现为处理器或控制器,例如可以是中央处理器(Central Processing Unit,CPU),通用处理器,数字信号处理器(Digital Signal Processor,DSP),专用集成电路(Application-Specific Integrated Circuit,ASIC),现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本发明公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信模块34可以实现为收发器、收发电路或通信接口等。存储模块33可以实现为存储器。The determining module 32 can be implemented as a processor or a controller, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), and an application specific integrated circuit (Application- Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure. The processor may also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like. The communication module 34 can be implemented as a transceiver, a transceiver circuit, or a communication interface or the like. The storage module 33 can be implemented as a memory.

若确定模块32实现为处理器、通信模块34实现为收发器、存储模块33实现为存储器,则如图13所示,终端40包括:处理器41、收发器42、存储器43,以及总线44。其中,处理器41、收发器42和存储器43通过总线44相互连接;总线44可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图13中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。If the determination module 32 is implemented as a processor, the communication module 34 is implemented as a transceiver, and the storage module 33 is implemented as a memory, as shown in FIG. 13, the terminal 40 includes a processor 41, a transceiver 42, a memory 43, and a bus 44. The processor 41, the transceiver 42 and the memory 43 are connected to each other through a bus 44. The bus 44 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Wait. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 13, but it does not mean that there is only one bus or one type of bus.

结合本发明公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(Random Access Memory,RAM)、闪存、只读存储器(Read Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以部署在同一设备中,或者,处理器和存储介质也可以作为分立组件部署在于不同的设备中。The steps of a method or algorithm described in connection with the present disclosure may be implemented in a hardware, or may be implemented by a processor executing software instructions. The software instructions may be composed of corresponding software modules, which may be stored in a random access memory (RAM), a flash memory, a read only memory (ROM), an erasable programmable read only memory ( Erasable Programmable ROM (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Register, Hard Disk, Mobile Hard Disk, Compact Disc Read-Only Memory (CD-ROM), or any of those well known in the art. Other forms of storage media. An exemplary storage medium is coupled to the processor to enable the processor to read information from, and write information to, the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium may be deployed in the same device, or the processor and the storage medium may be deployed as separate components in different devices.

以上所述的具体实施方式,对本发明实施例的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明实施例的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明实施例的保护范围之内。 The specific embodiments of the present invention have been described in detail with reference to the embodiments of the present invention. The scope of the invention is to be construed as being included in the scope of the embodiments of the invention.

Claims (25)

一种终端屏幕的定位方法,其特征在于,所述方法包括:A method for locating a terminal screen, the method comprising: 获取第一图像,所述第一图像为拍摄的终端的图像,所述终端设置有屏幕,所述屏幕显示图样,所述图样包括规则分布的标志图形;Acquiring a first image, the first image is an image of a photographed terminal, the terminal is provided with a screen, the screen displays a pattern, and the pattern includes a regularly distributed logo graphic; 确定第一坐标与第二坐标之间的转换关系,所述第一坐标用于表示所述标志图形在所述屏幕上的位置,所述第二坐标用于表示所述标志图形在所述第一图像中的位置;Determining a conversion relationship between the first coordinate and the second coordinate, the first coordinate is used to indicate a position of the logo graphic on the screen, and the second coordinate is used to represent the logo graphic in the first a position in an image; 根据所述转换关系,确定所述第一图像中所述屏幕的区域。An area of the screen in the first image is determined according to the conversion relationship. 根据权利要求1所述的方法,其特征在于,所述根据所述转换关系,确定所述第一图像中所述屏幕的区域,包括:The method according to claim 1, wherein the determining the area of the screen in the first image according to the conversion relationship comprises: 根据所述转换关系及第三坐标,确定第四坐标,所述第三坐标用于表示所述屏幕上各个角点在所述屏幕上的位置,所述第四坐标用于表示所述各个角点在所述第一图像中的位置;Determining, according to the conversion relationship and the third coordinate, a fourth coordinate, where the third coordinate is used to indicate a position of each corner point on the screen on the screen, and the fourth coordinate is used to represent the each corner Pointing a position in the first image; 在所述第一图像中,确定以所述第四坐标对应的所述各个角点的位置为端点所构成的区域为所述屏幕在所述第一图像中的区域。In the first image, an area formed by determining a position of each of the corner points corresponding to the fourth coordinate as an end point is an area of the screen in the first image. 根据权利要求1或2所述的方法,其特征在于,所述图样包括至少三个标志图形。A method according to claim 1 or 2, wherein said pattern comprises at least three logo patterns. 根据权利要求1至3中任意一项所述的方法,其特征在于,所述规则分布包括所述标志图形的中心点等间距按行、列呈矩阵式分布。The method according to any one of claims 1 to 3, wherein the rule distribution comprises a center point equidistance of the logo pattern distributed in a matrix in rows and columns. 根据权利要求1至4中任意一项所述的方法,其特征在于,所述标志图形包括常规标志图形和特殊标志图形,所述常规标志图形完全相同,所述特殊标志图形异于所述常规标志图形,且所述特殊标志图形用于区分所述终端在拍摄时的放置方向。The method according to any one of claims 1 to 4, wherein the logo pattern comprises a regular logo pattern and a special logo pattern, the conventional logo pattern being identical, the special logo pattern being different from the conventional A logo graphic, and the special logo graphic is used to distinguish a direction in which the terminal is placed at the time of shooting. 根据权利要求1至5中任意一项所述的方法,其特征在于,所述标志图形为黑色,所述图样中除所述标志图形以外的区域为白色。The method according to any one of claims 1 to 5, wherein the logo pattern is black, and an area other than the logo pattern in the pattern is white. 根据权利要求1至6中任意一项所述的方法,其特征在于,所述标志图形因拍摄角度的变化而发生形变后,所述标志图形的中心点位置不变。The method according to any one of claims 1 to 6, wherein the position of the center point of the logo pattern does not change after the logo pattern is deformed due to a change in the photographing angle. 根据权利要求7所述的方法,其特征在于,所述标志图形为圆形或椭圆形。The method of claim 7 wherein said logo pattern is circular or elliptical. 根据权利要求1至8中任意一项所述的方法,其特征在于,所述图样的分辨率与所述屏幕的分辨率相同。The method according to any one of claims 1 to 8, wherein the resolution of the pattern is the same as the resolution of the screen. 一种终端屏幕的定位方法,其特征在于,所述方法包括:A method for locating a terminal screen, the method comprising: 终端通过屏幕显示图样,所述图样包括规则分布的标志图形,所述第一坐标用于表示所述标志图形在所述屏幕上的位置;The terminal displays a pattern through a screen, the pattern includes a regularly distributed logo graphic, and the first coordinate is used to indicate a position of the logo graphic on the screen; 工业相机获取第一图像并确定第二坐标,所述第二坐标用于表示所述标志图形在所述第一图像中的位置,所述第一图像为拍摄的所述终端的图像;The industrial camera acquires a first image and determines a second coordinate, the second coordinate is used to indicate a position of the logo graphic in the first image, and the first image is an image of the photographed terminal; 测试设备获取所述第一坐标与所述第二坐标,并确定所述第一坐标与所述第二坐标之间的转换关系;The testing device acquires the first coordinate and the second coordinate, and determines a conversion relationship between the first coordinate and the second coordinate; 所述测试设备根据所述转换关系,确定所述第一图像中所述屏幕的区域。The test device determines an area of the screen in the first image according to the conversion relationship. 根据权利要求10所述的方法,其特征在于,在所述测试设备确定所述第一坐标与所述第二坐标之间的转换关系之后,所述方法进一步包括:The method of claim 10, wherein after the testing device determines a conversion relationship between the first coordinate and the second coordinate, the method further comprises: 所述测试设备获取第五坐标,所述第五坐标用于表示所述屏幕上的待测试位置; The testing device acquires a fifth coordinate, where the fifth coordinate is used to represent a location to be tested on the screen; 所述测试设备按照所述转换关系对所述第五坐标进行转换,得到第六坐标,并向所述机械臂发送,所述第六坐标用于表示所述待测试位置在所述第一图像中的位置;The testing device converts the fifth coordinate according to the conversion relationship to obtain a sixth coordinate, and sends the sixth coordinate to the robot arm, where the sixth coordinate is used to indicate that the to-be-tested position is in the first image Position in 所述机械臂响应于所述测试设备发送的消息,在所述第一图像中所述第六坐标的位置执行操作。The robotic arm performs an operation at a position of the sixth coordinate in the first image in response to a message transmitted by the test device. 一种终端屏幕的定位装置,其特征在于,所述装置包括:A positioning device for a terminal screen, characterized in that the device comprises: 获取模块,用于获取第一图像,所述第一图像为拍摄的终端的图像,所述终端设置有屏幕,所述屏幕显示图样,所述图样包括规则分布的标志图形;An acquiring module, configured to acquire a first image, where the first image is an image of a photographed terminal, the terminal is provided with a screen, and the screen displays a pattern, where the pattern includes a regularly distributed logo graphic; 确定模块,用于确定第一坐标与第二坐标之间的转换关系,所述第一坐标用于表示所述显示模块显示的所述标志图形在所述屏幕上的位置,所述第二坐标用于表示所述标志图形在所述获取模块获取的所述第一图像中的位置;a determining module, configured to determine a conversion relationship between the first coordinate and the second coordinate, where the first coordinate is used to indicate a position of the logo graphic displayed on the screen by the display module, the second coordinate Means for indicating a position of the logo graphic in the first image acquired by the acquiring module; 所述确定模块,还用于根据所述转换关系,确定所述第一图像中所述屏幕的区域。The determining module is further configured to determine an area of the screen in the first image according to the conversion relationship. 根据权利要求12所述的装置,其特征在于,所述确定模块,还用于:The device according to claim 12, wherein the determining module is further configured to: 根据所述转换关系及第三坐标,确定第四坐标,所述第三坐标用于表示所述屏幕上各个角点在所述屏幕上的位置,所述第四坐标用于表示所述各个角点在所述第一图像中的位置;Determining, according to the conversion relationship and the third coordinate, a fourth coordinate, where the third coordinate is used to indicate a position of each corner point on the screen on the screen, and the fourth coordinate is used to represent the each corner Pointing a position in the first image; 在所述第一图像中,确定以所述第四坐标对应的所述各个角点的位置为端点所构成的区域为所述屏幕在所述第一图像中的区域。In the first image, an area formed by determining a position of each of the corner points corresponding to the fourth coordinate as an end point is an area of the screen in the first image. 根据权利要求12或13所述的装置,其特征在于,所述图样包括至少三个标志图形。Apparatus according to claim 12 or claim 13 wherein said pattern comprises at least three logo patterns. 根据权利要求12至14中任意一项所述的装置,其特征在于,所述规则分布包括所述标志图形的中心点等间距按行、列呈矩阵式分布。The apparatus according to any one of claims 12 to 14, wherein the rule distribution comprises a center point equidistant spacing of the logo pattern distributed in a matrix in rows and columns. 根据权利要求12至15中任意一项所述的装置,其特征在于,所述标志图形包括常规标志图形和特殊标志图形,所述常规标志图形完全相同,所述特殊标志图形异于所述常规标志图形,且所述特殊标志图形用于区分所述终端在拍摄时的放置方向。The apparatus according to any one of claims 12 to 15, wherein said logo pattern comprises a regular logo pattern and a special logo pattern, said conventional logo pattern being identical, said special logo pattern being different from said conventional A logo graphic, and the special logo graphic is used to distinguish a direction in which the terminal is placed at the time of shooting. 根据权利要求12至16中任意一项所述的装置,其特征在于,所述标志图形为黑色,所述图样中除所述标志图形以外的区域为白色。The apparatus according to any one of claims 12 to 16, wherein the logo pattern is black, and an area other than the logo pattern in the pattern is white. 根据权利要求12至17中任意一项所述的装置,其特征在于,所述标志图形因拍摄角度的变化而发生形变后,所述标志图形的中心点位置不变。The apparatus according to any one of claims 12 to 17, wherein the position of the center point of the logo pattern does not change after the logo pattern is deformed due to a change in the photographing angle. 根据权利要求18所述的装置,其特征在于,所述标志图形为圆形或椭圆形。The device according to claim 18, wherein said logo pattern is circular or elliptical. 根据权利要求12至19中任意一项所述的装置,其特征在于,所述图样的分辨率与所述屏幕的分辨率相同。Apparatus according to any one of claims 12 to 19, wherein the resolution of the pattern is the same as the resolution of the screen. 一种终端,包括显示屏,存储器,一个或多个处理器,多个应用程序,以及一个或多个程序;其中,所述一个或多个程序被存储在所述存储器中;其特征在于,所述一个或多个处理器在执行所述一个或多个程序时,使得所述终端实现如权利要求1至9中任意一项所述的方法。A terminal comprising a display screen, a memory, one or more processors, a plurality of applications, and one or more programs; wherein the one or more programs are stored in the memory; The one or more processors, when executing the one or more programs, cause the terminal to implement the method of any one of claims 1 to 9. 一种可读存储介质,其特征在于,所述可读存储介质中存储有指令,当所述指令在终端上运行时,使得所述终端执行上述权利要求1至9中任意一项所述的方法。A readable storage medium, wherein the readable storage medium stores instructions for causing the terminal to perform the method of any one of claims 1 to 9 when the instruction is run on a terminal method. 一种计算机程序产品,其特征在于,所述计算机程序产品包括软件代码,所述软件代码用于执行上述权利要求1至9中任意一项所述的方法。 A computer program product, characterized in that the computer program product comprises software code for performing the method of any of the preceding claims 1 to 9. 一种终端屏幕的定位系统,其特征在于,所述系统包括:A positioning system for a terminal screen, characterized in that the system comprises: 终端,用于通过屏幕显示图样并确定第一坐标,所述图样包括规则分布的标志图形,所述第一坐标用于表示所述标志图形在所述屏幕上的位置;a terminal, configured to display a pattern through the screen and determine a first coordinate, the pattern includes a regularly distributed logo graphic, where the first coordinate is used to indicate a position of the logo graphic on the screen; 工业相机,用于获取第一图像并确定第二坐标,所述第二坐标用于表示所述标志图形在所述第一图像中的位置,所述第一图像为拍摄的所述终端的图像;An industrial camera for acquiring a first image and determining a second coordinate, the second coordinate for indicating a position of the logo graphic in the first image, the first image being an image of the photographed terminal ; 测试设备,用于获取所述第一坐标与所述第二坐标,并确定所述第一坐标与所述第二坐标之间的转换关系;a testing device, configured to acquire the first coordinate and the second coordinate, and determine a conversion relationship between the first coordinate and the second coordinate; 所述测试设备,还用于根据所述转换关系,确定所述第一图像中所述屏幕的区域。The test device is further configured to determine an area of the screen in the first image according to the conversion relationship. 根据权利要求24所述的系统,其特征在于,在所述测试设备确定所述第一坐标与所述第二坐标之间的转换关系之后,所述测试设备,还用于获取第五坐标,所述第五坐标用于表示所述屏幕上的待测试位置;The system according to claim 24, wherein after the testing device determines a conversion relationship between the first coordinate and the second coordinate, the testing device is further configured to acquire a fifth coordinate, The fifth coordinate is used to represent a location to be tested on the screen; 所述测试设备,还用于按照所述转换关系对所述第五坐标进行转换,得到第六坐标,并向所述机械臂发送,所述第六坐标用于表示所述待测试位置在所述第一图像中的位置;The testing device is further configured to convert the fifth coordinate according to the conversion relationship to obtain a sixth coordinate, and send the sixth coordinate to the robot arm, where the sixth coordinate is used to indicate that the to-be-tested location is in the The position in the first image; 所述机械臂,用于响应于所述测试设备发送的消息,在所述第一图像中所述第六坐标的位置执行操作。 The robot arm is configured to perform an operation at a position of the sixth coordinate in the first image in response to a message sent by the test device.
PCT/CN2017/113216 2017-11-27 2017-11-27 Positioning of terminal screen based on transformation relation of coordinates of marking graphic points in pattern Ceased WO2019100407A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/113216 WO2019100407A1 (en) 2017-11-27 2017-11-27 Positioning of terminal screen based on transformation relation of coordinates of marking graphic points in pattern
CN201780089459.5A CN110506252B (en) 2017-11-27 2017-11-27 Terminal screen is fixed a position to transform relation based on mark figure point coordinate in pattern

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/113216 WO2019100407A1 (en) 2017-11-27 2017-11-27 Positioning of terminal screen based on transformation relation of coordinates of marking graphic points in pattern

Publications (1)

Publication Number Publication Date
WO2019100407A1 true WO2019100407A1 (en) 2019-05-31

Family

ID=66631781

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/113216 Ceased WO2019100407A1 (en) 2017-11-27 2017-11-27 Positioning of terminal screen based on transformation relation of coordinates of marking graphic points in pattern

Country Status (2)

Country Link
CN (1) CN110506252B (en)
WO (1) WO2019100407A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111325717B (en) * 2020-01-21 2023-08-29 上海万物新生环保科技集团有限公司 Mobile phone defect location identification method and device
CN111311687B (en) * 2020-01-21 2022-12-02 上海万物新生环保科技集团有限公司 Method and equipment for detecting spatial position of mobile phone screen pixel point
CN111290660A (en) * 2020-01-21 2020-06-16 上海悦易网络信息技术有限公司 Method and equipment for converting screen coordinates into touch pen coordinates
CN113537218B (en) * 2021-07-27 2024-02-06 京东科技信息技术有限公司 Image recognition method and device
CN114393576B (en) * 2021-12-27 2024-09-10 江苏明月智能科技有限公司 Four-axis robotic arm click and position calibration method and system based on artificial intelligence

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298467A (en) * 2010-06-24 2011-12-28 北京威亚视讯科技有限公司 Automatic calibration method and system for display screen
CN104090689A (en) * 2014-06-27 2014-10-08 深圳市中兴移动通信有限公司 Mobile terminal and interactive projection method and system thereof
CN106257388A (en) * 2016-07-25 2016-12-28 北京仁光科技有限公司 A kind of localization method of optical touch screen

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4508553B2 (en) * 2003-06-02 2010-07-21 カシオ計算機株式会社 Captured image projection device and captured image correction method
JP4428371B2 (en) * 2006-09-22 2010-03-10 セイコーエプソン株式会社 Projection-type image display device and flat projection object
AT10237U1 (en) * 2007-10-12 2008-11-15 Austria Tech & System Tech METHOD AND DEVICE FOR POSITIONING AND ORIENTING AN OBJECT RELATIVELY TO BZW. WITH A UNDERGROUND AND USE OF HIEFÜR
CN102231093B (en) * 2011-06-14 2013-07-31 伍斌 Screen locating control method and device
CN102968794B (en) * 2012-11-22 2015-04-22 上海交通大学 In-situ calibration method for structure parameters of large-visual-field binocular stereo vision system by small two-dimensional targets
CN104766315B (en) * 2015-03-30 2019-03-29 联想(北京)有限公司 Method, the equipment of uncalibrated image acquisition device and display screen relative positional relationship
CN105427284A (en) * 2015-11-06 2016-03-23 西北工业大学 Fixed target marking method based on airborne android platform
CN106293270B (en) * 2016-08-05 2018-11-13 南京仁光电子科技有限公司 A kind of scaling method of large screen touch-control system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298467A (en) * 2010-06-24 2011-12-28 北京威亚视讯科技有限公司 Automatic calibration method and system for display screen
CN104090689A (en) * 2014-06-27 2014-10-08 深圳市中兴移动通信有限公司 Mobile terminal and interactive projection method and system thereof
CN106257388A (en) * 2016-07-25 2016-12-28 北京仁光科技有限公司 A kind of localization method of optical touch screen

Also Published As

Publication number Publication date
CN110506252B (en) 2021-01-29
CN110506252A (en) 2019-11-26

Similar Documents

Publication Publication Date Title
CN109684980B (en) Automatic scoring method and device
CN107977674B (en) Image processing method, device, mobile terminal, and computer-readable storage medium
CN110506252B (en) Terminal screen is fixed a position to transform relation based on mark figure point coordinate in pattern
CN103279225B (en) Projection type man-machine interactive system and touch control identification method
US10915750B2 (en) Method and device for searching stripe set
CN112488914B (en) Image stitching method, device, terminal and computer readable storage medium
CN113052919B (en) A visual sensor calibration method and device, electronic device and storage medium
EP4064714A1 (en) Screen display control method and electronic device
CN114399813B (en) Face shielding detection method, model training method, device and electronic equipment
CN105653017B (en) The gravity sensing bearing calibration of electronic device and electronic device
US10866649B2 (en) Gesture identification method and electronic device
CN110442521B (en) Control unit detection method and device
CN110730298A (en) A display control method and electronic device
WO2021204101A1 (en) Display method and electronic device
WO2021004407A1 (en) Screenshot method and terminal device
CN111488761A (en) Fingerprint identification method, apparatus, electronic device and computer-readable storage medium
WO2020078344A1 (en) Method for identifying special-shaped touch, terminal and storage medium
CN108564613A (en) A kind of depth data acquisition methods and mobile terminal
CN113066134B (en) A visual sensor calibration method and device, electronic device and storage medium
CN110738185B (en) Form object identification method, form object identification device and storage medium
CN110533019A (en) License plate positioning method, device and storage medium
CN108322639A (en) A kind of method, apparatus and mobile terminal of image procossing
CN108234703A (en) Electronic device, camera shooting head inspecting method and Related product
CN108984097B (en) Touch operation method, device, storage medium and electronic device
WO2018076720A1 (en) One-hand operation method and control system

Legal Events

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

Ref document number: 17932877

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17932877

Country of ref document: EP

Kind code of ref document: A1