Image acquisition method, device, equipment and storage medium
By responding to the application image acquisition request in the MacOS system, obtaining the window information of the target application and taking a screenshot, it solves the problem of low screenshot efficiency, achieves fast and accurate window image acquisition, and improves the user experience.
Patent Information
- Application Number
- CN202210412595.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-04-19
AI Technical Summary
In the MacOS system, the efficiency of capturing the window image of an application is low, and it is difficult to quickly and accurately obtain the window information of the target application with existing technology, resulting in a cumbersome screenshot process.
By responding to the application image acquisition request, the window information of the started window is obtained according to the application identification information of the target application, including window identification information, size information and position information, and then the window image of the target application is obtained. The image is realized by combining software and hardware. Obtain and support screenshots in multi-window situations.
It improves the efficiency and accuracy of capturing application window images on MacOS, and can quickly obtain the window information of the target application, improving the user's screenshot experience.
Smart Images

Figure CN114820882B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of computer vision and intelligent cloud technology, and specifically to an image acquisition method, device, equipment and storage medium. Background Art
[0002] With the development of computer technology, the use of Apple operating system (MacOS) is becoming more and more widespread. Among them, when using a device equipped with MacOS, users need to capture the window image of an application. Therefore, how to quickly capture the window image of an application on MacOS is very important. Summary of the invention
[0003] The present disclosure provides an image acquisition method, apparatus, device and storage medium.
[0004] According to one aspect of the present disclosure, there is provided an image acquisition method, the method comprising:
[0005] In response to an application image acquisition request, acquiring window information of a started window of the target application according to application identification information of the target application in the application image acquisition request; the window information includes window identification information;
[0006] The window image of the target application is acquired according to the window information of the started window.
[0007] According to another aspect of the present disclosure, there is provided an electronic device, the electronic device comprising:
[0008] at least one processor; and
[0009] a memory communicatively connected to the at least one processor; wherein,
[0010] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image acquisition method described in any embodiment of the present disclosure.
[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the image acquisition method described in any embodiment of the present disclosure.
[0012] According to the technology disclosed in the present invention, the efficiency of capturing window images of applications on MacOS can be improved.
[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0015] Figure 1 is a flow chart of an image acquisition method provided according to an embodiment of the present disclosure;
[0016] Figure 2 is a flow chart of another image acquisition method provided according to an embodiment of the present disclosure;
[0017] Figure 3 is a flowchart of another image acquisition method provided according to an embodiment of the present disclosure;
[0018] Figure 4 is a structural schematic diagram of an image acquisition device provided according to an embodiment of the present disclosure;
[0019] Figure 5 It is a block diagram of an electronic device used to implement the image acquisition method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0021] Figure 1 This is a flowchart of an image acquisition method provided according to an embodiment of the present disclosure. The method is applicable to the case of how to acquire an image, and is particularly applicable to the case of how to capture an application window image on MacOS. The method can be executed by an image acquisition device, which can be implemented in software and / or hardware, and can be integrated into an electronic device that carries an image acquisition function. Figure 1 As shown, the image acquisition method of this embodiment may include:
[0022] S101 , in response to an application image acquisition request, acquiring window information of an activated window of a target application according to application identification information of a target application in the application image acquisition request.
[0023] In this embodiment, the application image acquisition request is a request for acquiring a window image of a target application. Optionally, the application image acquisition request may include application identification information of the target application; wherein the application identification information refers to an identifier for uniquely identifying an application, for example, under MacOS, the application identification information may be the bundle id of the application.
[0024] An application may have one or more windows. In this embodiment, the activated window of the target application is the window of the target application that has been activated by the current system up to the moment when the application image acquisition request is obtained; optionally, the number of activated windows may be one or more.
[0025] The so-called window information is information related to the window, which may include window identification information, wherein the window identification information refers to an identifier used to uniquely identify the window, such as the window ID; further, the window information may also include window size information, window position information and window startup time, etc., wherein the window size information is the window resolution, and the window position information may include the coordinate information of the four vertices of the window, specifically may include the coordinate information of the four vertices of the window relative to the desktop origin coordinates (0, 0).
[0026] Optionally, when a user has a need to obtain an application image, the user can initiate an application image acquisition request that includes application identification information of a target application. In response to the application image acquisition request initiated by the user, it is possible to first determine whether the target application is running based on the application identification information of the target application. If the target application is already running, the window information of the started window of the target application is obtained based on the application identification information of the target application.
[0027] The method of determining whether the target application is running may be to obtain application identification information of all applications currently running in the system, compare the application identification information of the target application with the application identification information of all the obtained applications one by one, and determine whether the target application is running according to the comparison result. Optionally, if it is determined according to the comparison result that all applications currently running in the system include the target application, then it is determined that the target application is running.
[0028] In an optional manner, the activated window of the target application may be determined from all windows activated by the current system according to the application identification information of the target application in the application image request. For example, based on the association between the window and the application identification information, all windows activated by the current system may be traversed according to the application identification information of the target application to determine the activated window of the target application, and obtain the window information of the activated window.
[0029] S102: Acquire a window image of a target application according to the window information of the started window.
[0030] Optionally, when the number of started windows is one, the window image of the target application can be obtained according to the window identification information of the started window. For example, the image corresponding to the window can be obtained by using the method of obtaining an image according to the window identification information on MacOS, such as using cmd+shift+4->space to capture the image corresponding to the window.
[0031] Furthermore, when the number of activated windows is two or more, the window image of the target application may be acquired according to the window identification information, window size information and window position information of the activated windows.
[0032] It should be noted that no matter the target application is in the background running state or in the current display state, as long as the target application is running, the complete image of the started window of the target application can be captured through this solution.
[0033] The technical solution of the disclosed embodiment obtains the window information of the activated window of the target application according to the application identification information of the target application in the application image acquisition request in response to the application image acquisition request; and then obtains the window image of the target application according to the window information of the activated window. The above technical solution obtains the activated window information based on the application identification information. When the number of applications started by the system is large, the window information can be obtained quickly, accurately and comprehensively, thereby improving the efficiency of obtaining the window information, thereby improving the efficiency of capturing the window image of the application on MacOS.
[0034] In the MacOS system, an application can only start one instance, that is, an application corresponds to only one running process, and then the window information of the started window of the target application can be obtained based on the running process of the target application.
[0035] Optionally, on the basis of the above embodiments, as an optional method of the present disclosure, obtaining the window information of the launched window of the target application according to the application identification information of the target application in the application image acquisition request can also be: obtaining the process identification information of the running process corresponding to the target application according to the application identification information of the target application in the application image acquisition request; and obtaining the window information of the launched window of the target application according to the process identification information.
[0036] The process identification information refers to an identifier used to uniquely represent the process running the target application, for example, it may be a process ID. Optionally, one running process may correspond to multiple windows in one application.
[0037] Specifically, all running processes of the current system are obtained, and based on the correspondence between the running processes and the applications, all the running processes obtained are traversed according to the application identification information of the target application to determine the running process corresponding to the target application. Then, according to the process identification information of the running process corresponding to the target application, the window information of the started window of the target application is obtained. For example, based on the association between the window and the process identification information, according to the process identification information of the running process corresponding to the target application, all the windows started by the current system are traversed to determine the started window of the target application, and the window information of the started window is obtained.
[0038] It can be understood that acquiring the window information of the started window of the target application based on the process identification information further improves the efficiency of acquiring the window information of the started window of the target application.
[0039] On the basis of the above embodiments, as an optional method of the present disclosure, obtaining the window image of the target application according to the window information of the launched window can also be: obtaining the initial image of the target application according to the window information of the launched window; scaling and / or rotating the initial image to obtain the window image of the target application.
[0040] Specifically, the initial image of the target application is obtained according to the window information of the started window, for example, the initial image of the target application can be obtained according to the window identification information of the started window; further, the initial image of the target application can be obtained according to the window identification information, window size information and window position information of the started window. Afterwards, the initial image can be scaled and / or rotated in response to a scaling and / or rotation operation on the initial image, or according to the image display information provided by the user, to obtain the window image of the target application. The image display information may include display size information and / or display orientation information.
[0041] It is understandable that the initial image of the target application can be scaled and rotated according to user needs, further improving the user's screenshot experience.
[0042] Figure 2 is a flow chart of another image acquisition method provided according to an embodiment of the present disclosure. Based on the above embodiment, this embodiment further optimizes "acquiring the window image of the target application according to the window information of the started window" and provides an optional implementation scheme. Figure 2 As shown, the image acquisition method of this embodiment may include:
[0043] S201 , in response to an application image acquisition request, acquiring window information of an activated window of a target application according to application identification information of a target application in the application image acquisition request.
[0044] In this embodiment, the window information may include but is not limited to window identification information, window size information and window position information.
[0045] S202: Determine a main window and a secondary window from the activated windows according to the window activation time of the activated windows.
[0046] In this embodiment, the window start time is the time when the window is triggered to start.
[0047] Specifically, when there are multiple started windows, the window with the earliest window start time among the started windows may be used as the main window, and the other started windows may be used as secondary windows.
[0048] S203: Acquire a main image corresponding to the main window according to the window identification information of the main window.
[0049] Specifically, the main image corresponding to the main window can be obtained according to the window identification information of the main window in the same way as obtaining an image according to the window identification information on MacOS. For example, the main window can be located from all windows started in the current system according to the window identification information of the main window, and then the main image corresponding to the main window can be captured based on cmd+shift+4->space.
[0050] S204: Acquire a secondary image corresponding to the secondary window according to the window identification information of the secondary window.
[0051] Specifically, for each window, the method of obtaining an image based on window identification information on MacOS can also be used to obtain the secondary image corresponding to the secondary window based on the window identification information of the secondary window. For example, the secondary window can be located from all windows started in the current system based on the window identification information of the secondary window, and then the secondary image corresponding to the secondary window can be captured based on cmd+shift+4->space.
[0052] S205 , acquiring a window image of the target application according to the window size information, window position information and main image of the main window, and the window position information and secondary image of the secondary window.
[0053] An optional method is to draw an editable interface, such as a blank canvas, according to the window size information of the main window, and then render the main image and the secondary image into the blank canvas according to the window position information of the main window and the window position information of the secondary window to obtain the window image of the target application.
[0054] Another optional method is to create a blank canvas based on the window size information of the main window and the window size information of the secondary window. For example, the window size information of the main window and the secondary window can be compared, and a blank canvas can be created based on the larger window size information of the main window and the secondary window. Then, the window position information and the main image of the main window, as well as the window position information and the secondary image of the secondary window are sequentially rendered to the blank canvas to obtain the window image of the target application.
[0055] The technical solution of the disclosed embodiment is to obtain the window information of the activated window of the target application according to the application identification information of the target application in the application image acquisition request in response to the application image acquisition request, and then determine the main window and the secondary window from the activated window according to the window activation time of the activated window, obtain the main image corresponding to the main window according to the window identification information of the main window, and obtain the secondary image corresponding to the secondary window according to the window identification information of the secondary window, and then obtain the window image of the target application according to the window size information, window position information and main image of the main window, and the window position information and secondary image of the secondary window. The above technical solution can intercept the complete image of the activated window of the target application when the number of activated windows of the target application is large.
[0056] Figure 3 is a flowchart of another image acquisition method provided according to an embodiment of the present disclosure. Based on the above embodiment, this embodiment further optimizes "acquiring the window image of the target application according to the window size information, window position information and main image of the main window, and the window position information and secondary image of the secondary window", and provides an optional implementation scheme. Figure 3 As shown, the image acquisition method of this embodiment may include:
[0057] S301 , in response to an application image acquisition request, acquiring window information of an activated window of a target application according to application identification information of a target application in the application image acquisition request.
[0058] In this embodiment, the window information includes but is not limited to window identification information, window size information and window position information.
[0059] S302: Determine a main window and a secondary window from the activated windows according to the window activation time of the activated windows.
[0060] S303: Acquire a main image corresponding to the main window according to the window identification information of the main window.
[0061] S304: Acquire a secondary image corresponding to the secondary window according to the window identification information of the secondary window.
[0062] S305: Create a blank canvas according to the window size information of the main window.
[0063] Specifically, a blank canvas is created using the window size information of the main window as the size information of the blank canvas. For example, if the window size information of the main window is 600*600, a 600*600 blank canvas can be created.
[0064] S306, rendering the main image onto a blank canvas to obtain an intermediate image.
[0065] In this embodiment, the intermediate image is an editable image.
[0066] Specifically, the main image may be tiled onto a blank canvas to obtain an intermediate image.
[0067] S307: Determine relative position information of the secondary image on the intermediate image according to the window position information of the main window and the window position information of the secondary window.
[0068] In this embodiment, the relative position information is the position information of the image corresponding to the secondary window on the intermediate image.
[0069] An optional method is to determine the relative position information of the secondary image on the intermediate image based on the window position information of the main window and the window position information of the secondary window based on a pre-trained model.
[0070] Another optional method is to determine the reference point coordinates of the main window from the window position information of the main window; determine the difference between the window position information of the secondary window and the reference point coordinates of the main window; and determine the relative position information of the secondary image on the intermediate image based on the difference.
[0071] The reference point coordinates are vertex coordinates of the vertices in the window position information of the main window that can be used as the reference point of the canvas.
[0072] Specifically, if the secondary window is inside the main window, that is, the secondary window completely covers the main window, the coordinates of the upper left vertex in the window position information of the main window can be used as the reference point coordinates of the main window. Afterwards, for each window, the difference between the window position information of the secondary window (specifically the coordinates of each vertex of the secondary window) and the reference point coordinates of the main window can be calculated, and the difference can be used as the relative position information of the secondary image corresponding to the secondary window on the intermediate image.
[0073] Furthermore, if there is a partial overlap between the secondary window and the main window, that is, the secondary window partially covers the main window, then the overlapping window between the secondary window and the main window, as well as the window position information of the overlapping window are determined, and then, the upper left vertex coordinates in the window position information of the main window are used as the reference point coordinates of the main window, and then, the difference between the window position information of the overlapping window (specifically, the coordinates of each vertex of the overlapping window) and the reference point coordinates of the main window is calculated, and the difference is used as the relative position information of the secondary image corresponding to the secondary window on the intermediate image.
[0074] It can be understood that setting a reference point to determine the relative position information of the secondary image on the intermediate image can avoid distortion of the drawn secondary image and ensure the original appearance of the secondary image finally covered on the intermediate image.
[0075] S308, superimposing the secondary image onto the intermediate image according to the relative position information to obtain a window image of the target application.
[0076] Specifically, for each image, the image is superimposed on the intermediate image according to the relative position information to obtain a window image of the target application.
[0077] The technical solution of the disclosed embodiment is to obtain the window information of the activated window of the target application according to the application identification information of the target application in the application image acquisition request in response to the application image acquisition request, and then determine the main window and the secondary window from the activated window according to the window startup time of the activated window, obtain the main image corresponding to the main window according to the window identification information of the main window, and obtain the secondary image corresponding to the secondary window according to the window identification information of the secondary window, and then create a blank canvas according to the window size information of the main window, render the main image on the blank canvas to obtain an intermediate image, determine the relative position information of the secondary image on the intermediate image according to the window position information of the main window and the window position information of the secondary window, and superimpose the secondary image on the intermediate image according to the relative position information to obtain the window image of the target application. The above technical solution provides a preferred method for capturing the complete window image of the application on MacOS by introducing a blank canvas when there are multiple activated windows of the target application, enriches the function of screenshots on MacOS, and further improves the user experience.
[0078] On the basis of the above embodiments, as an optional method of the present disclosure, if the number of secondary windows is at least two, the secondary image is superimposed on the intermediate image according to the relative position information to obtain the window image of the target application. It can also be that, according to the window startup time of the at least two secondary windows, the stacking order of the secondary images corresponding to the at least two secondary windows is determined; according to the stacking order and the relative position information of the at least two secondary images on the intermediate image, the at least two secondary images are superimposed on the intermediate image to obtain the window image of the target application.
[0079] Specifically, the sequence of window startup time of at least two sub-windows is used as the stacking order of sub-images corresponding to the at least two sub-windows, and then according to the relative position information of the at least two sub-images on the intermediate image, the at least two sub-images are superimposed on the intermediate image in sequence according to the stacking order to obtain the window image of the target application.
[0080] It is understandable that the stacking order is determined by the window startup time, and the window image of the target application is obtained based on the stacking order, which fits the actual situation of the started window of the target application and truly restores the original appearance of the started window of the target application.
[0081] On the basis of the above embodiment, as an optional method of the present disclosure, if the number of secondary windows is at least two, the secondary image is superimposed on the intermediate image according to the relative position information to obtain the application window image of the target application. It can also be that according to the set window overlay value and the window startup time of at least two secondary windows, the target window is selected from at least two secondary windows; according to the relative position information of the secondary image corresponding to the target window on the intermediate image, the secondary image is superimposed on the intermediate image to obtain the window image of the target application.
[0082] Specifically, at least two sub-windows can be sorted according to the order of their window startup time, and the sub-window with the set window superimposed with the numerical value on the front of the sort is used as the target window, and then the sub-image corresponding to the target window is superimposed on the intermediate image according to the relative position information of the sub-image on the intermediate image to obtain the window image of the target application.
[0083] It is understandable that when there is too much secondary window data, an overlay quantity limitation condition is introduced, that is, the window overlay value is set. The secondary window can be flexibly selected according to the window startup time, thereby avoiding the situation where the window image of the target application is confused due to too many secondary window images.
[0084] Figure 41 is a schematic diagram of the structure of an image acquisition device provided according to an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the case of how to acquire an image, and is particularly applicable to the case of how to capture an application window image on MacOS. The device can be implemented by software and / or hardware, and the device can implement the image acquisition method of any embodiment of the present disclosure. Figure 4 As shown, the image acquisition device 400 includes:
[0085] The window information acquisition module 401 is used to respond to the application image acquisition request and acquire the window information of the started window of the target application according to the application identification information of the target application in the application image acquisition request;
[0086] The window image acquisition module 402 is used to acquire the window image of the target application according to the window information of the started window.
[0087] The technical solution of the embodiment of the present disclosure obtains the window information of the started window of the target application according to the application identification information of the target application in the application image acquisition request in response to the application image acquisition request, and then obtains the window image of the target application according to the window information of the started window. The above technical solution obtains the started window information based on the application identification information. When the number of applications started by the system is large, the window information can be obtained quickly, accurately and comprehensively, thereby improving the efficiency of obtaining the window information, thereby improving the efficiency of capturing the window image of the application on MacOS.
[0088] Furthermore, the window information acquisition module 401 is specifically used for:
[0089] Acquire the process identification information of the running process corresponding to the target application according to the application identification information of the target application in the application image acquisition request;
[0090] According to the process identification information, the window information of the started window of the target application is obtained.
[0091] Furthermore, the window information also includes window size information and window position information; accordingly, the window image acquisition module 402 includes:
[0092] A window determination unit, used to determine a main window and a secondary window from the activated windows according to the window activation time of the activated windows;
[0093] A main image acquisition unit, used for acquiring a main image corresponding to the main window according to the window identification information of the main window;
[0094] A secondary image acquisition unit, used for acquiring a secondary image corresponding to the secondary window according to the window identification information of the secondary window;
[0095] The window image acquisition unit is used to acquire the window image of the target application according to the window size information, window position information and main image of the main window, and the window position information and secondary image of the secondary window.
[0096] Furthermore, the window image acquisition unit includes:
[0097] A blank canvas creation subunit is used to create a blank canvas according to the window size information of the main window;
[0098] An intermediate image determination subunit, used for rendering the main image onto a blank canvas to obtain an intermediate image;
[0099] A relative position information determining subunit, used to determine the relative position information of the secondary image on the intermediate image according to the window position information of the main window and the window position information of the secondary window;
[0100] The window image determination subunit is used to superimpose the secondary image on the intermediate image according to the relative position information to obtain the window image of the target application.
[0101] Furthermore, the relative position information determination subunit is specifically used for:
[0102] Determine the reference point coordinates of the main window from the window position information of the main window;
[0103] Determine the difference between the window position information of the secondary window and the reference point coordinates of the main window;
[0104] According to the difference, the relative position information of the secondary image on the intermediate image is determined.
[0105] Further, if the number of the secondary windows is at least two, the window image determination subunit is specifically used for:
[0106] Determining, according to the window activation time of the at least two secondary windows, a stacking order of the secondary images corresponding to the at least two secondary windows;
[0107] According to the stacking order and the relative position information of the at least two sub-images on the intermediate image, the at least two sub-images are superimposed on the intermediate image to obtain a window image of the target application.
[0108] Further, if the number of the secondary windows is at least two, the window image determination subunit is further specifically used for:
[0109] Selecting a target window from at least two secondary windows according to a set window overlap value and window start times of at least two secondary windows;
[0110] According to the relative position information of the secondary image corresponding to the target window on the intermediate image, the secondary image is superimposed on the intermediate image to obtain the window image of the target application.
[0111] Furthermore, the window image acquisition module is specifically used for:
[0112] According to the window information of the started window, an initial image of the target application is obtained;
[0113] The initial image is scaled and / or rotated to obtain a window image of the target application.
[0114] In the technical solution disclosed in the present invention, the acquisition, storage and application of the initial image and window image involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0115] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0116] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0117] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0118] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0119] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as image acquisition methods. For example, in some embodiments, the image acquisition method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the image acquisition method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the image acquisition method in any other appropriate manner (e.g., by means of firmware).
[0120] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0121] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0122] In the context of the present disclosure, 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, device, or equipment. 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, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0124] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0125] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0126] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.
[0127] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.
[0128] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0129] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An image acquisition method, comprising: In response to an application image acquisition request, acquiring window information of a started window of the target application according to application identification information of the target application in the application image acquisition request; The window information includes window identification information, window size information and window position information; Acquiring the window image of the target application according to the window information of the activated window, including: determining a main window and a secondary window from the activated window according to the window activation time of the activated window; Acquire a main image corresponding to the main window according to the window identification information of the main window; Acquire a secondary image corresponding to the secondary window according to the window identification information of the secondary window; The window image of the target application is acquired according to the window size information, the window position information and the main image of the main window, and the window position information and the secondary image of the secondary window.
2. The method according to claim 1, wherein: The acquiring the window information of the started window of the target application according to the application identification information of the target application in the application image acquisition request includes: Acquire process identification information of a running process corresponding to the target application according to the application identification information of the target application in the application image acquisition request; According to the process identification information, the window information of the started window of the target application is obtained.
3. The method according to claim 1, wherein: The acquiring the window image of the target application according to the window size information, the window position information and the main image of the main window, and the window position information and the secondary image of the secondary window, comprises: Creating a blank canvas according to the window size information of the main window; Rendering the main image onto the blank canvas to obtain an intermediate image; Determining relative position information of the secondary image on the intermediate image according to the window position information of the main window and the window position information of the secondary window; According to the relative position information, the secondary image is superimposed on the intermediate image to obtain a window image of the target application.
4. The method according to claim 3, wherein: The determining the relative position information of the secondary image on the intermediate image according to the window position information of the main window and the window position information of the secondary window comprises: Determine the reference point coordinates of the main window from the window position information of the main window; Determine the difference between the window position information of the secondary window and the reference point coordinates of the main window; The relative position information of the secondary image on the intermediate image is determined according to the difference.
5. The method according to claim 3, wherein: If the number of the secondary windows is at least two, superimposing the secondary image on the intermediate image according to the relative position information to obtain the window image of the target application includes: Determining, according to the window activation time of the at least two secondary windows, a stacking order of the secondary images corresponding to the at least two secondary windows; According to the stacking order and the relative position information of the at least two sub-images on the intermediate image, the at least two sub-images are superimposed on the intermediate image to obtain the window image of the target application.
6. The method according to claim 3, wherein: If the number of the secondary windows is at least two, superimposing the secondary image on the intermediate image according to the relative position information to obtain the application window image of the target application includes: Selecting a target window from the at least two secondary windows according to a set window overlap value and window start times of the at least two secondary windows; According to the relative position information of the secondary image corresponding to the target window on the intermediate image, the secondary image is superimposed on the intermediate image to obtain the window image of the target application.
7. The method according to claim 1, wherein: The acquiring the window image of the target application according to the window information of the started window includes: Acquiring an initial image of the target application according to the window information of the started window; The initial image is scaled and / or rotated to obtain a window image of the target application.
8. An image acquisition device, comprising: A window information acquisition module, configured to respond to an application image acquisition request and acquire window information of an activated window of the target application according to application identification information of the target application in the application image acquisition request; The window information includes window identification information, window size information and window position information; Window image acquisition module, including: A window determining unit, configured to determine a main window and a secondary window from the activated window according to the window activation time of the activated window; A main image acquisition unit, used for acquiring a main image corresponding to the main window according to the window identification information of the main window; A secondary image acquisition unit, configured to acquire a secondary image corresponding to the secondary window according to the window identification information of the secondary window; The window image acquisition unit is used to acquire the window image of the target application according to the window size information, window position information and main image of the main window, and the window position information and secondary image of the secondary window.
9. The device according to claim 8, wherein: The window information acquisition module is specifically used for: Acquire process identification information of a running process corresponding to the target application according to the application identification information of the target application in the application image acquisition request; According to the process identification information, the window information of the started window of the target application is obtained.
10. The device according to claim 8, wherein: The window image acquisition unit comprises: A blank canvas creation subunit, used to create a blank canvas according to the window size information of the main window; An intermediate image determination subunit, used for rendering the main image onto the blank canvas to obtain an intermediate image; a relative position information determining subunit, configured to determine relative position information of the secondary image on the intermediate image according to the window position information of the main window and the window position information of the secondary window; The window image determination subunit is used to superimpose the secondary image on the intermediate image according to the relative position information to obtain the window image of the target application.
11. The device according to claim 10, wherein: The relative position information determination subunit is specifically used for: Determine the reference point coordinates of the main window from the window position information of the main window; Determine the difference between the window position information of the secondary window and the reference point coordinates of the main window; The relative position information of the secondary image on the intermediate image is determined according to the difference.
12. The device according to claim 10, wherein: If the number of the secondary windows is at least two, the window image determination subunit is specifically used for: Determining, according to the window activation time of the at least two secondary windows, a stacking order of the secondary images corresponding to the at least two secondary windows; According to the stacking order and the relative position information of the at least two sub-images on the intermediate image, the at least two sub-images are superimposed on the intermediate image to obtain the window image of the target application.
13. The device according to claim 10, wherein: If the number of the secondary windows is at least two, the window image determination subunit is further specifically configured to: Selecting a target window from the at least two secondary windows according to a set window overlap value and window start times of the at least two secondary windows; According to the relative position information of the secondary image corresponding to the target window on the intermediate image, the secondary image is superimposed on the intermediate image to obtain the application window image of the target application.
14. The device according to claim 8, wherein: The window image acquisition module is specifically used for: Acquiring an initial image of the target application according to the window information of the started window; The initial image is scaled and / or rotated to obtain a window image of the target application.
15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the image acquisition method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the image acquisition method according to any one of claims 1-7.
17. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the image acquisition method according to any one of claims 1 to 7.
