Method, device, storage medium and terminal for adjusting focus position
By periodically acquiring the terminal display interface image and adjusting the focus position, the problem of low accuracy caused by focus shift in continuous operations in shooting games is solved, achieving higher operating accuracy and user experience.
Patent Information
- Application Number
- CN202111034254.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-03
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In applications such as shooting games, the user's continuous operations cause the focus position to shift due to firearm recoil and other factors, reducing the accuracy of the operation.
By periodically acquiring the display interface image of the terminal, determining the offset between the target image and the current interface image, and adjusting the focus position according to the offset to make it consistent with the focus position in the target image, thereby improving the accuracy of continuous operations. Rate.
It effectively improves the accuracy of continuous operations, eliminates the need to identify firearm models, simplifies the operation process, and improves user experience.
Smart Images

Figure CN113655943B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of terminal technology, and in particular to a method, device, storage medium, and terminal for adjusting a focus position. Background Art
[0002] With the continuous advancement of communication technology, mobile devices such as mobile phones and tablets have become indispensable tools in people's lives. To further enrich people's lives, the types of applications are also increasing. In some applications, continuous operations must be performed on the same location on the display interface. However, due to accidental user touches or objective factors, the positions of the continuous operations may deviate, resulting in low accuracy of the continuous operations.
[0003] For example, in a shooting game application, a player can continuously shoot at a target object by triggering a continuous shooting command. However, when the player shoots, he will be affected by the recoil of the gun, causing the crosshairs to shift from the original aiming position after the shooting, resulting in low shooting accuracy. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a method, device, storage medium and terminal for adjusting a focus position.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for adjusting a focus position is provided, which is applied to a terminal, and the method includes:
[0006] Upon receiving a continuous operation instruction triggered by a user through the terminal, periodically acquiring an interface image corresponding to the display interface of the terminal; the continuous operation instruction is used to instruct the terminal to continuously perform a target operation on the same position in the display interface according to a preset operation frequency;
[0007] Determining a target image from the acquired interface image;
[0008] Obtaining the offset between the current interface image displayed on the display interface and the target image;
[0009] According to the offset, a position of a focus in the display interface that responds to the target operation is adjusted so that the position of the focus in the display interface is the same as the position of the focus in the target image.
[0010] Optionally, determining a target image from the acquired interface image includes:
[0011] The interface image acquired for the first time is used as the target image.
[0012] Optionally, obtaining the offset between the current interface image displayed on the display interface and the target image includes:
[0013] Determine a first focus image corresponding to the current interface image, where the focus image is an image including the focus position;
[0014] determining a second focus image corresponding to the target image;
[0015] An offset between the first focus image and the second focus image is obtained.
[0016] Optionally, determining the first focus image corresponding to the current interface image includes:
[0017] Obtaining an interface grayscale image corresponding to the current interface image;
[0018] An image corresponding to a preset position in the interface grayscale image is used as the first focus image.
[0019] Optionally, acquiring the offset between the first focus image and the second focus image includes:
[0020] determining a first image feature point in the first focus image and a second image feature point in the second focus image;
[0021] determining an image transformation matrix according to the first image feature points and the second image feature points;
[0022] An offset between the first focus image and the second focus image is determined according to the image transformation matrix.
[0023] Optionally, the offset includes an offset distance and an offset direction, and adjusting a position of a focus in the display interface in response to the target operation according to the offset includes:
[0024] According to the offset direction, the display interface of the terminal is controlled to slide the offset distance to adjust the position of the focus in the display interface.
[0025] Optionally, before periodically acquiring the interface image corresponding to the display interface of the terminal, the method further includes:
[0026] Determining whether a focus adjustment mode of the terminal is enabled;
[0027] The periodically acquiring the interface image corresponding to the display interface of the terminal includes:
[0028] When the focus adjustment mode is turned on, an interface image corresponding to the display interface of the terminal is periodically obtained.
[0029] Optionally, before adjusting the position of the focus in the display interface in response to the target operation according to the offset, the method further includes:
[0030] Determining whether the offset is greater than a preset offset threshold;
[0031] The adjusting, according to the offset, a position of a focus in the display interface in response to the target operation includes:
[0032] When the offset is less than or equal to the preset offset threshold, the position of the focus in the display interface that responds to the target operation is adjusted according to the offset.
[0033] Optionally, the method further includes:
[0034] When the offset is greater than the preset offset threshold, stop responding to the continuous operation instruction.
[0035] According to a second aspect of an embodiment of the present disclosure, there is provided a device for adjusting a focus position, which is applied to a terminal, and the device includes:
[0036] an interface image acquisition module configured to periodically acquire an interface image corresponding to the display interface of the terminal upon receiving a continuous operation instruction triggered by the user through the terminal; the continuous operation instruction is used to instruct the terminal to continuously perform a target operation on the same position in the display interface according to a preset operation frequency;
[0037] a target image determination module, configured to determine a target image from the acquired interface image;
[0038] an offset acquisition module, configured to acquire an offset between a current interface image displayed on the display interface and the target image;
[0039] The focus adjustment module is configured to adjust the position of the focus in the display interface in response to the target operation according to the offset, so that the position of the focus in the display interface is the same as the position of the focus in the target image.
[0040] Optionally, the target image determination module is further configured to:
[0041] The interface image acquired for the first time is used as the target image.
[0042] Optionally, the offset acquisition module is further configured to:
[0043] Determine a first focus image corresponding to the current interface image, where the focus image is an image including the focus position;
[0044] determining a second focus image corresponding to the target image;
[0045] An offset between the first focus image and the second focus image is obtained.
[0046] Optionally, the offset acquisition module is further configured to:
[0047] Obtaining an interface grayscale image corresponding to the current interface image;
[0048] An image corresponding to a preset position in the interface grayscale image is used as the first focus image.
[0049] Optionally, the offset acquisition module is further configured to:
[0050] determining a first image feature point in the first focus image and a second image feature point in the second focus image;
[0051] determining an image transformation matrix according to the first image feature points and the second image feature points;
[0052] An offset between the first focus image and the second focus image is determined according to the image transformation matrix.
[0053] Optionally, the offset includes an offset distance and an offset direction, and the focus adjustment module is further configured to:
[0054] According to the offset direction, the display interface of the terminal is controlled to slide by the offset distance to adjust the position of the focus in the display interface that responds to the target operation.
[0055] Optionally, the device further comprises:
[0056] a mode determination module, configured to determine whether a focus adjustment mode of the terminal is turned on;
[0057] The interface image acquisition module is further configured to:
[0058] When the focus adjustment mode is turned on, an interface image corresponding to the display interface of the terminal is periodically obtained.
[0059] Optionally, the device further comprises:
[0060] an offset determination module, configured to determine whether the offset is greater than a preset offset threshold;
[0061] The focus adjustment module is further configured to:
[0062] When the offset is less than or equal to the preset offset threshold, the position of the focus in the display interface that responds to the target operation is adjusted according to the offset.
[0063] Optionally, the device further comprises:
[0064] The stopping module is configured to stop responding to the continuous operation instruction when the offset is greater than the preset offset threshold.
[0065] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the method for adjusting the focus position provided in the first aspect of the present disclosure are implemented.
[0066] According to a fourth aspect of an embodiment of the present disclosure, a terminal is provided, including:
[0067] a memory having a computer program stored thereon;
[0068] A processor is used to execute the computer program in the memory to implement the steps of the method for adjusting the focus position provided in the first aspect of the present disclosure.
[0069] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: in the case of receiving a continuous operation instruction triggered by the user through the terminal, the interface image corresponding to the display interface of the terminal is periodically obtained; the continuous operation instruction is used to instruct the terminal to continuously perform the target operation on the same position in the display interface according to the preset operation frequency; the target image is determined from the obtained interface image; the offset between the current interface image displayed on the display interface and the target image is obtained; according to the offset, the position of the focus in the display interface that responds to the target operation is adjusted so that the position of the focus in the display interface is the same as the position of the focus in the target image. In other words, the present disclosure can adjust the position of the focus in the display interface that responds to the target operation according to the offset between the current interface image and the target image, so that the position of the focus is the same each time the target operation is performed, thereby improving the accuracy of continuous operations.
[0070] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0072] Figure 1is a flow chart showing a method for adjusting a focus position according to an exemplary embodiment;
[0073] Figure 2 is a flow chart showing another method for adjusting a focus position according to an exemplary embodiment;
[0074] Figure 3 is a schematic diagram showing a focus adjustment effect according to an exemplary embodiment;
[0075] Figure 4 is a block diagram showing a device for adjusting a focus position according to an exemplary embodiment;
[0076] Figure 5 is a block diagram showing a second device for adjusting a focus position according to an exemplary embodiment;
[0077] Figure 6 is a block diagram of a third device for adjusting a focus position according to an exemplary embodiment;
[0078] Figure 7 is a block diagram of a fourth device for adjusting a focus position according to an exemplary embodiment;
[0079] Figure 8 It is a block diagram of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION
[0080] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0081] First, the application scenarios of the present disclosure are described. The present disclosure can be applied to scenarios involving continuous operations. For example, the continuous operation can be continuously clicking the same position on the screen, or continuously shooting at the same position in a shooting game. The present disclosure does not limit the manner of the continuous operation.
[0082] In shooting game applications, aiming is done using a crosshair (also called a crosshair or scope) to indicate the direction of the weapon's aim. The crosshair can be any visually suggestive pattern, such as dots, a cross, or a ring with a color or a preset transparency. The size and shape of the crosshair are typically related to the type of weapon used in the game. After triggering the continuous fire command, the player can fire continuously at the target. However, the recoil of the gun can cause the crosshair to shift from its original position after firing.
[0083] Related technologies use on-screen image information to identify in-game gun models, buttstocks, grips, muzzles, and other accessories. This allows the user to adjust the crosshairs by adjusting the offset distance when pressing the gun based on the specific gun and accessories. However, the accuracy of identifying guns and accessories through image information is low, resulting in low crosshair adjustment accuracy.
[0084] In order to overcome the technical problems existing in the above-mentioned related technologies, the present disclosure provides a method, device, storage medium and terminal for adjusting the focus position, which can adjust the position of the focus in response to the target operation in the display interface according to the offset between the current interface image and the target image. In this way, the position of the focus is the same each time the target operation is performed, thereby improving the accuracy of continuous operations.
[0085] The present disclosure is described below with reference to specific embodiments.
[0086] Figure 1 FIG. 1 is a flow chart showing a method for adjusting a focus position according to an exemplary embodiment. Figure 1 As shown, the method is applied in a terminal, including:
[0087] S101: When receiving a continuous operation instruction triggered by a user through a terminal, periodically obtain an interface image corresponding to a display interface of the terminal.
[0088] The continuous operation instruction may be used to instruct the terminal to continuously perform a target operation on the same location in the display interface at a preset operation frequency. For example, the continuous operation instruction may include a continuous click instruction, such as continuously clicking on the same location, or a continuous shooting instruction in a shooting game. If the continuous operation instruction is a continuous click instruction, the target operation may be a click operation, and if the continuous operation instruction is a continuous shooting instruction, the target operation may be a shooting operation.
[0089] In this step, after receiving a continuous operation command triggered by the user, for example, after the user clicks the continuous shooting button in a shooting game, the terminal can periodically capture the interface image displayed on the terminal's display interface. The period for capturing the interface image corresponding to the terminal's display interface can be determined based on the accuracy requirements of the continuous operation command. For example, a shorter period, such as 80ms, can be set for continuous operation commands with higher accuracy requirements, while a longer period, such as 100ms, can be set for continuous operation commands with lower accuracy requirements. This is not limited in this disclosure.
[0090] S102: Determine a target image from the acquired interface image.
[0091] In this step, after acquiring the interface image, the target image can be determined from the acquired interface image based on the type of the continuous operation instruction. For example, if the continuous operation instruction is a continuous shooting instruction, and the position of the first shot is the most accurate during continuous shooting, and the positions of the second and subsequent shots may shift due to the recoil of the firearm, then the first acquired interface image can be used as the target image; if the continuous operation instruction is a continuous clicking instruction, and the click position generally does not change if the click focus is not accidentally touched, then if the position of the third click deviates slightly from the position of the first click, then the third acquired interface image can also be used as the target image.
[0092] S103: Obtain an offset between the current interface image displayed on the display interface and the target image.
[0093] In this step, after obtaining the current interface image displayed on the display interface, the current interface image and the target image can be compared to determine the offset between the current interface image and the target image. For example, if the continuous operation instruction is a continuous shooting instruction, the positions of the firearms in the current interface image and the target image can be compared to determine the offset between the current interface image and the target image based on the position of the firearms.
[0094] S104: Adjust the position of the focus in the display interface that responds to the target operation according to the offset, so that the position of the focus in the display interface is the same as the position of the focus in the target image.
[0095] In this step, after determining the offset between the current interface image and the target image, the position of the focus in the display interface that responds to the target operation can be adjusted based on the offset, simulating a user sliding the interface, so that the position of the focus in the display interface that responds to the target operation is the same as the position of the focus in the target image that responds to the target operation. For example, taking the target operation as a shooting operation, after adjusting the position of the focus in the display interface that responds to the target operation, the shooting position in the display interface is the same as the shooting position in the target image.
[0096] It should be noted that in order to facilitate user operation, when the user wishes to cancel the continuous operation instruction, the focus position in the current display interface can be moved significantly. In this way, there is no need to click the button to cancel the continuous operation instruction, which facilitates user operation and improves the user experience.
[0097] In one possible implementation, before adjusting the position of the focus in the display interface that responds to the target operation, it can be determined whether the offset is greater than a preset offset threshold. If the offset is less than or equal to the preset offset threshold, the position of the focus in the display interface that responds to the target operation is adjusted based on the offset. If the offset is greater than the preset offset threshold, responding to the continuous operation instruction is stopped. The preset offset threshold can be determined based on the application corresponding to the continuous operation instruction, and this disclosure is not limited to this.
[0098] By using the above method, the position of the focus responding to the target operation in the display interface can be adjusted according to the offset between the current interface image and the target image. In this way, the position of the focus for each target operation is the same, thereby improving the accuracy of continuous operations.
[0099] Figure 2 is a flow chart showing another method for adjusting the focus position according to an exemplary embodiment. Figure 2 As shown, the method includes:
[0100] S201: When receiving a continuous operation instruction triggered by a user through a terminal, periodically obtain an interface image corresponding to a display interface of the terminal.
[0101] The continuous operation instruction may be used to instruct the terminal to continuously perform a target operation on the same location in the display interface at a preset operation frequency. For example, the continuous operation instruction may include a continuous click instruction, such as continuously clicking on the same location, or a continuous shooting instruction in a shooting game. If the continuous operation instruction is a continuous click instruction, the target operation may be a click operation, and if the continuous operation instruction is a continuous shooting instruction, the target operation may be a shooting operation.
[0102] In this step, before periodically acquiring the interface image corresponding to the display interface of the terminal, it can be determined whether the focus adjustment mode of the terminal is enabled. If the focus adjustment mode is enabled, the interface image corresponding to the display interface of the terminal is periodically acquired. The focus adjustment mode can be enabled by a pre-set switch. For example, if the continuous operation instruction is a continuous shooting instruction in a shooting game, a focus adjustment switch can be added to the shooting game. Before the user starts continuous shooting, the focus adjustment switch can be used to enable the corner adjustment mode. Alternatively, the focus adjustment switch and the continuous shooting button can be integrated into one button. In this way, the focus adjustment mode is enabled when the user clicks the continuous shooting button.
[0103] S202: Use the interface image acquired for the first time as the target image.
[0104] S203: Determine a first focus image corresponding to the current interface image.
[0105] Among them, the focus image can be an image including a focus position. For example, if the continuous operation instruction is a continuous shooting instruction in a shooting game, the focus position can be the position of the shooting crosshairs in the current interface image; if the continuous operation instruction is a continuous click instruction, the focus position can be the click position.
[0106] In this step, after obtaining the current interface image, the interface grayscale image corresponding to the current interface image can be obtained, and the image corresponding to the preset position in the interface grayscale image can be used as the first focus image. Among them, the method for obtaining the interface grayscale image corresponding to the current interface image can refer to the method for obtaining grayscale images in the prior art, which will not be repeated here. The preset position can be pre-set according to the type of application corresponding to the continuous operation instruction. For example, if the continuous operation instruction is a continuous shooting instruction in the shooting game, the preset position can be the middle and upper position of the interface grayscale image. For example, the interface grayscale image can be divided into 5 equal parts horizontally and vertically, and the position corresponding to the middle horizontally and the second equal part from the top to the bottom vertically is used as the preset position.
[0107] S204: Determine a second focus image corresponding to the target image.
[0108] In this step, the method of determining the second focus image corresponding to the target image can refer to the method of obtaining the first focus image corresponding to the current interface image in the above step S203, which will not be repeated here.
[0109] S205: Acquire an offset between the first focus image and the second focus image.
[0110] In which, the offset may include an offset distance and an offset direction. For example, the offset may include a lateral offset and a longitudinal offset. When the lateral offset is a positive value, it indicates that the first focus image is offset to the right compared to the second focus image. When the longitudinal offset is a positive value, it indicates that the first focus image is offset downward compared to the second focus image.
[0111] In this step, after determining the first focus image and the second focus image, the first image feature points in the first focus image and the second image feature points in the second focus image can be determined, and the image transformation matrix can be determined based on the first image feature points and the second image feature points. Based on the image transformation matrix, the offset between the first focus image and the second focus image can be determined.
[0112] For example, the Shi-Tomasi algorithm can be used to detect key points of the second focus image to determine the second image feature points in the second focus image. Then, the Lucas-Kanade optical flow algorithm can be used to track the second image feature points to obtain the first image feature points in the first focus image. Thereafter, the image transformation matrix can be calculated based on the first image feature points and the second image feature points using the RANSAC algorithm, and the offset between the first focus image and the second focus image can be determined based on the image transformation matrix. For example, when the image transformation matrix is an affine transformation matrix, the affine transformation matrix includes a horizontal offset distance and a vertical offset distance.
[0113] S206: Control the display interface of the terminal to slide by the offset distance according to the offset direction to adjust the position of the focus in the display interface.
[0114] In this step, after determining the offset, the terminal's display interface can be controlled to slide the offset distance according to the offset direction corresponding to the offset to adjust the position of the focus in the display interface. For example, if the horizontal offset in the offset is 50 pixels and the vertical offset is -30 pixels, indicating that the current display interface is offset 50 pixels to the right and 30 pixels upward, the terminal's display interface can be controlled to slide 50 pixels to the left and 30 pixels downward.
[0115] Figure 3 FIG. 1 is a schematic diagram showing a focus adjustment effect according to an exemplary embodiment. Figure 3 As shown, the left side is a schematic diagram of continuous shooting before adjusting the focus, and the right side is a schematic diagram of continuous shooting after adjusting the focus. Figure 3 It can be clearly seen that the position deviation of continuous shooting is smaller after adjusting the focus.
[0116] Using this method, the focus position of the target action in the display interface can be adjusted based on the offset between the current interface image and the target image. This ensures that the focus position remains the same each time the target action is executed, thereby improving the accuracy of continuous actions. In shooting game applications, this eliminates the need to identify the model of firearms and accessories, improving the accuracy of continuous shooting and providing a better user experience.
[0117] Figure 4 is a block diagram of a device for adjusting a focus position according to an exemplary embodiment. Figure 4 As shown, the device is applied to a terminal and includes:
[0118] The interface image acquisition module 401 is configured to periodically acquire an interface image corresponding to the display interface of the terminal upon receiving a continuous operation instruction triggered by the user through the terminal; the continuous operation instruction is used to instruct the terminal to continuously perform a target operation on the same position in the display interface according to a preset operation frequency;
[0119] The target image determination module 402 is configured to determine a target image from the acquired interface image;
[0120] The offset acquisition module 403 is configured to acquire the offset between the current interface image displayed on the display interface and the target image;
[0121] The focus adjustment module 404 is configured to adjust the position of the focus in the display interface in response to the target operation according to the offset, so that the position of the focus in the display interface is the same as the position of the focus in the target image.
[0122] Optionally, the target image determination module 402 is further configured to:
[0123] The interface image obtained for the first time is used as the target image.
[0124] Optionally, the offset acquisition module 403 is further configured to:
[0125] Determine a first focus image corresponding to the current interface image, where the focus image is an image including the focus position;
[0126] determining a second focus image corresponding to the target image;
[0127] An offset between the first focus image and the second focus image is obtained.
[0128] Optionally, the offset acquisition module 403 is further configured to:
[0129] Obtain the interface grayscale image corresponding to the current interface image;
[0130] The image corresponding to the preset position in the interface grayscale image is used as the first focus image.
[0131] Optionally, the offset acquisition module 403 is further configured to:
[0132] determining a first image feature point in the first focus image and a second image feature point in the second focus image;
[0133] Determining an image transformation matrix according to the first image feature point and the second image feature point;
[0134] An offset between the first focus image and the second focus image is determined according to the image transformation matrix.
[0135] Optionally, the offset includes an offset distance and an offset direction, and the focus adjustment module 404 is further configured to:
[0136] According to the offset direction, the display interface of the terminal is controlled to slide by the offset distance to adjust the position of the focus in the display interface that responds to the target operation.
[0137] Optionally, Figure 5 is a block diagram of a second device for adjusting a focus position according to an exemplary embodiment. Figure 5 As shown, the device also includes:
[0138] The mode determination module 405 is configured to determine whether the focus adjustment mode of the terminal is turned on;
[0139] The interface image acquisition module 401 is further configured to:
[0140] When the focus adjustment mode is turned on, an interface image corresponding to the display interface of the terminal is periodically obtained.
[0141] Optionally, Figure 6 is a block diagram of a third device for adjusting a focus position according to an exemplary embodiment. Figure 6 As shown, the device also includes:
[0142] The offset determination module 406 is configured to determine whether the offset is greater than a preset offset threshold;
[0143] The focus adjustment module 404 is further configured to:
[0144] When the offset is less than or equal to the preset offset threshold, the position of the focus in the display interface that responds to the target operation is adjusted according to the offset.
[0145] Optionally, Figure 7is a block diagram of a fourth device for adjusting a focus position according to an exemplary embodiment. Figure 7 As shown, the device also includes:
[0146] The stopping module 407 is configured to stop responding to the continuous operation instruction when the offset is greater than the preset offset threshold.
[0147] Through the above device, the position of the focus responding to the target operation in the display interface can be adjusted according to the offset between the current interface image and the target image. In this way, the position of the focus for each target operation is the same, thereby improving the accuracy of continuous operations.
[0148] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0149] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon. When the program instructions are executed by a processor, the steps of the method for adjusting the focus position provided by the present disclosure are implemented.
[0150] Figure 8 FIG8 is a block diagram of a terminal 800 according to an exemplary embodiment. For example, the terminal 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0151] Reference Figure 8 The terminal 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0152] The processing component 802 generally controls the overall operation of the terminal 800, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the method for adjusting the focus position described above. In addition, the processing component 802 may include one or more modules to facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
[0153] The memory 804 is configured to store various types of data to support operations on the terminal 800. Examples of such data include instructions for any application or method operating on the terminal 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0154] Power component 806 provides power to various components of terminal 800. Power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal 800.
[0155] The multimedia component 808 includes a screen that provides an output interface between the terminal 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the terminal 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0156] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the terminal 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0157] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.
[0158] The sensor assembly 814 includes one or more sensors for providing various aspects of the terminal 800's status assessment. For example, the sensor assembly 814 can detect the open / closed state of the terminal 800, the relative positioning of components, such as the display and keypad of the terminal 800. The sensor assembly 814 can also detect changes in the position of the terminal 800 or a component of the terminal 800, the presence or absence of user contact with the terminal 800, the orientation or acceleration / deceleration of the terminal 800, and temperature changes of the terminal 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an accelerometer, a gyroscope, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0159] The communication component 816 is configured to facilitate wired or wireless communication between the terminal 800 and other devices. The terminal 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0160] In an exemplary embodiment, the terminal 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-mentioned method of adjusting the focus position.
[0161] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is further provided, such as a memory 804 including instructions. The instructions can be executed by the processor 820 of the terminal 800 to perform the above-mentioned method of adjusting the focus position. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0162] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a programmable device, and has a code portion for executing the above-mentioned method for adjusting the focus position when executed by the programmable device.
Claims
1. A method for adjusting a focal position, characterized in that: Applied to a terminal, the method comprises: Upon receiving a continuous operation instruction triggered by a user through the terminal, periodically acquiring an interface image corresponding to the display interface of the terminal; the continuous operation instruction is used to instruct the terminal to continuously perform a target operation on the same position in the display interface according to a preset operation frequency; Determining a target image from the acquired interface image; Obtaining the offset between the current interface image displayed on the display interface and the target image; adjusting, according to the offset, a position of a focus in the display interface in response to the target operation, so that the position of the focus in the display interface is the same as the position of the focus in the target image; The step of obtaining the offset between the current interface image displayed on the display interface and the target image comprises: Determine a first focus image corresponding to the current interface image, where the focus image is an image including the focus position; Determining a second focus image corresponding to the target image; Acquire an offset between the first focus image and the second focus image; The acquiring the offset between the first focus image and the second focus image comprises: Determining a first image feature point in the first focus image and a second image feature point in the second focus image; Determining an image transformation matrix according to the first image feature points and the second image feature points; An offset between the first focus image and the second focus image is determined according to the image transformation matrix.
2. The method according to claim 1, characterized in that Determining a target image from the acquired interface image includes: The interface image acquired for the first time is used as the target image.
3. The method according to claim 1, characterized in that The determining the first focus image corresponding to the current interface image comprises: Obtaining an interface grayscale image corresponding to the current interface image; An image corresponding to a preset position in the interface grayscale image is used as the first focus image.
4. The method according to claim 1, characterized in that: The offset includes an offset distance and an offset direction, and adjusting the position of the focus in the display interface in response to the target operation according to the offset includes: According to the offset direction, the display interface of the terminal is controlled to slide the offset distance to adjust the position of the focus in the display interface.
5. The method according to claim 1, characterized in that Before periodically acquiring the interface image corresponding to the display interface of the terminal, the method further includes: Determining whether a focus adjustment mode of the terminal is turned on; The periodically acquiring the interface image corresponding to the display interface of the terminal includes: When the focus adjustment mode is turned on, an interface image corresponding to the display interface of the terminal is periodically obtained.
6. The method according to any one of claims 1 to 5, characterized in that: Before adjusting the position of the focus in the display interface in response to the target operation according to the offset, the method further includes: Determining whether the offset is greater than a preset offset threshold; The adjusting, according to the offset, the position of the focus in the display interface in response to the target operation comprises: When the offset is less than or equal to the preset offset threshold, the position of the focus in the display interface in response to the target operation is adjusted according to the offset.
7. The method according to claim 6, characterized in that The method further comprises: When the offset is greater than the preset offset threshold, stop responding to the continuous operation instruction.
8. A device for adjusting a focal position, characterized in that: Applied to a terminal, the device comprises: An interface image acquisition module is configured to periodically acquire an interface image corresponding to the display interface of the terminal upon receiving a continuous operation instruction triggered by the user through the terminal; the continuous operation instruction is used to instruct the terminal to continuously perform a target operation on the same position in the display interface according to a preset operation frequency; A target image determination module is configured to determine a target image from the acquired interface image; An offset acquisition module is configured to acquire an offset between a current interface image displayed on the display interface and the target image; a focus adjustment module configured to adjust the position of the focus in the display interface in response to the target operation according to the offset, so that the position of the focus in the display interface is the same as the position of the focus in the target image; The offset acquisition module is further configured to: Determine a first focus image corresponding to the current interface image, where the focus image is an image including the focus position; Determining a second focus image corresponding to the target image; Acquire an offset between the first focus image and the second focus image; The offset acquisition module is further configured to: Determining a first image feature point in the first focus image and a second image feature point in the second focus image; Determining an image transformation matrix according to the first image feature points and the second image feature points; An offset between the first focus image and the second focus image is determined according to the image transformation matrix.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
10. A terminal, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.
