Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments, based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
As shown in Figure 1, this method may include following step the embodiment of the invention provides a kind of image characteristic extracting method
It is rapid:
Step 101: edge detection being carried out to image, obtains contour images.
In practical application scene, edge detection can be carried out to image using Sobel operator, Prewitt operator etc., obtained
To contour images.The contour images are bianry image.
Step 102: dividing contour images, obtain several profile subgraphs.
Step 103: being directed to each profile subgraph: determining the mass center of profile subgraph.
Step 104: calculating each pixel of profile subgraph at a distance from mass center.
Step 105: according to each pixel at a distance from mass center, other corresponding several pixels of each pixel, system
The quantity of meter and pixel distance and pixel and pixel corresponding at a distance from mass center;Wherein, corresponding any of pixel
The distance of other pixels is pixel distance.
In view of the correlation of other pixels and the pixel for closing on pixel is larger, therefore, in practical application
In scene, pixel distance is less than specified dependent thresholds.That is, image characteristics extraction process be concerned only with corresponding pixel away from
From other pixels in dependent thresholds.
This method incorporates the spatial information of pixel by dividing to contour images in characteristics of image;Meanwhile it should
Method considers in statistic processes and pixel is at a distance of the information of other pixels of pixel distance, can melt in characteristics of image
Enter the information of neighbor pixel.Due to obtained the multi-features spatial information of pixel and the letter of neighbor pixel
Breath, therefore, this method to image can describe more accurately, and then can be improved the accuracy of image recognition.
In one embodiment of the invention, step 102 specifically includes:
A1: the corresponding Rectangular Bounding Volume of contour images is determined.
A2: according to preset division threshold value and Rectangular Bounding Volume, contour images are divided into several profile subgraphs.
Wherein, dividing threshold value can rule of thumb be predefined by user.
A2 is specifically included: as unit of W/n, contour images being divided into n profile subgraph;Wherein, Rectangular Bounding Volume
Size be a × b, W=max (a, b), n for characterize divide threshold value.
The embodiment of the present invention divides contour images according to the corresponding Rectangular Bounding Volume of contour images, in actual scene
In, contour images can also be divided in other way, for example, according to the level of the mass center by contour images
Contour images are divided into several profile subgraphs by line.
This method can be evenly divided for contour images progress by Rectangular Bounding Volume, to incorporate wheel in characteristics of image
The spatial information of wide image.
In one embodiment of the invention, this method further include:
Determine the corresponding Rectangular Bounding Volume of contour images;
Minimum value in determining the corresponding pixel of contour images at a distance from mass center;
Maximum value in determining the corresponding pixel of contour images at a distance from mass center;
According to Rectangular Bounding Volume, maximum value and minimum value, each pixel is standardized at a distance from mass center;
According to each pixel at a distance from mass center, other corresponding several pixels of each pixel, statistics and pixel
The quantity of distance and pixel corresponding pixel at a distance from mass center, comprising:
According to the standardized each pixel of process at a distance from mass center, other corresponding several pixels of each pixel
Point, the quantity of statistics and pixel distance and pixel and pixel corresponding at a distance from mass center.
The distance difference of different pixel and mass center is larger, is standardized at a distance from mass center to pixel, can
Simplify and calculates.
In one embodiment of the invention, if according to each pixel at a distance from mass center, each pixel it is corresponding
Do other pixels, the quantity of statistics and pixel distance and pixel and pixel corresponding at a distance from mass center, comprising:
The upside or downside or left or right side for determining current pixel point are with the presence or absence of other pixels, wherein other pictures
Vegetarian refreshments is equal to current pixel point at a distance from mass center at a distance from mass center;Current pixel point is current at a distance from other pixels
Pixel distance;
If it is, adding 1 with current pixel distance and current pixel point quantity of corresponding pixel at a distance from mass center;
Wherein, current pixel point is any pixel point of profile subgraph, and current pixel distance is preset several pixels
Any one in distance.
In embodiments of the present invention, other pixels are found using the method for four neighborhoods, i.e., concern current pixel point is upper
Side, downside, left and right side.In practical application scene, other pixels can also be found using the method for eight neighborhood, i.e., really
The upside or downside or left or right side or upper left side or lower left side or upper right side or lower right side for determining current pixel point whether there is
Other pixels.
As shown in Fig. 2, the embodiment of the invention provides a kind of image characteristic extracting methods, comprising the following steps:
Step 201: edge detection being carried out to image, obtains contour images.
Edge detection is carried out to image using Sobel operator, obtains contour images.
Step 202: determining the corresponding Rectangular Bounding Volume of contour images.
The size of Rectangular Bounding Volume is a × b, and a > b.
Step 203: according to preset division threshold value and Rectangular Bounding Volume, contour images being divided into several profile subgraphs
Picture.
As unit of a/n, contour images are divided into n profile subgraph;Wherein, n divides threshold value for characterizing.
Step 204: being directed to each profile subgraph: determining the mass center of profile subgraph.
The pixel b of profile subgraphiCoordinate be (xi, yi);
Mass center c (the x of profile subgraph is calculated according to formula (1) and formula (2)c, yc)。
Wherein, N is used to characterize the quantity of the pixel of profile subgraph.
Step 205: calculating each pixel of profile subgraph at a distance from mass center.
D (bi, c) is for characterizing pixel bi at a distance from mass center c.
The corresponding pixel of each profile subgraph constitutes a distance matrix at a distance from mass center.
Step 206: the minimum value in determining the corresponding pixel of contour images at a distance from mass center.
Step 207: the maximum value in determining the corresponding pixel of contour images at a distance from mass center.
Step 208: according to Rectangular Bounding Volume, maximum value and minimum value, each pixel being marked at a distance from mass center
Standardization.
Pixel is standardized at a distance from mass center according to formula (4).
Wherein, norm_dis is for characterizing by standardized each pixel at a distance from mass center, and dis is for characterizing picture
Vegetarian refreshments is at a distance from mass center, disminFor characterize state the corresponding pixel of contour images at a distance from mass center in minimum value,
dismaxFor characterize the corresponding pixel of contour images at a distance from mass center in maximum value, W is for characterizing Rectangular Bounding Volume
Maximal side, in embodiments of the present invention, W=a.
Step 209: according to by standardized each pixel at a distance from mass center, each pixel it is corresponding it is several its
His pixel, the quantity of statistics and pixel distance and pixel and pixel corresponding at a distance from mass center.
Wherein, the distance of other corresponding any pixels of pixel is pixel distance.
For each pixel distance, successively each pixel of scanning profile subgraph, each pixel is made respectively
Execute following steps for current pixel point: the upside or downside or left or right side for determining current pixel point are with the presence or absence of other pictures
Vegetarian refreshments, wherein other pixels are equal to current pixel point at a distance from mass center at a distance from mass center;Current pixel point and other pictures
The distance of vegetarian refreshments is current pixel distance;If it is, corresponding at a distance from mass center with current pixel distance and current pixel point
The quantity of pixel add 1, otherwise, scan next pixel.
Wherein, current pixel point is any pixel point of profile subgraph, and current pixel distance is in several pixel distances
Any pixel distance.
In embodiments of the present invention, it needs under each pixel distance, different pixels point corresponding picture at a distance from mass center
The quantity of vegetarian refreshments is counted.For example, pixel distance includes: 1,3,5,7, pixel includes: 1 at a distance from mass center, 2,
3......50, then it is respectively 1,3,5,7 that this method, which needs statistical pixel distance, and pixel is respectively 1-50 at a distance from mass center
When pixel quantity.For example, when statistical pixel distance is 1, pixel is 1-50 at a distance from mass center, corresponding pixel
The quantity of point;When statistical pixel distance is 3, pixel is 1-50 at a distance from mass center, the quantity of corresponding pixel;
It, can be according to pixel in distance matrix during each pixel to profile subgraph is scanned
It puts in order, each pixel is scanned, mistake occur to avoid statistic processes, cause statistical result inaccurate.
And the quantity of pixel distance and pixel and pixel corresponding at a distance from mass center can be expressed as a K row M column
Matrix, wherein the corresponding pixel distance of each row is different, and it is different at a distance from mass center respectively to arrange corresponding pixel.According to the square
Battle array, can be generated apart from autocorrelogram.It, can be by the corresponding distance of each profile subgraph from phase in image recognition processes
The comparison for closing figure, determines the similitude of two images.
As shown in figure 3, the embodiment of the invention provides a kind of image processing methods, comprising:
Step 301: edge detection being carried out to images to be recognized, obtains contour images;
Step 302: dividing contour images, obtain several profile subgraphs;
Step 303;For each profile subgraph: determining the mass center of profile subgraph;
Step 304: calculating each pixel of profile subgraph at a distance from mass center;
Step 305: according to each pixel at a distance from mass center, other corresponding several pixels of each pixel, system
The quantity of meter and pixel distance and pixel and pixel corresponding at a distance from mass center;Wherein, corresponding any of pixel
The distance of other pixels is pixel distance;
Step 306: according to pixel distance, pixel at a distance from mass center, with pixel distance and pixel and mass center away from
Quantity from corresponding pixel, building profile subgraph are corresponding apart from autocorrelogram;
Step 307: by images to be recognized it is corresponding it is several apart from autocorrelogram respectively with the template image that obtains in advance
It is several to be compared apart from autocorrelogram, determine the similarity of images to be recognized and template image.
With pixel distance, pixel at a distance from mass center and pixel distance and pixel and picture corresponding at a distance from mass center
The quantity of vegetarian refreshments is reference axis, establishes coordinate system, obtains apart from autocorrelogram.
As shown in figure 4, being based on the emulation retrieval effectiveness figure apart from autocorrelogram, as shown in figure 5, being based on centroid distance
The emulation retrieval effectiveness figure of histogram.By the comparison of Fig. 4 and Fig. 5 as can be seen that based on the emulation retrieval apart from autocorrelogram
Accuracy is high, and effect is more preferable.That is, " being corresponded to from what is extracted in image at a distance from pixel distance and pixel and mass center
Pixel quantity " due to considering the spatial information of pixel and the information of other adjacent pixels, to image
The accuracy of description improves, and then improves the accuracy of image recognition.
A kind of image characteristics extraction device as shown in Figure 6, comprising:
Detection unit 601 is configured to carry out edge detection to image, obtains contour images;
Division unit 602 is configured to divide contour images, obtains several profile subgraphs;
Statistic unit 603 is configured to for each profile subgraph: determining the mass center of profile subgraph;Calculate profile
Each pixel of image is at a distance from mass center;According to each pixel at a distance from mass center, each pixel it is corresponding several
Other pixels, the quantity of statistics and pixel distance and pixel and pixel corresponding at a distance from mass center;Wherein, pixel with
The distance of its other corresponding any pixel is pixel distance.
In one embodiment of the invention, division unit 602 are configured to determine that the corresponding rectangle of contour images surrounds
Box;According to preset division threshold value and Rectangular Bounding Volume, contour images are divided into several profile subgraphs.
In one embodiment of the invention, division unit 602 are configured to as unit of W/n, and contour images are divided into
N profile subgraph;Wherein, the size of Rectangular Bounding Volume is a × b, and W=max (a, b), n divide threshold value for characterizing.
In one embodiment of the invention, which includes: Standardisation Cell;
Standardisation Cell is configured to determine the corresponding Rectangular Bounding Volume of contour images;Determine the corresponding pixel of contour images
Put the minimum value at a distance from mass center;Maximum value in determining the corresponding pixel of contour images at a distance from mass center;According to
Rectangular Bounding Volume, maximum value and minimum value are standardized each pixel at a distance from mass center;
Statistic unit 603 is configured to according to the standardized each pixel of process at a distance from mass center, each pixel pair
Other several pixels answered, the quantity of statistics and pixel distance and pixel and pixel corresponding at a distance from mass center.
In one embodiment of the invention, statistic unit 603, be configured to determine current pixel point upside or downside or
Left or right side whether there is other pixels, wherein other pixels are equal to current pixel point and mass center at a distance from mass center
Distance;Current pixel point is current pixel distance at a distance from other pixels;If it is, with current pixel distance and work as
Preceding pixel point quantity of corresponding pixel at a distance from mass center adds 1;Wherein, current pixel point is any picture of profile subgraph
Vegetarian refreshments, current pixel distance are any one in preset several pixel distances.
As shown in fig. 7, the embodiment of the invention provides a kind of image processing apparatus, comprising:
Detection unit 701 is configured to carry out edge detection to images to be recognized, obtains contour images;
Division unit 702 is configured to divide contour images, obtains several profile subgraphs;
Statistic unit 703 is configured to for each profile subgraph: determining the mass center of profile subgraph;Calculate profile
Each pixel of image is at a distance from mass center;According to each pixel at a distance from mass center, each pixel it is corresponding several
Other pixels, the quantity of statistics and pixel distance and pixel and pixel corresponding at a distance from mass center;According to pixel distance,
Pixel constructs distance at a distance from mass center and the quantity of pixel distance and pixel and pixel corresponding at a distance from mass center
Autocorrelogram;Wherein, the distance of other corresponding any pixels of pixel is pixel distance;
Determination unit 704, be configured to by images to be recognized it is corresponding it is several apart from autocorrelogram respectively in advance obtain
The several of template image compare apart from autocorrelogram, determine the similarity of images to be recognized and template image.
The embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer-readable instruction, meter
Calculation machine readable instruction can be executed by processor the method to realize any of the above-described embodiment.
The embodiment of the invention provides a kind of image characteristic amount extraction devices, comprising: for storing computer program instructions
Memory and processor for executing program instructions, wherein when the computer program instructions are executed by the processor, triggering
The method that the equipment executes any of the above-described embodiment.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker
Dedicated IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " is patrolled
Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development,
And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed is most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also answer
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
The hardware circuit for realizing the logical method process can be readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
The computer for the computer readable program code (such as software or firmware) that device and storage can be executed by (micro-) processor can
Read medium, logic gate, switch, specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and insertion microcontroller, the example of controller includes but is not limited to following microcontroller
Device: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320 are deposited
Memory controller is also implemented as a part of the control logic of memory.It is also known in the art that in addition to
Pure computer readable program code mode is realized other than controller, can be made completely by the way that method and step is carried out programming in logic
Controller is obtained to come in fact in the form of logic gate, switch, specific integrated circuit, programmable logic controller (PLC) and insertion microcontroller etc.
Existing identical function.Therefore this controller is considered a kind of hardware component, and to including for realizing various in it
The device of function can also be considered as the structure in hardware component.Or even, it can will be regarded for realizing the device of various functions
For either the software module of implementation method can be the structure in hardware component again.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit can be realized in the same or multiple software and or hardware when application.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence " including one ... ", it is not excluded that including described
There is also other identical elements in the process, method of element, commodity or equipment.
The application can describe in the general context of computer-executable instructions executed by a computer, such as program
Module.Generally, program module includes routines performing specific tasks or implementing specific abstract data types, programs, objects, group
Part, data structure etc..The application can also be practiced in a distributed computing environment, in these distributed computing environments, by
Task is executed by the connected remote processing devices of communication network.In a distributed computing environment, program module can be with
In the local and remote computer storage media including storage equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art
For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal
Replacement, improvement etc., should be included within the scope of the claims of this application.