A method and device for identifying trademark pictures
By converting the pictures into HSV format and performing multi-dimensional analysis, the problem of identifying trademark images in the prior art requires a large amount of specimen data, and fast and accurate trademark image recognition is achieved, reducing labor costs.
Patent Information
- Application Number
- CN202211184828.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-09-27
AI Technical Summary
The existing AI trademark image identification technology requires a large amount of specimen data, resulting in the collection of a large number of useless pictures, which consumes a lot of time and labor costs, and the inability to effectively screen out all trademark data.
The unsupervised algorithm is used to convert the image to be identified into HSV format, and the color information of the image is analyzed in multiple dimensions, including tone, saturation and brightness, the analysis values of each dimension are calculated, and the evaluation value is obtained in a comprehensive manner. According to the evaluation value and preset standards, whether the image is a trademark image.
It realizes rapid and accurate identification of trademark images, reduces manual intervention, and saves time and labor costs.
Smart Images

Figure CN115588115B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital images, and in particular, to a method and device for identifying trademark pictures. Background Art
[0002] When information is presented externally, trademarks can enhance the recognition of an enterprise and facilitate user memory and identification. Existing AI recognition technologies can recognize pictures, but they require a large amount of specimen data. Pictures can be collected in batches on the Internet by machines to supplement trademark data. In this way, a large number of useless non-trademark pictures will be collected additionally and the data volume is huge. If manual screening and judgment are used, it will consume a large amount of time and labor costs. Moreover, all trademark data cannot be truly found as samples. Summary of the Invention
[0003] To overcome the problems existing in the related art, embodiments of the present invention provide a method and device for identifying trademark pictures. The technical solutions are as follows:
[0004] According to a first aspect of an embodiment of the present invention, a method for identifying a trademark picture is provided, including:
[0005] Converting the picture to be identified into a picture in HSV format;
[0006] Analyzing the picture in multiple dimensions according to the color information of the picture, and respectively obtaining the analysis values of each dimension, where the color information includes: hue, saturation, and lightness; the multiple dimensions include: background type, dark part, highlight, and color;
[0007] Comprehensively processing the analysis values of each dimension to obtain an evaluation value of the picture;
[0008] Determining whether the picture is a trademark picture according to the evaluation value and a preset standard.
[0009] Optionally, obtaining the analysis value of the background type dimension includes:
[0010] Dividing the picture into multiple sub-regions with a size of n*n;
[0011] Calculating the color difference between adjacent sub-regions;
[0012] Determining the analysis value of the background type dimension according to the color difference between adjacent sub-regions.
[0013] Optionally, obtaining the analysis value of the dark part dimension includes:
[0014] Calculating the number of dark part regions, the dark part percentage, and the number of dark part colors of the picture according to a first saturation range and a first lightness range preset;
[0015] Determine the analysis value of the shadow dimension according to the number of shadow regions, the shadow percentage, and the number of shadow colors.
[0016] Optionally, obtaining the analysis value of the highlight dimension includes:
[0017] Calculate the number of highlight regions, the highlight percentage, and the number of highlight colors of the picture according to the preset second saturation range and the second lightness range;
[0018] Determine the analysis value of the highlight dimension according to the number of highlight regions, the highlight percentage, and the number of highlight colors.
[0019] Optionally, obtaining the analysis value of the color dimension includes:
[0020] Calculate the number of colors other than the shadows and highlights of the picture according to the preset third saturation range and the third lightness range;
[0021] Determine the analysis value of the color dimension according to the number of colors.
[0022] Optionally, comprehensively processing the analysis values of each dimension to obtain the evaluation value of the picture to be recognized includes: calculating the evaluation value of the picture to be recognized according to the following formula:
[0023] (Score2 + Score3 + 200) * Score1 + Score4
[0024] Wherein, Score1 is the analysis value of the background dimension, Score2 is the analysis value of the shadow dimension, Score3 is the analysis value of the highlight dimension, and Score4 is the analysis value of the color dimension.
[0025] According to the second aspect of the embodiments of the present invention, there is provided a device for recognizing trademark pictures, including:
[0026] A conversion module for converting the picture to be recognized into a picture in HSV format;
[0027] An analysis module for analyzing the picture in multiple dimensions according to the color information of the picture, and respectively obtaining the analysis values of each dimension, wherein the color information includes: hue, saturation, and lightness; the multiple dimensions include: background type, shadow, highlight, and color;
[0028] A processing module for comprehensively processing the analysis values of each dimension to obtain the evaluation value of the picture;
[0029] A determination module for determining whether the picture is a trademark picture according to the evaluation value and a preset standard.
[0030] Optionally, the analysis module includes:
[0031] The first analysis sub-module is used to obtain the analysis value of the background type dimension, including: dividing the picture into multiple sub-regions with a size of n*n; calculating the color difference between adjacent sub-regions; and determining the analysis value of the background type dimension according to the color difference between adjacent sub-regions.
[0032] Optionally, the analysis module includes:
[0033] The second analysis sub-module is used to obtain the analysis value of the dark part dimension, including: calculating the number of dark part regions, the dark part percentage, and the number of dark part colors of the picture according to the preset first saturation range and the first brightness range; and determining the analysis value of the dark part dimension according to the number of dark part regions, the dark part percentage, and the number of dark part colors.
[0034] Optionally, the analysis module includes:
[0035] The third analysis sub-module is used to obtain the analysis value of the highlight dimension, including: calculating the number of highlight regions, the highlight percentage, and the number of highlight colors of the picture according to the preset second saturation range and the second brightness range; and determining the analysis value of the highlight dimension according to the number of highlight regions, the highlight percentage, and the number of highlight colors.
[0036] Optionally, the analysis module includes:
[0037] The fourth analysis sub-module is used to calculate the number of colors other than the dark part and the highlight of the picture according to the preset third saturation range and the third brightness range; and determine the analysis value of the color dimension according to the number of colors.
[0038] Optionally, the comprehensive processing module is used to:
[0039] Calculate the evaluation value of the picture to be recognized according to the following formula:
[0040] (Score2 + Score3 + 200) * Score1 + Score4
[0041] Wherein, Score1 is the analysis value of the background dimension, Score2 is the analysis value of the dark part dimension, Score3 is the analysis value of the highlight dimension, and Score4 is the analysis value of the color dimension.
[0042] According to the third aspect of the embodiments of the present invention, there is provided a device for recognizing trademark pictures, including:
[0043] A processor;
[0044] A memory for storing instructions executable by the processor;
[0045] Wherein, the processor is configured to:
[0046] Convert the picture to be recognized into a picture in HSV format;
[0047] According to the color information of the picture, analyze the picture in multiple dimensions, and obtain the analysis values of each dimension respectively, where the color information includes: hue, saturation, and lightness; the multiple dimensions include: background type, dark part, highlight, and color;
[0048] Comprehensively process the analysis values of each dimension to obtain the evaluation value of the picture;
[0049] Determine whether the picture is a trademark picture according to the evaluation value and the preset standard.
[0050] According to the fourth aspect of the embodiment of the present invention, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of any one of the methods in the first aspect of the embodiment of the present invention are implemented.
[0051] The technical solution provided by the embodiment of the present invention uses an unsupervised algorithm to analyze and calculate pictures, so as to identify the picture type, with fast recognition speed and high accuracy, and can save a large amount of labor costs and time costs.
[0052] It should be understood that the above general description and subsequent detailed description are only exemplary and explanatory, and cannot limit the present invention. Brief Description of the Drawings
[0053] The drawings here are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention.
[0054] Figure 1 is a flowchart of a method for identifying trademark pictures shown according to an exemplary embodiment;
[0055] Figure 2 is a flowchart of a method for identifying trademark pictures shown according to an exemplary embodiment;
[0056] Figure 3 is a schematic diagram of a visualized picture of a trademark picture divided by HSV color shown according to an exemplary embodiment;
[0057] Figure 4 is a schematic diagram of a visualized picture of a non-trademark picture divided by HSV color shown according to an exemplary embodiment;
[0058] Figure 5 is a block diagram of a device for identifying trademark pictures shown according to an exemplary embodiment;
[0059] Figure 6It is a block diagram of an apparatus for recognizing trademark pictures shown according to an exemplary embodiment;
[0060] Figure 7 It is a block diagram of an apparatus for recognizing trademark pictures shown according to an exemplary embodiment. Detailed implementation manners
[0061] Here, the exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. On the contrary, they are merely examples of apparatuses and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0062] A trademark is a sign used to identify and distinguish the source of goods or services. Currently, AI recognition technology can recognize pictures, but it requires a large amount of specimen data. Collecting pictures by machines on the Internet will result in a large number of useless non-trademark pictures being collected, and manual screening and judgment of the pictures are required, which will consume a lot of time and increase labor costs.
[0063] Embodiments of the present invention provide a method for recognizing trademark pictures. This method can be applied to terminals such as computers and mobile phones to recognize whether a picture is a trademark picture. As Figure 1 shown, the method includes the following steps 101 to step 104:
[0064] In step 101, the picture to be recognized is converted into a picture in HSV format.
[0065] A picture in HSV format refers to a picture under the HSV color model. In the HSV color space, the three channels H, S, and V represent hue, saturation, and value respectively. The HSV color space can well separate color information and brightness information, place them in different channels, and can reduce the influence of light on the recognition of specific colors.
[0066] In step 102, the picture is analyzed in multiple dimensions according to the color information of the picture. The color information includes: hue, saturation, and value; the multiple dimensions include: background type, dark part, highlight, and color.
[0067] Each pixel of a picture in HSV format includes the following color information: hue, saturation, and value. According to this color information, the background type, dark part, highlight, and color of the picture are analyzed respectively. How to analyze the background type, dark part, highlight, and color of the picture using color information will be illustrated by examples below.
[0068] In step 103, the analysis values of each dimension are comprehensively processed to obtain the evaluation value of the picture.
[0069] In step 104, it is determined whether the picture is a trademark picture according to the evaluation value and a preset standard.
[0070] By proposing a picture processing algorithm, this application can accurately identify trademark pictures. The program has a fast recognition speed and a relatively high accuracy rate, thus reducing manual intervention and saving a large amount of labor costs and time costs.
[0071] In an embodiment of this application, obtaining the analysis value of the background type dimension may include steps A1 to A3:
[0072] Step A1, divide the picture into multiple sub-regions with a size of n*n.
[0073] Among them, n is an integer greater than or equal to 1. For example, a picture in HSV format is divided from left to right with a size of 3*3, and the picture is thus divided into multiple sub-regions, and each sub-region includes 9 pixel points. In other embodiments of this application, the picture can also be divided into other sizes. The size of the divided region needs to consider achieving a balance between accuracy and speed. The larger the divided region, the less accurate it is. Although a smaller divided region will be more accurate, the speed will be slower.
[0074] Step A2, calculate the color difference between adjacent sub-regions.
[0075] First, calculate the color value of each sub-region. In one embodiment, for each sub-region, the color information of 9 pixel points in the sub-region can be extracted respectively, and then the average value of the 9 pixel points is calculated. For example, after step A1 divides the picture into n sub-regions and calculates the color values of the n sub-regions, the color values of the n sub-regions can be arranged in an array in the order from top to bottom and from left to right.
[0076] Then, subtract the color of n2 from the color of n1 to obtain the color difference between the n1 sub-region and the n2 sub-region, and so on to calculate the color differences of n3 - n2 and n4 - n3.
[0077] In an embodiment of this application, the RGB colors of 9 pixel points in the sub-region can be extracted as color information. RGB are the three primary colors of red, yellow, and blue, which is more accurate for judging gradient colors, avoiding that in the HSV format, color information can only be determined according to the change of hue (H), and the change of lightness and saturation of the same hue cannot be recognized as different colors.
[0078] Step A3, determine the analysis value of the background type dimension according to the color difference between adjacent sub-regions.
[0079] In this step, first calculate the variance of the obtained color difference values to get the variance value. Variance is equal to the average of the sum of the squared deviations of each data from its arithmetic mean. Variance can reflect the changes in the background. The numerical range of variance can form a corresponding relationship with the background type. For example, as shown in Table 1 below:
[0080] Numerical range Background type 0-0.1 Solid color background 0.1-1 Gradient background 1-150 Similar background colors Above 150 Variegated background
[0081] Then, determine the analysis value of the background type dimension according to the variance value. In one embodiment, the following algorithm can be used to determine the analysis value of the background type dimension according to the variance value:
[0082]
[0083] where x is the variance value and Score1 is the analysis value of the background type dimension.
[0084] In one embodiment of the present application, obtaining the analysis value of the dark part dimension may include steps B1 to B2:
[0085] Step B1, calculate the number of dark part regions, the dark part percentage, and the number of dark part colors of the picture according to the preset first saturation range and the first brightness range.
[0086] In this step, the preset first saturation range and the first brightness range are used to determine the range of the dark part in the picture. That is, if the saturation of the pixel in the picture is within the first saturation range and the brightness is within the first brightness range, then the pixel belongs to the dark part. For example, the first saturation range is S: 10 to 255, and the first brightness range is: 21 to 85. Count all the pixels that belong to the dark part, and then determine the following values:
[0087] Number of dark part regions: The number of dark part regions; where a dark part region refers to a continuous region composed of dark part pixels minus the pixels in the middle hollow, and the number of dark part regions is the count of these regions;
[0088] Dark part percentage: The number of pixels belonging to the dark part / the total number of pixels;
[0089] Number of dark part colors: The number of colors of the pixels belonging to the dark part;
[0090] Among them, the color of the dark part pixels can be determined in the following way: Divide H in the HSV space into 12 regions, that is, corresponding to 12 colors, and then divide the 12 colors into dark part colors and highlight colors respectively through the adjustment of S and V. Finally, 36 colors are obtained. Additionally, count 3 colors of black, white, and gray, for a total of 39 colors. In this way, the colors corresponding to each dark part pixel in the HSV picture can be determined.
[0091] Step B2: Determine the analysis value of the dark part dimension according to the dark part percentage, the number of dark part regions, and the number of dark part colors.
[0092] In this step, the weight score d1 can be calculated first. Among them, the coefficient 0.55 can be adjusted as needed. The higher the given value, the higher the influence of the dark part on the final determination during the final calculation, and vice versa. 0 means not considering the dark part color:
[0093] d1 = 0.55 * dark part percentage - 0.55 * number of dark part regions
[0094] Use the weight score d1 to calculate the analysis value score2 of the dark part dimension through the following formula. The fewer the number of dark part colors, the higher the score:
[0095]
[0096] In an embodiment of the present application, obtaining the analysis value of the highlight dimension may include Step C1 to Step C2:
[0097] Step C1: Calculate the number of highlight regions, the highlight percentage, and the number of highlight colors of the picture according to the preset second saturation range and the second brightness range.
[0098] In this step, the preset second saturation range and the second brightness range are used to determine the range of highlights in the picture. That is, if the saturation of the pixels in the picture is within the second saturation range and the brightness is within the second brightness range, then the pixel belongs to the highlight. For example, the second saturation range is S: 10 to 63, and the second brightness range is V: 86 to 255. Count all the pixels that belong to the highlight, and then determine the following values:
[0099] Number of highlight regions: The number of highlight regions; among them, a highlight region refers to a continuous region composed of highlight pixels minus the pixels in the middle hollow, and the number of highlight regions is the count of these regions;
[0100] Highlight percentage: The number of pixels belonging to the highlight / the total number of pixels;
[0101] Number of highlight colors: The number of colors of the pixels belonging to the highlight.
[0102] Among them, the color of the highlight pixels can be determined in the following way: Divide H in the HSV space into 12 regions, that is, corresponding to 12 colors, and then divide the 12 colors into dark part colors and highlight colors respectively through the adjustment of S and V. Finally, 36 colors are obtained. Additionally, 3 colors of black, white, and gray are counted, for a total of 39 colors. In this way, the colors corresponding to each highlight pixel in the HSV picture can be determined.
[0103] Step C2: Determine the analysis value of the highlight dimension according to the highlight percentage, the number of highlight regions, and the number of highlight colors.
[0104] In this step, the weight score d2 can be calculated first:
[0105] d2 = 0.55 * highlight percentage - 0.55 * number of highlight regions
[0106] Use the weight score d2 to calculate the analysis value score3 of the highlight dimension through the following arithmetic, where the fewer the number of highlight colors, the higher the score:
[0107]
[0108] In an embodiment of the present application, obtaining the analysis value of the color dimension may include steps D1 to D2:
[0109] Step D1: Calculate the number of colors other than the dark part and highlights of the picture according to the preset third saturation range and third lightness range.
[0110] In this step, the preset third saturation range and third lightness range are used to determine the color range, that is, if the saturation of the pixel in the picture is within the third saturation range and the lightness is within the third lightness range, then the pixel belongs to the pixels other than the dark part and highlights. For example, the third saturation range is S: 64 to 255, and the third lightness range is V: 86 to 255. The colors of the pixels other than the dark part and highlights can be determined in the following way: divide by the H value, with each 15 as a range. Count the colors of all pixels with saturation within the third saturation range and lightness within the third lightness range, and then determine the number of colors of these pixels:
[0111] Step D2: Determine the analysis value of the color dimension according to the calculated number of colors. For example, it can be calculated using the following formula:
[0112] Score4 = -1.5 * number of colors + 21
[0113] In an embodiment of the present application, step 103 comprehensively processes the analysis values of each dimension to obtain the evaluation value of the picture, which may include step E1:
[0114] Calculate the evaluation value of the picture according to the following formula:
[0115] (Score2 + Score3 + 200) * Score1 + Score4
[0116] Among them, Score1 is the analysis value of the background dimension, Score2 is the analysis value of the dark part dimension, Score3 is the analysis value of the highlight dimension, and Score4 is the analysis value of the color dimension.
[0117] The implementation process will be introduced in detail through the following embodiments.
[0118] Figure 2 It is described according to the schematic flowchart of a method for identifying trademark pictures shown in an exemplary embodiment. As Figure 2 shown, it includes the following steps:
[0119] Step 201, perform mean shift on the picture to be recognized to reduce noise.
[0120] The function of this step is to preprocess the picture to be recognized. Using the Mean Shift algorithm in the image processing module can achieve operations such as denoising and edge-preserving filtering. In other embodiments of the present application, other preprocessing algorithms suitable for denoising images can also be used.
[0121] Step 202, convert the processed picture to be recognized into a picture in HSV format.
[0122] Step 203, divide the picture into multiple sub-regions with a size of n*n; calculate the color difference between adjacent sub-regions; determine the analysis value of the background type dimension according to the color difference between adjacent sub-regions.
[0123] Step 204, calculate the number of dark regions, the percentage of dark regions, and the number of dark colors in the picture according to the preset first saturation range and first brightness range; determine the analysis value of the dark dimension according to the number of dark regions, the percentage of dark regions, and the number of dark colors.
[0124] Step 205, calculate the number of highlight regions, the percentage of highlights, and the number of highlight colors in the picture according to the preset second saturation range and second brightness range; determine the analysis value of the highlight dimension according to the number of highlight regions, the percentage of highlights, and the number of highlight colors.
[0125] Step 206, calculate the number of colors other than dark and highlight in the picture according to the preset third saturation range and third brightness range; determine the analysis value of the color dimension according to the number of colors.
[0126] Step 207, comprehensively process the analysis values of each dimension to obtain the evaluation value of the picture to be recognized.
[0127] Step 208, determine whether the picture is a trademark picture according to the evaluation value and the preset standard.
[0128] Among them, the preset standard is determined, for example, based on the evaluation values calculated from multiple trademark pictures. For example, in one embodiment, trademark pictures and non-trademark pictures can be run in batches, and the preset standard can be given according to the results of these pictures. For example, if the evaluation value is higher than the preset standard, the picture is considered a trademark picture.
[0129] The execution order of the above steps 203-206 is not limited to the above order, and they can also be executed simultaneously or in other orders.
[0130] Such as Figure 3 Shown are the visualization pictures of each color obtained by dividing a trademark picture by HSV color. As Figure 4 Shown are the visualization pictures of each color obtained by dividing a non-trademark picture by HSV color. It can be seen that the background color of the trademark picture is solid and the color area is relatively concentrated, while the background and color area of the non-trademark picture are relatively messy. Among them, the HSV color division is as follows: H in the HSV space is divided into 12 regions, corresponding to 12 colors, and then the 12 colors are respectively divided into dark colors and highlight colors by adjusting S and V, and finally 36 colors are obtained. Additionally, 3 colors of black, white, and gray are statistically counted, for a total of 39 colors. Therefore, in this embodiment, from aspects such as the background type dimension, dark part, highlight, and color dimension, it can be measured whether a picture is a trademark, and trademark pictures and non-trademark pictures can be distinguished. Through the above algorithm calculation, trademark pictures are respectively subjected to recognition tests and non-trademark pictures are subjected to exclusion tests. A recognition rate of 91.66% and a photo exclusion rate of 78.00% can be achieved. It can basically meet the requirement of excluding a large number of incorrect pictures while recognizing trademark pictures.
[0131] The following is an embodiment of the device of the present invention, which can be used to execute the method embodiment of the present invention.
[0132] Figure 5 It is a block diagram of a device for recognizing trademark pictures shown according to an exemplary embodiment. The device for recognizing trademark pictures can be a server or a part of the server, or can be a terminal or a part of the terminal. The device for recognizing trademark pictures can be implemented as part or all of an electronic device through software, hardware, or a combination of both. As Figure 5 Shown, the device for recognizing trademark pictures includes:
[0133] A conversion module 501, configured to convert a picture to be recognized into a picture in HSV format;
[0134] An analysis module 502, configured to analyze the picture in multiple dimensions according to the color information of the picture, and respectively obtain the analysis values of each dimension. Among them, the color information includes: hue, saturation, and lightness; the multiple dimensions include: background type, dark part, highlight, and color;
[0135] A processing module 503 is configured to comprehensively process the analysis values of each dimension and obtain an evaluation value of the picture.
[0136] A determination module 504 is configured to determine whether the picture is a trademark picture according to the evaluation value and a preset standard.
[0137] In one embodiment, the analysis module 502 includes:
[0138] A first analysis sub-module is configured to obtain an analysis value of the background type dimension, including: dividing the picture into a plurality of sub-regions with a size of n*n; calculating the color difference between adjacent sub-regions; and determining the analysis value of the background type dimension according to the color difference between adjacent sub-regions.
[0139] In one embodiment, the analysis module 502 includes:
[0140] A second analysis sub-module is configured to obtain an analysis value of the dark part dimension, including: calculating the number of dark part regions, the dark part percentage, and the number of dark part colors of the picture according to a preset first saturation range and a first brightness range; and determining the analysis value of the dark part dimension according to the number of dark part regions, the dark part percentage, and the number of dark part colors.
[0141] In one embodiment, the analysis module 502 includes:
[0142] A third analysis sub-module is configured to obtain an analysis value of the highlight dimension, including: calculating the number of highlight regions, the highlight percentage, and the number of highlight colors of the picture according to a preset second saturation range and a second brightness range; and determining the analysis value of the highlight dimension according to the number of highlight regions, the highlight percentage, and the number of highlight colors.
[0143] In one embodiment, the analysis module 502 includes:
[0144] A fourth analysis sub-module is configured to obtain an analysis value of the color dimension, including: calculating the number of colors other than the dark part and the highlight of the picture according to a preset color range; and determining the analysis value of the color dimension according to the number of colors.
[0145] In one embodiment, the processing module 503 is configured to:
[0146] Calculate the evaluation value of the picture to be recognized according to the following formula:
[0147] (Score2 + Score3 + 200) * Score1 + Score4
[0148] Among them, Score1 is the analysis value of the background dimension, Score2 is the analysis value of the dark part dimension, Score3 is the analysis value of the highlight dimension, and Score4 is the analysis value of the color dimension.
[0149] Figure 6 FIG. is a block diagram of a device 60 for identifying trademark pictures shown according to an exemplary embodiment. The device may be a server or a part of the server, or may be a terminal or a part of the terminal. The device for identifying trademark pictures includes:
[0150] A processor 601;
[0151] A memory 602 for storing executable instructions of the processor 601;
[0152] Among them, the processor 601 is configured to:
[0153] Convert the picture to be recognized into a picture in HSV format;
[0154] According to the color information of the picture, analyze the picture in multiple dimensions, and respectively obtain the analysis values of each dimension. Among them, the color information includes: hue, saturation, and lightness; the multiple dimensions include: background type, dark part, highlight, and color;
[0155] Comprehensively process the analysis values of each dimension to obtain the evaluation value of the picture;
[0156] Determine whether the picture is a trademark picture according to the evaluation value and a preset standard.
[0157] Figure 7 FIG. is a block diagram of a device 800 for identifying trademark pictures shown according to an exemplary embodiment. The device may be a computer, a server, etc.
[0158] The device may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0159] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, telephone call, data communication, camera operation, and recording operation. The processing element 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0160] The memory 804 is configured to store various types of data to support the operation of the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.
[0161] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0162] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of the touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
[0163] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.
[0164] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, and the like. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.
[0165] The sensor assembly 814 includes one or more sensors for providing a status assessment of various aspects of the device 800. For example, the sensor assembly 814 can detect the on / off state of the device 800, the relative positioning of components, such as the display and keypad of the device 600 as the components, the sensor assembly 814 can also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0166] The communication component 816 is configured to facilitate communication between the device 800 and other devices in a wired or wireless manner. The device 800 can access a wireless network based on communication standards, such as a private radio network, WiFi, 2G, 3G, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0167] In an exemplary embodiment, the device 800 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above method.
[0168] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the above instructions can be executed by a processor 820 of the device 800 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0169] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of the device 800, enables the device 800 to execute the above method for identifying a trademark picture, and the method includes:
[0170] Convert the image to be recognized into an HSV format image;
[0171] According to the color information of the image, analyze the image in multiple dimensions, and respectively obtain the analysis values of each dimension. Among them, the color information includes: hue, saturation, and lightness; the multiple dimensions include: background type, dark part, highlight, and color;
[0172] Comprehensively process the analysis values of each dimension to obtain the evaluation value of the image;
[0173] Determine whether the image is a trademark image according to the evaluation value and a preset standard.
[0174] After considering the specification and practicing the invention herein, those skilled in the art will readily conceive of other embodiments of the present invention. This application is intended to cover any variations, uses, or adaptations of the present invention, which follow the general principles of the present invention and include known common knowledge or conventional technical means in the technical field not invented by the present invention. The specification and examples are only illustrative, and the true scope and spirit of the present invention are pointed out by the following claims.
[0175] It should be understood that the present invention is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.
Claims
1. A method for identifying trademark pictures, characterized in that, Including: Converting the picture to be recognized into a picture in HSV format; Analyzing the picture in multiple dimensions according to the color information of the picture, and respectively obtaining the analysis values of each dimension, wherein the color information includes: hue, saturation, and lightness; the multiple dimensions include: background type, dark part, highlight, and color; Comprehensively processing the analysis values of each dimension to obtain the evaluation value of the picture; Determining whether the picture is a trademark picture according to the evaluation value and a preset standard; Among them, the comprehensively processing the analysis values of each dimension to obtain the evaluation value of the picture to be recognized includes: calculating the evaluation value of the picture to be recognized according to the following formula: (Score2 + Score3 + 200) * Score1 + Score4, where Score1 is the analysis value of the background dimension, Score2 is the analysis value of the dark part dimension, Score3 is the analysis value of the highlight dimension, and Score4 is the analysis value of the color dimension; The algorithm formula corresponding to the determined background dimension analysis value is as follows: where X is the variance value; Through the formula: The analysis value of the dark part dimension is calculated, where d1 is the weight score, and the fewer the number of dark colors, the higher the score; And d1 = 0.55 * dark part percentage - number of dark part areas * 0.55; Through the formula: Calculate the analysis value of the highlight dimension, where d2 is the weight score, and the fewer the number of highlight colors, the higher the score; And d2 = 0.55 * highlight percentage - number of highlight areas * 0.55; Obtaining the analysis value of the color dimension includes: Calculating the number of colors outside the dark part and highlight of the picture according to a preset third saturation range and third lightness range; Determining the analysis value of the color dimension according to the number of colors, using the formula: Score4 = -1.5 * number of colors + 21.
2. The method according to claim 1, characterized in that, Obtaining the analysis value of the background type dimension includes: Dividing the picture into multiple sub-regions with a size of n * n; calculating the color difference between adjacent sub-regions; Determining the analysis value of the background type dimension according to the color difference between adjacent sub-regions.
3. The method according to claim 1, wherein Obtaining the analysis value of the dark part dimension includes: Calculating the number of dark part areas, dark part percentage, and dark part color number of the picture according to a preset first saturation range and first lightness range; Determining the analysis value of the dark part dimension according to the number of dark part areas, dark part percentage, and dark part color number.
4. The method according to claim 1, characterized in that, Obtaining the analysis value of the highlight dimension includes: Calculating the number of highlight areas, highlight percentage, and highlight color number of the picture according to a preset second saturation range and second lightness range; Determining the analysis value of the highlight dimension according to the number of highlight areas, highlight percentage, and highlight color number.
5. An apparatus for recognizing trademark pictures, characterized in that, Including: A conversion module for converting the picture to be recognized into a picture in HSV format; An analysis module for analyzing the picture in multiple dimensions according to the color information of the picture, and respectively obtaining the analysis values of each dimension, wherein the color information includes: hue, saturation, and lightness; the multiple dimensions include: background type, dark part, highlight, and color; A processing module for comprehensively processing the analysis values of each dimension to obtain the evaluation value of the picture; A determination module for determining whether the picture is a trademark picture according to the evaluation value and a preset standard; the processing module is used for: Calculating the evaluation value of the picture to be recognized according to the following formula: (Score2 + Score3 + 200) * Score1 + Score4 Among them, Score1 is the analysis value of the background dimension, Score2 is the analysis value of the dark part dimension, Score3 is the analysis value of the highlight dimension, and Score4 is the analysis value of the color dimension; The algorithm formula corresponding to the determined background dimension analysis value is as follows: where X is the variance value; Through the formula: Calculate the analysis value of the dark part dimension, where d1 is the weight score, and the fewer the number of dark part colors, the higher the score; and d1 = 0.55 * dark part percentage - the number of dark part areas * 0.55; Through the formula: Calculate the analysis value of the high-light dimension, where d2 is the weight score, and the fewer the number of high-light colors, the higher the score; and d2 = 0.55 * high-light percentage - number of high-light regions * 0.55; The analysis module includes: A fourth analysis sub-module, configured to calculate the number of colors other than the dark part and the highlight of the picture according to a preset third saturation range and a third lightness range; Determine the analysis value of the color dimension according to the number of colors, using the formula: Score4 = -1.5 * number of colors + 21. The analysis module includes: A first analysis sub-module, configured to obtain the analysis value of the background type dimension, including: dividing the picture into multiple sub-regions with a size of n*n; calculating the color difference between adjacent sub-regions; and determining the analysis value of the background type dimension according to the color difference between adjacent sub-regions.
6. The device according to claim 5, characterized in that, The analysis module includes: A second analysis sub-module, configured to obtain the analysis value of the dark part dimension, including: calculating the number of dark part regions, the dark part percentage, and the number of dark part colors of the picture according to a preset first saturation range and a first lightness range; and determining the analysis value of the dark part dimension according to the number of dark part regions, the dark part percentage, and the number of dark part colors.
7. The device according to claim 5, characterized in that The analysis module includes: A third analysis sub-module, configured to obtain the analysis value of the highlight dimension, including: calculating the number of highlight regions, the highlight percentage, and the number of highlight colors of the picture according to a preset second saturation range and a second lightness range; and determining the analysis value of the highlight dimension according to the number of highlight regions, the highlight percentage, and the number of highlight colors.
8. The device according to claim 5, characterized in that,
Citation Information
Patent Citations
Classification processing method and device
CN104517115A
Test question file screening method and device, model training method and device, equipment and medium
CN114020904A