CN111243038B - Graphic comparison method and device based on color characteristics and computer storage medium - Google Patents

Graphic comparison method and device based on color characteristics and computer storage medium Download PDF

Info

Publication number
CN111243038B
CN111243038B CN202010013472.6A CN202010013472A CN111243038B CN 111243038 B CN111243038 B CN 111243038B CN 202010013472 A CN202010013472 A CN 202010013472A CN 111243038 B CN111243038 B CN 111243038B
Authority
CN
China
Prior art keywords
graph
compared
comparison
graphic
blocks
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.)
Active
Application number
CN202010013472.6A
Other languages
Chinese (zh)
Other versions
CN111243038A (en
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.)
Xi'an Xintong Semiconductor Technology Co ltd
Original Assignee
Xi'an Xintong Semiconductor Technology 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 Xi'an Xintong Semiconductor Technology Co ltd filed Critical Xi'an Xintong Semiconductor Technology Co ltd
Priority to CN202010013472.6A priority Critical patent/CN111243038B/en
Publication of CN111243038A publication Critical patent/CN111243038A/en
Application granted granted Critical
Publication of CN111243038B publication Critical patent/CN111243038B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • G06T7/337Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods involving reference images or patches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the invention discloses a graph comparison method and device based on color characteristics and a computer storage medium; the method may include: dividing the standard graph according to a set first size to obtain a plurality of first graph blocks; selecting a sampling point from each first graphic block; determining the searching range of each sampling point corresponding to the graph to be compared according to the pixel points in the corresponding positions of each sampling point in the graph to be compared and the set searching range; searching whether pixel points meeting the comparison requirement exist in the searching range corresponding to each sampling point based on the color characteristic value and the color characteristic value deviation threshold value: if the pixel points which meet the comparison requirement do not exist, the graph to be compared is removed from the graph set to be compared due to the fact that the graph to be compared is determined to be not in accordance with the comparison requirement; if the pixel points meeting the comparison requirement exist, carrying out a subsequent comparison process aiming at the graph to be compared.

Description

Graphic comparison method and device based on color characteristics and computer storage medium
Technical Field
The embodiment of the invention relates to the technical field of computer graphics processing, in particular to a graphics contrast method and device based on color characteristics and a computer storage medium.
Background
In general, a pattern similar to a standard pattern pixel color value is compared and retrieved from a pattern set (or group) formed by a plurality of patterns, and the pattern to be compared in the pattern set or group is compared with the standard pattern pixel by color value. Based on the above manner, when the pixel or the pixel block with abnormal color value is located at the second half section of the graph to be compared, a great deal of operation resources are wasted; especially, when the number of the graphics to be compared in the graphics set or group is large and the graphics to be compared meeting the comparison requirement are positioned at the rear of the comparison sequence in the graphics set or group, the waste of operation resources is particularly obvious. A large number of nonsensical calculations can significantly reduce contrast efficiency.
Disclosure of Invention
In view of the foregoing, embodiments of the present invention desirably provide a method, an apparatus, and a computer storage medium for graphic contrast based on color features; in the graphic comparison process, the waste of operation resources can be reduced, and the graphic comparison efficiency is improved.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a graphic contrast method based on color features, where the method includes:
dividing a standard graph into a plurality of first graph blocks according to a set first size, wherein the sizes of the first graph blocks are consistent and not overlapped, and all the first graph blocks can completely cover the standard graph;
selecting a sampling point from each first graphic block;
determining the searching range of each sampling point corresponding to the graph to be compared according to the pixel points in the corresponding positions of each sampling point in the graph to be compared and the set searching range;
searching whether pixel points meeting the comparison requirement exist in the searching range corresponding to each sampling point based on the color characteristic value: if the pixel points which meet the comparison requirement do not exist, the graph to be compared is removed from the graph set to be compared due to the fact that the graph to be compared is determined to be not in accordance with the comparison requirement; if the pixel points meeting the comparison requirement exist, carrying out a subsequent comparison process aiming at the graph to be compared.
In a second aspect, an embodiment of the present invention provides a graphic contrast device based on color features, where the device includes: dividing part, selecting part, searching part, judging part, eliminating part and subsequent comparing part; wherein;
the dividing part is configured to divide the standard graph into a plurality of first graph blocks according to a set first size, wherein the sizes of the first graph blocks are consistent and do not coincide, and all the first graph blocks can completely cover the standard graph;
the selecting part is configured to select a sampling point from each first graph block;
the searching part is configured to determine the searching range of each sampling point corresponding to the graph to be compared according to the pixel points in the corresponding positions of each sampling point in the graph to be compared and the set searching range;
the judging part is configured to search whether pixel points meeting the comparison requirement exist in the search range corresponding to each sampling point based on the color characteristic value and the color characteristic value deviation threshold value; if no pixel points meeting the comparison requirement exist, triggering the rejecting part; if pixel points meeting the comparison requirement exist, triggering the subsequent comparison part;
the eliminating part is configured to eliminate the graph to be compared from the graph set to be compared due to the fact that the graph to be compared is determined to be not in accordance with the comparison requirement;
the subsequent comparison part is configured to perform a subsequent comparison process for the graph to be compared.
In a third aspect, embodiments of the present invention provide a computing device, the computing device comprising: a communication interface, a memory and a processor; the components are coupled together by a bus system;
the communication interface is used for receiving and transmitting signals in the process of receiving and transmitting information with other external network elements;
the memory is used for storing a computer program capable of running on the processor;
the processor is configured to execute the graphic contrast method step based on color features according to the first aspect when the computer program is run.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium storing a color feature-based graphic comparison program, which when executed by at least one processor implements the color feature-based graphic comparison method steps of the first aspect.
The embodiment of the invention provides a graph comparison method and device based on color characteristics and a computer storage medium; by utilizing the search comparison of the sampling points in the set range to reject the graphics to be compared, which do not meet the comparison requirement, in the graphics set to be compared, compared with the conventional pixel-by-pixel comparison scheme, the method saves the operation resources consumed during comparison operation, reduces the operation amount and improves the graphics comparison efficiency. In the graphic comparison process, the waste of operation resources can be reduced, and the graphic comparison efficiency is improved.
Drawings
FIG. 1 is a schematic flow chart of a graphic contrast method based on color features according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a subsequent graphic comparison flow provided in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a standard graph according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a graph to be compared according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a graphic contrast device based on color features according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of another embodiment of a graphic contrast device based on color features;
fig. 7 is a schematic diagram of a specific hardware structure of a computing device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Comparing and retrieving the graphics similar to the pixel color value of the standard graphics from a graphics set (or group) formed by a plurality of graphics, wherein a conventional mode is generally adopted, wherein each graphics to be compared in the graphics set or group is subjected to color value comparison operation with the standard graphics pixel by pixel, and if a large difference exists between the color value of one pixel in the graphics to be compared and the color value of the corresponding pixel in the standard graphics, the graphics to be compared are not in accordance with the comparison requirement, namely the graphics to be compared do not belong to the similar graphics of the standard graphics; correspondingly, if the color values of all pixels in the graph to be compared and the corresponding pixels in the standard graph do not have large differences, the graph to be compared is proved to meet the comparison requirement, that is, the graph to be compared belongs to the similar graph of the standard graph.
Currently, a common graphic contains hundreds of thousands or even millions of pixels, for example, a graphic with a resolution of 1027×768 and a color of RGB, and a total of 786432 pixels. Taking the graph as a standard graph for graph comparison, setting that the first 100001 pixels of the graph to be compared do not meet the comparison requirement, and then in the graph comparison process in a conventional mode, the comparison operation performed on the first 100000 pixels of the graph to be compared becomes meaningless because the graph to be compared does not meet the comparison requirement; even when nine to-be-compared graphs in the graph set are in the 8 th bit of the comparison sequence in the graph set, the comparison operation of 700000 pixels on 7 to-be-compared graphs before the 8 th to-be-compared graph is not significant.
As can be seen from the above description, in the conventional manner of performing graphic comparison at present, since each graphic to be compared is subjected to pixel-by-pixel comparison operation, a great amount of operation resources are wasted in the process of performing graphic comparison on the graphic to be compared which does not meet the comparison requirement, and the comparison efficiency is significantly reduced. In view of this, the embodiment of the invention is expected to provide a graph comparison method based on color features, which eliminates graphs to be compared which do not meet the comparison requirement from a set or group of graphs to be compared formed by the graphs to be compared before comparing the graphs to be compared according to pixel by pixel, thereby reducing the number of graphs to be compared for pixel by pixel comparison, improving the hit rate of graph comparison, reducing the overall operand, reducing the waste of operation resources, and improving the graph comparison efficiency.
In some examples, in order to be able to preliminarily reject some graphics to be compared which obviously do not meet the comparison requirement from the graphics to be compared set, for example, the graphics composition of details, objects, scenes and the like in the graphics to be compared are inconsistent with the standard graphics, more than one sampling point can be selected from the standard graphics; searching whether pixel points similar to the color characteristics of the corresponding sampling points exist in the vicinity range of the pixel points in the corresponding positions of the sampling points in the graphics to be compared aiming at each graphics to be compared in the graphics to be compared set, and if not, indicating that the graphics to be compared obviously do not meet the comparison requirement; if so, the pattern to be compared can be further compared with the standard pattern. Specifically, referring to fig. 1, it may include: s101: dividing a standard graph into a plurality of first graph blocks according to a set first size, wherein the sizes of the first graph blocks are consistent and not overlapped, and all the first graph blocks can completely cover the standard graph; s102: selecting a sampling point from each first graph block, wherein the obtained sampling point can be positioned at each detail position of the standard graph; s103: determining the searching range of each sampling point corresponding to the graph to be compared according to the pixel points in the corresponding positions of each sampling point in the graph to be compared and the set searching range; s104: searching whether pixel points meeting the comparison requirement exist in the searching range corresponding to each sampling point based on the color characteristic value and the color characteristic value deviation threshold value: if not, go to S105: the graphics to be compared are removed from the graphics set to be compared due to the fact that the graphics to be compared are determined to be not in accordance with the comparison requirement, and therefore follow-up comparison flow is not needed to be conducted on the removed graphics to be compared; if so, go to S106: the graphics to be compared can be subjected to a subsequent comparison process, and a position offset can be preferably determined according to the positions of the sampling points and the positions of the corresponding pixel points meeting the comparison requirements.
For example, the set first size may be a size of 4×4 pixels or 8×8 pixels, and the size of the first size may be set according to the set search range, the set resolution, and the like, which is not limited in the embodiment of the present invention. After the standard graph is divided into graph blocks according to the first size, setting the position of a sampling point in the standard graph as (100 ), setting the color characteristic value as 178, wherein the color characteristic value deviation threshold value col_offset used for representing the color characteristic value meeting the comparison requirement is 3, and setting the searching range pos_offset as 2; then, according to the above example, whether the pixel point with the color characteristic value of (178±3) exists or not can be searched in the rectangular blocks of (100±2 ) of the graph to be compared; if the pixel points meeting the requirements are not found in the rectangular block, confirming that the graph to be compared does not meet the comparison requirements, and eliminating the graph to be compared; if the pixel points meeting the requirements are found in the rectangular block, determining that the graph to be compared can enter a subsequent comparison flow, wherein the subsequent comparison flow can be a pixel-by-pixel comparison flow as described in a conventional scheme or a comparison flow as described in a subsequent example; if the comparison process is described for the subsequent example, the position offset between the pixel point position and the sampling point position may also be recorded for use in the comparison process described for the subsequent example.
It should be noted that, in the foregoing examples and descriptions of the examples, the embodiment of the present invention does not make any determination on the selection policy of the sampling points in each first graphics block, so it can be known that any scheme capable of selecting a sampling point from a graphics block can be applied to the technical scheme of the embodiment of the present invention. The color characteristic value is preferably an RGB color value, but the color characteristic value in the technical solution of the embodiment of the present invention may also be preferably various color component values such as a gray value, transparency, YUV, YRC, and the like according to the specific implementation state. The threshold value used for representing the meeting of the comparison requirement can be preferably an integral value or can be preferably set for each component respectively; for example, an overall threshold may be set for the RGB format, with three color components in common; the threshold values may also be set for the three color components, which are not described in detail herein.
It can be understood that, by the above scheme of using the search and comparison of the sampling points in the set range to reject the graphics to be compared, which do not meet the comparison requirement in the graphics set to be compared, compared with the pixel-by-pixel comparison scheme adopted conventionally, the method saves the operation resources consumed during the comparison operation, reduces the operation amount, and improves the graphics comparison efficiency.
After some to-be-compared graphs which obviously do not meet the comparison requirement are preliminarily removed from the to-be-compared graph set according to the above example, a further comparison process can be performed on the to-be-compared graphs reserved through the above example, and as described above, the subsequent comparison process can be either a pixel-by-pixel comparison process as described in the conventional scheme or a comparison process as described below, so that the to-be-compared graphs which are not removed can be subjected to graph comparison according to the pixel-by-pixel comparison process as described in the conventional scheme after the comparison process as described in the following example is completed.
In some examples, the graphics to be compared that remain in the foregoing examples further need to continue the following comparison process, as shown in fig. 2, S201: dividing the standard graph according to a set second size to obtain a plurality of second graph blocks, and dividing the graph to be compared according to the second size based on the position offset to obtain a plurality of third graph blocks; the second graphic blocks and the third graphic blocks are equal in size and correspond to each other one by one, the second graphic blocks are not overlapped with each other, all the second graphic blocks can completely cover the standard graph, the third graphic blocks are not overlapped with each other, and all the third graphic blocks can completely cover the graph to be compared; s202: selecting a plurality of sampling points from corresponding positions in the corresponding second graphic block and third graphic block; s203: subtracting the color characteristic value difference value between the sampling points in the second graph block from the color characteristic value difference value between the sampling points in the corresponding third graph block; s204: comparing the subtracted first difference with a set first threshold: s205: if the first difference value is larger than the set first threshold value, the pixel point color characteristic value of the graph to be compared is larger in fluctuation, and the graph to be compared is removed if the comparison requirement is not met; s206: if the first difference value is not greater than the set first threshold value, the pixel point color characteristic value of the graph to be compared is indicated to have small fluctuation, the comparison requirement is met, and subtraction operation is carried out on the sum value of the color characteristic values between the sampling points in the second graph block and the sum value of the color characteristic values between the sampling points in the corresponding third graph block; s207: comparing the subtracted second difference with a set second threshold: s208: if the second difference value is larger than the set second threshold value, indicating that the color characteristic value of the pixel point of the graph to be compared is large or small as a whole and does not meet the comparison requirement, so that the graph to be compared needs to be removed; s209: if the second difference value is not greater than the set second threshold value, the color characteristic value of the pixel points of the graph to be compared is indicated to be in accordance with the comparison requirement, so that the graph to be compared can be subjected to subsequent pixel-by-pixel comparison.
Based on the above example, for example, the position offset obtained based on the foregoing example is set to be (1, 2), the standard pattern is segmented from the (0, 0) position according to the second size, and the pattern to be compared is segmented from the (0+1, 0+2) position according to the second size, where it should be noted that the second size may be the same as or different from the first size, and the numerical value adopted in the specific implementation may be selected according to the actual implementation situation, which is not repeated in this example. Selecting 2 sampling points from the second graphic block, and selecting 2 sampling points at corresponding positions in the corresponding third graphic block; firstly, obtaining color characteristic value difference values among sampling points in a second graph block through subtraction of color characteristic values among the sampling points selected in the second graph block, and obtaining color characteristic value difference values among the sampling points in a third graph block through subtraction of color characteristic values among the sampling points selected in the third graph block; then, subtracting the color characteristic value difference value between the sampling points in the second graph block from the color characteristic value difference value between the sampling points in the corresponding third graph block; if the difference value m obtained by subtraction is larger than a set first threshold value, such as 2 xcol_offset, it is indicated that the color characteristic value of some pixels in the graph to be compared fluctuates greatly, so that the graph to be compared is removed from the graph set to be compared; if the difference value m obtained by subtraction is not greater than a set first threshold value, for example, 2 xcol_offset, for the graph to be compared, performing subtraction operation on the sum value of the color characteristic values between the sampling points in the second graph block and the sum value of the color characteristic values between the sampling points in the corresponding third graph block; if the difference value n obtained by subtraction is larger than a set second threshold value, for example, p×col_offset, p represents the number of pixels in the second graph block or the third graph block, it is indicated that the color characteristic value of the pixels of the graph to be compared is larger or smaller as a whole and does not meet the comparison requirement, so that the graph to be compared needs to be removed from the graph set to be compared; if the difference value n obtained by subtraction is not greater than the second threshold value, the color characteristic value of the pixel point of the graph to be compared is indicated to be in accordance with the comparison requirement as a whole, so that the graph to be compared can be subjected to subsequent pixel-by-pixel comparison.
It should be noted that, the remaining graphics to be compared in the foregoing example are removed, and the graphics to be compared with the standard graphics are continuously compared according to the present example, so that the graphics to be compared with the standard graphics, which have larger fluctuation of the color characteristic value and larger or smaller color characteristic value of the pixel point, can be removed without pixel-by-pixel comparison, thereby greatly increasing the possibility that the remaining graphics to be compared in the graphics set to be compared belong to the graphics similar to the standard graphics, and then comparing the remaining graphics to be compared in the graphics set to be compared with each other according to pixel-by-pixel comparison, thereby improving the hit rate of pixel-by-pixel comparison, and further reducing the number of the graphics to be compared with each pixel and improving the graphics comparison efficiency.
For the above two examples, taking the graphs shown in fig. 3 and fig. 4 as an example, fig. 3 is a standard graph, fig. 4 is one graph to be compared in the graph set to be compared, the resolution of the graph is 640×480, there are 153600 pixels in total, and if there is an abnormal pixel shown in the square frame in the graph in fig. 4, the abnormal pixel starts from 100001 th. Based on the above setting, according to the conventional pixel-by-pixel comparison method, 100000 comparison operations are needed to find the abnormal pixel in fig. 4; for the embodiment of the present invention, pos_offset=2 and col_offset=2 are set.
Firstly, setting a first size to be 16×16, so that fig. 3 can be divided into 600 first graph blocks, each first graph block is selected to be a sampling point, and then in the graph to be compared shown in fig. 4, (2×2+1) x (2×2+1) =25 pixels to be searched are shared around the pixel point corresponding to the sampling point, and in combination with the 600 first graph blocks, for the graph to be compared shown in fig. 4, abnormal pixels can be found by 25×600=15000 operations under the worst condition, so that the graph to be compared which obviously does not meet the comparison requirement is determined and removed from the graph set to be compared, so that the graph comparison flow of the graph to be compared of the next station is stopped, and the calculation force (100000-15000)/100000=85) is saved; if the abnormal pixel point in fig. 4 cannot be found by 25×600=15000 operations, it is necessary to determine the position offset by at most 25×600=15000 operations, and the following graph comparison process is continued.
Next, the second size is set to be still 16×16, and fig. 3 is divided into 600 second graphic blocks according to the position offset, and the corresponding fig. 4 is also divided into 600 third graphic blocks, and each second graphic block and each corresponding third graphic block has 2 sampling points corresponding to the selected positions. For eliminating the graphics to be compared with larger fluctuation of the color characteristic values, three subtraction operations and one comparison operation are needed for each second graphic block and the corresponding third graphic block, and for 600 second graphic blocks and the corresponding third graphic blocks, the worst case is that 4×600=2400 operations are needed to be performed, so that abnormal pixel points can be found, and therefore the graphics to be compared with larger fluctuation of the color characteristic values in fig. 4 are determined and eliminated from the graphics to be compared set, and the graphics comparison process for fig. 4 is stopped to perform the graphics comparison process for the next station of graphics to be compared, and the saved calculation force is (100000-15000×2-2400)/100000=67.6%.
Then, if determining that fig. 4 does not belong to the to-be-compared graph with large fluctuation of the color characteristic value through 2400 operations, continuously determining whether the to-be-compared graph with large or small overall color characteristic value of the pixel point is the to-be-compared graph with large or small overall color characteristic value of the pixel point, and for each second graph block and the corresponding third graph block, performing addition operation, subtraction operation and comparison operation twice, if 600 second graph blocks and the corresponding third graph blocks are required, performing operation 4×600=2400 times in the worst case, and finding abnormal pixel points, thereby determining that fig. 4 belongs to the to-be-compared graph with large or small overall color characteristic value of the pixel point, removing the to-be-compared graph from the to-be-compared graph set, and stopping the graph comparison flow for the next to-be-compared graph, wherein the saving calculation force is (100000-15000×2-2400×2)/100000=65.2%.
Finally, through the above procedure, if fig. 4 is still not removed from the set of graphics to be compared, pixel-by-pixel comparison is performed according to the conventional scheme, and the wasted calculation force is 1-65.2% = 34.8%.
For the above example, if the occurrence probabilities of the above four cases are the same, the average of the theoretically saved forces is (85% +67.6% +65.2% -34.8%)/4=45.75% by adopting the technical scheme of the embodiment of the present invention. However, in the actual implementation process, based on specific situations such as differences between the comparison graph and the standard graph, distribution of abnormal points, and the like, the situation that all 25 sampling points meet the requirements in the first implementation process is rare, and the abnormal points are not usually found after all operations of the block are executed, so that the actual saving of the calculation force is more remarkable. It can be appreciated that the greater the number of patterns to be compared in the pattern set to be compared, the more significant the effect of the computational effort savings.
As can be seen from the above examples and examples, the pattern comparison scheme based on the color features provided by the embodiments of the present invention may be implemented before performing pixel-by-pixel comparison on the standard pattern and the pattern to be compared, so as to eliminate the pattern to be compared that does not conform to the standard pattern by using a smaller amount of operation, reduce the number of patterns to be compared that need to be compared pixel-by-pixel, improve the contrast hit rate, and greatly reduce the overall operation amount. Moreover, as the conventional pixel-by-pixel comparison process is that each pixel is compared one by one, the serial implementation is realized; in the implementation process, the scheme provided by the embodiment of the invention can be realized through the operation between the mutually misaligned graph blocks, so that the scheme can be realized by utilizing the powerful parallel computing capacity of the GPU of the graph processor, and the time efficiency in the specific implementation is improved.
Referring to fig. 5, a color feature based graphical contrast device 50 that enables one or more aspects of the above examples is shown, the device 50 comprising: a dividing section 501, a selecting section 502, a searching section 503, a judging section 504, a culling section 505, a subsequent comparing section 506; wherein;
the dividing part 501 is configured to divide a standard graph into a plurality of first graph blocks according to a set first size, where the sizes of the first graph blocks are consistent and not coincident, and all the first graph blocks can completely cover the standard graph;
the selecting portion 502 is configured to select a sampling point from each of the first graphics blocks;
the searching part 503 is configured to determine a searching range of each sampling point corresponding to the graph to be compared according to the pixel point at the corresponding position of each sampling point in the graph to be compared and the set searching range;
the determining portion 504 is configured to search whether a pixel point meeting the contrast requirement exists in a search range corresponding to each sampling point based on the color feature value and the color feature value deviation threshold; and triggering the rejecting portion 505 if there are no pixels meeting the contrast requirement; and triggering the subsequent comparison portion 506 if there are pixels meeting the comparison requirement;
the rejecting part 505 is configured to reject the graphics to be compared from the graphics set to be compared due to the fact that the graphics to be compared are determined to be not in accordance with the comparison requirement;
the subsequent comparison section 506 is configured to perform a subsequent comparison procedure with respect to the graph to be compared.
In some examples, referring to fig. 6, the apparatus 50 further includes a determining portion 507;
the determining part 504 is further configured to trigger the determining part if there are pixel points meeting the contrast requirement; the determining part is configured to determine a position offset according to the positions of the sampling points and the positions of the corresponding pixel points meeting the comparison requirement.
In some examples, the subsequent comparison portion 506 is configured to:
dividing the standard graph according to a set second size to obtain a plurality of second graph blocks, and dividing the graph to be compared according to the second size based on the position offset to obtain a plurality of third graph blocks; the second graphic blocks and the third graphic blocks are equal in size and correspond to each other one by one, the second graphic blocks are not overlapped with each other, all the second graphic blocks can completely cover the standard graph, the third graphic blocks are not overlapped with each other, and all the third graphic blocks can completely cover the graph to be compared; the method comprises the steps of,
selecting a plurality of sampling points from corresponding positions in the corresponding second graphic block and third graphic block; the method comprises the steps of,
subtracting the color characteristic value difference value between the sampling points in the second graph block from the color characteristic value difference value between the sampling points in the corresponding third graph block; the method comprises the steps of,
comparing the subtracted first difference with a set first threshold: the method comprises the steps of,
if the first difference value is larger than a set first threshold value, the graph to be compared is removed from the graph set to be compared based on the fact that the graph does not meet the comparison requirement; the method comprises the steps of,
if the first difference value is not greater than the first threshold value, subtracting the sum value of the color characteristic values between the sampling points in the second graph block from the sum value of the color characteristic values between the sampling points in the corresponding third graph block; the method comprises the steps of,
comparing the subtracted second difference with a set second threshold: the method comprises the steps of,
if the second difference value is larger than a set second threshold value, the graph to be compared is removed from the graph set to be compared based on the fact that the graph does not meet the comparison requirement; the method comprises the steps of,
and if the second difference value is not greater than the set second threshold value, comparing the graphics to be compared pixel by pixel.
In some examples, the first size is the same as or different from the second size.
In some examples, the subsequent comparison portion 506 is configured to: and comparing the graphics to be compared pixel by pixel.
In some examples, the color feature values include:
at least one of RGB color values, gray values, transparency, YUV color component values, and YRC color component values.
It will be appreciated that in this embodiment, a "part" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course may be a unit, or a module may be non-modular.
In addition, each component in the present embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional modules.
The integrated units, if implemented in the form of software functional modules, may be stored in a computer-readable storage medium, if not sold or used as separate products, and based on such understanding, the technical solution of the present embodiment may be embodied essentially or partly in the form of a software product, which is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or processor to perform all or part of the steps of the method described in the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Accordingly, the present embodiment provides a computer storage medium storing a color feature-based graphic comparison program, which when executed by at least one processor, implements the color feature-based graphic comparison method steps in the above technical solution.
According to the above-described color feature based graphic contrast device 50 and computer storage medium, referring to fig. 7, there is shown a specific hardware structure of a computing apparatus 70 capable of implementing the above-described color feature based graphic contrast device 50 according to an embodiment of the present invention, the computing apparatus 70 may be a wireless device, a mobile or cellular phone (including a so-called smart phone), a Personal Digital Assistant (PDA), a video game console (including a video display, a mobile video game device, a mobile video conference unit), a laptop computer, a desktop computer, a television set-top box, a tablet computing device, an e-book reader, a fixed or mobile media player, etc. The computing device 70 may include: a communication interface 701, a memory 702 and a processor 703; the various components are coupled together by a bus system 704. It is appreciated that bus system 704 is used to enable connected communications between these components. The bus system 704 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as bus system 704 in fig. 7. Wherein,
the communication interface 701 is configured to receive and send signals during the process of receiving and sending information with other external network elements;
the memory 702 is configured to store a computer program capable of running on the processor 703;
the processor 703 is configured to execute the graphic comparison method step based on the color feature in the foregoing technical solution when running the computer program, which is not described herein.
It is to be appreciated that memory 702 in embodiments of the invention may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (Double Data Rate SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). The memory 702 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
And the processor 703 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 703 or by instructions in the form of software. The processor 703 may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 702, and the processor 703 reads information in the memory 702 and, in combination with its hardware, performs the steps of the method described above.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP devices, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
It should be noted that: the technical schemes described in the embodiments of the present invention may be arbitrarily combined without any collision.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A method of graphic contrast based on color characteristics, the method comprising:
dividing a standard graph into a plurality of first graph blocks according to a set first size, wherein the sizes of the first graph blocks are consistent and not overlapped, and all the first graph blocks can completely cover the standard graph;
selecting a sampling point from each first graphic block;
determining the searching range of each sampling point corresponding to the graph to be compared according to the pixel points in the corresponding positions of each sampling point in the graph to be compared and the set searching range;
searching whether pixel points meeting the comparison requirement exist in the searching range corresponding to each sampling point based on the color characteristic value and the color characteristic value deviation threshold value: if the pixel points which meet the comparison requirement do not exist, the graph to be compared is removed from the graph set to be compared due to the fact that the graph to be compared is determined to be not in accordance with the comparison requirement; if the pixel points meeting the comparison requirement exist, carrying out a subsequent comparison process aiming at the graph to be compared;
the performing a subsequent comparison process on the graph to be compared includes:
dividing the standard graph according to a set second size to obtain a plurality of second graph blocks, and dividing the graph to be compared according to the second size based on the position of each sampling point and the position offset determined by the position of the pixel point corresponding to the comparison requirement to obtain a plurality of third graph blocks; the second graphic blocks and the third graphic blocks are equal in size and correspond to each other one by one, the second graphic blocks are not overlapped with each other, all the second graphic blocks can completely cover the standard graph, the third graphic blocks are not overlapped with each other, and all the third graphic blocks can completely cover the graph to be compared;
selecting a plurality of sampling points from corresponding positions in the corresponding second graphic block and third graphic block;
subtracting the color characteristic value difference value between the sampling points in the second graph block from the color characteristic value difference value between the sampling points in the corresponding third graph block;
comparing the subtracted first difference with a set first threshold:
if the first difference value is larger than a set first threshold value, the graph to be compared is removed from the graph set to be compared based on the fact that the graph does not meet the comparison requirement;
if the first difference value is not greater than the first threshold value, subtracting the sum value of the color characteristic values between the sampling points in the second graph block from the sum value of the color characteristic values between the sampling points in the corresponding third graph block;
comparing the subtracted second difference with a set second threshold:
if the second difference value is larger than a set second threshold value, the graph to be compared is removed from the graph set to be compared based on the fact that the graph does not meet the comparison requirement;
and if the second difference value is not greater than the set second threshold value, comparing the graphics to be compared pixel by pixel.
2. The method of claim 1, wherein if there are pixels meeting contrast requirements, the method further comprises: and determining a position offset according to the positions of the sampling points and the positions of the corresponding pixel points meeting the comparison requirement.
3. The method of claim 1, wherein the first size is the same as or different from the second size.
4. The method according to claim 1, wherein the performing a subsequent comparison procedure for the graphics to be compared comprises: and comparing the graphics to be compared pixel by pixel.
5. The method according to any one of claims 1 to 4, wherein the color feature values comprise:
at least one of RGB color values, gray values, transparency, YUV color component values, and YRC color component values.
6. A graphic contrast device based on color features, the device comprising: dividing part, selecting part, searching part, judging part, eliminating part and subsequent comparing part; wherein;
the dividing part is configured to divide the standard graph into a plurality of first graph blocks according to a set first size, wherein the sizes of the first graph blocks are consistent and do not coincide, and all the first graph blocks can completely cover the standard graph;
the selecting part is configured to select a sampling point from each first graph block;
the searching part is configured to determine the searching range of each sampling point corresponding to the graph to be compared according to the pixel points in the corresponding positions of each sampling point in the graph to be compared and the set searching range;
the judging part is configured to search whether pixel points meeting the comparison requirement exist in the search range corresponding to each sampling point based on the color characteristic value and the color characteristic value deviation threshold value; if no pixel points meeting the comparison requirement exist, triggering the rejecting part; if pixel points meeting the comparison requirement exist, triggering the subsequent comparison part;
the eliminating part is configured to eliminate the graph to be compared from the graph set to be compared due to the fact that the graph to be compared is determined to be not in accordance with the comparison requirement;
the subsequent comparison part is configured to perform a subsequent comparison process for the graph to be compared;
wherein the subsequent comparison section is configured to:
dividing the standard graph according to a set second size to obtain a plurality of second graph blocks, and dividing the graph to be compared according to the second size based on the position of each sampling point and the position offset determined by the position of the pixel point corresponding to the comparison requirement to obtain a plurality of third graph blocks; the second graphic blocks and the third graphic blocks are equal in size and correspond to each other one by one, the second graphic blocks are not overlapped with each other, all the second graphic blocks can completely cover the standard graph, the third graphic blocks are not overlapped with each other, and all the third graphic blocks can completely cover the graph to be compared; the method comprises the steps of,
selecting a plurality of sampling points from corresponding positions in the corresponding second graphic block and third graphic block; the method comprises the steps of,
subtracting the color characteristic value difference value between the sampling points in the second graph block from the color characteristic value difference value between the sampling points in the corresponding third graph block; the method comprises the steps of,
comparing the subtracted first difference with a set first threshold: the method comprises the steps of,
if the first difference value is larger than a set first threshold value, the graph to be compared is removed from the graph set to be compared based on the fact that the graph does not meet the comparison requirement; the method comprises the steps of,
if the first difference value is not greater than the first threshold value, subtracting the sum value of the color characteristic values between the sampling points in the second graph block from the sum value of the color characteristic values between the sampling points in the corresponding third graph block; the method comprises the steps of,
comparing the subtracted second difference with a set second threshold: the method comprises the steps of,
if the second difference value is larger than a set second threshold value, the graph to be compared is removed from the graph set to be compared based on the fact that the graph does not meet the comparison requirement; the method comprises the steps of,
and if the second difference value is not greater than the set second threshold value, comparing the graphics to be compared pixel by pixel.
7. A computing device, the computing device comprising: a communication interface, a memory and a processor; the components are coupled together by a bus system;
the communication interface is used for receiving and transmitting signals in the process of receiving and transmitting information with other external network elements;
the memory is used for storing a computer program capable of running on the processor;
the processor is configured to perform the color feature based graphic contrast method steps of any one of claims 1 to 5 when the computer program is run.
8. A computer storage medium storing a color feature based graphic comparison program which, when executed by at least one processor, implements the color feature based graphic comparison method steps of any one of claims 1 to 5.
CN202010013472.6A 2020-01-07 2020-01-07 Graphic comparison method and device based on color characteristics and computer storage medium Active CN111243038B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010013472.6A CN111243038B (en) 2020-01-07 2020-01-07 Graphic comparison method and device based on color characteristics and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010013472.6A CN111243038B (en) 2020-01-07 2020-01-07 Graphic comparison method and device based on color characteristics and computer storage medium

Publications (2)

Publication Number Publication Date
CN111243038A CN111243038A (en) 2020-06-05
CN111243038B true CN111243038B (en) 2024-02-09

Family

ID=70877656

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010013472.6A Active CN111243038B (en) 2020-01-07 2020-01-07 Graphic comparison method and device based on color characteristics and computer storage medium

Country Status (1)

Country Link
CN (1) CN111243038B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103996041A (en) * 2014-05-15 2014-08-20 武汉睿智视讯科技有限公司 Vehicle color identification method and system based on matching
WO2017088564A1 (en) * 2015-11-26 2017-06-01 努比亚技术有限公司 Image processing method, device, terminal, and storage medium
CN108961345A (en) * 2018-06-01 2018-12-07 沈阳普泽众康医药科技有限公司 A kind of effective determination method and determining device of color in Urine test paper

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7111941B2 (en) * 2004-08-25 2006-09-26 Hewlett-Packard Development Company, L.P. Method and apparatus for multiple-resolution light value projector

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103996041A (en) * 2014-05-15 2014-08-20 武汉睿智视讯科技有限公司 Vehicle color identification method and system based on matching
WO2017088564A1 (en) * 2015-11-26 2017-06-01 努比亚技术有限公司 Image processing method, device, terminal, and storage medium
CN108961345A (en) * 2018-06-01 2018-12-07 沈阳普泽众康医药科技有限公司 A kind of effective determination method and determining device of color in Urine test paper

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张旭东 ; 吕言言 ; 缪永伟 ; 郝鹏翼 ; 陈佳舟 ; .结合区域协方差分析的图像显著性检测.中国图象图形学报.2016,(05),全文. *
张洋 ; 普杰信 ; 梁灵飞 ; 张蕾 ; .基于超像素的印刷品色差在线检测方法.测控技术.2017,(09),全文. *

Also Published As

Publication number Publication date
CN111243038A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
EP3979082A1 (en) Memory reclamation method and apparatus, electronic device, and storage medium
WO2022127912A1 (en) Image segmentation method, network training method, electronic equipment and storage medium
US20220035655A1 (en) Method and Device for Anonymous Page Management, Terminal Device, and Readable Storage Medium
US11521303B2 (en) Method and device for inpainting image
CN110727607B (en) Memory recovery method and device and electronic equipment
US20220327661A1 (en) Image super-resolution processing method, system, and device
CN111047496A (en) Threshold determination method, watermark detection device and electronic equipment
CN115035128A (en) Image overlapping sliding window segmentation method and system based on FPGA
CN111243038B (en) Graphic comparison method and device based on color characteristics and computer storage medium
CN103425539B (en) Information processing method and device
CN111221734B (en) Verification method and device for graphic interface and computer storage medium
CN114299030A (en) Object detection model processing method, device, equipment and storage medium
US6812927B1 (en) System and method for avoiding depth clears using a stencil buffer
US20200327638A1 (en) Connected component detection method, circuit, device and computer-readable storage medium
US6321301B1 (en) Cache memory device with prefetch function and method for asynchronously renewing tag addresses and data during cache miss states
US6518973B1 (en) Method, system, and computer program product for efficient buffer level management of memory-buffered graphics data
CN107861990B (en) Video searching method and system and terminal equipment
CN110879948B (en) Image processing method, device and storage medium
CN114219812A (en) Label avoiding method and device, electronic equipment and storage medium
CN112052089B (en) Memory recovery method and device and electronic equipment
CN115829846A (en) Image processing method, image processing device, electronic equipment and storage medium
CN111857604A (en) Method, apparatus, device and medium for quickly reconstructing packet management mapping reverse lookup table
CN112000462A (en) Data processing method and device based on shared peripheral resources
CN111562983A (en) Memory optimization method and device, electronic equipment and storage medium
CN111160358A (en) Image binarization method, device, equipment and 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 301, Building D, Yeda Science and Technology Park, No. 300 Changjiang Road, Yantai Area, Yantai Free Trade Zone, Shandong Province, 265503

Applicant after: Xi'an Xintong Semiconductor Technology Co.,Ltd.

Address before: Room 21101, 11 / F, unit 2, building 1, Wangdu, No. 3, zhangbayi Road, Zhangba Street office, hi tech Zone, Xi'an City, Shaanxi Province

Applicant before: Xi'an Xintong Semiconductor Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant