Picture resource processing method and device and electronic equipment

By obtaining image features in software development and using clustering algorithms to divide image collections and updating resource reference parameters, the data redundancy problem caused by redundant images is solved, and project execution efficiency and automation processing capabilities are improved.

CN120523987APending Publication Date: 2025-08-22NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510406359.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

In software application development, redundant pictures lead to redundant business project data, and the existing similarity calculation methods are inefficient and insufficiently accurate, so redundant pictures cannot be effectively removed.

Method used

By obtaining the image features in the business project, using the clustering algorithm to divide similar images into the collection, and updating the resource reference parameters, so that the pictures in the similar image collection only reference one image in the business project, reducing redundancy.

Benefits of technology

It effectively reduces data redundancy in business projects, improves execution efficiency, reduces labor costs, and improves the project's automation processing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120523987A_ABST
    Figure CN120523987A_ABST
Patent Text Reader

Abstract

The invention provides a picture resource processing method and apparatus, and an electronic device. The method comprises the steps of obtaining a plurality of pictures in a preset business item; the picture is used for forming a display interface of the business item; the picture has a corresponding resource reference parameter; the resource reference parameter is used for indicating an application position of the picture in the business item; determining image features of the plurality of pictures, and dividing the plurality of pictures into at least one picture set based on the image features of the plurality of pictures; and based on the at least one picture set, updating resource reference parameters of the pictures in the business item. In the mode, the picture set composed of the similar pictures is determined based on the picture features, and then the resource application parameters of the pictures in the business item are updated based on the picture set, so that redundant pictures in the picture set are not quoted any more, data redundancy in the business item is reduced, and the execution efficiency of the business item is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of software development technology, and in particular to a method, device, and electronic device for processing image resources. Background Art

[0002] In software application development, as business iterations continue, a large number of redundant, similar images are likely to be generated. The use of redundant images in business projects leads to significant data redundancy, reducing project execution efficiency.

[0003] In related technologies, the similarity of images is usually measured through algorithms such as pixel comparison, cosine similarity, histogram similarity, and structural similarity index (SSIM) to determine redundant images. When these methods are applied to large projects, it is usually necessary to perform similarity calculations on all image files in the project, which is computationally expensive and inefficient. In addition, these methods for determining image similarity are usually translationally invariant and rotationally invariant, making them unsuitable for determining redundant images in a project. This results in low accuracy in determining redundant images. Summary of the Invention

[0004] In view of this, the purpose of the present disclosure is to provide a method, device and electronic device for processing image resources so that redundant images in an image collection are no longer referenced, thereby reducing data redundancy in business projects and improving the execution efficiency of business projects.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for processing image resources, the method comprising: obtaining multiple images in a preset business project; the images are used to: form a display interface of the business project; the images have corresponding resource reference parameters; the resource reference parameters are used to indicate: the application location of the images in the business project; determining image features of the multiple images, and based on the image features of the multiple images, dividing the multiple images into at least one image set; based on at least one image set, updating the resource reference parameters of the images in the business project.

[0006] In the second aspect, an embodiment of the present disclosure provides a device for processing image resources, which includes: an image acquisition module, used to acquire multiple images in a preset business project; the images are used to: form a display interface of the business project; the images have corresponding resource reference parameters; the resource reference parameters are used to indicate: the application location of the images in the business project; a picture collection determination module, used to determine the image features of multiple images, and based on the image features of the multiple images, divide the multiple images into at least one picture collection; a resource reference parameter update module, used to update the resource reference parameters of the images in the business project based on at least one picture collection.

[0007] In a third aspect, an embodiment of the present invention provides an electronic device including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned method for processing image resources.

[0008] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned method for processing image resources.

[0009] The embodiments of the present invention bring the following beneficial effects:

[0010] The above-mentioned method, device, and electronic device for processing image resources obtain multiple images from a preset business project; the images are used to form a display interface for the business project; the images have corresponding resource reference parameters; the resource reference parameters are used to indicate the application location of the images in the business project; the image features of the multiple images are determined, and based on the image features of the multiple images, the multiple images are divided into at least one image set; and based on the at least one image set, the resource reference parameters of the images in the business project are updated. In this method, an image set consisting of similar images is determined based on the image features, and the resource application parameters of the images in the business project are then updated based on the image set. This prevents redundant images in the image set from being referenced, reduces data redundancy in the business project, and improves the execution efficiency of the business project.

[0011] Other features and advantages of the present disclosure will be described in the following description, and in part will become apparent from the description, or understood by practicing the present disclosure. The objectives and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0012] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0014] Figure 1 A schematic diagram of an arrow picture provided in an embodiment of the present disclosure;

[0015] Figure 2A flowchart of a method for processing image resources provided in an embodiment of the present disclosure;

[0016] Figure 3 A schematic diagram of the structure of a device for processing image resources provided by an embodiment of the present disclosure;

[0017] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0018] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0019] In software application development, with the continuous iteration of the business, it is easy to generate a large number of redundant similar images. When developers are developing art resources, they generally do not pay attention to whether the same image files have already been used in the project.

[0020] For example, consider an arrow art resource. Different business scenarios require different spacing, sizes, and other characteristics. Furthermore, even if a user suspects a similar resource already exists, they don't know the file names used in previous projects. Manually comparing each file to see if they're the same doesn't necessarily mean they're a good fit, leading to a low incentive to proactively search. Consequently, over the course of years and months of iteration, a large-scale business project inevitably encounters a significant amount of redundant image resources. Addressing redundant images can effectively reduce the size of the application package (APK), improve the user experience, and mitigate user churn.

[0021] Image similarity measurement is well established in the industry, and is often used to identify redundant image resources. Image similarity algorithms are typically based on feature space mapping methods from computer vision, assessing the similarity between two or more images by quantifying the relative distance in the feature space. The output is a normalized similarity value in the range [0, 1], where 0 indicates orthogonal feature spaces and 1 indicates complete feature vector overlap.

[0022] Common image similarity measurement techniques include pixel comparison, cosine similarity, histogram similarity, SSIM (structural similarity metric), mutual information, and various deep learning and machine learning algorithms. However, these algorithms only provide tools for comparing similarities and lack effective integration into project development. In actual development, it's necessary to identify images with a similarity greater than a specific threshold within the project.

[0023] Among the aforementioned technologies, a common approach is to compare the similarity of individual images. This is done when the user already knows what image they are looking for, such as when searching for images by image. However, in large projects, removing redundant images requires processing the entire project file and calculating the similarity between each image and other images, which is computationally intensive.

[0024] Furthermore, the aforementioned similarity calculation and measurement techniques generally exhibit good translation and rotation invariance. This means that even after an image is rotated or translated, the similarity algorithm still considers it similar. This property is applicable to most application scenarios because it provides robustness to similarity measurement. This result is also more consistent with human intuition.

[0025] However, in large-scale business projects, such as Android projects, the above translation invariance and rotation invariance are not suitable for finding redundant images in business projects. Take the resource image with three right arrows as an example. Figure 1 As shown, four right arrows are displayed from left to right. The second arrow on the left is obtained by translating the first arrow on the left, the third arrow on the left is obtained by rotating the first arrow on the left, and the right arrow is obtained by scaling the first arrow on the left.

[0026] The first, second, and third arrows on the left cannot be replaced in business projects. For example, if you simply replace the second arrow on the left with the first arrow on the left, the spacing in the project's graphical user interface will be problematic.

[0027] In most similarity measurement algorithms, the images with the first, second, and third arrows on the left are all considered to be in the same category due to their translational and rotational invariance. However, in Android projects, these resource files, while similar, cannot be directly replaced.

[0028] The arrow on the right is a scaled version of the arrow on the left. In this case, it should be treated as the same as the arrow on the left, because it is very likely that the same image will be used in some places with a triple image and some with a double image in the project. These images can actually be replaced.

[0029] Therefore, the particularity of business projects makes common traditional similarity measurement algorithms have a great risk of interface control style replacement.

[0030] If a traditional solution is used, the typical workflow is as follows: resource scanning, followed by manual confirmation, and finally scripted processing. This approach can automate resource scanning and scripted processing, but manual confirmation prevents full closed-loop integration, resulting in low efficiency and high labor costs in handling redundant resources within business projects.

[0031] Based on this, the embodiments of the present disclosure provide a method, device, and electronic device for processing image resources. This technology can be applied to business projects that require software development.

[0032] See also Figure 2 First, a method for processing image resources provided by an embodiment of the present invention is introduced. A graphical user interface is provided by a terminal device; the method includes the following steps:

[0033] Step S202, obtaining a plurality of pictures in a preset business project; the pictures are used to form a display interface of the business project; the pictures have corresponding resource reference parameters; the resource reference parameters are used to indicate the application location of the pictures in the business project.

[0034] The above-mentioned multiple pictures can be multiple elements in the display interface, for example, they can be interface backgrounds, or icons of controls such as windows, dialog boxes, scroll bars, etc., and are not limited here.

[0035] When the application corresponding to the business project runs, the above multiple images will form the corresponding display interface. The resource reference parameter of the image is used to indicate which interface the image is displayed on, and can also be used to indicate the location of the image on which interface it is displayed, that is, the application location of the image in the business project.

[0036] Step S204: determining image features of the plurality of pictures, and dividing the plurality of pictures into at least one picture set based on the image features of the plurality of pictures.

[0037] To offset the effect of image size on image features, each image is usually resized to the same size. The image features of the image can then be determined based on the pixel values ​​of each pixel in the image.

[0038] Color images typically have multiple channels. Images are grayscale images that store different types of information within a digital image. Commonly used RGB (Red-Green-Blue) and Lab images have two channels by default, while CMYK (Cyan-Magenta-Yellow-Black) images have four channels.

[0039] When an image is a color image, each pixel in the image has a pixel value corresponding to each channel. When determining the image features based on the pixel values ​​of each pixel in the image, a feature vector can be generated based on multiple dimensions, such as the pixel location and the channel corresponding to the pixel value, to describe the image features.

[0040] After determining the image features of multiple images, the images need to be grouped into multiple image sets so that the images in each set are highly similar and can be substituted for each other. If the images in the multiple images are similar, they may be grouped into the same image set.

[0041] Clustering algorithms or other algorithms capable of achieving this goal can be used to partition image collections. Clustering, also known as cluster analysis, is an unsupervised machine learning task. Clustering algorithms rely solely on input data and aim to find natural groups or clusters in feature space. These clusters are typically dense regions in feature space, where data points in the same cluster are more closely clustered than in other clusters. Clusters obtained through clustering algorithms are often called clusters.

[0042] The input data to the clustering algorithm is usually the image features of multiple images. The clustering algorithm can determine which image features are similar and group the images corresponding to these image features into the same image set.

[0043] Step S206: Based on at least one picture set, update resource reference parameters of pictures in the business project.

[0044] An image collection can contain one or more images. Multiple images in an image collection indicate that they are similar. You can use a single image in an image collection to replace other images in a business project, reducing redundant images in the project.

[0045] When a clustering algorithm identifies a cluster, it determines the cluster center. When clustering image features, the cluster center is often also an image feature. To determine the image to replace other images in a collection, the distance between the image features of each image in the collection and the image feature of the cluster center can be calculated. The image with the closest image feature in the calculated result is then used as the replacement image. Furthermore, the image quality of the images in the collection can be evaluated, and the target image can be determined based on both the image quality and the distance between the image features and the cluster center. The specific settings can be customized based on your needs and are not limited here.

[0046] To use an image from an image collection in a business project instead of another image, you need to update the resource reference parameters of the image in the business project. If certain application locations in the business project reference images that are not from the image collection, you need to change the resource reference parameters so that these application locations reference images from the image collection.

[0047] The above-mentioned method for processing image resources obtains multiple images from a preset business project; the images are used to form the display interface of the business project; the images have corresponding resource reference parameters; the resource reference parameters are used to indicate the application location of the images in the business project; the image features of the multiple images are determined, and based on the image features of the multiple images, the multiple images are divided into at least one image set; and based on the at least one image set, the resource reference parameters of the images in the business project are updated. In this method, an image set consisting of similar images is determined based on the image features, and the resource application parameters of the images in the business project are then updated based on the image set. This prevents redundant images in the image set from being referenced, reduces data redundancy in the business project, and improves the execution efficiency of the business project.

[0048] The following embodiment provides a specific method for determining image features of a plurality of pictures and dividing the plurality of pictures into at least one picture set based on the image features of the plurality of pictures.

[0049] In the process of determining the image features of an image, each image needs to be normalized so that the size parameters of the processed image are consistent with the preset specified size parameters. In specific implementations, it is usually necessary to scale the image based on the preset specified size parameters. For example, if the image size is 128×128 and the specified size parameter is 64×64, the image needs to be scaled down. During the image normalization process, the image may also need to be zero-padded. Zero padding of image pixels refers to adding additional pixel values ​​to the edges of the image. These additional pixel values ​​are usually set to zero. For example, if the image size is 128×96 and the specified size parameter is 64×64, after scaling the image down, the resulting image size is 64×48. In this case, the image needs to be zero-padded to bring the image size back to 64×64.

[0050] Next, the color information of each pixel in the processed image needs to be extracted and, based on this color information, a feature vector for the image is generated. This color information typically includes the number of channels and the pixel values ​​corresponding to each channel. In specific implementations, an initial feature vector for the image needs to be generated based on the color information. When generating the feature vector, the pixel values ​​corresponding to each channel of each pixel can be used as a dimension of the feature vector. In this case, the dimensionality of the feature vector is typically very high. For example, if the image is 64×64 and is in RGB mode, the dimensionality of its feature vector is 64×64×3. To reduce computational complexity, the initial feature vector can be reduced in dimensionality using principal component analysis (PCA). Principal component analysis (PCA) is an unsupervised machine learning algorithm used to explore the structure of high-dimensional data. It is primarily used for dimensionality reduction, which can reveal features that are more easily understood by humans and accelerate the processing of valuable information from the sample. PCA can also be used for visualization (reducing the image to two dimensions) and denoising. The basic principle is to project the original data into a new coordinate system through a linear transformation, maximizing the variance of the projected data. The goal of the PCA algorithm is to minimize the amount of information lost in the data after dimensionality reduction.

[0051] After determining the image features of each image, the image features of the multiple images can be input into a clustering algorithm. Then, based on the clustering algorithm and the image features of the multiple images, at least one cluster is determined; a cluster consists of a cluster center and at least one image feature. The distance between the cluster center and the other image features in a cluster is typically close. For each cluster, the images corresponding to the image features in the cluster need to be grouped into the image set corresponding to the cluster.

[0052] The following embodiment provides a specific method for updating resource reference parameters of images in a business project based on at least one image set.

[0053] In practical applications, for each image collection, it is necessary to first identify the target image in the collection. The image features of the images in each collection belong to the same cluster. This cluster is determined based on a clustering algorithm. After identifying similar image features, the clustering algorithm also determines the cluster center. When determining the target image in the collection, it is necessary to determine the characteristic distance between the image features of each image in the collection and the cluster center. This can be calculated using methods such as Euclidean distance, Manhattan distance, and cosine similarity, which are not limited here. The image in the collection whose image features are closest to the characteristic distance between the cluster center can then be identified as the target image.

[0054] After determining the target image, a resource mapping relationship can be established between the target image and other images in the image collection. This resource mapping relationship can be stored in the form of a resource mapping table. Based on this resource mapping relationship, the resource reference parameters of the images in the business project can be updated to redirect the application locations of other images in the same image collection to the target image in the image collection.

[0055] In the specific implementation, all resource reference parameters can be traversed. If it is found that the picture referenced in the resource reference parameter is not the picture determined in the picture set where it is located, the relevant parameters of the current picture in the resource reference parameter will be replaced with the relevant parameters of the picture determined in the picture set where it is located, such as the picture name, picture location, etc.

[0056] The embodiment of the present invention also provides another method for processing image resources. Figure 1 This method is implemented based on the method shown in the figure. Taking the business project developed in the Android environment as an example, referred to as the "Android project", this method provides Android developers with the theoretical support of a high-efficiency tool for cleaning up redundant art resources, reducing the degree of manual intervention in the redundant resource cleaning process.

[0057] This method first preprocesses the images of the entire Android project and determines the image features of the images (also known as "feature engineering"). It then uses the unsupervised clustering k-means algorithm to cluster the images with the determined image features. Finally, it uses the cluster center resources to replace the remaining redundant resources.

[0058] This method is specifically implemented in the following ways:

[0059] 1. The input image is rigidly scaled to 64×64 pixels according to its aspect ratio (using bilinear interpolation to maintain edge continuity).

[0060] 2. Non-square images are filled with zero values ​​to form a standard square, eliminating feature interference caused by aspect ratio differences.

[0061] 3. Extract RGB (Red-Green-Blue) information pixel by pixel, obtain 64x64x3 dimensional data, and expand it into a 12288-dimensional feature vector.

[0062] 4. The PCA algorithm is used for adaptive dimensionality reduction optimization to ensure that the information retention rate is ≥95%, and the feature vector with dimensions far less than 12288 is obtained.

[0063] 5. Input the feature vector from the previous step into the kmeans algorithm.

[0064] The KMeans algorithm is a common unsupervised learning algorithm. It typically randomly selects K objects as initial cluster centers. It then calculates the distance between each object and each cluster center and assigns each object to the cluster center closest to it. The cluster centers and the objects assigned to them represent a cluster. With each assigned sample, the cluster center is recalculated based on the existing objects in the cluster. This process repeats until a set termination condition is met.

[0065] In this algorithm, when initializing the optimization, the initial cluster center can be selected based on the kmeans++ strategy; the normalized Euclidean distance is used to calculate the feature vector similarity for distance measurement; the termination condition can be set as: stop the calculation when the intra-class variance changes less than 0.5% for three consecutive iterations

[0066] 6. Set the original resource image closest to the central store in the cluster as the benchmark resource.

[0067] 7. Generate a resource mapping table and redirect other resources in the cluster to the benchmark resources.

[0068] In this method's similarity measurement process, movement and rotation directly increase pixel-by-pixel differences, making it sensitive to translation, rotation, and mirroring of content. However, since the images are uniformly scaled to 64x64, they are insensitive to scale changes. During implementation, considering the computational complexity of the entire project, the PCA algorithm was used for dimensionality reduction.

[0069] This method uses the kmeans unsupervised clustering algorithm to cluster similar images in a project. The image at the center of the cluster is then selected to replace the remaining images within the cluster. This removes unused images within the cluster, reducing the size of the APK. This method can be developed as an Android Studio plugin for developers' convenience.

[0070] This method provides a cross-project, universal solution for removing redundant resources, constructs a similarity measurement scheme tailored to the particularity of Android projects, and solves the shortcomings of traditional solutions that require a lot of manual intervention.

[0071] For the above method embodiments, see Figure 3 A device for processing image resources shown, the device comprising:

[0072] The image acquisition module 302 is used to acquire multiple images in a preset business project; the images are used to form a display interface of the business project; the images have corresponding resource reference parameters; the resource reference parameters are used to indicate the application location of the images in the business project;

[0073] a picture set determining module 304, configured to determine image features of a plurality of pictures, and group the plurality of pictures into at least one picture set based on the image features of the plurality of pictures;

[0074] The resource reference parameter updating module 306 is configured to update resource reference parameters of images in a business item based on at least one image set.

[0075] The above-mentioned image resource processing device obtains multiple images from a preset business project; the images are used to form the display interface of the business project; the images have corresponding resource reference parameters; the resource reference parameters are used to indicate the application location of the images in the business project; the image features of the multiple images are determined, and based on the image features of the multiple images, the multiple images are divided into at least one image set; and based on the at least one image set, the resource reference parameters of the images in the business project are updated. In this method, an image set composed of similar images is determined based on the image features, and the resource application parameters of the images in the business project are then updated based on the image set. This prevents redundant images in the image set from being referenced, reduces data redundancy in the business project, and improves the execution efficiency of the business project.

[0076] The above-mentioned picture set determination module is also used to: standardize each picture; the size parameters of the processed picture are consistent with the preset specified size parameters; extract the color information of each pixel in the processed picture; and generate a feature vector of the picture based on the color information.

[0077] The picture set determination module is further configured to: perform scaling processing on the pictures based on preset specified size parameters, and / or perform zero-fill processing on the pictures.

[0078] The above-mentioned picture set determination module is further used to: generate an initial feature vector of the picture based on color information; and perform dimensionality reduction processing on the initial feature vector based on the principal component analysis algorithm to obtain a feature vector of the picture.

[0079] The above-mentioned picture collection determination module is also used to: determine at least one cluster based on the clustering algorithm and the image features of multiple pictures; the cluster includes a cluster center and at least one image feature; for each cluster, the pictures corresponding to the image features in the cluster are divided into the picture collection corresponding to the cluster.

[0080] The above-mentioned resource reference parameter update module is also used to: determine the target image in the image collection for each image collection; establish a resource mapping relationship between the target image and other images in the image collection; based on the resource mapping relationship, update the resource reference parameters of the images in the business project to redirect the application location of other images to the target image.

[0081] The image features of the pictures in the above-mentioned picture collection belong to the same cluster; the cluster is determined based on a clustering algorithm; the cluster also includes a cluster center; the above-mentioned resource reference parameter update module is also used to: determine the feature distance between the image features of each picture in the picture collection and the cluster center; and determine the picture in the picture collection whose image features are closest to the feature distance between the cluster center as the target picture.

[0082] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned image resource processing method, for example:

[0083] Obtain multiple pictures in a preset business project; the pictures are used to: form a display interface of the business project; the pictures have corresponding resource reference parameters; the resource reference parameters are used to indicate: the application location of the pictures in the business project; determine the image features of the multiple pictures, and based on the image features of the multiple pictures, divide the multiple pictures into at least one picture set; based on the at least one picture set, update the resource reference parameters of the pictures in the business project.

[0084] In the above method, a picture set consisting of similar pictures is determined based on picture features, and then the resource application parameters of the pictures in the business project are updated based on the picture set, so that redundant pictures in the picture set are no longer referenced, reducing data redundancy in the business project and improving the execution efficiency of the business project.

[0085] Optionally, the above-mentioned step of determining the image features of multiple pictures includes: for each picture, standardizing the picture; the size parameters of the processed picture are consistent with the preset specified size parameters; extracting the color information of each pixel in the processed picture; and generating a feature vector of the picture based on the color information.

[0086] Optionally, the above-mentioned step of performing standardization processing on the image includes: performing scaling processing on the image based on preset specified size parameters, and / or performing zero-value padding processing on the image.

[0087] Optionally, the step of generating a feature vector of the image based on color information includes: generating an initial feature vector of the image based on the color information; and performing dimensionality reduction processing on the initial feature vector based on a principal component analysis algorithm to obtain a feature vector of the image.

[0088] Optionally, the above-mentioned step of dividing multiple pictures into at least one picture set based on the image features of multiple pictures includes: determining at least one cluster based on a clustering algorithm and the image features of multiple pictures; the cluster includes a cluster center and at least one image feature; for each cluster, dividing the pictures corresponding to the image features in the cluster into the picture set corresponding to the cluster.

[0089] Optionally, the above-mentioned step of updating the resource reference parameters of the pictures in the business project based on at least one picture set includes: determining the target picture in the picture set for each picture set; establishing a resource mapping relationship between the target picture and other pictures in the picture set; and updating the resource reference parameters of the pictures in the business project based on the resource mapping relationship so that the application location of other pictures is redirected to the target picture.

[0090] Optionally, the image features of the pictures in the above-mentioned picture collection belong to the same cluster; the cluster is determined based on a clustering algorithm; the cluster also includes a cluster center; the step of determining the target picture in the picture collection includes: determining the feature distance between the image features of each picture in the picture collection and the cluster center; and determining the picture in the picture collection whose image features are closest to the feature distance between the cluster center as the target picture.

[0091] See also Figure 4 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-mentioned method for processing image resources.

[0092] Furthermore, Figure 4 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0093] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is achieved through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0094] The processor 100 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 100 or by instructions in the form of software. The above-mentioned processor 100 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 101, and processor 100 reads information in memory 101 and, in conjunction with its hardware, implements the method of the aforementioned embodiment.

[0095] This embodiment further provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned image resource processing method.

[0096] The embodiments of the present disclosure provide a method, apparatus, and electronic device for processing image resources, including a computer-readable storage medium storing program code. The program code includes instructions that can be used to execute the methods described in the previous method embodiments, for example:

[0097] Obtain multiple pictures in a preset business project; the pictures are used to: form a display interface of the business project; the pictures have corresponding resource reference parameters; the resource reference parameters are used to indicate: the application location of the pictures in the business project; determine the image features of the multiple pictures, and based on the image features of the multiple pictures, divide the multiple pictures into at least one picture set; based on the at least one picture set, update the resource reference parameters of the pictures in the business project.

[0098] In the above method, a picture set consisting of similar pictures is determined based on picture features, and then the resource application parameters of the pictures in the business project are updated based on the picture set, so that redundant pictures in the picture set are no longer referenced, reducing data redundancy in the business project and improving the execution efficiency of the business project.

[0099] Optionally, the above-mentioned step of determining the image features of multiple pictures includes: for each picture, standardizing the picture; the size parameters of the processed picture are consistent with the preset specified size parameters; extracting the color information of each pixel in the processed picture; and generating a feature vector of the picture based on the color information.

[0100] Optionally, the above-mentioned step of performing standardization processing on the image includes: performing scaling processing on the image based on preset specified size parameters, and / or performing zero-value padding processing on the image.

[0101] Optionally, the step of generating a feature vector of the image based on color information includes: generating an initial feature vector of the image based on the color information; and performing dimensionality reduction processing on the initial feature vector based on a principal component analysis algorithm to obtain a feature vector of the image.

[0102] Optionally, the above-mentioned step of dividing multiple pictures into at least one picture set based on the image features of multiple pictures includes: determining at least one cluster based on a clustering algorithm and the image features of multiple pictures; the cluster includes a cluster center and at least one image feature; for each cluster, dividing the pictures corresponding to the image features in the cluster into the picture set corresponding to the cluster.

[0103] Optionally, the above-mentioned step of updating the resource reference parameters of the pictures in the business project based on at least one picture set includes: determining the target picture in the picture set for each picture set; establishing a resource mapping relationship between the target picture and other pictures in the picture set; and updating the resource reference parameters of the pictures in the business project based on the resource mapping relationship so that the application location of other pictures is redirected to the target picture.

[0104] Optionally, the image features of the pictures in the above-mentioned picture collection belong to the same cluster; the cluster is determined based on a clustering algorithm; the cluster also includes a cluster center; the step of determining the target picture in the picture collection includes: determining the feature distance between the image features of each picture in the picture collection and the cluster center; and determining the picture in the picture collection whose image features are closest to the feature distance between the cluster center as the target picture.

[0105] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0106] In addition, in the description of the embodiments of the present disclosure, unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in the present disclosure based on the specific circumstances.

[0107] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0108] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this disclosure and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0109] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A method for processing image resources, characterized in that: The method comprises: Acquire multiple pictures in a preset business project; the pictures are used to form a display interface of the business project; the pictures have corresponding resource reference parameters; the resource reference parameters are used to indicate the application location of the pictures in the business project; determining image features of the plurality of pictures, and dividing the plurality of pictures into at least one picture set based on the image features of the plurality of pictures; Based on the at least one picture set, resource reference parameters of the pictures in the business item are updated.

2. The method according to claim 1, characterized in that The step of determining image features of the plurality of pictures comprises: For each picture, the picture is standardized; the size parameters of the processed picture are consistent with the preset specified size parameters; Extracting color information of each pixel in the processed image; Based on the color information, a feature vector of the image is generated.

3. The method according to claim 2, characterized in that The step of performing standardization processing on the image includes: Based on preset specified size parameters, the image is scaled, and / or the image is zero-filled.

4. The method according to claim 2, characterized in that The step of generating a feature vector of the image based on the color information includes: Based on the color information, generating an initial feature vector of the image; The initial feature vector is subjected to dimensionality reduction processing based on a principal component analysis algorithm to obtain a feature vector of the image.

5. The method according to claim 1, wherein The step of dividing the plurality of pictures into at least one picture set based on image features of the plurality of pictures includes: Determine at least one cluster based on a clustering algorithm and image features of the plurality of images; the cluster includes a cluster center and at least one image feature; For each cluster, the pictures corresponding to the image features in the cluster are divided into a picture set corresponding to the cluster.

6. The method according to claim 1, characterized in that The step of updating resource reference parameters of pictures in the business project based on the at least one picture set includes: For each of the picture sets, determining a target picture in the picture set; Establishing a resource mapping relationship between the target image and other images in the image set; Based on the resource mapping relationship, the resource reference parameters of the pictures in the business project are updated to redirect the application locations of the other pictures to the target picture.

7. The method according to claim 6, characterized in that The image features of the pictures in the picture set belong to the same cluster; the cluster is determined based on a clustering algorithm; the cluster also includes a cluster center; The step of determining a target image in the image set includes: Determining a feature distance between an image feature of each picture in the picture set and a feature center of the cluster; The picture in the picture set whose image feature is closest to the feature of the cluster center is determined as the target picture.

8. A device for processing image resources, characterized in that: The device comprises: The image acquisition module is used to acquire multiple images in a preset business project; the images are used to form a display interface of the business project; the images have corresponding resource reference parameters; the resource reference parameters are used to indicate the application location of the images in the business project; a picture set determining module, configured to determine image features of the plurality of pictures, and divide the plurality of pictures into at least one picture set based on the image features of the plurality of pictures; The resource reference parameter updating module is configured to update the resource reference parameters of the pictures in the business item based on the at least one picture set.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for processing image resources according to any one of claims 1 to 7.

10. A machine-readable storage medium, characterized in that The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions prompt the processor to implement the method for processing image resources according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Application program repeated resource processing method and device

    CN110232051A

  • Picture processing method and device

    CN112445922A

  • Off-line package picture processing method and device, electronic equipment and storage medium

    CN117435840A

  • Transparent planar heating element with excellent electrical conductivity and visible light transparency and flexible electronic device containing the same

    KR102933391B1