Color picking method and electronic equipment
By pre-acquiring the image's color storage information and color block fusion method, the problem of processor computing consumption caused by multiple color image acquisitions is solved, and efficient color acquisition is achieved in low-performance devices.
Patent Information
- Application Number
- CN202510513661.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-09-19
AI Technical Summary
When the existing technology extracts colors of an image multiple times, such as a desktop wallpaper, it is necessary to calculate the color of the color-extracted area multiple times, resulting in high processor computing power and being difficult to effectively implement in electronic devices with low computing performance.
By pre-acquiring the image's stored color information, utilizing the location information of the color-picking area and the color information of the stored color block, a color block fusion method is adopted to reduce processor computational consumption, including weighted averaging and color purity adjustment, combined with grid area connectivity processing to optimize the color-picking algorithm.
While ensuring the color picking effect, the computing consumption of the processor is significantly reduced and the computing performance of the processor is improved.
Smart Images

Figure CN120672873A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a color selection method and electronic equipment. Background Art
[0002] Image color extraction is widely used in electronics. Related technologies can perform real-time color extraction based on the coordinates of an image and a region within it. For example, a desktop calendar on a personal computer (PC) can be displayed with the background color of the calendar as the desktop wallpaper.
[0003] However, for some images that will be colored multiple times, such as desktop wallpapers, due to the changes in the color picking area, it is necessary to use a color picking algorithm to perform multi-position color picking operations on the image to obtain the color of the color picking area. This method consumes a lot of computational resources. Summary of the Invention
[0004] The embodiments of the present application provide a color picking method and an electronic device, which reduce the computing power of a processor while ensuring the color picking effect.
[0005] In the first aspect, the embodiments of the present application provide a color selection method that can be applied to electronic devices. The electronic device here can refer to the electronic device itself, or it can refer to a processor, module, chip, or chip system that implements the method in the electronic device. The following is an example of an electronic device, and the method includes the following steps:
[0006] Obtain position information of a color picking area in a first image; determine the color of the color picking area based on the position information of the color picking area and the color storage information of the first image, wherein the color storage information of the first image includes: position information of multiple color storage blocks of the first image and color information corresponding to the multiple color storage blocks.
[0007] In this application, the electronic device pre-acquires the color storage information of the first image, and determines the color of the color picking area based on the color storage information and the position information of the color picking area. This method does not repeatedly use the color picking algorithm to calculate the color of the color picking area, which can reduce the computing consumption of the processor and ensure the color picking effect.
[0008] In one possible design, the electronic device determines the proportion of each color storage block in the color picking area and the color information corresponding to each color storage block in the color picking area based on the position information of the color picking area and the color storage information of the first image; and performs color block fusion based on the proportion of each color storage block in the color picking area and the color information corresponding to each color storage block in the color picking area to determine the color of the color picking area.
[0009] This method does not repeatedly use the color picking algorithm to calculate the color of the color picking area, which can reduce the computing consumption of the processor, ensure the color picking effect, and clearly define the color of the color picking area.
[0010] In one possible design, color block fusion includes one of the following methods: if the color picking area includes a first proportion color block, each color storage block in the color picking area is weighted averaged according to the proportion; or, if the color picking area includes multiple second proportion color blocks, after adjusting the weights of the color storage blocks corresponding to the multiple second proportion color blocks, each color storage block in the color picking area is weighted averaged; or, if the color picking area includes multiple third proportion color blocks, each color storage block in the color picking area is weighted averaged according to the proportion and then the color purity is reduced; wherein, the first proportion color block is a color storage block with an area proportion greater than 80% in the color picking area; multiple second proportion color blocks are color storage blocks with the same category of color, and the total area proportion of the multiple second proportion color blocks in the color picking area is greater than 80%; multiple third proportion color blocks are color storage blocks with the same category of color, and the total area proportion of the multiple third proportion color blocks in the color picking area is not greater than 80%.
[0011] Using the above method to perform color block fusion can reduce the computing consumption of the processor and ensure the color picking effect.
[0012] In one possible design, after the electronic device divides the first image into multiple grid areas of the same size, it samples the multiple grid areas separately to obtain the intermediate color values in the multiple grid areas respectively; according to the distance values between the intermediate color values in the multiple grid areas, the multiple grid areas are connected to obtain multiple color storage areas, wherein the color storage areas correspond to the color storage blocks; a color sampling algorithm is used to sample colors from the multiple color storage areas separately to obtain multiple color storage blocks, and color storage information of the first image is obtained; and the color storage information of the first image is stored.
[0013] Acquiring the stored color information of the first image based on the above method can reduce the computational consumption of the processor and ensure the color extraction effect.
[0014] In one possible design, the electronic device connects multiple grid areas based on the distance values between the intermediate color values in the multiple grid areas to obtain multiple color storage areas, and determines that a first condition is satisfied; wherein the first condition includes one or more of the following: the area of the first image is greater than or equal to a first area threshold; or, the color picking areas are discretely distributed; or, the area of the color picking areas is greater than or equal to a second area threshold, and the second area threshold is related to the area of the first image.
[0015] Based on this, the electronic device can clearly determine the timing for performing connectivity processing on the grid area, and further reduce the computational consumption of the processor.
[0016] In a possible design, the electronic device divides the first image into multiple grid areas of the same size, samples the multiple grid areas respectively, obtains color storage information of the first image, and stores the color storage information of the first image.
[0017] By acquiring the color storage information of the first image in the above manner, the color extraction effect can be guaranteed.
[0018] In one possible design, the electronic device responds to a color picking area selection operation; or receives a system notification.
[0019] Based on this, the electronic device can obtain the position information of the color picking area.
[0020] In one possible design, the color picking area is static or changes dynamically.
[0021] In one possible design, the location information includes one of the following:
[0022] The geographic coordinates of all endpoints, the coordinates of the center point and the length of the sides, and the geographic coordinates of one endpoint and the length of the sides.
[0023] In one possible design, the color information is indicated by one of the following parameters: RGB (red (R), green (G), blue (B)) value.
[0024] In a second aspect, embodiments of the present application provide an electronic device comprising one or more processors and a memory; the one or more processors are coupled to the memory, and the one or more processors are configured to read a computer program stored in the memory to execute any of the methods provided in any of the above aspects. The computer program code includes computer instructions.
[0025] In a third aspect, an embodiment of the present application provides a chip comprising a processor coupled to a memory, wherein the processor is configured to invoke computer program instructions stored in the memory at runtime to implement the method provided in any of the above aspects. Optionally, the chip may further include components such as a memory, a communication interface, and a power supply module. The memory is configured to store computer programs; the communication interface is configured to receive and send data; and the power supply is configured to supply power to the processor.
[0026] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores computer program instructions. When the computer program instructions are executed on an electronic device, the computer executes the method provided in any of the above aspects.
[0027] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program instructions; when the computer program instructions are run on a computer, the computer is enabled to execute the method provided in any of the above aspects.
[0028] The technical effects that can be achieved in any of the second to fifth aspects mentioned above can refer to the description of the technical effects that can be achieved in any of the possible designs in the first to fifth aspects mentioned above, and the repetitions will not be discussed here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of a color selection process according to an embodiment of the present invention;
[0032] Figure 4A A schematic diagram of a color selection area provided in an embodiment of the present application;
[0033] Figure 4B A schematic diagram of a color selection area provided in an embodiment of the present application;
[0034] Figure 4C A schematic diagram of a color selection area provided in an embodiment of the present application;
[0035] Figure 5 A schematic diagram of another color selection area provided in an embodiment of the present application;
[0036] Figure 6 A schematic diagram of obtaining a color storage block provided in an embodiment of the present application;
[0037] Figure 7 A schematic diagram of color block fusion provided in an embodiment of the present application;
[0038] Figure 8 A schematic diagram of another color block fusion provided in an embodiment of the present application;
[0039] Figure 9 A schematic diagram of another color block fusion provided in an embodiment of the present application;
[0040] Figure 10 A schematic diagram of a color block fusion with a dynamically changing color selection area provided in an embodiment of the present application;
[0041] Figure 11 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] Below, some terms used in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0043] The at least one involved in the embodiments of the present application includes one or more; wherein, more means greater than or equal to two. In addition, it should be understood that, in the description of this specification, words such as "first", "second", and "third" are only used for the purpose of distinguishing the description, and cannot be understood as expressing or implying relative importance, nor can they be understood as expressing or implying order. For example, the first device and the second device do not represent the importance of the two or the order of the two, but are only for distinguishing the description. In the embodiments of the present application, "and / or" is only a description of the association relationship, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.
[0044] The directional terms mentioned in the embodiments of the present application, such as "up", "down", "left", "right", "inside", "outside", etc., are only references to the directions in the drawings. Therefore, the directional terms used are for better and clearer explanation and understanding of the embodiments of the present application, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0045] References to "one embodiment," "in some examples," or "some embodiments" described in the embodiments of this application mean that one or more embodiments of this specification include specific features, structures, or characteristics described in conjunction with the embodiment. Thus, phrases such as "in some examples," "in one embodiment," "in some other embodiments," and "in other embodiments" appearing in different places in this specification do not necessarily all refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0046] The technical solutions provided in the embodiments of the present application can be applied to electronic devices. For example, the electronic device can be a mobile terminal. Exemplarily, the mobile terminal can be a portable device such as a mobile phone, a tablet computer, a laptop computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA); or, it can also be a wearable device such as a watch or a bracelet; or, it can also be a virtual reality (VR) device, an augmented reality (AR) device, a mixed reality (MR) device, etc. In short, the embodiments of the present application do not limit the specific type of mobile terminal.
[0047] like Figure 1 As shown in FIG, a schematic diagram of the structure of an electronic device provided by the present application. The electronic device may be the above-mentioned mobile terminal, for example, a mobile phone. Figure 1 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0048] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. The controller may serve as the nerve center and command center of the electronic device. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. The processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. This memory may store instructions or data that have just been used or are being recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces the processor 110's waiting time, and thus improves system efficiency.
[0049] In some embodiments, the processor 110 may execute the interactive method provided in the embodiments of the present application.
[0050] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0051] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.
[0052] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0053] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0054] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.
[0055] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0056] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0057] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0058] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0059] The wireless communication function of the electronic device can be implemented using antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, a modem processor, and a baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antenna can be used in conjunction with a tuning switch.
[0060] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied in electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0061] The wireless communication module 160 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0062] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that the electronic device can communicate with the network and other devices through wireless communication technology.
[0063] The display screen 194 is used to display the display interface of the application, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0064] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor, etc. Among them, the ISP is used to process the data fed back by the camera 193.
[0065] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, and the software code of at least one application, etc. The data storage area can store data (such as images, videos, etc.) generated during the use of the electronic device. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory, etc.
[0066] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as pictures and videos can be stored on the external memory card.
[0067] The electronic device can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0068] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0069] The speaker 170A, also called a "speaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to external speaker scenarios such as hands-free calls through one or more speakers 170A.
[0070] The receiver 170B, also called "earpiece", can be one or more and is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be heard by placing the receiver 170B close to the human ear.
[0071] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.
[0072] The headphone jack 170D is used to connect a wired headphone.
[0073] The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194 .
[0074] The gyro sensor 180B can be used to determine the motion posture of the electronic device. In some embodiments, the gyro sensor 180B can be used to determine the angular velocity of the electronic device around three axes (i.e., the x, y, and z axes). The gyro sensor 180B can also be used for anti-shake photography.
[0075] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0076] The magnetic sensor 180D includes a Hall sensor, and the electronic device can use the magnetic sensor 180D to detect the opening and closing of the flip cover.
[0077] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device in various directions (generally three axes) and the magnitude and direction of gravity when the electronic device is stationary.
[0078] The distance sensor 180F is used to measure distance. The electronic device can measure distance using infrared or laser.
[0079] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device emits infrared light through the light emitting diode. The electronic device uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device. When insufficient reflected light is detected, the electronic device can determine that there is no object near the electronic device.
[0080] The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness.
[0081] The fingerprint sensor 180H is used to collect fingerprints.
[0082] The temperature sensor 180J is used to detect temperature.
[0083] The touch sensor 180K, also known as a "touch panel," can be mounted on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen." The touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event.
[0084] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone in a human vocal part.
[0085] The buttons 190 include a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The electronic device can receive button input and generate key signal input related to the user settings and function control of the electronic device. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be connected to and separated from the electronic device by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195.
[0086] It is understandable that Figure 1 The components shown do not constitute a specific limitation on the electronic device. The electronic device in the embodiment of the present invention may include Figure 1 More or fewer components in . In addition, Figure 1 The combination / connection relationship between the components can also be adjusted and modified.
[0087] Optionally, the software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. For example, Figure 2 As shown in the figure, the software architecture can be divided into four layers, from top to bottom: application layer, application framework layer (framework, FWK), runtime and system library, and (Linux) kernel layer.
[0088] The application layer is the top layer of the operating system, including native applications of the operating system, such as calendar, Bluetooth, music, video, mailbox, etc., and may also include third-party applications. The application involved in the embodiment of the present application is referred to as application (APP), which is a software program that can realize one or more specific functions. Typically, multiple applications can be installed in an electronic device. The applications mentioned below can be system applications that are installed on the electronic device when it leaves the factory, or they can be third-party applications that the user downloads from the Internet or obtains from other electronic devices while using the electronic device.
[0089] Of course, developers can write applications and install them into this layer. In one possible implementation, applications can be developed using the Java language by calling the application programming interface (API) provided by the application framework layer. Developers can use the application framework to interact with the underlying layer of the operating system (such as the kernel layer) and develop their own applications.
[0090] The application framework layer provides the application API and programming framework. It includes predefined functions and can include a window manager, content provider, view system, resource manager, and notification manager.
[0091] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the display (or screen), capture the display, etc.
[0092] Content providers are used to store and retrieve data and make it accessible to applications. The data may include files (such as documents, videos, images, audio), text, and other information.
[0093] The view system includes visual controls, such as those that display text, images, and documents. The view system is used to build applications. The interface in a display window can be composed of one or more views.
[0094] The runtime includes the core library and the virtual machine. The runtime is responsible for the scheduling and management of the system.
[0095] The system's core library consists of two parts: one containing the Java language's callable functions and the other the system's core library. The application layer and application framework layer run within a virtual machine. For example, in Java, the virtual machine executes Java files from the application and framework layers as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0096] The system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), image processing library, etc. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.564, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.
[0097] The kernel layer provides the operating system's core system services, such as security, memory management, process management, network protocol stacks, and driver models. These services are all implemented at the kernel layer. The kernel layer also serves as an abstraction layer between the hardware and software stacks. This layer contains many drivers related to electronic devices, including the following: keyboard drivers for input devices; audio drivers; Wi-Fi drivers; Bluetooth drivers; and display drivers.
[0098] It should be understood that the functional services described above are only examples. In actual applications, electronic devices can also be divided into more or fewer functional services according to other factors, or the functions of each service can be divided in other ways, or the functional services can be not divided but work as a whole.
[0099] For images that may be picked up multiple times in electronic devices (such as desktop wallpapers, mobile phone screensavers, etc.), a color picking algorithm is used to perform multiple operations on the colors of the picked up areas. This consumes a lot of computation and is unbearable for electronic devices with low computing performance.
[0100] Based on this, this application provides a color picking method that reduces the computational consumption of the processor while ensuring the color picking effect. Figure 1 The electronic device shown in FIG. 1 may have a software structure as shown in FIG. Figure 2 As shown below. Figure 3 The method provided in this application is described in detail. Execute as follows:
[0101] In step 301 , the electronic device obtains position information of a color extraction area in a first image.
[0102] The first image is an image that may be used for multiple color extractions, such as a computer desktop wallpaper, a mobile phone screen saver, a web page cover, etc., which is not specifically limited here. The first image may be a single image or multiple images, and the number and size of the first images are not specifically limited here.
[0103] In one possible implementation, the electronic device can obtain the position information of the color picking area in the first image by calculating the position of the color picking area in response to the color picking area selection operation. The color picking area selection operation can be a user touch operation. For example, the color picking area is a folder, and the user adjusts the size of the folder by sliding the phone screen with his finger to drag the APP icon to the folder. Figure 4A As shown, or as Figure 4B As shown, the user slides the phone screen with his finger to drag the folder location, or, as shown Figure 4C As shown, the user drags the folder position by sliding the finger on the phone screen, and drags the APP icon to the folder to adjust the folder size. In addition, the color picking area selection operation can also be a user voice operation, such as controlling the APP icon on the phone screen to move to a certain folder by voice. This is only an example and not limited to specific examples. In addition, when the electronic device is a laptop, the color picking area selection operation can be understood as dragging a window, such as Figure 5 In the example, the calendar window at different locations on the desktop can be understood as different color picking areas, such as color picking area 1 on the right side of the desktop and color picking area 2 on the lower left side of the desktop. This is only an example and not a limitation. The above color picking areas can be understood as dynamically changing.
[0104] In another possible implementation, the electronic device may receive a system notification to obtain the location information of the color picking area in the first image. For example, the position of a window in a laptop computer (the navigation window below the desktop, such as the taskbar / program bar) is fixed (that is, a static color picking area). The system calculates the location information of the window and sends it directly to the electronic device.
[0105] It should be noted that this application does not specifically limit the shape, size and number of the color picking areas. For example, the color picking area is rectangular, the color picking area is elliptical, and the color picking area is irregular, which are not specifically limited here.
[0106] For example, the location information of the color picking area in the first image can be the geographic coordinates of all endpoints of the color picking area, the coordinates of the center point of the color picking area and the side length, or the geographic coordinates of one endpoint of the color picking area and the side length. How to represent the location information of the color picking area is not specifically limited herein.
[0107] In step 302 , the electronic device determines the color of the color picking area according to the position information of the color picking area and the color storage information of the first image.
[0108] The color storage information of the first image includes: position information of a plurality of color storage blocks of the first image and color information corresponding to the plurality of color storage blocks.
[0109] In a possible implementation, the electronic device obtains the color storage information of the first image in advance by referring to the following steps, and stores the color storage information of the first image, and performs the following:
[0110] In step S1 , the electronic device divides a first image into a plurality of grid areas of the same size, samples the plurality of grid areas respectively, and obtains intermediate color values in the plurality of grid areas respectively.
[0111] For example, if the first image is 640*480 in size, the grid area can be 50*50, 30*30, or the like. The size of the grid area is not specifically limited herein. If the first image includes multiple colors, more grid areas can be provided in the first image, and the grid area sizes can be smaller. If the first image includes a relatively single color, fewer grid areas can be provided in the first image, and the grid area sizes can be larger. The specific method for setting the grid area sizes can be determined based on the size of the first image, the color distribution within the first image, and the computing power of the electronic device. For example, if the first image is 1920*1080 in size, the colors within the first image are relatively scattered and include multiple colors, and the electronic device has relatively strong computing power (e.g., a graphics processing unit (GPU) with 8 cores), the first image can be divided into more grid areas. For example, if the first image is 1920*1080 in size, the colors within the first image are relatively single, and the electronic device has relatively weak computing power (e.g., a GPU with 2 cores), the first image can be divided into fewer grid areas. This is merely an example description and does not specifically limit how to divide the first image into grid areas.
[0112] Exemplarily, the electronic device may use the color value (e.g., RGB value) of the middle pixel in each grid area as the middle color value of each grid area. For example, if the RGB value of the middle pixel in grid area 1 is (25, 25, 25), then (25, 25, 25) is the middle color value. The electronic device may also use the average color value of all pixels in each grid area as the middle color value of each grid area. For example, if grid area 2 includes three pixels, and the RGB values of each pixel are (25, 25, 25), (50, 50, 50), and (75, 75, 75), respectively, and the average color value of the three pixels in grid area 2 is (50, 50, 50), then (50, 50, 50) is the middle color value.
[0113] In addition, the present application does not specifically limit the number of first images. It can be one picture or multiple pictures. The number of first images is not specifically limited here.
[0114] In step S2, the electronic device connects the multiple grid areas according to the distance values between the intermediate color values in the multiple grid areas to obtain multiple color storage areas, wherein the color storage areas correspond to the color storage blocks.
[0115] For example, if the distance between the intermediate color values in multiple grid regions is small, the grid regions can be connected to form a single region. For example, if the RGB values of grid region 1 are (25, 25, 25), the RGB values of grid region 2 are (25, 24, 25), the RGB values of grid region 3 are (24, 25, 25), and the RGB values of grid region 4 are (25, 25, 24), then the distances between grid region 1, grid region 2, grid region 3, and grid region 4 can be understood to be small, and grid region 1, grid region 2, grid region 3, and grid region 4 can be connected to form a single color storage region.
[0116] For example, if the difference in RGB values between adjacent grid regions is small (e.g., an R difference of 0.5, a G difference of 0.5, a B difference of 0.5, etc., which is only an example and not a limitation), the electronic device may connect the grid regions into one region. If the difference in RGB values between adjacent grid regions is large (e.g., an R difference of 10, a G difference of 10, a B difference of 15, etc., which is only an example and not a limitation), the electronic device does not connect the grid regions into one region. Alternatively, the electronic device may convert the RGB values of each grid region into Lab values (where L represents brightness; a positive value represents red, a negative value represents green; b positive value represents yellow, a negative value represents blue). If the Euclidean distance between adjacent grid regions is less than a distance threshold (which can be flexibly set based on the needs of the specific application and is not specifically limited here, for example, in the color selection scenario, the distance threshold is 50), the grid regions may be connected into one region. This is only an example and does not specifically limit how to connect the grid regions.
[0117] In step S3, the electronic device uses a color picking algorithm to pick colors from the multiple color storage areas respectively to obtain multiple color storage blocks, and acquires color storage information of the first image.
[0118] Exemplarily, the electronic device can use the minimum difference method, median segmentation method, octree algorithm, clustering, color modeling method, etc. to extract the color of the color storage area to obtain the color storage information of the first image. The color storage information of the first image includes the position information of multiple color storage blocks of the first image (the geographical location coordinates of all endpoints of any color storage block, and can also be the coordinates and side length of the center point of any color storage block, or the geographical location coordinates and side length of one endpoint of any color storage block. It is not specifically limited here how to characterize the position information of any color storage block) and the color information corresponding to multiple color storage blocks (for example, the RGB value corresponding to the color storage block). Optionally, the color storage information of the first image can also include the label of the color storage block.
[0119] For example, as shown in Table 1 below, the color storage information of the first image stored by the electronic device includes the number of the color storage block, the position information of the color storage block, and the color information corresponding to the color storage block. For example, the position information of color storage block 1 is (15, 15) (15, 45) (45, 15) (45, 45), and the color information corresponding to color storage block 1 is RGB (100, 150, 120). This is merely an example and is not a limitation.
[0120] Table 1
[0121]
[0122] like Figure 6 As shown, the first image is a background image of a portrait. After dividing the first image into multiple grids of the same size, the intermediate color value of each grid is obtained. Figure 6 In this example, the RGB value of the middle pixel of the grid is used as the middle color value. The electronic device connects multiple grid regions to obtain multiple color storage regions, extracts colors from each of the multiple color storage regions, and obtains multiple color storage blocks (color storage blocks 1 to 8). The electronic device then obtains and stores the color storage information of the first image.
[0123] It should be noted that before the electronic device executes step S2, the electronic device may determine whether the first condition is met, and execute step S2 when the first condition is met. When the first condition is not met, the electronic device does not execute the above step S2, that is, the grid areas are not connected. The electronic device may divide the first image into multiple grid areas of the same size, and then sample the multiple grid areas separately to obtain the color storage information of the first image. Among them, the first condition includes one or more of the following: the area of the first image is greater than or equal to the first area threshold (for example, the area of the first image is 30 cm * 24 cm, the first area threshold is 20 cm * 20 cm, then the area of the first image is greater than the first area threshold, or the first area threshold is 80% of the screen area of the electronic device, the electronic device is a computer, the size of the computer is 35.6 cm * 24.5 cm, and the first area threshold is 35.6 cm * 24.5 cm * 80%. This is only an example, and the value of the first area threshold is not specifically limited. , which can be flexibly set based on the needs of actual applications); or, the color picking areas are discretely distributed (for example, the color picking areas are fixed and multiple, and the color picking areas are discretely distributed in the screen of the electronic device, and the color picking areas are distributed in the upper right, lower right, middle, upper left, lower left, etc. of the screen); or, the area of the color picking area is greater than or equal to the second area threshold, and the second area threshold is related to the area of the first image (for example, the area of the first image is 30 cm * 24 cm, and the area of the color picking area is 20 cm * 24 cm, for example, the second area threshold is 50% of the area of the first image).
[0124] In another possible implementation, multiple electronic devices all store color storage information for a first image. When applying the solution of this application, if an electronic device does not store the color storage information for the first image, it may request the color storage information from another electronic device that does store the color storage information for the first image. For example, if electronic device 1 and electronic device 2 both store the color storage information for the first image, but electronic device 3 does not, electronic device 3 may request the color storage information for the first image from either electronic device 1 or electronic device 2. This is merely an example and not a limitation.
[0125] After obtaining the stored color information of the first image, the electronic device may also obtain the position information of the color-picking region in the first image to determine the color of the color-picking region. For example, the stored color information of the first image and the position information of the color-picking region in the first image may be input into an artificial intelligence processing model to obtain the color of the color-picking region, or data processing may be performed based on the stored color information of the first image and the position information of the color-picking region in the first image to obtain the color of the color-picking region, without specific limitation herein.
[0126] For example, the electronic device determines the proportion (e.g., area proportion) of each color storage block in the color picking area and the color storage information of the first image based on the position information of the color picking area and the color storage information of the first image; and performs color block fusion based on the proportion of each color storage block in the color picking area and the color information corresponding to each color storage block in the color picking area to determine the color of the color picking area. Based on this, the color of the color picking area can be clearly determined.
[0127] Specifically, color block fusion includes one of the following methods:
[0128] Method 1: If the color picking area includes a color block with a first proportion, weighted averaging is performed on each color storage block in the color picking area according to the proportion, wherein the first color storage block is a color storage block that accounts for more than 80% of the area in the color picking area.
[0129] For example, Figure 7 As shown, the color picking area in the first image is the portion selected by the rectangular frame, and the color picking area includes the color storage blocks 5, 6, 7, 9, and 10 of the first image. Figure 7 Different fill values represent different RGB values. For example, the area of color storage block 7 accounts for 80% of the color selection area, the area of color storage block 5 accounts for 5%, the area of color storage block 6 accounts for 5%, the area of color storage block 9 accounts for 5%, and the area of color storage block 10 accounts for 5%. Color storage block 7 is the first proportional color block. The color corresponding to the color selection area is obtained by taking the weighted average of the RGB values corresponding to color storage blocks 5, 6, 7, 9, and 10 and the proportion of each color storage block's area in the color selection area. The weighted average is the RGB value of color storage block 5 (25, 25, 25) multiplied by 5% of the area of color storage block 5, plus the RGB value of color storage block 6 (50, 50, 50) multiplied by 5% of the area of color storage block 6, plus the RGB value of color storage block 7 (125, 125, 125) multiplied by 80% of the area of color storage block 7, plus the RGB value of color storage block 9 (150, 150, 150) multiplied by 5% of the area of color storage block 9, plus the RGB value of color storage block 10 (5, 5, 5) multiplied by 5% of the area of color storage block 10, to obtain the value (115, 115, 115). This is merely an example and is not a specific limitation.
[0130] Method 2: If the color picking area includes multiple second proportion color blocks, after adjusting the weights of the color storage blocks corresponding to the multiple second proportion color blocks, the color storage blocks in the color picking area are weighted averaged. Among them, the multiple second proportion color blocks are color storage blocks with the same category of color, and the area and proportion of the multiple second proportion color blocks in the color picking area are greater than 80%. For example, after the RGB value of the second proportion color block is converted to Lab value, if the Euclidean distance between the multiple second proportion color blocks is less than the distance threshold, the second proportion color block is considered to be a color storage block with the same category of color. This is only an example and is not specifically limited.
[0131] For example, Figure 8 As shown, the color extraction area in the first image is the portion selected by the rectangular frame, and the color extraction area includes color storage blocks 8, 9, 10, 11, 12, and 14 of the first image. Among them, color storage blocks 8, 9, and 14 are color storage blocks of the same color category (for example, red), and the total area of color storage blocks 8, 9, and 14 accounts for 80% of the color extraction area. Among them, the area of color storage block 8 accounts for 20% of the color extraction area, the area of color storage block 9 accounts for 20% of the color extraction area, the area of color storage block 14 accounts for 40% of the color extraction area, the area of color storage block 10 accounts for 10% of the color extraction area, the area of color storage block 11 accounts for 5% of the color extraction area, and the area of color storage block 12 accounts for 5% of the color extraction area. Adjust the weight of the second color block to 90% and the weight of the other color storage blocks to 10%. Then the area of color storage block 8 accounts for 22.5% (90%*2 / 8) of the color picking area, the area of color storage block 9 accounts for 22.5% (90%*2 / 8) of the color picking area, the area of color storage block 14 accounts for 45% (90%*4 / 8) of the color picking area, the area of color storage block 10 accounts for 5% (10%*1 / 2) of the color picking area, the area of color storage block 11 accounts for 2.5% (10%*1 / 4) of the color picking area, and the area of color storage block 12 accounts for 2.5% (10%*1 / 4) of the color picking area. The weighted average can be understood by referring to the description in the above method 1 and will not be repeated here.
[0132] Method 3: If the color selection area includes multiple color blocks with a third percentage, the color purity is reduced by weighted averaging the color blocks in the color selection area based on their percentages. The multiple color blocks with a third percentage are color blocks of the same color category, and their combined area and percentage within the color selection area do not exceed 80%.
[0133] For example, Figure 9As shown, the color extraction area in the first image is the portion selected within the rectangular frame, and the color extraction area includes color storage blocks 8, 9, 10, 11, 12, and 14 of the first image. Color storage blocks 8, 9, and 14 are color storage blocks of the same color (e.g., red), and their combined area accounts for 60% of the color extraction area. The area of color storage block 8 accounts for 20% of the color extraction area, the area of color storage block 9 accounts for 20% of the color extraction area, the area of color storage block 14 accounts for 20% of the color extraction area, the area of color storage block 10 accounts for 10% of the color extraction area, the area of color storage block 11 accounts for 5% of the color extraction area, and the area of color storage block 12 accounts for 5% of the color extraction area. Exemplarily, after the electronic device performs weighted averaging on color storage blocks 8, 9, 10, 11, 12, and 14, the obtained RGB values are converted into Lab values, and then converted into LCH values (L (brightness), C (chroma), H (hue angle)), wherein the values of L and H remain unchanged, and the value of C is reduced (for example, the value of C is reduced from 100 to 80, and the specific reduction amount is not specifically limited here and can be flexibly set based on the needs of actual applications), and then converted into Lab values, and then converted into RGB values to obtain a value that reduces color purity. Alternatively, the electronic device performs weighted averaging on the color storage blocks 8, 9, 10, 11, 12, and 14, converts the obtained RGB values into Lab values, and then converts them into HSV values (wherein, hue (H), saturation (S), and value (V), where the values of H and V remain unchanged, and the value of S is reduced (for example, the value of S is reduced from 100 to 80, and the specific reduction amount is not specifically limited here, and can be flexibly set based on the needs of actual application), and then converts them into Lab values, and then converts them into RGB values to obtain a value for reducing color purity. This is only an example description and is not specifically limited. In specific applications, other schemes for reducing color purity may also be involved. The above is only an example description and is not specifically limited here.
[0134] In addition, if Figure 10 As shown, the color picking area changes dynamically. Figure 10 is Figure 7 Specifically, one of the above methods 1 to 3 may be referred to to perform color block fusion to determine the color of the fused color-picking area.
[0135] In this application, the electronic device pre-acquires the color storage information of the first image, and determines the color of the color picking area based on the color storage information and the position information of the color picking area. This method does not repeatedly use the color picking algorithm to calculate the color of the color picking area, which can reduce the computing consumption of the processor and ensure the color picking effect.
[0136] Figure 11Schematic diagram of the structure of the electronic device 1100 provided in the embodiment of the present application. The electronic device 1100 may be the mobile terminal listed above, such as a mobile phone. Figure 11 As shown, the electronic device 1100 may include: one or more processors 1101; one or more memories 1102; a communication interface 1103, and one or more computer programs 1104. The above components may be connected via one or more communication buses 1105. The one or more computer programs 1104 are stored in the above memory 1102 and configured to be executed by the one or more processors 1101. The one or more computer programs 1104 include instructions. For example, when the electronic device 1100 is a mobile phone as described above, the instructions may be used to execute the relevant steps of the mobile phone in the above corresponding embodiments, such as executing Figures 1 to 10 The communication interface 1103 is used to implement communication between the electronic device 1100 and other devices. For example, the communication interface can be a transceiver.
[0137] In the embodiments provided in the present application above, the method provided in the embodiment of the present application is introduced from the perspective of an electronic device (e.g., a mobile phone) as an execution subject. In order to implement the various functions in the method provided in the embodiment of the present application above, the electronic device may include a hardware structure and / or a software module to implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a function of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
[0138] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)). In the absence of conflict, the solutions of the above embodiments can be used in combination.
[0139] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0140] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0141] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0143] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
Claims
1. A color picking method, applied to electronic equipment, characterized in that: include: Obtaining position information of a color extraction area in the first image; The color of the color picking area is determined based on the position information of the color picking area and the color storage information of the first image, wherein the color storage information of the first image includes: the position information of multiple color storage blocks of the first image and the color information corresponding to the multiple color storage blocks.
2. The method according to claim 1, characterized in that The determining the color of the color picking area according to the position information of the color picking area and the color storage information of the first image includes: determining, according to the position information of the color picking area and the color storage information of the first image, the proportion of each color storage block in the color picking area and the color information corresponding to each color storage block in the color picking area; Color block fusion is performed based on the proportion of each color storage block in the color picking area and the color information corresponding to each color storage block in the color picking area to determine the color of the color picking area.
3. The method according to claim 2, characterized in that The color block fusion includes one of the following methods: If the color picking area includes a color block with a first proportion, weighted averaging is performed on each color storage block in the color picking area according to the proportion; or If the color picking area includes a plurality of second proportion color blocks, after adjusting the weights of the color storage blocks corresponding to the plurality of second proportion color blocks, weighted averaging is performed on the color storage blocks in the color picking area; or If the color picking area includes multiple color blocks with a third proportion, the color purity is reduced after weighted averaging of the color blocks in the color picking area according to their proportions; Among them, the first proportion color block is a color storage block whose area accounts for more than 80% in the color picking area; the multiple second proportion color blocks are color storage blocks with the same category of color, and the total area and proportion of the multiple second proportion color blocks in the color picking area are more than 80%; the multiple third proportion color blocks are color storage blocks with the same category of color, and the total area and proportion of the multiple third proportion color blocks in the color picking area are not more than 80%.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: After dividing the first image into a plurality of grid areas of the same size, sampling the plurality of grid areas respectively to obtain intermediate color values in the plurality of grid areas respectively; connecting the plurality of grid areas according to distance values between intermediate color values in the plurality of grid areas to obtain a plurality of color storage areas, wherein the color storage areas correspond to the color storage blocks; Using a color picking algorithm to pick colors from the multiple color storage areas respectively to obtain a plurality of color storage blocks, and acquiring color storage information of the first image; The color storage information of the first image is stored.
5. The method according to claim 4, characterized in that Before connecting the plurality of grid areas according to the distance values between the intermediate color values in the plurality of grid areas to obtain the plurality of color storage areas, the method further includes: Ensure that the first condition is met; The first condition includes one or more of the following: The area of the first image is greater than or equal to a first area threshold; or, The color picking areas are discretely distributed; or, The area of the color picking region is greater than or equal to a second area threshold, and the second area threshold is related to the area of the first image.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: After dividing the first image into a plurality of grid areas of the same size, sampling the plurality of grid areas respectively to obtain color storage information of the first image; The color storage information of the first image is stored.
7. The method according to any one of claims 1 to 6, characterized in that: The acquiring of the position information of the color picking area in the first image includes one or more of the following methods: In response to a color picking area selection operation; or Receive system notifications.
8. The method according to any one of claims 1 to 7, characterized in that: The color picking area is static or dynamically changing.
9. The method according to any one of claims 1 to 8, characterized in that The location information includes one of the following: The geographic coordinates of all endpoints, the coordinates of the center point and the length of the sides, and the geographic coordinates of one endpoint and the length of the sides.
10. An electronic device, characterized in that: The electronic device includes a memory and one or more processors; The memory is used to store computer program code, which includes computer instructions; when the computer instructions are executed by the one or more processors, the electronic device executes the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is run on an electronic device, the electronic device executes the method according to any one of claims 1 to 9.
12. A computer program product, characterized in that The computer program product includes a computer program or instructions. When the computer program or instructions are run on an electronic device, the electronic device is enabled to perform the method according to any one of claims 1 to 9.