CN114238223A - Picture removing method and device, computer equipment and computer readable storage medium - Google Patents

Picture removing method and device, computer equipment and computer readable storage medium Download PDF

Info

Publication number
CN114238223A
CN114238223A CN202111553213.3A CN202111553213A CN114238223A CN 114238223 A CN114238223 A CN 114238223A CN 202111553213 A CN202111553213 A CN 202111553213A CN 114238223 A CN114238223 A CN 114238223A
Authority
CN
China
Prior art keywords
picture
pictures
candidate
similarity
initial similar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111553213.3A
Other languages
Chinese (zh)
Inventor
陆增其
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Leiniao Network Media Co ltd
Original Assignee
Shenzhen Leiniao Network Media Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Leiniao Network Media Co ltd filed Critical Shenzhen Leiniao Network Media Co ltd
Priority to CN202111553213.3A priority Critical patent/CN114238223A/en
Publication of CN114238223A publication Critical patent/CN114238223A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application provides a picture removing method, a picture removing device, computer equipment and a computer readable storage medium, which can acquire a picture set of an application package; acquiring a hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value; screening out an initial similar picture from the candidate pictures based on the first similarity; acquiring a pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value; and screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package. According to the method and the device for screening the initial similar pictures from the candidate pictures, the initial similar pictures can be screened from the candidate pictures based on the first similarity, so that the second similarity can be calculated based on the pixel values of the initial similar pictures, the target pictures can be screened from the initial similar pictures, the accuracy of screening the phase pictures or the similar pictures can be improved, and the size of the application package is reduced.

Description

Picture removing method and device, computer equipment and computer readable storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image removing method and apparatus, a computer device, and a computer-readable storage medium.
Background
In the application development process, the phenomenon that the same picture or similar pictures are repeatedly imported into an application package by a plurality of people exists, and the same picture or similar pictures are increased in the application package along with the accumulation of time, so that the volume of the application package is increased.
Disclosure of Invention
The embodiment of the application provides a picture removing method and device, computer equipment and a computer readable storage medium, and the size of an application package can be reduced.
A picture removal method comprises the following steps:
acquiring a picture set of an application package, wherein the picture set comprises at least two candidate pictures;
acquiring a hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value;
screening out an initial similar picture from the candidate pictures based on the first similarity;
acquiring a pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value;
and screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package.
Accordingly, an embodiment of the present application provides an image removing device, including:
the device comprises a first acquisition unit and a second acquisition unit, wherein the first acquisition unit can be used for acquiring a picture set aiming at an application package, and the picture set comprises at least two candidate pictures;
the second obtaining unit may be configured to obtain a hash value of the candidate picture, and calculate a first similarity between each two pictures in the candidate picture based on the hash value;
the first screening unit may be configured to screen an initial similar picture from the candidate pictures based on the first similarity;
the third acquiring unit may be configured to acquire a pixel value of the initial similar picture, and calculate a second similarity between each two pictures in the initial similar picture based on the pixel value;
and the second screening unit can be used for screening the target picture from the initial similar pictures based on the second similarity and removing the target picture from the application package.
In some embodiments, the third obtaining unit may be specifically configured to determine, based on a pixel value corresponding to each pixel point in the initial similar picture, a grayscale picture corresponding to the initial similar picture; and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value corresponding to each pixel point in the gray picture.
In some embodiments, the third obtaining unit may be specifically configured to determine, for each pixel point in the initial similar picture, a gray value of the pixel point based on a pixel value corresponding to each channel in the pixel point; and generating a gray picture based on the gray value corresponding to each pixel point.
In some embodiments, the second obtaining unit may be specifically configured to perform size adjustment on the candidate picture based on the number of pixel points of the candidate picture, so as to obtain an adjusted picture; and calculating the hash value of each candidate image based on the pixel value corresponding to each pixel point of the adjusted picture.
In some embodiments, the second obtaining unit may be specifically configured to calculate a hamming distance between every two pictures in the candidate pictures based on the hash value of each candidate image; determining a first similarity between every two pictures in the candidate pictures based on the Hamming distance between every two pictures in the candidate pictures
In some embodiments, the first obtaining unit may be specifically configured to obtain a resource file of the application package; screening out at least two candidate pictures from the resource file based on the file format of the resource file; and generating a picture set based on at least two candidate pictures.
In some embodiments, the second filtering unit may be specifically configured to obtain a storage path of the target picture in the application package; classifying the target picture based on the storage path to obtain a classified picture of at least one classification category; based on the classification category, storing the classified picture to a target folder to remove the target picture from the application package.
In addition, the embodiment of the application also provides a computer device, which comprises a memory and a processor; the memory stores a computer program, and the processor is used for operating the computer program in the memory to execute any picture removing method provided by the embodiment of the application.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and the computer program is suitable for being loaded by a processor to execute any one of the image removing methods provided in the embodiment of the present application.
The method and the device for processing the application package can obtain a picture set of the application package, wherein the picture set comprises at least two candidate pictures; acquiring a hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value; screening out an initial similar picture from the candidate pictures based on the first similarity; acquiring a pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value; and screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package. According to the method and the device for screening the initial similar pictures from the candidate pictures, the initial similar pictures can be screened from the candidate pictures based on the first similarity, so that the second similarity can be calculated based on the pixel values of the initial similar pictures, the target pictures can be screened from the initial similar pictures, the accuracy of screening the phase pictures or the similar pictures can be improved, and the size of the application package is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a scene schematic diagram of a picture removal method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a picture removing method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an application package development phase provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of a picture removing device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a picture removing method and device, computer equipment and a computer readable storage medium. The image removing device may be integrated in a computer device, and the computer device may be a server or a terminal.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Network acceleration service (CDN), big data and an artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
For example, referring to fig. 1, taking the example that the picture removing apparatus is integrated in the computer device, the computer device obtains a picture set of the application package; acquiring a hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value; screening out an initial similar picture from the candidate pictures based on the first similarity; acquiring a pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value; and screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package.
Wherein the picture set comprises at least two candidate pictures. The candidate pictures refer to pictures imported into the application package by developers in the development process of the application package.
The hash value may be understood as a fingerprint of the candidate picture, and thus, the embodiment of the application may compare the first similarity between each two pictures in the candidate pictures based on the fingerprint corresponding to each candidate picture.
In the embodiment of the present application, since the detection tolerance of the first similarity calculated by using the hash value is high, a situation that an error occurs in detection may occur.
The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
The embodiment will be described from the perspective of a picture removing device, where the picture removing device may be specifically integrated in a computer device, and the computer device may be a server or a terminal; the terminal may include a tablet Computer, a notebook Computer, a Personal Computer (PC), a wearable device, a virtual reality device, or other intelligent devices capable of acquiring data.
As shown in fig. 2, the specific flow of the image removing method is as follows:
s101, acquiring a picture set aiming at the application package.
Wherein the picture set comprises at least two candidate pictures. The candidate pictures refer to pictures imported into the application package by developers in the development process of the application package.
S102, obtaining the hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value.
The hash value may be understood as a fingerprint of the candidate picture, and thus, the embodiment of the application may compare the first similarity between each two pictures in the candidate pictures based on the fingerprint corresponding to each candidate picture.
S103, screening an initial similar picture from the candidate pictures based on the first similarity.
And S104, acquiring the pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value.
In the embodiment of the present application, since the detection tolerance of the first similarity calculated by using the hash value is high, a situation that an error occurs in detection may occur.
S105, screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package.
The method and the device for processing the application package can obtain a picture set of the application package, wherein the picture set comprises at least two candidate pictures; acquiring a hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value; screening out an initial similar picture from the candidate pictures based on the first similarity; acquiring a pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value; and screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package. According to the method and the device for screening the initial similar pictures from the candidate pictures, the initial similar pictures can be screened from the candidate pictures based on the first similarity, so that the second similarity can be calculated based on the pixel values of the initial similar pictures, the target pictures can be screened from the initial similar pictures, the accuracy of screening the phase pictures or the similar pictures can be improved, and the size of the application package is reduced.
The method described in the above examples is further illustrated in detail below by way of example.
In this embodiment, the image removing apparatus is specifically integrated in a computer device, and the computer device is a server.
As shown in fig. 2, a method for removing a picture includes the following specific steps:
s101, acquiring a picture set aiming at the application package.
Wherein the picture set comprises at least two candidate pictures.
According to the method and the device, the candidate pictures led into the application package by the developer can be collected in the development process, and the picture set can be generated based on the collected candidate pictures.
In addition to the above, in the embodiment of the present application, candidate pictures may be screened from the application package, so that the embodiment of the present application may generate a picture set based on the screened candidate pictures, for example, a computer device obtains a resource file of the application package; screening out at least two candidate pictures from the resource file based on the file format of the resource file; and generating a picture set based on at least two candidate pictures.
The files in the application package include a plurality of files, such as byte code files, resource files, and the like. The resource files comprise pictures and xml format files.
Based on this, for the format based on the resource file, the image format for screening out the candidate image from the resource file may be various, for example, the candidate image in at least one format of the ". webp" format, ". jpg" format, ". png" format, ". jpeg" format.
According to the method and the device, the resource file is traversed based on the file format of the resource file, and therefore the candidate pictures are screened out.
In order to reduce the intrusiveness of codes adopted by an application package, a construction tool is adopted in the embodiment of the application to obtain a picture set for the application package. The build tool may be a plug-in, which may be a Gradle plug-in. The plug-in is simple to integrate and is convenient to obtain the picture set.
As shown in fig. 3, the application package according to the embodiment of the present application includes multiple stages in a development process, for example, an initialization stage, a configuration stage, and a running stage. The initialization phase refers to initializing the application package. The configuration phase refers to configuring the application package. The running phase refers to the running of the programs of the application package. In the embodiment of the application, a picture set for an application package can be acquired at each stage. Of course, the embodiment of the present application may also acquire a picture set for the application package in a process between the configuration phase and the running phase.
S102, obtaining the hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value.
Specifically, the process of obtaining the hash value of the candidate picture in the embodiment of the present application may be: the computer equipment adjusts the size of the candidate picture based on the number of pixel points of the candidate picture to obtain an adjusted picture; and calculating the hash value of each candidate image based on the pixel value corresponding to each pixel point of the adjusted picture.
First, the embodiment of the present application compresses a candidate picture. The method specifically comprises the following steps: according to the embodiment of the application, the size of the candidate picture can be compressed based on the number of the pixel points of the candidate picture, and the size of the candidate picture is compressed into 64 pixel points, so that the adjusted image is obtained.
Secondly, the embodiment of the application simplifies the color of the adjusted image. The method specifically comprises the following steps: according to the embodiment of the application, the adjusted picture is converted into the target gray picture based on the pixel value corresponding to each pixel point of the adjusted picture.
In the embodiment of the present application, there are various ways to convert the adjusted picture into the target grayscale picture, for example, based on the pixel value corresponding to each channel in each pixel, the pixel value of each pixel in the adjusted picture is converted into the target grayscale value by any one of a floating point algorithm, an integer method, and a shift method; and generating a target gray image based on the target gray value of each pixel point.
Thirdly, the hash value is calculated in the embodiment of the application, which specifically includes: the gray value average value of the target gray image is calculated based on the gray value of each pixel point of the target gray image, and the gray value average value refers to the gray value average value; comparing the gray value average value of the target gray image with the pixel value of each pixel point in the target gray image; aiming at the pixel value of each pixel point in the target gray level picture, if the pixel value of the pixel point is larger than or equal to the mean value of the gray values, a first target value is obtained; and if the pixel value of the pixel point is smaller than the mean value of the gray values, acquiring a second target value. Based on the first target value and the second target value, a hash value is generated. The hash value is a 64-bit integer.
Wherein the first target value may be set to 1 and the second target value may be set to 0.
In the embodiment of the present application, the first similarity between every two pictures in the candidate pictures is calculated based on the hash value, which may specifically be: the computer equipment calculates the Hamming distance between every two pictures in the candidate pictures based on the Hash value of each candidate image; and determining a first similarity between every two pictures in the candidate pictures based on the Hamming distance between every two pictures in the candidate pictures.
In this embodiment, the computer device may use the hamming distance as the first similarity.
S103, screening an initial similar picture from the candidate pictures based on the first similarity.
In the embodiment of the application, for every two candidate images, if the hamming distance of the two candidate images is smaller than the preset threshold, the two candidate images are proved to be highly similar, and the two candidate images with the hamming distance smaller than the preset threshold are determined as the initial similar images.
Wherein the preset threshold may be set to 5.
After the initial similar picture is screened out, the initial similar picture can be placed in a new picture set.
And S104, acquiring the pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value.
In the embodiment of the application, the computer equipment determines the gray level picture corresponding to the initial similar picture based on the pixel value corresponding to each pixel point in the initial similar picture; and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value corresponding to each pixel point in the gray picture.
In the embodiment of the application, aiming at each pixel point in the initial similar picture, the gray value of the pixel point is determined based on the pixel value corresponding to each channel in the pixel point; and generating a gray picture based on the gray value corresponding to each pixel point.
In the embodiment of the application, any one of a floating point algorithm, an integer method and a shifting method can be adopted to convert the pixel value of each pixel point of the initial similar picture into a gray value; and generating a gray picture based on the gray value of each pixel point.
According to the method and the device for processing the gray-scale image, the initial similar image can be compressed into the image with the size based on each pixel point in the initial similar image, the compressed image is obtained, and then the gray-scale image corresponding to the initial similar image can be determined based on the pixel value corresponding to each pixel point of the compressed image. In this process, in the embodiment of the present application, any one of a floating point algorithm, an integer method, and a shift method may be adopted to convert the pixel value of each pixel point of the compressed picture into a gray value, so as to generate a gray picture.
In this embodiment of the application, the specific calculation of the second similarity between each two pictures in the initial similar picture based on the pixel value corresponding to each pixel point in the grayscale picture may be: aiming at each gray picture, based on the gray value of each pixel point of the gray picture, the computer equipment calculates a gray histogram of the gray picture; and calculating a second similarity between every two pictures in the initial similar pictures by adopting a Babbitt coefficient algorithm based on the gray level histogram.
S105, screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package.
And when the second similarity is greater than the preset similarity threshold, determining that the two initial similar pictures with the second similarity greater than the preset similarity threshold are similar pictures.
Wherein the preset similarity threshold may be set to 0.8.
The method for removing the target picture from the application package in the embodiment of the application has various modes, for example, the computer device acquires a storage path of the target picture in the application package; classifying the target picture based on the storage path to obtain a classified picture of at least one classification category; based on the classification category, storing the classified picture to a target folder to remove the target picture from the application package.
The storage directory can be set in the embodiment of the application, and the file identifiers of all files in the application package and the storage path corresponding to each file are recorded in the storage directory.
In addition to the above, the application may delete the target picture from the application package, and update the storage directory in the application package.
In addition to the above, the computer device and the mailbox can be bound in the embodiment of the application, so that the screening result of the screened target picture can be sent to the mailbox. The screening result may include an identification of the target picture, the second similarity, and the storage path.
The method and the device for processing the application package can obtain a picture set of the application package, wherein the picture set comprises at least two candidate pictures; acquiring a hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value; screening out an initial similar picture from the candidate pictures based on the first similarity; acquiring a pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value; and screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package. According to the method and the device for screening the initial similar pictures from the candidate pictures, the initial similar pictures can be screened from the candidate pictures based on the first similarity, so that the second similarity can be calculated based on the pixel values of the initial similar pictures, the target pictures can be screened from the initial similar pictures, the accuracy of screening the phase pictures or the similar pictures can be improved, and the size of the application package is reduced.
In order to better implement the above method, the present application further provides a picture removing apparatus, which may be integrated in a computer device, such as a server or a terminal, and the terminal may include a tablet computer, a notebook computer, and/or a personal computer.
For example, as shown in fig. 4, the picture removing apparatus may include a first obtaining unit 301, a second obtaining unit 302, a first filtering unit 303, a third obtaining unit 304, and a second filtering unit 305, as follows:
(1) a first acquisition unit 301;
the first obtaining unit 301 may be configured to obtain a picture set for an application package, where the picture set includes at least two candidate pictures.
In some embodiments, the first obtaining unit 301 may be configured to obtain a resource file of an application package;
screening out at least two candidate pictures from the resource file based on the file format of the resource file; and generating a picture set based on at least two candidate pictures.
(2) A second acquisition unit 302;
the second obtaining unit 302 may be configured to obtain a hash value of the candidate picture, and calculate a first similarity between each two pictures in the candidate picture based on the hash value.
In some embodiments, the second obtaining unit 302 may be configured to perform size adjustment on the candidate picture based on the number of pixel points of the candidate picture, so as to obtain an adjusted picture; and calculating the hash value of each candidate image based on the pixel value corresponding to each pixel point of the adjusted picture.
In some embodiments, the second obtaining unit 302 may be configured to calculate a hamming distance between every two pictures in the candidate pictures based on the hash value of each candidate image; and determining a first similarity between every two pictures in the candidate pictures based on the Hamming distance between every two pictures in the candidate pictures.
(3) A first screening unit 303;
the first filtering unit 303 may be configured to filter out an initial similar picture from the candidate pictures based on the first similarity.
(4) A third acquisition unit 304;
the third obtaining unit 304 may be configured to obtain pixel values of the initial similar picture, and calculate a second similarity between each two pictures in the initial similar picture based on the pixel values.
In some embodiments, the third obtaining unit 304 may be configured to determine, based on a pixel value corresponding to each pixel point in the initial similar picture, a grayscale picture corresponding to the initial similar picture; and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value corresponding to each pixel point in the gray picture.
In some embodiments, the third obtaining unit 304 may be configured to, for each pixel point in the initial similar picture, determine a gray value of the pixel point based on a pixel value corresponding to each channel in the pixel point; and generating a gray picture based on the gray value corresponding to each pixel point.
(5) A second screening unit 305;
the second filtering unit 305 may be configured to filter out the target picture from the initial similar pictures based on the second similarity, and remove the target picture from the application package.
In some embodiments, the second filtering unit 305 may be configured to obtain a storage path of the target picture in the application package; classifying the target picture based on the storage path to obtain a classified picture of at least one classification category; based on the classification category, storing the classified picture to a target folder to remove the target picture from the application package.
As can be seen from the above, the first obtaining unit 301 in this embodiment of the application may be configured to obtain a picture set of an application package, where the picture set includes at least two candidate pictures; the second obtaining unit 302 may be configured to obtain a hash value of the candidate picture, and calculate a first similarity between each two pictures in the candidate picture based on the hash value; the first screening unit 303 may be configured to screen an initial similar picture from the candidate pictures based on the first similarity; the third obtaining unit 304 may be configured to obtain pixel values of the initial similar picture, and calculate a second similarity between each two pictures in the initial similar picture based on the pixel values; the second filtering unit 305 may be configured to filter out the target picture from the initial similar pictures based on the second similarity, and remove the target picture from the application package. According to the method and the device for screening the initial similar pictures from the candidate pictures, the initial similar pictures can be screened from the candidate pictures based on the first similarity, so that the second similarity can be calculated based on the pixel values of the initial similar pictures, the target pictures can be screened from the initial similar pictures, the accuracy of screening the phase pictures or the similar pictures can be improved, and the size of the application package is reduced.
The embodiment of the present application further provides a computer device, as shown in fig. 5, which shows a schematic structural diagram of the computer device according to the embodiment of the present application, specifically:
the computer device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 5 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby monitoring the computer device as a whole. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, computer programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 via a power management system, so that functions of managing charging, discharging, and power consumption are implemented via the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The computer device may also include an input unit 404, where the input unit 404 may be used to receive input numeric or character information communications, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the computer device loads the executable file corresponding to the process of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 runs the computer program stored in the memory 402, so as to implement various functions as follows:
acquiring a picture set aiming at an application package, wherein the picture set comprises at least two candidate pictures; acquiring a hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value; screening out an initial similar picture from the candidate pictures based on the first similarity; acquiring a pixel value of the initial similar picture, and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value; and screening out the target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by a computer program, which may be stored in a computer-readable storage medium and loaded and executed by a processor, or by related hardware controlled by the computer program.
To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, where the computer program can be loaded by a processor to execute any one of the picture removing methods provided in the embodiment of the present application.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute the steps in any image removing method provided in the embodiments of the present application, beneficial effects that can be achieved by any image removing method provided in the embodiments of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
According to an aspect of the application, there is provided, among other things, a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations provided by the embodiments described above.
The above detailed description is given to a method, an apparatus, a computer device, and a computer-readable storage medium for removing an image provided in the embodiments of the present application, and a specific example is applied in the detailed description to explain the principles and embodiments of the present application, and the description of the above embodiments is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A picture removing method is characterized by comprising the following steps:
acquiring a picture set aiming at an application package, wherein the picture set comprises at least two candidate pictures;
obtaining the hash value of the candidate pictures, and calculating a first similarity between every two pictures in the candidate pictures based on the hash value;
screening out an initial similar picture from the candidate pictures based on the first similarity;
acquiring pixel values of the initial similar pictures, and calculating a second similarity between every two pictures in the initial similar pictures based on the pixel values;
and screening out a target picture from the initial similar pictures based on the second similarity, and removing the target picture from the application package.
2. The method according to claim 1, wherein the obtaining of the pixel values of the initial similar pictures and the calculating of the second similarity between each two pictures in the initial similar pictures based on the pixel values comprises:
determining a gray level picture corresponding to the initial similar picture based on the pixel value corresponding to each pixel point in the initial similar picture;
and calculating a second similarity between every two pictures in the initial similar picture based on the pixel value corresponding to each pixel point in the gray picture.
3. The method according to claim 2, wherein the determining the grayscale picture corresponding to the initial similar picture based on the pixel value corresponding to each pixel point in the initial similar picture comprises:
aiming at each pixel point in the initial similar picture, determining the gray value of the pixel point based on the pixel value corresponding to each channel in the pixel point;
and generating the gray picture based on the gray value corresponding to each pixel point.
4. The method according to claim 1, wherein the obtaining the hash value of the candidate picture comprises:
based on the number of the pixel points of the candidate picture, carrying out size adjustment on the candidate picture to obtain an adjusted picture;
and calculating the hash value of each candidate image based on the pixel value corresponding to each pixel point of the adjusted picture.
5. The method according to claim 1, wherein the calculating a first similarity between each two pictures in the candidate pictures based on the hash value comprises:
calculating the Hamming distance between every two pictures in the candidate pictures based on the Hash value of each candidate image;
and determining a first similarity between each two pictures in the candidate pictures based on the Hamming distance between each two pictures in the candidate pictures.
6. The method according to claim 1, wherein the obtaining the picture set for the application package comprises:
acquiring a resource file of an application package;
screening out at least two candidate pictures from the resource file based on the file format of the resource file;
and generating the picture set based on the at least two candidate pictures.
7. The method according to claim 1, wherein the removing the target picture from the application package comprises:
acquiring a storage path of the target picture in the application package;
classifying the target picture based on the storage path to obtain a classified picture of at least one classification category;
storing the classified pictures to a target folder based on the classification category to remove the target pictures from the application package.
8. A picture removing device, comprising:
the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a picture set aiming at an application package, and the picture set comprises at least two candidate pictures;
the second acquisition unit is used for acquiring the hash value of the candidate picture and calculating the first similarity between every two pictures in the candidate picture based on the hash value;
the first screening unit is used for screening an initial similar picture from the candidate pictures based on the first similarity;
a third obtaining unit, configured to obtain a pixel value of the initial similar picture, and calculate a second similarity between each two pictures in the initial similar picture based on the pixel value;
and the second screening unit is used for screening a target picture from the initial similar pictures based on the second similarity and removing the target picture from the application package.
9. A computer device comprising a memory and a processor; the memory stores a computer program, and the processor is used for operating the computer program in the memory to execute the picture removing method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that it stores a computer program adapted to be loaded by a processor for performing the picture removal method of any one of claims 1 to 7.
CN202111553213.3A 2021-12-17 2021-12-17 Picture removing method and device, computer equipment and computer readable storage medium Pending CN114238223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111553213.3A CN114238223A (en) 2021-12-17 2021-12-17 Picture removing method and device, computer equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111553213.3A CN114238223A (en) 2021-12-17 2021-12-17 Picture removing method and device, computer equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114238223A true CN114238223A (en) 2022-03-25

Family

ID=80758186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111553213.3A Pending CN114238223A (en) 2021-12-17 2021-12-17 Picture removing method and device, computer equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114238223A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115687677A (en) * 2022-10-18 2023-02-03 武汉骏信达信息咨询有限公司 Data storage management method and system based on artificial intelligence

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115687677A (en) * 2022-10-18 2023-02-03 武汉骏信达信息咨询有限公司 Data storage management method and system based on artificial intelligence
CN115687677B (en) * 2022-10-18 2024-03-22 浙江丰能医药科技有限公司 Data storage management method and system based on artificial intelligence

Similar Documents

Publication Publication Date Title
JP6916895B2 (en) Face image duplication deletion method and device, electronic device, storage medium, program
CN106294798A (en) A kind of images share method based on thumbnail and terminal
CN112381104A (en) Image identification method and device, computer equipment and storage medium
US10917484B2 (en) Identifying and managing redundant digital content transfers
KR20140045897A (en) Device and method for media stream recognition based on visual image matching
CN112114849B (en) Resource updating method and device
CN106844727B (en) Mass image characteristic data distributed acquisition processing and grading application system and method
CN114238223A (en) Picture removing method and device, computer equipment and computer readable storage medium
CN112883827B (en) Method and device for identifying specified target in image, electronic equipment and storage medium
CN115053516A (en) Electronic device and method for storing image
CN111368128A (en) Target picture identification method and device and computer readable storage medium
CN113568645B (en) Software updating method, device, electronic equipment and storage medium
TW202018540A (en) Method, apparatus and electronic device for database updating and computer storage medium thereof
CN113365104B (en) Video concentration method and device
CN112487943B (en) Key frame de-duplication method and device and electronic equipment
CN112691382A (en) Resource processing method, device and computer readable storage medium
CN110337008B (en) Video interaction adjusting method, device, equipment and storage medium
CN115964061A (en) Plug-in updating method and device, electronic equipment and computer readable storage medium
CN114090911A (en) Interface processing method and device, computer equipment and computer readable storage medium
CN110413603B (en) Method and device for determining repeated data, electronic equipment and computer storage medium
CN114187172A (en) Image fusion method and device, computer equipment and computer readable storage medium
CN113890872B (en) Data set uploading method and device, electronic equipment and storage medium
CN110908958B (en) File processing method, device, terminal and storage medium
CN117409219A (en) Image matching method, device, electronic equipment and computer storage medium
CN113934453B (en) Risk detection method, risk detection device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination