WO2023109385A1 - 图标点击的检测方法、装置、设备及存储介质 - Google Patents

图标点击的检测方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023109385A1
WO2023109385A1 PCT/CN2022/131250 CN2022131250W WO2023109385A1 WO 2023109385 A1 WO2023109385 A1 WO 2023109385A1 CN 2022131250 W CN2022131250 W CN 2022131250W WO 2023109385 A1 WO2023109385 A1 WO 2023109385A1
Authority
WO
WIPO (PCT)
Prior art keywords
position information
target icon
value
dimensional mask
original image
Prior art date
Application number
PCT/CN2022/131250
Other languages
English (en)
French (fr)
Inventor
徐远
杨杰
王益峰
Original Assignee
北京字跳网络技术有限公司
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 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023109385A1 publication Critical patent/WO2023109385A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/038Control and interface arrangements therefor, e.g. drivers or device-embedded control circuitry
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/544Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices for evaluating functions by calculation
    • G06F7/5443Sum of products
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user

Definitions

  • the present disclosure relates to the technical field of image processing, for example, to an icon click detection method, device, device and storage medium.
  • Icon clicks are mostly judged based on image features, for example, by judging the pixel color feature or transparency feature of the clicked position to distinguish whether the click hits the icon area. This way of judging has limitations and cannot be applied to universal interface frameworks, and judging clicks often requires holding image data in memory, which takes up memory.
  • the present disclosure provides an icon click detection method, device, device and storage medium, which can accurately and quickly detect the click behavior of an icon in an interface.
  • the present disclosure provides a method for detecting icon clicks, including:
  • the present disclosure also provides a device for detecting icon clicks, including:
  • An original image acquisition module configured to acquire an original image containing a target icon
  • the foreground and foreground segmentation module is configured to segment the foreground and foreground in the original image to obtain a two-dimensional mask map, wherein the value of a pixel in the two-dimensional mask map indicates whether it is the target icon;
  • the location information acquisition module is configured to acquire the location information of the click operation on the control corresponding to the target icon
  • a judging module configured to judge whether the position information and the value of the pixel point corresponding to the position information in the two-dimensional mask map meet a set condition
  • the click determination module is configured to determine that the target icon is clicked when the position information and the value of the pixel point corresponding to the position information in the two-dimensional mask map meet the set conditions, and control the The target icon executes the business logic corresponding to the click operation.
  • an electronic device comprising:
  • a storage device configured to store one or more programs
  • the one or more processing devices When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the icon click detection method according to the embodiment of the present disclosure.
  • a computer-readable medium is also provided, storing a computer program, and when the computer program is executed by a processing device, the method for detecting icon clicks as described in the embodiments of the present disclosure is implemented.
  • FIG. 1 is a flow chart of a method for detecting icon clicks in an embodiment of the present disclosure
  • Fig. 2a is an example diagram of an original image corresponding to a target icon in an embodiment of the present disclosure
  • Fig. 2b is a schematic diagram of a bit array corresponding to a target icon in an embodiment of the present disclosure
  • FIG. 3 is a schematic structural diagram of an icon click detection device in an embodiment of the present disclosure.
  • Fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
  • the term “comprise” and its variations are open-ended, ie “including but not limited to”.
  • the term “based on” is “based at least in part on”.
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
  • FIG. 1 is a flow chart of a method for detecting icon clicks provided by an embodiment of the present disclosure. This embodiment is applicable to the situation of detecting image click behaviors.
  • the method can be performed by a device for detecting icon clicks. It can be composed of hardware and/or software, and can generally be integrated in a device with a function of detecting clicks on rendered icons of web pages, and the device can be electronic devices such as servers, mobile terminals, or server clusters. As shown in Figure 1, the method includes the following steps.
  • Step 110 acquiring the original image containing the target icon.
  • the target icon may be an icon composed of regular graphics or irregular graphics, and the original image includes the target icon and a background area.
  • the target icon may be understood as an icon displayed on the interface.
  • the target icon can be set on the button control, and by drawing the layout, the button control with the target icon displayed on the set position of the display interface.
  • Step 120 segmenting the foreground and foreground in the original image to obtain a two-dimensional mask map.
  • the value of the pixel in the two-dimensional mask image represents whether it is the target icon.
  • the area where the target icon is located is the foreground area, and the remaining areas are the background area.
  • the flag information can be represented by a set value, including "0", "1", "2" and "3". Among them, 0 represents background; 1 represents foreground; 2 represents possible background; 3 represents possible foreground.
  • Any image segmentation algorithm (such as the GrabCut algorithm) can be used to segment the original image from the background to the foreground, so as to obtain the marking information of whether each pixel in the original image is a target icon, thereby obtaining a two-dimensional mask map.
  • the method of segmenting the foreground and foreground in the original image to obtain a two-dimensional mask image may be: grayscale processing the original image to obtain a grayscale image; performing foreground and foreground segmentation on the grayscale image to obtain a two-dimensional mask map.
  • the process of performing grayscale processing on the original image can be understood as converting the color value of each pixel of the original image into a grayscale value between 0-255, thereby obtaining a grayscale image.
  • the GrabCut algorithm is used to segment the grayscale image from the foreground to the background, and a two-dimensional mask image representing whether each pixel is the target icon is obtained.
  • grayscale processing is performed on the original image, and foreground and background segmentation is performed, which can improve the efficiency of image segmentation.
  • Step 130 acquiring the position information of the click operation on the control corresponding to the target icon.
  • the target icon is displayed in the interface window, and the user can trigger a click operation on the interface window through a mouse or touch pen, and the operating system detects the user's click operation on the interface window, and obtains the position information of the click operation on the interface window , convert the position information on the interface window to the position information on the control where the target icon is located.
  • the process of obtaining the position information of the click operation on the control corresponding to the target icon may be: obtaining the position information of the click operation on the interface window; obtaining the transformation matrix between the interface window and the control where the target icon is located; Transform to obtain the position information of the click operation on the control where the target icon is located.
  • the position information is transformed according to the transformation matrix, and the way to obtain the position information of the click operation on the control where the target icon is located can be: dot product the position information with the inverse matrix of the transformation matrix to obtain the position of the click operation on the control where the target icon is located information.
  • the system can obtain the click position on the interface window, and the click position is set as (p gx , p gy ).
  • the position of BtnIcon on the interface window (Btn gx , Btn gy ) can be obtained by drawing the layout, so that the transformation matrix from the position on the button to the position of the interface window can be obtained Trans 2*2 , then the clicked position on the BtnIcon is obtained according to the following formula:
  • the click position on the control is determined through the transformation matrix between the interface window and the control where the target icon is located, and the click position on the control can be accurately obtained, so as to facilitate accurate detection of subsequent click behavior on the target icon.
  • Step 140 judging whether the position information and the value of the pixel point corresponding to the position information in the two-dimensional mask map satisfy the set condition; if yes, execute step 150.
  • Satisfying the set condition can be understood as whether the value of the pixel is "1" or "3". If the value of the position information clicked by the click operation and the pixel point corresponding to the position information in the two-dimensional mask map is "1" or "3", then the target icon is clicked; otherwise, the target icon is not clicked. That is, if the position clicked by the click operation is "foreground” or "probably foreground", the target icon is clicked.
  • Step 150 determine that the target icon is clicked, and control the target icon to execute the business logic corresponding to the click operation.
  • the business logic is associated with the click operation in the business layer and is set by the technician. For example: if the target icon is clicked, jump to page A; if the target icon is double-clicked, jump to page B. There is no limit to the business logic here, which is defined by the user.
  • the following step is further included: creating a bit array according to the size information of the two-dimensional mask image and the original image.
  • the process of judging whether the position information and the value of the pixel point corresponding to the position information in the two-dimensional mask map satisfies the setting condition may be: judging whether the position information and the value of the position corresponding to the position information in the bit array are the first setting value.
  • the size information may include: width (width) and height (Height).
  • a bit array can be understood as a bitset array, that is, each element in the array occupies one bit. Wherein, the first set value may be set as "1".
  • the value of each bit in the bit array represents whether the corresponding pixel in the original image belongs to the target icon. If the value in the bit is "1", it indicates that the pixel is the target icon, and if the value in the bit is "0", it indicates that the pixel is not the target icon.
  • the bit array is used to assist in detecting the click behavior on the target icon, and the image information can be compressed by at least 7/8, thereby reducing the memory occupied by the image, saving system resources, and improving the speed of click detection.
  • the process of creating a bit array according to the size information of the two-dimensional mask image and the original image can be: create a corresponding size empty array according to the size information of the original image; traverse the pixels in the two-dimensional mask image, if the pixels traversed If the value of the pixel satisfies the first condition, the value of the corresponding position of the pixel and the pixel in the vacancy array is set as the first set value; if the value of the traversed pixel satisfies the second condition, the pixel and the pixel The value of the corresponding position of the point in the vacancy array is set as the second set value.
  • the first condition is that the pixel point is the foreground
  • the second condition is that the pixel point is the background; that is, the first condition can be that the flag information is "1" or "3", and the second condition can be that the flag information is "0" or "2" .
  • FIG. 2a is an example diagram of an original image corresponding to a target icon
  • FIG. 2b is a schematic diagram of a bit array corresponding to a target icon.
  • "1" indicates that the pixel point is the target icon
  • "0" indicates that the pixel point is the background.
  • the value of each bit in the bit array is determined by the value of the pixel in the two-dimensional mask image, so that the bit array corresponds to the two-dimensional mask image, and the accuracy of the bit array is improved, thereby improving Accuracy of click detection.
  • the following step is further included: deleting the original image and the size information from the memory.
  • the click behavior on the target icon can be detected only according to the bit array, so the original image and size information can be deleted from the memory, thereby saving memory space and improving the speed of click detection.
  • the original image containing the target icon is obtained; the front and back scenes in the original image are segmented to obtain a two-dimensional mask map; wherein, the value of the pixel in the two-dimensional mask map indicates whether it is the target icon ; Obtain the position information of the click operation on the control corresponding to the target icon; determine whether the position information and the value of the corresponding pixel point in the two-dimensional mask map meet the set conditions; if so, the target icon is clicked, and the control target icon is executed The business logic corresponding to the click operation.
  • the icon click detection method of the embodiment of the present disclosure determines whether the icon is clicked by judging whether the clicked position information and the pixel value of the position information in the two-dimensional mask map meet the set conditions, and can accurately and quickly detect the interface.
  • Fig. 3 is a schematic structural diagram of an icon click detection device provided by an embodiment of the present disclosure. As shown in Figure 3, the device includes the following modules.
  • the original image acquisition module 210 is configured to acquire the original image containing the target icon
  • the foreground and foreground segmentation module 220 is configured to segment the foreground and foreground in the original image to obtain a two-dimensional mask map; wherein, the value of the pixel in the two-dimensional mask map indicates whether it is a target icon;
  • the location information acquisition module 230 is configured to acquire the location information of the click operation on the control corresponding to the target icon;
  • the judging module 240 is configured to judge whether the position information and the value of the pixel point corresponding to the position information in the two-dimensional mask map meet the set condition;
  • the click determination module 250 is configured to determine that the target icon is clicked when the position information and the value of the pixel point corresponding to the position information in the two-dimensional mask map meet the set conditions, and control the target icon to perform the business corresponding to the click operation logic.
  • the foreground and foreground segmentation module 220 is set to:
  • bit array creation module configured to: after said segmenting the foreground and foreground in the original image to obtain a two-dimensional mask image
  • the judging module 240 is set to:
  • bit array creation module is set to:
  • an image deletion module configured to: after creating the bit array according to the size information of the two-dimensional mask image and the original image,
  • the location information acquisition module 230 is set to:
  • the position information is transformed according to the transformation matrix to obtain the position information of the click operation on the control where the target icon is located.
  • the location information acquisition module 230 is set to:
  • the above-mentioned device can execute the methods provided by all the foregoing embodiments of the present disclosure, and has corresponding functional modules and effects for executing the above-mentioned methods.
  • the above-mentioned device can execute the methods provided by all the foregoing embodiments of the present disclosure, and has corresponding functional modules and effects for executing the above-mentioned methods.
  • FIG. 4 it shows a schematic structural diagram of an electronic device 300 suitable for implementing an embodiment of the present disclosure.
  • Electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computers (Portable Android Device, PAD), portable multimedia players (Portable Multimedia Player, PMP), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), fixed terminals such as digital television (television, TV), desktop computers, etc., or various forms of servers, such as independent servers or Server cluster.
  • PDA Personal Digital Assistant
  • PAD Portable multimedia players
  • PMP Portable Multimedia Player
  • mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), fixed terminals such as digital television (television, TV), desktop computers, etc.
  • PMP portable multimedia players
  • mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), fixed terminals such as digital television (television, TV), desktop
  • the electronic device 300 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 301, and the processing device 301 may be stored in a program or A program loaded from the storage device 308 into the random access memory (Random Access Memory, RAM) 303 executes various appropriate actions and processes. In the RAM 303, various programs and data necessary for the operation of the electronic device 300 are also stored.
  • the processing device 301, ROM 302, and RAM 303 are connected to each other through a bus 304.
  • An input/output (Input/Output, I/O) interface 305 is also connected to the bus 304 .
  • the following devices can be connected to the I/O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; including, for example, a liquid crystal display (Liquid Crystal Display, LCD), a speaker , an output device 307 such as a vibrator; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309.
  • the communication means 309 may allow the electronic device 300 to perform wireless or wired communication with other devices to exchange data. While FIG. 4 shows electronic device 300 having various means, it is not a requirement to implement or possess all of the means shown. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing a word recommendation method.
  • the computer program may be downloaded and installed from a network via communication means 309, or from storage means 308, or from ROM 302.
  • the processing device 301 When the computer program is executed by the processing device 301, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof.
  • a computer readable storage medium may include, but is not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Flash memory, optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • the program code contained on the computer readable medium can be transmitted by any appropriate medium, including but not limited to: electric wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
  • the storage medium may be a non-transitory storage medium.
  • the client and the server can communicate using any currently known or future network protocols such as Hypertext Transfer Protocol (HyperText Transfer Protocol, HTTP), and can communicate with digital data in any form or medium
  • the communication eg, communication network
  • Examples of communication networks include local area networks (Local Area Network, LAN), wide area networks (Wide Area Network, WAN), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently existing networks that are known or developed in the future.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: acquires the original image containing the target icon; Segmentation to obtain a two-dimensional mask map; wherein, the value of the pixel in the two-dimensional mask map indicates whether it is the target icon; obtain the position information of the click operation on the control corresponding to the target icon; determine the Whether the position information and the value of the pixel point corresponding to the position information in the two-dimensional mask map meet the set condition; When the value of the pixel point satisfies the set condition, it is determined that the target icon is clicked, and the target icon is controlled to execute the business logic corresponding to the click operation.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user computer through any kind of network, including a LAN or WAN, or it can be connected to an external computer (eg via the Internet using an Internet Service Provider).
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures.
  • two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • Each block in the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by dedicated hardware implemented in combination with computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself in one case.
  • FPGA Field Programmable Gate Array
  • ASIC Application Specific Integrated Circuit
  • ASSP Application Specific Standard Parts
  • SOC System on Chip
  • Complex Programmable Logic Device Complex Programmable Logic Device, CPLD
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • Machine-readable storage media include one or more wire-based electrical connections, portable computer discs, hard drives, RAM, ROM, EPROM, flash memory, optical fiber, portable CD-ROMs, optical storage devices, magnetic storage devices, or Any suitable combination of content.
  • the embodiments of the present disclosure provide a method for detecting icon clicks, including:
  • Segmenting the foreground and foreground in the original image to obtain a two-dimensional mask image including:
  • Foreground and background segmentation is performed on the grayscale image to obtain a two-dimensional mask image.
  • the two-dimensional mask map After the foreground and foreground segmentation in the original image is obtained and the two-dimensional mask map is obtained, it also includes:
  • bit array is created according to the two-dimensional mask image and the size information of the original image, it further includes:
  • the original image and the size information are deleted from memory.
  • Obtaining the position information of the click operation on the control corresponding to the target icon including:
  • the position information is transformed according to the transformation matrix to obtain the position information of the click operation on the control where the target icon is located.
  • Transforming the position information according to the transformation matrix to obtain the position information of the click operation on the control where the target icon is located including:

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本公开提供了一种图标点击的检测方法、装置、设备及存储介质。该图标点击的检测方法包括:获取包含目标图标的原始图像;对所述原始图像中的前后景进行分割,获得二维掩膜图;其中,所述二维掩膜图中像素点的值表征是否为所述目标图标;获取在所述目标图标对应的控件上的点击操作的位置信息;判断所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值是否满足设定条件;在所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值满足所述设定条件的情况下,确定所述目标图标被点击,并控制所述目标图标执行所述点击操作对应的业务逻辑。

Description

图标点击的检测方法、装置、设备及存储介质
本申请要求在2021年12月17日提交中国专利局、申请号为202111554937.X的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及图像处理技术领域,例如涉及一种图标点击的检测方法、装置、设备及存储介质。
背景技术
图标点击的判定方式大多是根据图像特征来判断,例如:通过判定点击位置的像素颜色特征或透明度特征来区分是否点击命中图标区域。这种判断方式有局限性,不能普适于通用性的界面框架,而且判断点击往往需要内存中持有图像数据,占用内存。
发明内容
本公开提供一种图标点击的检测方法、装置、设备及存储介质,可以准确快速的检测到界面中对图标的点击行为。
本公开提供了一种图标点击的检测方法,包括:
获取包含目标图标的原始图像;
对所述原始图像中的前后景进行分割,获得二维掩膜图,其中,所述二维掩膜图中像素点的值表征是否为所述目标图标;
获取在所述目标图标对应的控件上的点击操作的位置信息;
判断所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值是否满足设定条件;
在所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值满足所述设定条件的情况下,确定所述目标图标被点击,并控制所述目标图标执行所述点击操作对应的业务逻辑。
本公开还提供了一种图标点击的检测装置,包括:
原始图像获取模块,设置为获取包含目标图标的原始图像;
前后景分割模块,设置为对所述原始图像中的前后景进行分割,获得二维掩膜图,其中,所述二维掩膜图中像素点的值表征是否为所述目标图标;
位置信息获取模块,设置为获取在所述目标图标对应的控件上的点击操作的位置信息;
判断模块,设置为判断所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值是否满足设定条件;
点击确定模块,设置为在所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值满足设定条件的情况下,确定所述目标图标被点击,并控制所述目标图标执行所述点击操作对应的业务逻辑。
还提供了一种电子设备,包括:
一个或多个处理装置;
存储装置,设置为存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理装置执行,使得所述一个或多个处理装置实现如本公开实施例所述的图标点击的检测方法。
还提供了一种计算机可读介质,存储有计算机程序,该计算机程序被处理装置执行时实现如本公开实施例所述的图标点击的检测方法。
附图说明
图1是本公开实施例中的一种图标点击的检测方法的流程图;
图2a是本公开实施例中的目标图标对应的原始图像示例图;
图2b是本公开实施例中的目标图标对应的位数组示意图;
图3是本公开实施例中的一种图标点击的检测装置的结构示意图;
图4是本公开实施例中的一种电子设备的结构示意图。
具体实施方式
下面将参照附图描述本公开的实施例。虽然附图中显示了本公开的一些实施例,然而本公开可以通过多种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了理解本公开。本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
本公开的方法实施方式中记载的多个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。 术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,除非在上下文另有指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
图1为本公开实施例提供的一种图标点击的检测方法的流程图,本实施例可适用于对图像的点击行为进行检测的情况,该方法可以由图标点击的检测装置来执行,该装置可由硬件和/或软件组成,并一般可集成在具有对网页的渲染图标点击的检测功能的设备中,该设备可以是服务器、移动终端或服务器集群等电子设备。如图1所示,该方法包括如下步骤。
步骤110,获取包含目标图标的原始图像。
目标图标可以是由规则图形或者不规则图形构成的图标,原始图像包含目标图标以及背景区域。本实施例应用于显示界面的场景下,目标图标可以理解为显示于界面上的图标。目标图标可以设置于按钮控件上,通过绘制布局,设置有目标图标的按钮控件在显示界面的设定位置显示。
步骤120,对原始图像中的前后景进行分割,获得二维掩膜图。
二维掩膜图中像素点的值表征是否为目标图标。本实施例中,目标图标所在的区域为前景区域,其余区域为背景区域。标记信息可以由设定数值表示,包括“0”、“1”、“2”和“3”。其中,0表示背景;1表示前景;2表示可能的背景;3表示可能的前景。
可以采用任意的图像分割算法(如:GrabCut算法)对原始图像进行前后景分割,以获得原始图像中每个像素点是否为目标图标的标记信息,从而获得二维掩膜图。
可选的,对原始图像中的前后景进行分割,获得二维掩膜图的方式可以是:对原始图像进行灰度处理,获得灰度图像;对灰度图像进行前后景分割,获得二维掩膜图。
对原始图像进行灰度处理的过程可以理解为将原始图像每个像素点的彩色 颜色值转化为0-255之间的灰度值,从而获得灰度图像。在获得灰度图像后,采用GrabCut算法对灰度图像进行前后景分割,获得表征每个像素点是否为目标图标的二维掩膜图。本实施例中,对原始图像进行灰度处理,进行前后景分割,可以提高图像分割的效率。
步骤130,获取在目标图标对应的控件上的点击操作的位置信息。
本实施例中,目标图标在界面窗口中显示,用户可以通过鼠标或者触碰笔在界面窗口触发点击操作,操作系统检测用户在界面窗口上的点击操作,并获取点击操作在界面窗口的位置信息,将在界面窗口的位置信息转换为在目标图标所在控件上的位置信息。
获取在目标图标对应的控件上的点击操作的位置信息的过程可以是:获取在界面窗口的点击操作的位置信息;获取界面窗口与目标图标所在控件间的变换矩阵;根据变换矩阵对位置信息进行变换,获得在目标图标所在控件的点击操作的位置信息。
根据变换矩阵对位置信息进行变换,获得在目标图标所在控件的点击操作的位置信息的方式可以是:将位置信息与变换矩阵的逆矩阵进行点乘,获得在目标图标所在控件的点击操作的位置信息。
本实施例中,系统可以获取到界面窗口上的点击位置,设点击位置为(p gx,p gy)。假设目标图标设置在一个按钮控件上,按钮控件名为BtnIcon,通过绘制布局,可以获得BtnIcon在界面窗口上的位置(Btn gx,Btn gy),从而可以获得按钮上位置到界面窗口位置的变换矩阵Trans 2*2,则点击在BtnIcon上的位置按照如下公式获得:
Figure PCTCN2022131250-appb-000001
本实施例中,通过界面窗口与目标图标所在控件间的变换矩阵确定在控件上的点击位置,可以准确的获取在控件上的点击位置,以利于后续对目标图标的点击行为的准确检测。
步骤140,判断位置信息与位置信息在二维掩膜图中对应的像素点的值是否满足设定条件;若是,则执行步骤150。
满足设定条件可以理解为像素点的值是否为“1”或“3”。若点击操作点击的位置信息与该位置信息在二维掩膜图中对应的像素点的值为“1”或“3”,则目标图标被点击,否则,目标图标未被点击。即点击操作点击的位置为“前景”或者“可能为前景”,则目标图标被点击。
步骤150,确定目标图标被点击,并控制目标图标执行点击操作对应的业务逻辑。
业务逻辑在业务层中与点击操作关联,由技术人员来设置。例如:若目标图标为单击,则跳转至A页面,若目标图标被双击,则跳转至B页面。此处对业务逻辑不做限定,由用户自定义。
可选的,在对原始图像中的前后景进行分割,获得二维掩膜图之后,还包括如下步骤:根据二维掩膜图和原始图像的尺寸信息创建位数组。判断位置信息与位置信息在二维掩膜图中对应的像素点的值是否满足设定条件的过程可以是:判断位置信息与位置信息在位数组中对应的位置的值是否为第一设定值。
尺寸信息可以包括:宽(width)和高(Height)。位数组可以理解为位集合(bitset)数组,即数组中每个元素占一个比特位。其中,第一设定值可以设置为“1”。本实施例中,位数组中每个比特位中的值代表在原始图像中对应像素点是否属于目标图标。若比特位中的值为“1”,则表明该像素点为目标图标,若比特位中的值为“0”,则表明该像素点不是目标图标。本实施例中,根据位数组来辅助检测对目标图标的点击行为,可以将图像信息压缩至少7/8,从而减少图像占用的内存,节省系统资源,从提升点击检测的速度。
根据二维掩膜图和原始图像的尺寸信息创建位数组的过程可以是:根据原始图像的尺寸信息创建对应大小的空位数组;遍历二维掩膜图中的像素点,若遍历到的像素点的值满足第一条件,则将像素点与像素点在空位数组中的对应位置的值设置为第一设定值;若遍历到的像素点的值满足第二条件,则将像素点与像素点在空位数组中的对应位置的值设置为第二设定值。
第一条件为像素点为前景,第二条件为像素点为背景;即第一条件可以是标记信息为“1”或者“3”,第二条件可以是标记信息为“0”或者“2”。根据原始图像的尺寸信息创建Width*Height大小的位数组,遍历二维掩膜图,若遍历到第i行第j列的数组值为1或者3时,设置位数组中i*width+j的值为1,若遍历到第i行第j列的数组值为0或者2时,设置位数组中i*width+j的值为0。即将图像的前景和背景信息以1和0的形式记录在位数组中。示例性的,图2a为目标图标对应的原始图像示例图,图2b为目标图标对应的位数组示意图。如图2b所示,“1”表示该像素点为目标图标,“0”表示该像素点为背景。本实施例中,通过二维掩膜图中像素点的值确定位数组中每个比特位中的值,使得位数组与二维掩膜图相对应,提高位数组的准确性,从而可以提高点击检测的准确性。
可选的,在根据二维掩膜图和原始图像的尺寸信息创建位数组之后,还包括如下步骤:将原始图像及尺寸信息从内存中删除。
本实施例中,在获得位数组后,可以是只根据位数组来检测对目标图标的点击行为,因此可以将原始图像及尺寸信息从内存中删除,从而节省内存空间,提升点击检测的速度。
本公开实施例的技术方案,获取包含目标图标的原始图像;对原始图像中的前后景进行分割,获得二维掩膜图;其中,二维掩膜图中像素点的值表征是否为目标图标;获取在目标图标对应控件的点击操作的位置信息;判断位置信息与位置信息在二维掩膜图中对应像素点的值是否满足设定条件;若是,则目标图标被点击,控制目标图标执行点击操作对应的业务逻辑。本公开实施例的图标点击的检测方法,通过判断点击的位置信息与位置信息在二维掩膜图中像素点的值是否满足设定条件来确定图标是否被点击,可以准确快速的检测到界面中对图标的点击行为。
图3是本公开实施例提供的一种图标点击的检测装置的结构示意图。如图3所示,该装置包括如下模块。
原始图像获取模块210,设置为获取包含目标图标的原始图像;
前后景分割模块220,设置为对原始图像中的前后景进行分割,获得二维掩膜图;其中,二维掩膜图中像素点的值表征是否为目标图标;
位置信息获取模块230,设置为获取在目标图标对应的控件上的点击操作的位置信息;
判断模块240,设置为判断位置信息与位置信息在二维掩膜图中对应的像素点的值是否满足设定条件;
点击确定模块250,设置为在位置信息与位置信息在二维掩膜图中对应的像素点的值满足设定条件的情况下,确定目标图标被点击,并控制目标图标执行点击操作对应的业务逻辑。
可选的,前后景分割模块220,是设置为:
对原始图像进行灰度处理,获得灰度图像;
对灰度图像进行前后景分割,获得二维掩膜图。
可选的,还包括:位数组创建模块,设置为:在所述对所述原始图像中的前后景进行分割,获得二维掩膜图之后,
根据二维掩膜图和原始图像的尺寸信息创建位数组;
可选的,判断模块240,是设置为:
判断位置信息与位置信息在位数组中对应的位置的值是否为第一设定值。
可选的,位数组创建模块,是设置为:
根据原始图像的尺寸信息创建对应大小的空位数组;
遍历二维掩膜图中的像素点,若遍历到的像素点的值满足第一条件,则将像素点与像素点在空位数组中的对应位置的值设置为第一设定值;若遍历到的像素点的值满足第二条件,则将像素点与像素点在空位数组中的对应位置的值设置为第二设定值;其中,第一条件为像素点为前景,第二条件为像素点为背景。
可选的,还包括:图像删除模块,设置为:在所述根据所述二维掩膜图和所述原始图像的尺寸信息创建位数组之后,
将原始图像及尺寸信息从内存中删除。
可选的,位置信息获取模块230,是设置为:
获取在界面窗口的点击操作的位置信息;
获取界面窗口与目标图标所在控件间的变换矩阵;
根据变换矩阵对位置信息进行变换,获得在目标图标所在控件的点击操作的位置信息。
可选的,位置信息获取模块230,是设置为:
将位置信息与变换矩阵的逆矩阵进行点乘,获得在目标图标所在控件的点击操作的位置信息。
上述装置可执行本公开前述所有实施例所提供的方法,具备执行上述方法相应的功能模块和效果。未在本实施例中详尽描述的技术细节,可参见本公开前述所有实施例所提供的方法。
下面参考图4,其示出了适于用来实现本公开实施例的电子设备300的结构示意图。本公开实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,PDA)、平板电脑(Portable Android Device,PAD)、便携式多媒体播放器(Portable Multimedia Player,PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字电视(television,TV)、台式计算机等等的固定终端,或者多种形式的服务器,如独立服务器或者服务器集群。图4示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图4所示,电子设备300可以包括处理装置(例如中央处理器、图形处理器等)301,处理装置301可以根据存储在只读存储装置(Read-only Memory,ROM)302中的程序或者从存储装置308加载到随机访问存储装置(Random  Access Memory,RAM)303中的程序而执行多种适当的动作和处理。在RAM 303中,还存储有电子设备300操作所需的多种程序和数据。处理装置301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(Input/Output,I/O)接口305也连接至总线304。
以下装置可以连接至I/O接口305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置306;包括例如液晶显示器(Liquid Crystal Display,LCD)、扬声器、振动器等的输出装置307;包括例如磁带、硬盘等的存储装置308;以及通信装置309。通信装置309可以允许电子设备300与其他设备进行无线或有线通信以交换数据。虽然图4示出了具有多种装置的电子设备300,但是并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行词语的推荐方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置309从网络上被下载和安装,或者从存储装置308被安装,或者从ROM 302被安装。在该计算机程序被处理装置301执行时,执行本公开实施例的方法中限定的上述功能。
本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、RAM、ROM、可擦式可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。存储介质可以是非暂态(non-transitory)存储介质。
在一些实施方式中,客户端、服务器可以利用诸如超文本传输协议(HyperText Transfer Protocol,HTTP)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取包含目标图标的原始图像;对所述原始图像中的前后景进行分割,获得二维掩膜图;其中,所述二维掩膜图中像素点的值表征是否为所述目标图标;获取在所述目标图标对应的控件上的点击操作的位置信息;判断所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值是否满足设定条件;在所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值满足所述设定条件的情况下,确定所述目标图标被点击,并控制所述目标图标执行所述点击操作对应的业务逻辑。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括LAN或WAN—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开多种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实 现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在一种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(Field Programmable Gate Array,FPGA)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用标准产品(Application Specific Standard Parts,ASSP)、片上系统(System on Chip,SOC)、复杂可编程逻辑设备(Complex Programmable Logic Device,CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、RAM、ROM、EPROM、快闪存储器、光纤、便捷式CD-ROM、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开实施例的一个或多个实施例,本公开实施例提供了一种图标点击的检测方法,包括:
获取包含目标图标的原始图像;
对所述原始图像中的前后景进行分割,获得二维掩膜图;其中,所述二维掩膜图中像素点的值表征是否为所述目标图标;
获取在所述目标图标对应控件的点击操作的位置信息;
判断所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值是否满足设定条件;
在所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值满足设定条件的情况下,确定所述目标图标被点击,并控制所述目标图标执行所述点击操作对应的业务逻辑。
对所述原始图像中的前后景分割,获得二维掩膜图,包括:
对所述原始图像进行灰度处理,获得灰度图像;
对所述灰度图像进行前后景分割,获得二维掩膜图。
在对所述原始图像中的前后景分割,获得二维掩膜图之后,还包括:
根据所述二维掩膜图和所述原始图像的尺寸信息创建位数组;
判断所述位置信息与所述位置信息在所述二维掩膜图中对应像素点的值是否满足设定条件,包括:
判断所述位置信息与所述位置信息在所述位数组中对应位置的值是否为第一设定值。
根据所述二维掩膜图和所述原始图像的尺寸信息创建位数组,包括:
根据所述原始图像的尺寸信息创建对应大小的空位数组;
遍历所述二维掩膜图中的像素点,若遍历到的像素点的值满足第一条件,则将所述像素点与所述像素点在所述空位数组中的对应位置的值设置为第一设定值;若遍历到的像素点的值满足第二条件,则将所述像素点与所述像素点在所述空位数组中的对应位置的值设置为第二设定值;其中,第一条件为所述像素点为前景,第二条件为所述像素点为背景。
在根据所述二维掩膜图和所述原始图像的尺寸信息创建位数组之后,还包括:
将所述原始图像及所述尺寸信息从内存中删除。
获取在所述目标图标对应控件的点击操作的位置信息,包括:
获取在界面窗口的点击操作的位置信息;
获取界面窗口与所述目标图标所在控件间的变换矩阵;
根据所述变换矩阵对所述位置信息进行变换,获得在所述目标图标所在控件的点击操作的位置信息。
根据所述变换矩阵对所述位置信息进行变换,获得在所述目标图标所在控件的点击操作的位置信息,包括:
将所述位置信息与所述变换矩阵的逆矩阵进行点乘,获得在所述目标图标所在控件的点击操作的位置信息。

Claims (10)

  1. 一种图标点击的检测方法,包括:
    获取包含目标图标的原始图像;
    对所述原始图像中的前后景进行分割,获得二维掩膜图,其中,所述二维掩膜图中像素点的值表征是否为所述目标图标;
    获取在所述目标图标对应的控件上的点击操作的位置信息;
    判断所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值是否满足设定条件;
    在所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值满足所述设定条件的情况下,确定所述目标图标被点击,并控制所述目标图标执行所述点击操作对应的业务逻辑。
  2. 根据权利要求1所述的方法,其中,所述对所述原始图像中的前后景进行分割,获得二维掩膜图,包括:
    对所述原始图像进行灰度处理,获得灰度图像;
    对所述灰度图像进行前后景分割,获得所述二维掩膜图。
  3. 根据权利要求1所述的方法,其中,在所述对所述原始图像中的前后景进行分割,获得二维掩膜图之后,还包括:
    根据所述二维掩膜图和所述原始图像的尺寸信息创建位数组;
    所述判断所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值是否满足设定条件,包括:
    判断所述位置信息与所述位置信息在所述位数组中对应的位置的值是否为第一设定值。
  4. 根据权利要求3所述的方法,其中,所述根据所述二维掩膜图和所述原始图像的尺寸信息创建位数组,包括:
    创建与所述原始图像的尺寸信息对应大小的空位数组;
    遍历所述二维掩膜图中的像素点,在遍历到的像素点的值满足第一条件的情况下,将所述像素点与所述像素点在所述空位数组中的对应位置的值设置为所述第一设定值;在遍历到的像素点的值满足第二条件的情况下,将所述像素点与所述像素点在所述空位数组中的对应位置的值设置为第二设定值;其中,所述第一条件为所述像素点为前景,所述第二条件为所述像素点为背景。
  5. 根据权利要求3所述的方法,其中,在所述根据所述二维掩膜图和所述原始图像的尺寸信息创建位数组之后,还包括:
    将所述原始图像及所述尺寸信息从内存中删除。
  6. 根据权利要求1所述的方法,其中,所述获取在所述目标图标对应的控件上的点击操作的位置信息,包括:
    获取在界面窗口的点击操作的位置信息;
    获取所述界面窗口与所述目标图标所在控件间的变换矩阵;
    根据所述变换矩阵对所述位置信息进行变换,获得在所述目标图标对应的控件上的点击操作的位置信息。
  7. 根据权利要求6所述的方法,其中,所述根据所述变换矩阵对所述位置信息进行变换,获得在所述目标图标对应的控件上的点击操作的位置信息,包括:
    将所述位置信息与所述变换矩阵的逆矩阵进行点乘,获得在所述目标图标对应的控件上的点击操作的位置信息。
  8. 一种图标点击的检测装置,包括:
    原始图像获取模块,设置为获取包含目标图标的原始图像;
    前后景分割模块,设置为对所述原始图像中的前后景进行分割,获得二维掩膜图,其中,所述二维掩膜图中像素点的值表征是否为所述目标图标;
    位置信息获取模块,设置为获取在所述目标图标对应的控件上的点击操作的位置信息;
    判断模块,设置为判断所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值是否满足设定条件;
    点击确定模块,设置为在所述位置信息与所述位置信息在所述二维掩膜图中对应的像素点的值满足所述设定条件的情况下,确定所述目标图标被点击,并控制所述目标图标执行所述点击操作对应的业务逻辑。
  9. 一种电子设备,包括:
    至少一个处理装置;
    存储装置,设置为存储至少一个程序;
    当所述至少一个程序被所述至少一个处理装置执行,使得所述至少一个处理装置实现如权利要求1-7中任一项所述的图标点击的检测方法。
  10. 一种计算机可读介质,存储有计算机程序,其中,所述计算机程序被处理装置执行时实现如权利要求1-7中任一项所述的图标点击的检测方法。
PCT/CN2022/131250 2021-12-17 2022-11-11 图标点击的检测方法、装置、设备及存储介质 WO2023109385A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111554937.XA CN116266087A (zh) 2021-12-17 2021-12-17 图标点击的检测方法、装置、设备及存储介质
CN202111554937.X 2021-12-17

Publications (1)

Publication Number Publication Date
WO2023109385A1 true WO2023109385A1 (zh) 2023-06-22

Family

ID=86743824

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/131250 WO2023109385A1 (zh) 2021-12-17 2022-11-11 图标点击的检测方法、装置、设备及存储介质

Country Status (3)

Country Link
US (1) US20230195288A1 (zh)
CN (1) CN116266087A (zh)
WO (1) WO2023109385A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009146343A (ja) * 2007-12-18 2009-07-02 Nikon Corp 画像処理情報表示用プログラム、および画像処理情報表示装置
CN104657458A (zh) * 2015-02-06 2015-05-27 腾讯科技(深圳)有限公司 场景图像中的前景目标的目标信息的展示方法及装置
CN113608805A (zh) * 2021-07-08 2021-11-05 阿里巴巴新加坡控股有限公司 掩膜预测方法、图像处理方法、显示方法及设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101023207B1 (ko) * 2007-09-05 2011-03-18 한국전자통신연구원 영상 객체 추출 장치 및 그 방법
KR20140055703A (ko) * 2012-11-01 2014-05-09 삼성전자주식회사 컨텐츠 공유 방법 및 시스템
WO2018226790A1 (en) * 2017-06-09 2018-12-13 ORock Holdings, LLC Secure network-accessible system for executing remote applications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009146343A (ja) * 2007-12-18 2009-07-02 Nikon Corp 画像処理情報表示用プログラム、および画像処理情報表示装置
CN104657458A (zh) * 2015-02-06 2015-05-27 腾讯科技(深圳)有限公司 场景图像中的前景目标的目标信息的展示方法及装置
CN113608805A (zh) * 2021-07-08 2021-11-05 阿里巴巴新加坡控股有限公司 掩膜预测方法、图像处理方法、显示方法及设备

Also Published As

Publication number Publication date
CN116266087A (zh) 2023-06-20
US20230195288A1 (en) 2023-06-22

Similar Documents

Publication Publication Date Title
CN112184738B (zh) 一种图像分割方法、装置、设备及存储介质
WO2021179882A1 (zh) 图像的绘制方法、装置、可读介质和电子设备
WO2021135626A1 (zh) 菜单项选择方法、装置、可读介质及电子设备
CN111882634B (zh) 一种图像渲染方法、装置、设备及存储介质
WO2022237811A1 (zh) 图像处理方法、装置及设备
WO2023143178A1 (zh) 对象分割方法、装置、设备及存储介质
WO2022252881A1 (zh) 图像处理方法、装置、可读介质和电子设备
WO2022111591A1 (zh) 页面生成方法和装置、存储介质和电子设备
US20230334880A1 (en) Hot word extraction method and apparatus, electronic device, and medium
WO2022105622A1 (zh) 图像分割方法、装置、可读介质及电子设备
WO2020156058A1 (zh) 基于终端的图像拖拽变形实现方法和装置
CN110874172B (zh) 放大app界面的方法、装置、介质及电子设备
CN111738316B (zh) 零样本学习的图像分类方法、装置及电子设备
CN111459364A (zh) 图标更新方法、装置和电子设备
WO2022099871A1 (zh) 笔迹数据处理方法、装置及电子设备
WO2024037556A1 (zh) 图像处理方法、装置、设备及存储介质
WO2023138468A1 (zh) 虚拟物体的生成方法、装置、设备及存储介质
WO2023109385A1 (zh) 图标点击的检测方法、装置、设备及存储介质
WO2023088379A1 (zh) 表格处理方法、装置、电子设备和存储介质
WO2023065895A1 (zh) 文本识别方法、装置、可读介质及电子设备
WO2022242441A1 (zh) 电子表格导入方法、装置、设备及介质
WO2023056841A1 (zh) 一种数据服务方法、装置及相关产品
WO2022052889A1 (zh) 图像识别方法、装置、电子设备和计算机可读介质
CN113807056B (zh) 一种文档名称序号纠错方法、装置和设备
CN110334763B (zh) 模型数据文件生成、图像识别方法、装置、设备及介质

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: 22906137

Country of ref document: EP

Kind code of ref document: A1