WO2014036813A1 - Method and device for extracting image features - Google Patents

Method and device for extracting image features Download PDF

Info

Publication number
WO2014036813A1
WO2014036813A1 PCT/CN2013/071183 CN2013071183W WO2014036813A1 WO 2014036813 A1 WO2014036813 A1 WO 2014036813A1 CN 2013071183 W CN2013071183 W CN 2013071183W WO 2014036813 A1 WO2014036813 A1 WO 2014036813A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
extraction
pixel
image
extraction region
Prior art date
Application number
PCT/CN2013/071183
Other languages
French (fr)
Chinese (zh)
Inventor
彭健
叶茂
杨素娟
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2014036813A1 publication Critical patent/WO2014036813A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour

Definitions

  • the invention relates to the field of computer vision, and in particular to a method and a device for extracting image features. Background technique
  • target tracking and detection technology has become the core technology in the field of computer vision, and the image feature extraction technology will directly affect the accuracy, adaptability and stability of target tracking and detection. Therefore, image features The extraction technology is of significant importance.
  • image feature extraction is performed by using image brightness information, which is specifically used to perform gray level equalization and Gaussian blur processing on the image to eliminate the influence of illumination on the image, and then randomly select N pairs of points randomly.
  • the two points of each pair of points are diagonal points to form a rectangular area.
  • the horizontal middle line is used to divide it into two equal areas and compare the sum of the pixels in the two areas. The latter is assigned a maximum of 1; Conversely, assign 0 to output the first bit data, then use the vertical center line to divide it into two equal regions and compare the sum of the pixels in the two regions, the latter being assigned a maximum of 1; Assigned to 0, the second bit data is output, and finally the feature vector whose dimension is N is output.
  • the prior art uses the luminance information of the image to calculate the feature vector, but still faces many difficulties in practical applications, such as illumination changes, target occlusion or partial occlusion, target pose change, and nonlinear deformation, etc., resulting in extracted image features. Less accurate.
  • embodiments of the present invention provide a method and apparatus for extracting image features.
  • the technical solution is as follows:
  • a method for extracting image features comprising:
  • the calculation of the corresponding scalar value is performed by other points in the first set of point pairs, and the scalar value of the pair of the preset number is combined to obtain the feature vector of the image to be processed.
  • the obtaining a color component of each pixel in the range of the first extraction area to obtain a color quantization matrix corresponding to the first extraction area specifically includes:
  • the color components corresponding to each pixel are weighted and quantized to obtain a color quantization matrix corresponding to the second extraction region.
  • the color quantization matrix corresponding to the first extraction region is obtained by performing weight quantization on the color component corresponding to each pixel, and specifically includes:
  • h is a hue
  • s is a saturation
  • V is a brightness
  • ⁇ ° ⁇ is a weighting coefficient
  • the acquiring the gradient value of each pixel in the range of the first extraction area to obtain the gradient matrix corresponding to the first extraction area specifically includes:
  • the horizontal matrix and the vertical matrix in the Sobel operator are respectively convoluted with each pixel in the first extraction region to obtain a horizontal and vertical luminance difference approximation;
  • a gradient matrix corresponding to the first extraction region is obtained according to the luminance difference approximation between the horizontal and vertical directions.
  • the horizontal matrix and the vertical matrix in the Sobel operator are respectively associated with the first mention
  • the convolution operation is performed on each pixel in the range of the region to obtain a horizontal and vertical luminance difference approximation, which specifically includes:
  • I is the a pixel in the first extraction area;
  • the gradient matrix corresponding to the first extraction area is obtained according to the brightness difference approximation of the horizontal and vertical directions, and specifically includes:
  • the merging the color quantization matrix corresponding to the first extraction area and the gradient matrix to obtain the first fusion matrix corresponding to the first extraction area specifically includes:
  • the calculating, according to the first fusion matrix and the second fusion matrix, the scalar value corresponding to the first set of point pairs specifically:
  • an apparatus for extracting image features comprising: a processing module, configured to perform grayscale equalization processing on an image to be processed;
  • a selection module configured to select a preset pair of pairs of points in the image processed by the processing module
  • a determining module configured to take a first set of point pairs, and determine a first extraction area and a second extraction area of a preset range respectively by using two of the first set of point pairs
  • a first obtaining module configured to acquire color components of each pixel in the first extraction area, and obtain a color quantization matrix corresponding to the first extraction area
  • a second acquiring module configured to acquire a gradient value of each pixel in the first extraction area, to obtain a gradient matrix corresponding to the first extraction area
  • a merging module configured to combine a color quantization matrix and a gradient matrix corresponding to the first extraction region, to obtain a first fusion matrix corresponding to the first extraction region;
  • a first repetition module configured to acquire, according to the first fusion matrix corresponding to the first extraction area, a second fusion matrix corresponding to the second extraction area;
  • a calculation module configured to calculate, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
  • a second repeating module configured to perform calculation of a corresponding scalar value of the other point pair according to the first set of point pairs
  • a combination module configured to combine the scalar value of the pair of the preset number of points, to obtain the Process the feature vector of the image.
  • the first acquiring module specifically includes:
  • a converting unit configured to convert an image of the first extraction area to a corresponding color space, to obtain a color component corresponding to each pixel in the first extraction area
  • an obtaining unit configured to weight quantize the color component corresponding to each pixel obtained by the converting unit, to obtain a color quantization matrix corresponding to the first extraction region.
  • the h is a hue
  • s is a saturation
  • V is a brightness
  • the ⁇ 3 ⁇ 4 and ⁇ ⁇ ⁇ are weighting coefficients.
  • the second acquiring module specifically includes:
  • An operation unit configured to perform a convolution operation with each of the pixels in the first extraction region by using a horizontal matrix and a vertical matrix in the Sobel operator, to obtain a horizontal and vertical luminance difference approximation; and an acquisition unit, configured to The horizontal and vertical luminance difference approximation obtained by the operation unit obtains a gradient matrix corresponding to the first extraction region.
  • the operation unit is specifically configured to use a horizontal matrix in a Sobel operator - 1 0 +1, f+ ⁇ +2 +1
  • the merging module is specifically configured to perform a product operation on the color quantization matrix corresponding to the first extraction region and the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
  • the calculating module specifically includes:
  • An expansion unit configured to expand the first fusion matrix in a row to form a row vector
  • a sorting unit configured to sort the vector elements in the row vector obtained by expanding the expansion unit by size, to form a new row vector
  • a first comparing unit configured to compare an element value of each vector in the new row vector obtained by the sorting unit with an element value of a vector corresponding to a central pixel of the first extraction region, to obtain a first comparison result ;
  • a re-operation unit configured to process the second fusion matrix according to the first fusion matrix manner, to obtain a second comparison result
  • a second comparing unit configured to obtain a scalar value corresponding to the first set of point pairs by comparing the first comparison result with the second comparison result.
  • the gradient value can describe the target contour of the image, and because the color is often closely related to the object or scene contained in the image, and compared with other features, the color feature has less dependence on the size, direction, and viewing angle of the image itself. It has high robustness. Therefore, by extracting image features with gradient values and color components, features with strong descriptive ability and resistance to illumination can be extracted, which can not only improve the accuracy of extracted image features. And can also be adapted to the extraction of image features in many common target tracking and detection techniques.
  • FIG. 1 is a flowchart of a method for extracting image features according to a first embodiment of the present invention
  • FIG. 2 is a flowchart of a method for extracting image features according to a second embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of an image feature extraction device according to Embodiment 3 of the present invention
  • FIG. 5 is a schematic structural diagram of a first acquisition module according to Embodiment 3 of the present invention.
  • FIG. 6 is a schematic structural diagram of a second acquiring module according to Embodiment 3 of the present invention.
  • FIG. 7 is a schematic structural diagram of a computing module according to Embodiment 3 of the present invention.
  • FIG. 8 is a schematic structural diagram of an apparatus for extracting image features according to Embodiment 4 of the present invention. detailed description
  • This embodiment provides a method for extracting image features.
  • the method of the method provided in this embodiment is as follows:
  • the color component of each pixel in the first extraction area is obtained, and the color quantization matrix corresponding to the first extraction area is obtained, including but not limited to:
  • a color quantization matrix corresponding to the first extraction region is obtained, including but not limited to:
  • h is the hue
  • s is the saturation
  • V is the brightness
  • ⁇ 3 ⁇ 4 is the brightness
  • ⁇ ⁇ is the weighting factor.
  • the gradient values of the pixels in the first extraction area are obtained, and the gradient matrix corresponding to the first extraction area is obtained, including but not limited to:
  • the horizontal matrix and the vertical matrix in the Sobel operator are respectively convoluted with each pixel in the first extraction region to obtain a horizontal and vertical luminance difference approximation;
  • a gradient matrix corresponding to the first extraction region is obtained according to the luminance difference approximation between the horizontal and vertical directions. Further, the horizontal matrix and the vertical matrix in the Sobel operator are respectively convoluted with each pixel in the first extraction region to obtain a lateral and vertical luminance difference approximation, including but not limited to:
  • the color quantization matrix corresponding to the first extraction region is merged with the gradient matrix to obtain the first extraction
  • the first fusion matrix corresponding to the region including but not limited to:
  • the color quantization matrix corresponding to the first extraction region is multiplied by the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
  • Step 105 Obtain a second fusion matrix corresponding to the second extraction area, in a manner of acquiring a first fusion matrix corresponding to the first extraction area.
  • the scalar value corresponding to the first set of point pairs is calculated according to the first fusion matrix and the second fusion matrix, including but not limited to:
  • the vector elements in the row vector are sorted according to the large d, to form a new row vector
  • the gradient value can describe the target contour of the image, and because the color is often closely related to the object or scene contained in the image, and compared with other features, the color feature has the size and direction of the image itself.
  • the dependence of the angle of view is small and has high robustness. Therefore, by extracting the image features with gradient values and color components, features with strong descriptive ability and resistance to illumination can be extracted, which can not only improve extraction.
  • the accuracy of the image features and can also be adapted to the extraction of image features in many common target tracking and detection techniques; in addition, based on the fusion image color and gradient values, by expanding the fusion matrix in rows, The vector elements in the row vector are sorted by size, and the feature vectors are obtained accordingly, so that the targets have similar feature vectors at different angles, and the anti-rotation ability of the feature vectors is increased.
  • Embodiment 2 This embodiment provides a method for extracting image features. Referring to FIG. 2, the method of the method provided in this embodiment is as follows:
  • the image to be processed includes, but is not limited to, an image captured in a video stream formed by the video recording device.
  • Histogram equalization is one of the most common processing methods when performing grayscale equalization processing on an image to be processed. Therefore, this step can process the histogram distribution of the image to be processed into a uniform histogram distribution. From the theory of informatics, the image with the largest entropy (ie, the maximum amount of information) is the equalized image. From an intuitive point of view, the histogram equalization will increase the contrast of the image. Therefore, this step performs gray scale equalization processing on the image to be processed, which can effectively eliminate the interference of the error caused by the strong change of the light on the feature extraction.
  • the specific value of the preset number of groups is not limited in this embodiment.
  • This step only takes 100 sets of point pairs randomly in the processed image range as an example. A total of 200 sets of points are selected, and the points in the pair should be randomly but tend to be evenly distributed on the processed image, and the two points in the pair need to be separated by a certain distance.
  • the first extraction area and the second extraction area of the preset range are respectively determined by the two points in the first set of point pairs, for convenience of explanation, only two of the first set of point pairs are used here. Taking the points as the center and taking the square with the side length of 7 pixels as the extraction area, the first extraction area and the second extraction area are both 7*7 pixel matrices.
  • the preset range of the first extraction area and the second extraction area may be other sizes or other shapes.
  • the specific preset range of the extraction area is not limited, and the specific shape of the extraction area is not limited. .
  • the color components of each pixel in the first extraction area are obtained, and the color quantization matrix corresponding to the first extraction area is obtained, including but not limited to:
  • RGB composed of color components such as R (red), G (green) and B (blue).
  • Color space HSV color space composed of color components such as H (hue), S (saturation), and V (value); HIS color space composed of H (hue), S (saturation) ⁇ I (intensity) color components, etc. Etc. Therefore, the present embodiment does not limit the specific color space to which the image of the first extraction region is converted, but only converts it to the HSV color space as an example. Since the image-to-color space conversion technology in the prior art is very mature, the specific conversion process of the step can be implemented according to the existing conversion technology, which is not described in this embodiment.
  • the step passes the coefficient when acquiring the color quantization matrix corresponding to the first extracted region. Enhance tonal information while weakening brightness and saturation information.
  • the color quantization matrix corresponding to the first extraction region is obtained, including but not limited to:
  • h is the hue
  • s is the saturation
  • V is the brightness
  • ⁇ 3 ⁇ 4 is the brightness
  • ⁇ ⁇ is the weighting factor.
  • the first extraction region determined in the above step 202 is a 7*7 pixel matrix as an example, after performing color component weight quantization on each pixel in the first extraction region, each pixel obtains a corresponding color. For component f, then this step will result in a 7*7 color quantization matrix C 7x7.
  • Step 204 Obtain a gradient value of each pixel in the first extraction area, and obtain a gradient matrix corresponding to the first extraction area.
  • the gradient values of the pixels in the first extraction region are obtained, and the gradient matrix corresponding to the first extraction region is obtained, including but not limited to:
  • the horizontal matrix and the vertical matrix in the Sobel operator are respectively separated from the first extraction region
  • the pixel performs a convolution operation to obtain a horizontal and vertical luminance difference approximation
  • a gradient matrix corresponding to the first extraction region is obtained according to the luminance difference approximation between the horizontal and vertical directions.
  • the horizontal matrix and the vertical matrix in the Sobel operator are respectively convoluted with each pixel in the first extraction region to obtain a horizontal and vertical luminance difference approximation, including but not limited to:
  • the color quantization matrix corresponding to the first extraction region is merged with the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region, including but not limited to:
  • the color quantization matrix corresponding to the first extraction region is multiplied by the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
  • the color quantization matrix corresponding to the first extraction area obtained in the above step 203 is C 7x7
  • the gradient matrix corresponding to the first extraction area obtained in the above step 204 is taken as an example, and the step corresponding to the first extraction area is obtained by the step.
  • the color of each pixel in the second extraction region is obtained in the manner provided in step 203 above.
  • a component obtaining a color quantization matrix corresponding to the second extraction region;
  • the method of the foregoing step 204 is performed to obtain the gradient value of each pixel in the second extraction region, and obtain the gradient matrix corresponding to the second extraction region; and the color quantization matrix and the gradient matrix corresponding to the second extraction region are merged according to the manner provided in step 205 above.
  • a second fusion matrix corresponding to the second extraction region is obtained.
  • the specific implementation of the step includes, but is not limited to, the following steps:
  • Step a expanding the first fusion matrix by rows to form a row vector
  • Step b sorting the vector elements in the row vector according to the size to form a new row vector
  • Step c the elements of the vector corresponding to the element value of each vector in the new row vector and the central pixel of the first extraction region The values are compared to obtain a first comparison result
  • Step d processing the second fusion matrix according to the first fusion matrix manner to obtain a second comparison result;
  • Step e obtaining a scalar value corresponding to the first set of point pairs by comparing the first comparison result with the second comparison result.
  • the first fusion matrix as the matrix ⁇ 7 as an example, an implementation manner of each step of calculating the scalar value corresponding to the first set of point pairs according to the first fusion matrix and the second fusion matrix is illustrated:
  • Step a expanding the first fusion matrix 7 into rows to form a 49-dimensional row vector /;
  • the row of the matrix may be the last vector of the first row of the matrix and the first vector of the second row, and the last vector of the second row.
  • the first vector of the three lines is connected, and so on, the first and the next line of each line are joined to form a 49-dimensional row vector.
  • Step b sorting the vector elements in the row vector/ by size to form a new row vector/;
  • the order may be in descending order Sorting may also be sorted in order from small to large. This embodiment does not limit the specific sorting manner.
  • Step c comparing the element value of each vector in the new row vector / with the element value of the vector corresponding to the central pixel of the first extraction region, to obtain a first comparison result
  • the embodiment does not limit the manner in which the first comparison result is obtained, for example, a vector corresponding to the element value of each vector in the new row vector/the center pixel of the first extraction region.
  • a 48-dimensional vector can be obtained for a new row vector / , and the value in each vector dimension in the 48-dimensional vector is only a value of 0 or 1.
  • Step d processing the second fusion matrix according to the first fusion matrix method to obtain a second comparison result.
  • Step e by comparing the first comparison result and the second comparison result to obtain a scalar value corresponding to the first set of point pairs, since both points in the first set of point pairs can follow the above step a, to step c, Obtaining a 48-dimensional vector, and the value in each vector dimension of the 48-dimensional vector is only a value of 0 or 1, and the first comparison result and the second comparison result corresponding to two points in the first set of point pairs may be obtained. For comparison, the scalar values corresponding to the first set of point pairs are obtained according to the comparison result.
  • the first comparison result corresponding to one of the points is denoted as ⁇ .
  • the second comparison result corresponding to another point is recorded as M. Since the first comparison result and the second comparison result both obtain a 48-dimensional vector, and the value in each vector dimension in the 48-dimensional vector is only a value of 0. Or 1, then ". and both are binary sequences, which can be used to represent unsigned numbers. Therefore, by comparing M. The binary value corresponding to M , the scalar value corresponding to the first set of point pairs is obtained.
  • the comparison result is 1 and it is taken as the corresponding scalar value of the first set of point pairs; otherwise, the comparison result is 0, which is used as the corresponding scalar value of the first set of point pairs.
  • the scalar value corresponding to each set of point pairs can be calculated, and The result of combining the scalar values of the pair of points of the preset number is used as the feature vector of the image to be processed.
  • the scalar value corresponding to the pair of 100 pairs can be obtained, and the scalar values corresponding to the pair of 100 pairs can be combined to obtain 100 00.
  • Feature vector For example, in the above step 201, if 100 pairs of points are selected in the processed image, the scalar value corresponding to the pair of 100 pairs can be obtained, and the scalar values corresponding to the pair of 100 pairs can be combined to obtain 100 00. Feature vector.
  • the above image feature extraction method can be applied to a scene such as target tracking and detection, and the image feature extraction process realized by the above steps is based on the fusion of the image color and the gradient information, and the merged matrix is adopted. Sorting the data in the data, allowing tracking or detection of the target at different angles The degrees have similar feature vectors, which in turn increases the anti-rotation ability of the feature vectors.
  • the image feature extraction method provided by the embodiment is applied to the target tracker as an example. , combined with experimental data for explanation.
  • the video of the marked target circumscribed rectangular area is used as the experimental input data, and the target tracker based on the extraction feature of the image feature provided by the embodiment is separately operated and the target tracking of the image feature based on the prior art is used.
  • the target area to be marked is referred to as a positive sample, and the area around the marked sample area and the area overlapping with the positive sample area are referred to as negative samples. 4. If the area of the target tracker output target area and the target mark overlaps less than, the target tracker is not detected to be the target, otherwise the target tracker is considered to have detected the target.
  • the random forest is used as a classifier, and the precision of the target tracker based on the technical solution provided by the prior art and the technical solution provided by the embodiment is calculated separately (reca is ion) and recall rate (reca Ll) data.
  • recall rate recall rate
  • a continuous 125 frames of video data are selected, and a rectangular area of the position where the tracked object appears in the video is marked.
  • the specific mark can be implemented by using a manual mark, which is not specifically limited in this embodiment.
  • the information of the marked rectangular area of the position can be represented by the horizontal and vertical coordinates of the starting position of the rectangular area of the position and the length and width of the rectangular area of the position.
  • the upper left corner of the position rectangular area can be regarded as the coordinate origin, and the horizontal and vertical coordinates of the starting position of the position rectangular area are the origin coordinates of the upper left corner of the position rectangular area, in pixels, for each pixel position of the position rectangular area.
  • the length and width of the rectangular area of the position can be represented by the distance between two pixels, and the unit is a pixel.
  • the information of the position rectangular area can be expressed as: The coordinates of the starting position are (256, 108), the length is 100 pixels, and the width is 200 pixels.
  • the information of the rectangular area of the position is recorded in the file together with the frame number (not directly drawn in the video), the type of the file about the information of the rectangular area of the recorded position, The storage location and the like are not specifically limited in this embodiment. For a fully occluded target, the location data of the target is not recorded. For partially occluded targets, only record targets The coordinate data of the visible area.
  • the rectangle marking the target area should be as close as possible to the outer contour of the visible area of the tracked target, and the target area data of the above mark is a positive sample.
  • the target to be tracked is the woman's head and the boy's shirt.
  • the frame number of the video segment is represented by 1, 2, ..., 125. Since the first frame of the video segment does not necessarily contain the tracking target, the tracking target may not be numbered from the first frame of the video. Frame start number;
  • i is an arbitrary value from 1 to 125, and the process of extracting the image feature vector of the i-th frame data is included in the processing of the ith frame data, and the manner of extracting the feature here is described in the above steps 201 to 206, where No longer.
  • the target tracker When recording the ith frame, the target tracker outputs a rectangular area of R; reifci , where the positive sample is located; R; a ei .
  • the interval is [W], where 0 means the rectangle "the area and the area ⁇ ⁇ have no overlapping area, and 1 means that the two areas completely overlap.
  • the positive sample of the i-th frame is judged as a positive sample by the classifier, that is, the classifier output target area and the target mark area substantially overlap; the service O ver lap, K predict D ⁇ a , the negative sample of the i-th frame is The classifier is judged as a positive sample, that is, the classifier output target area is far from the target mark area.
  • the positive sample is judged as the total number of positive samples by the tracker
  • the total number of positive samples The positive sample is judged as the total number of positive samples by the tracker
  • the positive sample is judged as the total number of positive samples by the tracker +
  • the negative sample is judged as the total number of positive samples.
  • the experimental results are shown in Figure 3.
  • the first row of four pictures and the third row of four pictures are respectively corresponding to the operation effect of the target tracker based on the image feature extraction scheme provided by the prior art; the second row of four pictures and the fourth row of four pictures are based on The running effect corresponding to the target tracker of the image feature extraction scheme provided by this embodiment.
  • the four pictures on the left show the head of the woman, and the four pictures on the right track the men's shirt.
  • the experimental data is shown in Table 3 below.
  • the target tracker experimental data based on the image feature extraction scheme provided by the present embodiment is as shown in Table 2 below:
  • TP indicates the total number of samples whose positive samples are positive by the target tracker
  • FP indicates the total number of samples whose negative samples are positive by the target tracker
  • P indicates the total number of positive samples marked.
  • the technical solution provided by this embodiment has a higher recall rate and precision than the technical solution provided by the prior art, thereby improving the extraction.
  • the accuracy of the image features is a higher recall rate and precision than the technical solution provided by the prior art, thereby improving the extraction.
  • the gradient value can describe the target contour of the image, and because the color is often closely related to the object or scene contained in the image, and compared with other features, the color feature has the size and direction of the image itself.
  • the dependence of the angle of view is small and has high robustness. Therefore, by extracting the image features with gradient values and color components, features with strong descriptive ability and resistance to illumination can be extracted, which can not only improve extraction.
  • the accuracy of the image features can be adapted to the extraction of image features in many common target tracking and detection techniques.
  • the merged matrix is expanded by row. The vector elements in the row vector are sorted according to the size, and the feature vector is obtained according to the result, so that the target has similar feature vectors at different angles, and the anti-rotation ability of the feature vector is increased.
  • Embodiment 3 The embodiment provides an image feature extraction device, which is used to perform the image feature extraction method provided in the first embodiment or the second embodiment.
  • the image feature extraction device includes:
  • a processing module 401 configured to perform grayscale equalization processing on the image to be processed
  • the selecting module 402 is configured to select a pair of preset pairs of points in the image processed by the processing module 401; the determining module 403 is configured to take the first set of point pairs, and take two points in the first set of point pairs as The center respectively determines a first extraction area and a second extraction area of the preset range;
  • the first obtaining module 404 is configured to obtain color components of each pixel in the first extraction area, and obtain a color quantization matrix corresponding to the first extraction area;
  • the second obtaining module 405 is configured to obtain a gradient value of each pixel in the first extraction area, and obtain a gradient matrix corresponding to the first extraction area.
  • the merging module 406 is configured to combine the color quantization matrix and the gradient matrix corresponding to the first extraction region to obtain a first fusion matrix corresponding to the first extraction region;
  • a first repetition module 407 configured to acquire a second fusion matrix corresponding to the second extraction region, by acquiring a first fusion matrix corresponding to the first extraction region;
  • the calculating module 408 is configured to calculate, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
  • a second repeating module 409 configured to perform calculation of a corresponding scalar value of other point pairs according to the first set of point pairs;
  • the combination module 41 0 is configured to combine the scalar values of the pair of preset groups to obtain the feature vector of the image to be processed.
  • the first obtaining module 404 specifically includes:
  • a converting unit 4041 configured to convert an image of the first extraction area to a corresponding color space, to obtain a color component corresponding to each pixel in the first extraction area;
  • the obtaining unit 4042 is configured to weight quantize the color component corresponding to each pixel obtained by the converting unit 4041 to obtain a color quantization matrix corresponding to the first extraction region.
  • the second obtaining module 405 specifically includes:
  • the operation unit 4051 is configured to perform a convolution operation on each of the pixels in the first extraction region by using the horizontal matrix and the vertical matrix in the Sobel operator to obtain a luminance difference approximation between the horizontal and vertical directions.
  • the obtaining unit 4052 is configured to The horizontal and vertical luminance difference approximation obtained by the operation unit 4051 obtains a gradient matrix corresponding to the first extraction region.
  • the merging module 406 is specifically configured to perform a product operation on the color quantization matrix corresponding to the first extraction region and the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
  • the calculating module 408 specifically includes:
  • An expansion unit 4081 configured to expand the first fusion matrix in rows to form a row vector
  • a sorting unit 4082 wherein the vector elements in the row vector obtained by expanding the expansion unit 4081 are sorted according to the size to form a new row vector;
  • the first comparing unit 4083 is configured to compare the element value of each vector in the new row vector obtained by the sorting unit 4082 with the element value of the vector corresponding to the central pixel of the first extraction region, to obtain a first comparison result;
  • a re-operation unit 4084 configured to process the second fusion matrix according to the first fusion matrix manner to obtain a second comparison result
  • the second comparing unit 4085 is configured to obtain a scalar value corresponding to the first pair of point pairs by comparing the first comparison result with the second comparison result.
  • the device provided in this embodiment can describe the target contour of the image because the gradient value is closely related to the object or scene contained in the image, and the color feature is compared with other features. It has less dependence on the size, direction and angle of view of the image itself, and has higher robustness. Therefore, by extracting image features with gradient values and color components, it can extract strong ability to describe and resist light changes.
  • the feature can not only improve the accuracy of the extracted image features, but also adapt to the extraction of image features in many common target tracking and detection techniques; in addition, based on the fusion image color and gradient values, The fused matrix is expanded by rows, and the vector elements in the row vector are sorted according to the size, and the eigenvectors are obtained according to the eigenvectors, so that the targets have similar eigenvectors at different angles, and the anti-rotation ability of the eigenvectors is increased.
  • FIG. 8 is a block diagram showing the structure of a feature extraction device in an embodiment, the feature extraction device including at least one processor (801), such as a CPU, at least one network interface 804 or other user interface 803, a memory 805, and at least one communication bus 802. .
  • Communication bus 802 is used to implement connection communication between these devices.
  • User interface 803 can be a display, a keyboard or a pointing device.
  • the memory 805 may include a high speed RAM memory and may also include a non-volatile memory, such as at least one disk memory.
  • the memory 805 can optionally include at least one storage device located remotely from the aforementioned CPU 802. In some embodiments, memory 805 stores the following elements, modules or data structures, or a subset thereof, or their extensions:
  • Operating system 806 containing various programs for implementing various basic services and processing hardware-based tasks
  • the application module 807 includes a processing module 401, a selection module 402, a determination module 403, a first acquisition module 404, a second acquisition module 405, a fusion module 406, a first repetition module 407, a calculation module 408, a second repetition module 409, and a combination.
  • Module 410 For the functions of the above modules, refer to the description of the working principle diagram of Figure 4, and details are not described here.
  • the device provided in this embodiment can describe the target contour of the image because the gradient value is closely related to the object or scene contained in the image, and the size and direction of the color feature on the image itself compared with other features.
  • the dependence of the angle of view is small and has high robustness. Therefore, by extracting the image features with gradient values and color components, features with strong descriptive ability and resistance to illumination can be extracted, which can not only improve extraction.
  • the accuracy of the image features and can also be adapted to the extraction of image features in many common target tracking and detection techniques;
  • the vector elements in the row vector are sorted by size according to the scale, and the feature vectors are obtained according to the result, so that the target has similar feature vectors at different angles, and the feature is added.
  • the anti-rotation ability of the vector is sorted by size according to the scale, and the feature vectors are obtained according to the result, so that the target has similar feature vectors at different angles, and the feature is added.
  • the image feature extraction device provided in the foregoing embodiment is only illustrated by the division of the above functional modules when extracting image features. In actual applications, the functions may be assigned to different functional modules according to needs. Completion, dividing the internal structure of the device into different functional modules to perform all or part of the functions described above.
  • the image feature extraction device and the image feature extraction method embodiment provided by the above embodiments are in the same concept, and the specific implementation process is described in detail in the method embodiment, and details are not described herein again.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

The present invention relates to the computer vision field. Disclosed are a method and a device for extracting image features. The method comprises: performing gray scale equalization processing on an image to be processed, and selecting a preset number of point pairs from the image that is processed; determining two extraction areas by using two points in a first point pair as centers; obtaining a color quantization matrix and a gradient matrix corresponding to each extraction area; fusing the color quantization matrix and the gradient matrix corresponding to each extraction area to obtain two fusion matrixes; calculating, according to the two fusion matrixes, a scalar value corresponding to the first point pair; calculating scalar values of other point pairs in the same way; and combining scalar values of the preset number of point pairs to obtain a feature vector of the image to be processed. A gradient value can describe a target outline of an image, and a color relates to an object and a scene contained in the image, featuring low dependency on the image and high robustness. Therefore, the present invention uses a gradient value and a color to extract an image feature, which can improve accuracy of the image feature that is extracted.

Description

图像特征的提取方法及装置  Image feature extraction method and device
本申请要求于 2012 年 09 月 10 日提交中国专利局、 申请号为 201210332125.5、 发明名称为 "图像特征的提取方法及装置" 的中国专利申请 的优先权, 其全部内容通过引用结合在本申请中。  The present application claims priority to Chinese Patent Application No. 201210332125.5, entitled "Image Feature Extraction Method and Apparatus", filed on September 10, 2012, the entire contents of which is incorporated herein by reference. .
技术领域 Technical field
本发明涉及计算机视觉领域, 特别涉及一种图像特征的提取方法及装置。 背景技术  The invention relates to the field of computer vision, and in particular to a method and a device for extracting image features. Background technique
随着计算机视觉技术的快速发展,目标跟踪与检测技术成为了计算机视觉 领域的核心技术,而图像特征的提取技术将直接影响目标跟踪与检测的准确性、 适应性与稳定性, 因此, 图像特征的提取技术具有显著的重要性。  With the rapid development of computer vision technology, target tracking and detection technology has become the core technology in the field of computer vision, and the image feature extraction technology will directly affect the accuracy, adaptability and stability of target tracking and detection. Therefore, image features The extraction technology is of significant importance.
现有技术中, 釆用图像亮度信息进行图像特征的提取, 其具体通过对图像 做灰度均衡化与高斯模糊处理用以消除光照对图像的影响,之后随机不重复地 选取 N个对点, 以每一个点对中的两点为对角点构成矩形区域, 釆用水平中分 线将其平分为两个均等区域并对两个区域内像素之和进行比较, 后者大赋为 1 ; 反之, 赋为 0, 输出第一个比特数据, 再釆用竖直中分线将其平分为两个均等 区域并对两个区域内像素之和进行比较, 后者大赋为 1 ; 反之, 赋为 0, 输出 第二个比特数据, 最后输出维数为 N的特征向量。  In the prior art, image feature extraction is performed by using image brightness information, which is specifically used to perform gray level equalization and Gaussian blur processing on the image to eliminate the influence of illumination on the image, and then randomly select N pairs of points randomly. The two points of each pair of points are diagonal points to form a rectangular area. The horizontal middle line is used to divide it into two equal areas and compare the sum of the pixels in the two areas. The latter is assigned a maximum of 1; Conversely, assign 0 to output the first bit data, then use the vertical center line to divide it into two equal regions and compare the sum of the pixels in the two regions, the latter being assigned a maximum of 1; Assigned to 0, the second bit data is output, and finally the feature vector whose dimension is N is output.
现有技术釆用图像的亮度信息计算特征向量,而实际应用中仍然面临许多 困难, 如光照变化、 目标被遮挡或者部分遮挡、 目标姿态的改变以及非线性形 变等, 导致提取出的图像特征的准确性较低。  The prior art uses the luminance information of the image to calculate the feature vector, but still faces many difficulties in practical applications, such as illumination changes, target occlusion or partial occlusion, target pose change, and nonlinear deformation, etc., resulting in extracted image features. Less accurate.
发明内容 Summary of the invention
有鉴于此, 本发明实施例提供了一种图像特征的提取方法及装置。 所述技 术方案如下:  In view of this, embodiments of the present invention provide a method and apparatus for extracting image features. The technical solution is as follows:
一方面, 提供了一种图像特征的提取方法, 所述方法包括:  In one aspect, a method for extracting image features is provided, the method comprising:
对待处理图像进行灰度均衡化处理,并在处理后的图像中选取预设组数的 点对;  Performing grayscale equalization processing on the image to be processed, and selecting a pair of preset pairs of points in the processed image;
取第一组点对,并以所述第一组点对中的两个点为中心分别确定预设范围 的第一提取区域和第二提取区域;  Taking a first set of point pairs, and determining a first extraction area and a second extraction area of the preset range respectively by using two of the first set of point pairs;
获取所述第一提取区域范围内各像素的颜色分量,得到所述第一提取区域 对应的颜色量化矩阵, 并获取所述第一提取区域范围内各像素的梯度值,得到 所述第一提取区域对应的梯度矩阵; Obtaining a color component of each pixel in the first extraction area to obtain the first extraction area a corresponding color quantization matrix, and acquiring a gradient value of each pixel in the first extraction region to obtain a gradient matrix corresponding to the first extraction region;
融合所述第一提取区域对应的颜色量化矩阵与梯度矩阵,得到所述第一提 取区域对应的第一融合矩阵;  And merging the color quantization matrix corresponding to the first extraction area and the gradient matrix to obtain a first fusion matrix corresponding to the first extraction area;
按获取所述第一提取区域对应的第一融合矩阵的方式获取所述第二提取 区域对应的第二融合矩阵;  Obtaining, by acquiring the first fusion matrix corresponding to the first extraction area, a second fusion matrix corresponding to the second extraction area;
根据所述第一融合矩阵和第二融合矩阵计算得到所述第一组点对对应的 标量值;  Calculating, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
按第一组点对方式完成其他点对对应的标量值的计算,组合所述预设组数 的点对的标量值, 得到所述待处理图像的特征向量。  The calculation of the corresponding scalar value is performed by other points in the first set of point pairs, and the scalar value of the pair of the preset number is combined to obtain the feature vector of the image to be processed.
可选地, 所述获取所述第一提取区域范围内各像素的颜色分量,得到所述 第一提取区域对应的颜色量化矩阵, 具体包括:  Optionally, the obtaining a color component of each pixel in the range of the first extraction area to obtain a color quantization matrix corresponding to the first extraction area, specifically includes:
将所述第一提取区域的图像转换到对应的颜色空间,得到所述第一提取区 域范围内每个像素对应的颜色分量;  Converting an image of the first extraction area to a corresponding color space to obtain a color component corresponding to each pixel in the first extraction area;
将每个像素对应的颜色分量加权量化后,得到所述第二提取区域对应的颜 色量化矩阵。  The color components corresponding to each pixel are weighted and quantized to obtain a color quantization matrix corresponding to the second extraction region.
可选地, 所述将每个像素对应的颜色分量加权量化后,得到所述第一提取 区域对应的颜色量化矩阵, 具体包括:  Optionally, the color quantization matrix corresponding to the first extraction region is obtained by performing weight quantization on the color component corresponding to each pixel, and specifically includes:
通过公式 / = σ¾/7 + σ^ + σνν将每个像素对应的颜色分量加权量化,得到所述 第一提取区域对应的颜色量化矩阵; Weighting the color component corresponding to each pixel by the formula / = σ 3⁄4 /7 + σ^ + σ ν ν to obtain a color quantization matrix corresponding to the first extraction region;
其中, 所述 h为色调, s为饱和度, V为亮度, 所述 、 σ °^为加权系 数。 Wherein h is a hue, s is a saturation, and V is a brightness, and σ °^ is a weighting coefficient.
可选地, 所述获取所述第一提取区域范围内各像素的梯度值,得到所述第 一提取区域对应的梯度矩阵, 具体包括:  Optionally, the acquiring the gradient value of each pixel in the range of the first extraction area to obtain the gradient matrix corresponding to the first extraction area, specifically includes:
釆用索贝尔算子中的横向矩阵及纵向矩阵分别与所述第一提取区域范围 内各像素进行卷积运算, 得到横向与纵向的亮度差分近似值;  The horizontal matrix and the vertical matrix in the Sobel operator are respectively convoluted with each pixel in the first extraction region to obtain a horizontal and vertical luminance difference approximation;
根据所述横向与纵向的亮度差分近似值得到所述第一提取区域对应的梯 度矩阵。  A gradient matrix corresponding to the first extraction region is obtained according to the luminance difference approximation between the horizontal and vertical directions.
可选地,所述釆用索贝尔算子中的横向矩阵及纵向矩阵分别与所述第一提 取区域范围内各像素进行卷积运算,得到横向与纵向的亮度差分近似值, 具体 包括: Optionally, the horizontal matrix and the vertical matrix in the Sobel operator are respectively associated with the first mention The convolution operation is performed on each pixel in the range of the region to obtain a horizontal and vertical luminance difference approximation, which specifically includes:
-1 0  -1 0
釆用 索 贝 尔算子中 的横向矩阵 = 与纵向矩阵
Figure imgf000005_0001
Using the transverse matrix in the Sobel operator = with the longitudinal matrix
Figure imgf000005_0001
f+\ +2 +1、  f+\ +2 +1
Sy = 0 0 0 分别与所述第一提取区域范围内各像素进行卷积运算,得到横 -1 -2 -1 向亮度差分近似值 = 与纵向亮度差分近似值 1; 其中, 所述 I为 所述第一提取区域范围内的像素; 所述根据所述横向与纵向的亮度差分近似值得到所述第一提取区域对应 的梯度矩阵, 具体包括: Sy = 0 0 0 is respectively convoluted with each pixel in the range of the first extraction region to obtain a horizontal -1 -1 -1 luminance difference approximation = a longitudinal luminance difference approximation 1 ; wherein the I is the a pixel in the first extraction area; the gradient matrix corresponding to the first extraction area is obtained according to the brightness difference approximation of the horizontal and vertical directions, and specifically includes:
通过公式 = i + Gy 2得到所述第一提取区域对应的梯度矩阵 Gi¾y。 可选地, 所述融合所述第一提取区域对应的颜色量化矩阵与梯度矩阵,得 到所述第一提取区域对应的第一融合矩阵, 具体包括: The gradient matrix G i3⁄4y corresponding to the first extraction region is obtained by the formula = i + G y 2 . Optionally, the merging the color quantization matrix corresponding to the first extraction area and the gradient matrix to obtain the first fusion matrix corresponding to the first extraction area, specifically includes:
将所述第一提取区域对应的颜色量化矩阵与梯度矩阵进行乘积运算,得到 所述第一提取区域对应的第一融合矩阵。  And performing a product operation on the color quantization matrix corresponding to the first extraction region and the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
可选地,所述根据所述第一融合矩阵和第二融合矩阵计算得到所述第一组 点对对应的标量值, 具体包括:  Optionally, the calculating, according to the first fusion matrix and the second fusion matrix, the scalar value corresponding to the first set of point pairs, specifically:
将所述第一融合矩阵按行展开, 形成行向量;  Expanding the first fusion matrix in rows to form a row vector;
将所述行向量中的向量元素按照大小进行排序, 形成新的行向量; 将所述新的行向量中的每个向量的元素值与所述提取区域的中心像素对 应的向量的元素值进行比较, 得到第一比较结果;  Sorting vector elements in the row vector by size to form a new row vector; performing element values of each vector in the new row vector and element values of vectors corresponding to central pixels of the extracted region Comparing, obtaining a first comparison result;
按照所述第一融合矩阵方式处理所述第二融合矩阵, 得到第二比较结果; 通过比较第一比较结果和第二比较结果得到所述第一组点对对应的标量 值。  Processing the second fusion matrix according to the first fusion matrix manner to obtain a second comparison result; obtaining a scalar value corresponding to the first set of point pairs by comparing the first comparison result with the second comparison result.
另一方面, 还提供了一种图像特征的提取装置, 所述装置包括: 处理模块, 用于对待处理图像进行灰度均衡化处理;  In another aspect, an apparatus for extracting image features is provided, the apparatus comprising: a processing module, configured to perform grayscale equalization processing on an image to be processed;
选取模块, 用于在所述处理模块处理后的图像中选取预设组数的点对; 确定模块, 用于取第一组点对, 并以所述第一组点对中的两个点为中心分 别确定预设范围的第一提取区域和第二提取区域; a selection module, configured to select a preset pair of pairs of points in the image processed by the processing module; a determining module, configured to take a first set of point pairs, and determine a first extraction area and a second extraction area of a preset range respectively by using two of the first set of point pairs;
第一获取模块, 用于获取所述第一提取区域范围内各像素的颜色分量,得 到所述第一提取区域对应的颜色量化矩阵;  a first obtaining module, configured to acquire color components of each pixel in the first extraction area, and obtain a color quantization matrix corresponding to the first extraction area;
第二获取模块, 用于获取所述第一提取区域范围内各像素的梯度值,得到 所述第一提取区域对应的梯度矩阵;  a second acquiring module, configured to acquire a gradient value of each pixel in the first extraction area, to obtain a gradient matrix corresponding to the first extraction area;
融合模块, 用于融合所述第一提取区域对应的颜色量化矩阵与梯度矩阵, 得到所述第一提取区域对应的第一融合矩阵;  a merging module, configured to combine a color quantization matrix and a gradient matrix corresponding to the first extraction region, to obtain a first fusion matrix corresponding to the first extraction region;
第一重复模块,用于按获取所述第一提取区域对应的第一融合矩阵的方式 获取所述第二提取区域对应的第二融合矩阵;  a first repetition module, configured to acquire, according to the first fusion matrix corresponding to the first extraction area, a second fusion matrix corresponding to the second extraction area;
计算模块,用于根据所述第一融合矩阵和第二融合矩阵计算得到对应第一 组点对的标量值;  a calculation module, configured to calculate, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
第二重复模块,用于按第一组点对方式完成其他点对对应的标量值的计算; 组合模块, 用于组合所述预设组数的点对的标量值,得到所述待处理图像 的特征向量。  a second repeating module, configured to perform calculation of a corresponding scalar value of the other point pair according to the first set of point pairs; a combination module, configured to combine the scalar value of the pair of the preset number of points, to obtain the Process the feature vector of the image.
可选地, 所述第一获取模块, 具体包括:  Optionally, the first acquiring module specifically includes:
转换单元, 用于将所述第一提取区域的图像转换到对应的颜色空间,得到 所述第一提取区域范围内每个像素对应的颜色分量;  a converting unit, configured to convert an image of the first extraction area to a corresponding color space, to obtain a color component corresponding to each pixel in the first extraction area;
获取单元,用于将所述转换单元得到的每个像素对应的颜色分量加权量化 后, 得到所述第一提取区域对应的颜色量化矩阵。  And an obtaining unit, configured to weight quantize the color component corresponding to each pixel obtained by the converting unit, to obtain a color quantization matrix corresponding to the first extraction region.
可选地, 所述获取单元,具体用于通过公式/ = 0^ + 0^ + 0^将每个像素对 应的颜色分量加权量化, 得到所述第一提取区域对应的颜色量化矩阵; 其中, 所述 h为色调, s为饱和度, V为亮度, 所述 σ¾、 σ σν为加权系数。 Optionally, the acquiring unit is specifically configured to weight-quantize the color components corresponding to each pixel by using the formula /= 0^ + 0^ + 0^ to obtain a color quantization matrix corresponding to the first extraction region; The h is a hue, s is a saturation, V is a brightness, and the σ 3⁄4 and σ σ ν are weighting coefficients.
可选地, 所述第二获取模块, 具体包括:  Optionally, the second acquiring module specifically includes:
运算单元,用于釆用索贝尔算子中的横向矩阵及纵向矩阵分别与所述第一 提取区域范围内各像素进行卷积运算, 得到横向与纵向的亮度差分近似值; 获取单元,用于根据所述运算单元得到的横向与纵向的亮度差分近似值得 到所述第一提取区域对应的梯度矩阵。  An operation unit, configured to perform a convolution operation with each of the pixels in the first extraction region by using a horizontal matrix and a vertical matrix in the Sobel operator, to obtain a horizontal and vertical luminance difference approximation; and an acquisition unit, configured to The horizontal and vertical luminance difference approximation obtained by the operation unit obtains a gradient matrix corresponding to the first extraction region.
可选地, 所述运算单元, 具体用于釆用索贝尔算子中的横向矩阵 - 1 0 +1、 f+\ +2 +1 Optionally, the operation unit is specifically configured to use a horizontal matrix in a Sobel operator - 1 0 +1, f+\ +2 +1
-2 0 +2 与纵向矩阵 0 0 0 分别与所述第一提取区域范围内 -1 0 +1 -1 -2 -1 各像素进行卷积运算,得到横向亮度差分近似值 ^ = 1与纵向亮度差分近似 值 Gy = g / ; 其中, 所述 I为所述第一提取区域范围内的像素; 所述获取单元,具体用于通过公式 = ^^得到所述第一提取区域对 应的梯度矩阵 Gi¾y-2 0 +2 and the vertical matrix 0 0 0 are respectively convoluted with each pixel of the range -1 0 +1 -1 -2 -1 in the first extraction region to obtain a lateral luminance difference approximation ^ = 1 and longitudinal luminance a difference approximation G y = g / ; wherein the I is a pixel in the range of the first extraction region; the acquiring unit is specifically configured to obtain a gradient matrix G corresponding to the first extraction region by using a formula = ^^ I3⁄4y .
可选地, 所述融合模块, 具体用于将所述第一提取区域对应的颜色量化矩 阵与梯度矩阵进行乘积运算, 得到所述第一提取区域对应的第一融合矩阵。  Optionally, the merging module is specifically configured to perform a product operation on the color quantization matrix corresponding to the first extraction region and the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
可选地, 所述计算模块, 具体包括:  Optionally, the calculating module specifically includes:
展开单元, 用于将所述第一融合矩阵按行展开, 形成行向量;  An expansion unit, configured to expand the first fusion matrix in a row to form a row vector;
排序单元,用于将所述展开单元展开得到的行向量中的向量元素按照大小 进行排序, 形成新的行向量;  a sorting unit, configured to sort the vector elements in the row vector obtained by expanding the expansion unit by size, to form a new row vector;
第一比较单元,用于将所述排序单元得到的新的行向量中的每个向量的元 素值与所述第一提取区域的中心像素对应的向量的元素值进行比较,得到第一 比较结果;  a first comparing unit, configured to compare an element value of each vector in the new row vector obtained by the sorting unit with an element value of a vector corresponding to a central pixel of the first extraction region, to obtain a first comparison result ;
重操作单元, 用于按照所述第一融合矩阵方式处理所述第二融合矩阵,得 到第二比较结果;  a re-operation unit, configured to process the second fusion matrix according to the first fusion matrix manner, to obtain a second comparison result;
第二比较单元,用于通过比较第一比较结果和第二比较结果得到所述第一 组点对对应的标量值。  And a second comparing unit, configured to obtain a scalar value corresponding to the first set of point pairs by comparing the first comparison result with the second comparison result.
本发明实施例提供的技术方案的有益效果是:  The beneficial effects of the technical solutions provided by the embodiments of the present invention are:
由于梯度值能够描述图像的目标轮廓,又由于颜色往往和图像中所包含的 物体或场景十分相关, 且与其他的特征相比, 颜色特征对图像本身的尺寸、 方 向、 视角的依赖性较小, 具有较高的鲁棒性, 因而通过釆用梯度值及颜色分量 进行图像特征的提取, 可提取出具有描述能力强、 抗光照变化能力的特征, 不 仅能够提高提取出的图像特征的准确性,且还可适应于众多常见的目标跟踪与 检测技术中的图像特征的提取。  Since the gradient value can describe the target contour of the image, and because the color is often closely related to the object or scene contained in the image, and compared with other features, the color feature has less dependence on the size, direction, and viewing angle of the image itself. It has high robustness. Therefore, by extracting image features with gradient values and color components, features with strong descriptive ability and resistance to illumination can be extracted, which can not only improve the accuracy of extracted image features. And can also be adapted to the extraction of image features in many common target tracking and detection techniques.
附图说明 为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所 需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明 的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。 DRAWINGS In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Other drawings may also be obtained from those of ordinary skill in the art in view of the drawings.
图 1是本发明实施例一提供的一种图像特征的提取方法的流程图; 图 2是本发明实施例二提供的一种图像特征的提取方法的流程图; 图 3是本发明实施例二提供的一种实验运行效果示意图;  1 is a flowchart of a method for extracting image features according to a first embodiment of the present invention; FIG. 2 is a flowchart of a method for extracting image features according to a second embodiment of the present invention; A schematic diagram of an experimental operation effect provided;
图 4是本发明实施例三提供的一种图像特征的提取装置的结构示意图; 图 5是本发明实施例三提供的一种第一获取模块的结构示意图;  4 is a schematic structural diagram of an image feature extraction device according to Embodiment 3 of the present invention; FIG. 5 is a schematic structural diagram of a first acquisition module according to Embodiment 3 of the present invention;
图 6是本发明实施例三提供的一种第二获取模块的结构示意图;  6 is a schematic structural diagram of a second acquiring module according to Embodiment 3 of the present invention;
图 7是本发明实施例三提供的一种计算模块的结构示意图;  7 is a schematic structural diagram of a computing module according to Embodiment 3 of the present invention;
图 8是本发明实施例四提供的一种图像特征的提取装置的结构示意图。 具体实施方式  FIG. 8 is a schematic structural diagram of an apparatus for extracting image features according to Embodiment 4 of the present invention. detailed description
为使本发明的目的、技术方案和优点更加清楚, 下面将结合附图对本发明 实施方式作进一步地详细描述。  The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
实施例一  Embodiment 1
本实施例提供了一种图像特征的提取方法, 参见图 1 , 本实施例提供的方 法流程具体如下:  This embodiment provides a method for extracting image features. Referring to FIG. 1, the method of the method provided in this embodiment is as follows:
101: 对待处理图像进行灰度均衡化处理, 并在处理后的图像中选取预设 组数的点对;  101: Perform gray level equalization processing on the image to be processed, and select a pair of preset pairs of points in the processed image;
102: 取第一组点对, 并以第一组点对中的两个点为中心分别确定预设范 围的第一提取区域和第二提取区域;  102: taking a first set of point pairs, and determining a first extraction area and a second extraction area of the preset range respectively by using two points of the first set of point pairs;
103: 获取第一提取区域范围内各像素的颜色分量, 得到第一提取区域对 应的颜色量化矩阵, 并获取第一提取区域范围内各像素的梯度值,得到第一提 取区域对应的梯度矩阵;  103: Obtain a color component of each pixel in the first extraction area, obtain a color quantization matrix corresponding to the first extraction area, and obtain a gradient value of each pixel in the first extraction area to obtain a gradient matrix corresponding to the first extraction area;
其中, 获取第一提取区域范围内各像素的颜色分量,得到第一提取区域对 应的颜色量化矩阵, 包括但不限于:  The color component of each pixel in the first extraction area is obtained, and the color quantization matrix corresponding to the first extraction area is obtained, including but not limited to:
将第一提取区域的图像转换到对应的颜色空间,得到第一提取区域范围内 每个像素对应的颜色分量; 将每个像素对应的颜色分量加权量化后,得到第一提取区域对应的颜色量 化矩阵。 Converting an image of the first extraction area to a corresponding color space to obtain a color component corresponding to each pixel in the first extraction area; After the color components corresponding to each pixel are weighted and quantized, a color quantization matrix corresponding to the first extraction region is obtained.
进一步地, 将每个像素对应的颜色分量加权量化后,得到第一提取区域对 应的颜色量化矩阵, 包括但不限于:  Further, after the color components corresponding to each pixel are weighted and quantized, a color quantization matrix corresponding to the first extraction region is obtained, including but not limited to:
通过公式 f = ohh + ass + σνν将每个像素对应的颜色分量加权量化,得到第一 提取区域对应的颜色量化矩阵; The color components corresponding to each pixel are weighted and quantized by the formula f = o h h + a s s + σ ν ν to obtain a color quantization matrix corresponding to the first extraction region;
其中, h为色调, s为饱和度, V为亮度, σ¾、 as . σν为加权系数。 Where h is the hue, s is the saturation, V is the brightness, σ 3⁄4 , a s . σ ν is the weighting factor.
进一步地, 获取第一提取区域范围内各像素的梯度值,得到第一提取区域 对应的梯度矩阵, 包括但不限于:  Further, the gradient values of the pixels in the first extraction area are obtained, and the gradient matrix corresponding to the first extraction area is obtained, including but not limited to:
釆用索贝尔算子中的横向矩阵及纵向矩阵分别与第一提取区域范围内各 像素进行卷积运算, 得到横向与纵向的亮度差分近似值;  The horizontal matrix and the vertical matrix in the Sobel operator are respectively convoluted with each pixel in the first extraction region to obtain a horizontal and vertical luminance difference approximation;
根据横向与纵向的亮度差分近似值得到第一提取区域对应的梯度矩阵。 进一步地,釆用索贝尔算子中的横向矩阵及纵向矩阵分别与第一提取区域 范围内各像素进行卷积运算,得到横向与纵向的亮度差分近似值, 包括但不限 于:  A gradient matrix corresponding to the first extraction region is obtained according to the luminance difference approximation between the horizontal and vertical directions. Further, the horizontal matrix and the vertical matrix in the Sobel operator are respectively convoluted with each pixel in the first extraction region to obtain a lateral and vertical luminance difference approximation, including but not limited to:
-1 0  -1 0
釆用 索 贝 尔算子中 的横向矩阵 = 与纵向矩阵
Figure imgf000009_0001
Using the transverse matrix in the Sobel operator = with the longitudinal matrix
Figure imgf000009_0001
f+\ +2 +1、  f+\ +2 +1
Sy = 0 0 0 分别与第一提取区域范围内各像素进行卷积运算,得到横向亮 -1 -2 -1 度差分近似值 = * 与纵向亮度差分近似值 = ^ * ; 其中, I为第一提取 区域范围内的像素; 根据横向与纵向的亮度差分近似值得到第一提取区域对应的梯度矩阵 ,具 体包括: Sy = 0 0 0 is convoluted with each pixel in the first extraction region to obtain a lateral bright -1 -2 -1 degree difference approximation = * and a longitudinal luminance difference approximation = ^ * ; where I is the first extraction The pixels in the region range; the gradient matrix corresponding to the first extraction region is obtained according to the brightness difference approximation between the horizontal and vertical directions, and specifically includes:
通过公式 = i + Gy 2得到第一提取区域对应的梯度矩阵 Gi¾yThe gradient matrix G i3⁄4y corresponding to the first extraction region is obtained by the formula = i + G y 2 .
104: 融合第一提取区域对应的颜色量化矩阵与梯度矩阵, 得到第一提取 区域对应的第一融合矩阵;  104: merging a color quantization matrix corresponding to the first extraction region and a gradient matrix to obtain a first fusion matrix corresponding to the first extraction region;
其中, 融合第一提取区域对应的颜色量化矩阵与梯度矩阵,得到第一提取 区域对应的第一融合矩阵, 包括但不限于: Wherein, the color quantization matrix corresponding to the first extraction region is merged with the gradient matrix to obtain the first extraction The first fusion matrix corresponding to the region, including but not limited to:
将第一提取区域对应的颜色量化矩阵与梯度矩阵进行乘积运算,得到第一 提取区域对应的第一融合矩阵。  The color quantization matrix corresponding to the first extraction region is multiplied by the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
105: 按获取第一提取区域对应的第一融合矩阵的方式获取第二提取区域 对应的第二融合矩阵;  Step 105: Obtain a second fusion matrix corresponding to the second extraction area, in a manner of acquiring a first fusion matrix corresponding to the first extraction area.
106: 根据第一融合矩阵和第二融合矩阵计算得到第一组点对对应的标量 值;  106: Calculate, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
具体地,根据第一融合矩阵和第二融合矩阵计算得到第一组点对对应的标 量值, 包括但不限于:  Specifically, the scalar value corresponding to the first set of point pairs is calculated according to the first fusion matrix and the second fusion matrix, including but not limited to:
将第一融合矩阵按行展开, 形成行向量;  Spreading the first fusion matrix in rows to form a row vector;
将行向量中的向量元素按照大 d、进行排序, 形成新的行向量;  The vector elements in the row vector are sorted according to the large d, to form a new row vector;
将新的行向量中的每个向量的元素值与第一提取区域的中心像素对应的 向量的元素值进行比较, 得到第一比较结果;  Comparing the element value of each vector in the new row vector with the element value of the vector corresponding to the central pixel of the first extraction region to obtain a first comparison result;
按照第一融合矩阵方式处理第二融合矩阵, 得到第二比较结果; 通过比较第一比较结果和第二比较结果得到第一组点对对应的标量值。 Processing the second fusion matrix according to the first fusion matrix manner to obtain a second comparison result; obtaining a scalar value corresponding to the first set of point pairs by comparing the first comparison result with the second comparison result.
107: 按第一组点对方式完成其他点对对应的标量值的计算, 组合预设组 数的点对的标量值, 得到待处理图像的特征向量。 107: Calculate the corresponding scalar value of other points according to the first set of point pairs, and combine the scalar values of the pair of preset groups to obtain the feature vector of the image to be processed.
本实施例提供的方法, 由于梯度值能够描述图像的目标轮廓, 又由于颜色 往往和图像中所包含的物体或场景十分相关,且与其他的特征相比,颜色特征 对图像本身的尺寸、 方向、 视角的依赖性较小, 具有较高的鲁棒性, 因而通过 釆用梯度值及颜色分量进行图像特征的提取, 可提取出具有描述能力强、抗光 照变化能力的特征, 不仅能够提高提取出的图像特征的准确性, 且还可适应于 众多常见的目标跟踪与检测技术中的图像特征的提取; 另外,在融合图像颜色 与梯度值的基础上,通过将融合矩阵按行展开,将行向量中的向量元素按照大 小进行排序, 并据此得到特征向量,从而使得目标在不同角度具有相近的特征 向量, 增加特征向量的抗旋转能力。  The method provided in this embodiment, because the gradient value can describe the target contour of the image, and because the color is often closely related to the object or scene contained in the image, and compared with other features, the color feature has the size and direction of the image itself. The dependence of the angle of view is small and has high robustness. Therefore, by extracting the image features with gradient values and color components, features with strong descriptive ability and resistance to illumination can be extracted, which can not only improve extraction. The accuracy of the image features, and can also be adapted to the extraction of image features in many common target tracking and detection techniques; in addition, based on the fusion image color and gradient values, by expanding the fusion matrix in rows, The vector elements in the row vector are sorted by size, and the feature vectors are obtained accordingly, so that the targets have similar feature vectors at different angles, and the anti-rotation ability of the feature vectors is increased.
为了更加清楚地阐述上述实施例提供的方法, 结合上述内容, 以如下实施 例二为例, 对图像特征的提取方法进行举例说明, 详见如下实施例二:  In order to clarify the method provided by the foregoing embodiment, the method for extracting image features is illustrated by taking the following example 2 as an example. For details, refer to the following embodiment 2:
实施例二 本实施例提供了一种图像特征的提取方法, 结合上述实施例一的内容, 参 见图 2 , 本实施例提供的方法流程具体如下: Embodiment 2 This embodiment provides a method for extracting image features. Referring to FIG. 2, the method of the method provided in this embodiment is as follows:
201: 对待处理图像进行灰度均衡化处理, 并在处理后的图像中选取预设 组数的点对;  201: Perform gray level equalization processing on the image to be processed, and select a pair of preset pairs of points in the processed image;
其中,该待处理图像包括但不限于通过视频记录设备形成的视频流中截取 的图像。在对待处理图像进行灰度均衡化处理时, 直方图均衡化是一种最常用 的处理方式,因而该步骤可将该待处理图像的直方图分布处理成均勾直方图分 布。 从信息学的理论来看, 具有最大熵(即最大信息量)的图像为均衡化图像, 从直观地角度来看, 直方图均衡化将使图像的对比度增加。 因此, 该步骤通过 对待处理图像进行灰度均衡化处理,可有效消除光线强烈变化产生的误差对特 征提取的干扰。  The image to be processed includes, but is not limited to, an image captured in a video stream formed by the video recording device. Histogram equalization is one of the most common processing methods when performing grayscale equalization processing on an image to be processed. Therefore, this step can process the histogram distribution of the image to be processed into a uniform histogram distribution. From the theory of informatics, the image with the largest entropy (ie, the maximum amount of information) is the equalized image. From an intuitive point of view, the histogram equalization will increase the contrast of the image. Therefore, this step performs gray scale equalization processing on the image to be processed, which can effectively eliminate the interference of the error caused by the strong change of the light on the feature extraction.
在处理后的图像中选取预设组数的点对时,本实施例不对预设组数的具体 数值进行限定, 该步骤仅以在处理后的图像范围内随机选取 100组点对为例, 则共选取 200组点, 点对中的点应随机但趋于均匀地分布在处理后的图像上, 点对中的两个点需保持有一定距离间隔。  When a pair of preset pairs of points is selected in the processed image, the specific value of the preset number of groups is not limited in this embodiment. This step only takes 100 sets of point pairs randomly in the processed image range as an example. A total of 200 sets of points are selected, and the points in the pair should be randomly but tend to be evenly distributed on the processed image, and the two points in the pair need to be separated by a certain distance.
202: 取第一组点对, 并以第一组点对中的两个点为中心分别确定预设范 围的第一提取区域和第二提取区域;  202: Take a first set of point pairs, and determine a first extraction area and a second extraction area of the preset range respectively by using two points of the first set of point pairs;
针对该步骤,以第一组点对中的两个点为中心分别确定预设范围的第一提 取区域和第二提取区域时, 为了便于说明, 此处仅以第一组点对中的两个点为 中心, 分别取边长为 7像素的正方形作为提取区域为例, 则第一提取区域和第 二提取区域均为 7*7像素矩阵。 当然, 第一提取区域和第二提取区域的预设范 围还可以为其他大小,也可以为其他形状, 本实施例不对提取区域的具体预设 范围进行限定, 同样不对提取区域的具体形状进行限定。  For this step, when the first extraction area and the second extraction area of the preset range are respectively determined by the two points in the first set of point pairs, for convenience of explanation, only two of the first set of point pairs are used here. Taking the points as the center and taking the square with the side length of 7 pixels as the extraction area, the first extraction area and the second extraction area are both 7*7 pixel matrices. Certainly, the preset range of the first extraction area and the second extraction area may be other sizes or other shapes. In this embodiment, the specific preset range of the extraction area is not limited, and the specific shape of the extraction area is not limited. .
203: 获取第一提取区域范围内各像素的颜色分量, 得到第一提取区域对 应的颜色量化矩阵;  203: Obtain color components of each pixel in the first extraction area, and obtain a color quantization matrix corresponding to the first extraction area.
具体地, 获取第一提取区域范围内各像素的颜色分量,得到第一提取区域 对应的颜色量化矩阵, 包括但不限于:  Specifically, the color components of each pixel in the first extraction area are obtained, and the color quantization matrix corresponding to the first extraction area is obtained, including but not limited to:
将第一提取区域的图像转换到对应的颜色空间,得到第一提取区域范围内 每个像素对应的颜色分量; 将每个像素对应的颜色分量加权量化后,得到第一提取区域对应的颜色量 化矩阵。 Converting an image of the first extraction area to a corresponding color space to obtain a color component corresponding to each pixel in the first extraction area; After the color components corresponding to each pixel are weighted and quantized, a color quantization matrix corresponding to the first extraction region is obtained.
其中,将第一提取区域的图像转换到对应的颜色空间时, 由于实际应用中 存在多种颜色空间, 例如, 由 R (red), G (green)和 B (blue)等颜色分量 组成的 RGB颜色空间; 由 H (hue )、 S ( saturation)和 V (value)等颜色分 量组成的 HSV颜色空间; 由 H (hue)、 S ( saturation) ^ I ( intensity) 颜色分量组成的 HIS颜色空间等等, 因此, 本实施例不对将第一提取区域的图 像转换到的具体颜色空间进行限定,仅以将其转换到 HSV颜色空间为例。 由于 现有技术中的图像到颜色空间的转换技术十分成熟,因而该步骤的具体转换过 程可依据现有的转换技术实现, 本实施例对此不再赘述。  Wherein, when converting the image of the first extraction area to the corresponding color space, there are multiple color spaces in the actual application, for example, RGB composed of color components such as R (red), G (green) and B (blue). Color space; HSV color space composed of color components such as H (hue), S (saturation), and V (value); HIS color space composed of H (hue), S (saturation) ^ I (intensity) color components, etc. Etc. Therefore, the present embodiment does not limit the specific color space to which the image of the first extraction region is converted, but only converts it to the HSV color space as an example. Since the image-to-color space conversion technology in the prior art is very mature, the specific conversion process of the step can be implemented according to the existing conversion technology, which is not described in this embodiment.
另外,由于 HSV颜色空间中的亮度与饱和度等颜色分量不具备明显的区分 能力, 而色调具有较强的区分能力, 因此, 该步骤在获取第一提取区域对应的 颜色量化矩阵时, 通过系数强化色调信息, 而弱化亮度与饱和度信息。 具体实 施时,在将每个像素对应的颜色分量加权量化后,得到第一提取区域对应的颜 色量化矩阵的方式, 包括但不限于:  In addition, since the color components such as brightness and saturation in the HSV color space do not have a clear distinguishing ability, and the hue has a strong distinguishing ability, the step passes the coefficient when acquiring the color quantization matrix corresponding to the first extracted region. Enhance tonal information while weakening brightness and saturation information. In a specific implementation, after the color components corresponding to each pixel are weighted and quantized, the color quantization matrix corresponding to the first extraction region is obtained, including but not limited to:
通过公式 f = ohh + ass + σνν将每个像素对应的颜色分量加权量化,得到第一 提取区域对应的颜色量化矩阵; The color components corresponding to each pixel are weighted and quantized by the formula f = o h h + a s s + σ ν ν to obtain a color quantization matrix corresponding to the first extraction region;
其中, h为色调, s为饱和度, V为亮度, σ¾、 as . σν为加权系数。 Where h is the hue, s is the saturation, V is the brightness, σ 3⁄4 , a s . σ ν is the weighting factor.
针对上述加权系数 σ¾、 和 σν, 可依据实际需要进行设置, 例如, 设置 ah = 0.8 , as=0.l , σν=0Λ, 当然, 除此之外还可以设置其他加权系数值, 本实 施例不对加权系数的具体数值进行限定。以上述步骤 202中确定的第一提取区 域为 7*7像素矩阵的正方形为例,通过该步骤对第一提取区域中的每个像素进 行颜色分量加权量化后, 每个像素得到一个对应的颜色分量 f, 则该步骤将得 到一个 7*7的颜色量化矩阵 C7x7。 For the above weighting coefficients σ 3⁄4 , and σ ν , it can be set according to actual needs, for example, setting a h = 0.8 , a s =0.l , σ ν =0 Λ, of course, other weighting factors can be set besides Value, this embodiment does not limit the specific value of the weighting coefficient. Taking the square in which the first extraction region determined in the above step 202 is a 7*7 pixel matrix as an example, after performing color component weight quantization on each pixel in the first extraction region, each pixel obtains a corresponding color. For component f, then this step will result in a 7*7 color quantization matrix C 7x7.
204: 获取第一提取区域范围内各像素的梯度值, 得到第一提取区域对应 的梯度矩阵;  Step 204: Obtain a gradient value of each pixel in the first extraction area, and obtain a gradient matrix corresponding to the first extraction area.
针对该步骤, 获取第一提取区域范围内各像素的梯度值,得到第一提取区 域对应的梯度矩阵, 包括但不限于:  For this step, the gradient values of the pixels in the first extraction region are obtained, and the gradient matrix corresponding to the first extraction region is obtained, including but not limited to:
釆用索贝尔算子中的横向矩阵及纵向矩阵分别与第一提取区域范围内各 像素进行卷积运算, 得到横向与纵向的亮度差分近似值; The horizontal matrix and the vertical matrix in the Sobel operator are respectively separated from the first extraction region The pixel performs a convolution operation to obtain a horizontal and vertical luminance difference approximation;
根据横向与纵向的亮度差分近似值得到第一提取区域对应的梯度矩阵。 其中,釆用索贝尔算子中的横向矩阵及纵向矩阵分别与第一提取区域范围 内各像素进行卷积运算, 得到横向与纵向的亮度差分近似值, 包括但不限于:  A gradient matrix corresponding to the first extraction region is obtained according to the luminance difference approximation between the horizontal and vertical directions. Wherein, the horizontal matrix and the vertical matrix in the Sobel operator are respectively convoluted with each pixel in the first extraction region to obtain a horizontal and vertical luminance difference approximation, including but not limited to:
-1 0  -1 0
釆用 索 贝 尔算子中 的横向矩阵 = 与纵向矩阵
Figure imgf000013_0001
Using the transverse matrix in the Sobel operator = with the longitudinal matrix
Figure imgf000013_0001
f+\ +2 +1、  f+\ +2 +1
Sy = 0 0 0 分别与第一提取区域范围内各像素进行卷积运算,得到横向亮 -1 -2 -1 度差分近似值 = 与纵向亮度差分近似值 ; 其中, I为第一提取 区域范围内的像素; 根据横向与纵向的亮度差分近似值得到提取区域对应的梯度矩阵 ,包括但 不限于:  Sy = 0 0 0 is convoluted with each pixel in the first extraction region to obtain a lateral bright -1 -2 -1 degree difference approximation = an approximation to the longitudinal luminance difference; where I is within the first extraction region Pixel; according to the horizontal and vertical luminance difference approximation, the gradient matrix corresponding to the extracted region is obtained, including but not limited to:
通过公式 = i + Gy 2得到第一提取区域对应的梯度矩阵 Gi¾yThe gradient matrix G i3⁄4y corresponding to the first extraction region is obtained by the formula = i + G y 2 .
205: 融合第一提取区域对应的颜色量化矩阵与梯度矩阵, 得到第一提取 区域对应的第一融合矩阵;  205: merging a color quantization matrix corresponding to the first extraction region and a gradient matrix to obtain a first fusion matrix corresponding to the first extraction region;
具体地, 融合第一提取区域对应的颜色量化矩阵与梯度矩阵,得到第一提 取区域对应的第一融合矩阵, 包括但不限于:  Specifically, the color quantization matrix corresponding to the first extraction region is merged with the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region, including but not limited to:
将第一提取区域对应的颜色量化矩阵与梯度矩阵进行乘积运算,得到第一 提取区域对应的第一融合矩阵。  The color quantization matrix corresponding to the first extraction region is multiplied by the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
以上述步骤 203得到的第一提取区域对应的颜色量化矩阵为 C7x7 , 上述步 骤 204得到的第一提取区域对应的梯度矩阵为 w为例, 则该步骤得到的与第 一提取区域相对应的第一融合矩阵为 F,X, = GX,* C,X,。 The color quantization matrix corresponding to the first extraction area obtained in the above step 203 is C 7x7 , and the gradient matrix corresponding to the first extraction area obtained in the above step 204 is taken as an example, and the step corresponding to the first extraction area is obtained by the step. The first fusion matrix is F, X , = G , X , * C, X , .
206: 按获取第一提取区域对应的第一融合矩阵的方式获取第二提取区域 对应的第二融合矩阵;  206: Acquire a second fusion matrix corresponding to the second extraction area, in a manner of acquiring a first fusion matrix corresponding to the first extraction area.
针对该步骤,按获取第一提取区域对应的第一融合矩阵的方式获取第二提 取区域对应的第二融合矩阵时,即按照上述步骤 203提供的方式获取第二提取 区域范围内各像素的颜色分量,得到第二提取区域对应的颜色量化矩阵; 按照 上述步骤 204提供的方式获取第二提取区域范围内各像素的梯度值,得到第二 提取区域对应的梯度矩阵;按照上述步骤 205提供的方式融合第二提取区域对 应的颜色量化矩阵与梯度矩阵, 得到第二提取区域对应的第二融合矩阵。 For obtaining the second fusion matrix corresponding to the second extraction region, the color of each pixel in the second extraction region is obtained in the manner provided in step 203 above. a component, obtaining a color quantization matrix corresponding to the second extraction region; The method of the foregoing step 204 is performed to obtain the gradient value of each pixel in the second extraction region, and obtain the gradient matrix corresponding to the second extraction region; and the color quantization matrix and the gradient matrix corresponding to the second extraction region are merged according to the manner provided in step 205 above. A second fusion matrix corresponding to the second extraction region is obtained.
207: 根据第一融合矩阵和第二融合矩阵计算得到第一组点对对应的标量 值;  207: Calculate, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
具体地, 该步骤的具体实现方式包括但不限于如下几个步骤:  Specifically, the specific implementation of the step includes, but is not limited to, the following steps:
步骤 a、 将第一融合矩阵按行展开, 形成行向量;  Step a, expanding the first fusion matrix by rows to form a row vector;
步骤 b、 将行向量中的向量元素按照大小进行排序, 形成新的行向量; 步骤 c、 将新的行向量中的每个向量的元素值与第一提取区域的中心像素 对应的向量的元素值进行比较, 得到第一比较结果;  Step b, sorting the vector elements in the row vector according to the size to form a new row vector; Step c, the elements of the vector corresponding to the element value of each vector in the new row vector and the central pixel of the first extraction region The values are compared to obtain a first comparison result;
步骤 d、 按照第一融合矩阵方式处理第二融合矩阵, 得到第二比较结果; 步骤 e、 通过比较第一比较结果和第二比较结果得到第一组点对对应的标 量值。  Step d: processing the second fusion matrix according to the first fusion matrix manner to obtain a second comparison result; Step e, obtaining a scalar value corresponding to the first set of point pairs by comparing the first comparison result with the second comparison result.
为了便于理解, 以第一融合矩阵为矩阵 ^7为例, 对上述根据第一融合矩 阵和第二融合矩阵计算得到第一组点对对应的标量值的各个步骤的实现方式 进行举例说明: For ease of understanding, taking the first fusion matrix as the matrix ^ 7 as an example, an implementation manner of each step of calculating the scalar value corresponding to the first set of point pairs according to the first fusion matrix and the second fusion matrix is illustrated:
步骤 a,, 将第一融合矩阵 7按行展开形成 49维的行向量/; Step a, expanding the first fusion matrix 7 into rows to form a 49-dimensional row vector /;
针对该步骤, 将第一融合矩阵 ^7按行展开时, 可以矩阵的行为单位, 矩 阵第一行的最后一个向量与第二行的第一个向量衔接,第二行的最后一个向量 与第三行的第一个向量衔接, 依此类推, 每一行的首与下一行的尾衔接, 形成 49维的行向量 /。 For this step, when the first fusion matrix ^ 7 is expanded in rows, the row of the matrix may be the last vector of the first row of the matrix and the first vector of the second row, and the last vector of the second row The first vector of the three lines is connected, and so on, the first and the next line of each line are joined to form a 49-dimensional row vector.
步骤 b,,将行向量/中的向量元素按照大小进行排序,形成新的行向量 /; 针对该步骤,将行向量 中的向量元素按照大小进行排序时, 既可以按照 由大到小的顺序进行排序,也可以按照由小到大的顺序排序, 本实施例不对具 体排序方式进行限定。  Step b, sorting the vector elements in the row vector/ by size to form a new row vector/; For this step, when sorting the vector elements in the row vector by size, the order may be in descending order Sorting may also be sorted in order from small to large. This embodiment does not limit the specific sorting manner.
步骤 c,,将新的行向量 /中的每个向量的元素值与第一提取区域的中心像 素对应的向量的元素值进行比较, 得到第一比较结果;  Step c, comparing the element value of each vector in the new row vector / with the element value of the vector corresponding to the central pixel of the first extraction region, to obtain a first comparison result;
针对该步骤, 本实施例不对得到第一比较结果的方式进行限定, 例如, 将 新的行向量/中的每个向量的元素值与第一提取区域的中心像素对应的向量 的元素值进行比较时, 若前者大, 则得到的第一比较结果 = (); 否则, 得到 的第一比较结果为 = 1 ; 或者, 若前者大, 则得到的第一比较结果 = 1 , 否 则, 得到的第一比较结果为 0。 无论得到何种第一比较结果, 对于一个新的行 向量 / , 均可得到一个 48维向量, 且该 48维向量中的每个向量维度上的值仅 为数值 0或 1。 For this step, the embodiment does not limit the manner in which the first comparison result is obtained, for example, a vector corresponding to the element value of each vector in the new row vector/the center pixel of the first extraction region. When the element values are compared, if the former is large, the first comparison result obtained is = () ; otherwise, the first comparison result obtained is = 1 ; or, if the former is large, the first comparison result obtained = 1 ; Otherwise, the first comparison result obtained is 0. Regardless of the first comparison result obtained, a 48-dimensional vector can be obtained for a new row vector / , and the value in each vector dimension in the 48-dimensional vector is only a value of 0 or 1.
步骤 d,, 按照上述第一融合矩阵方式处理第二融合矩阵, 得到的第二比 较结果。  Step d, processing the second fusion matrix according to the first fusion matrix method to obtain a second comparison result.
步骤 e, , 通过比较第一比较结果和第二比较结果得到第一组点对对应的 标量值时, 由于第一组点对中的两个点均可按照上述步骤 a, 到步骤 c, 得到 一个 48维向量, 而 48维向量中的每个向量维度上的值仅为数值 0或 1 , 则可 将第一组点对中的两个点对应的第一比较结果和第二比较结果进行比较,根据 比较结果得到第一组点对对应的标量值。  Step e, , by comparing the first comparison result and the second comparison result to obtain a scalar value corresponding to the first set of point pairs, since both points in the first set of point pairs can follow the above step a, to step c, Obtaining a 48-dimensional vector, and the value in each vector dimension of the 48-dimensional vector is only a value of 0 or 1, and the first comparison result and the second comparison result corresponding to two points in the first set of point pairs may be obtained. For comparison, the scalar values corresponding to the first set of point pairs are obtained according to the comparison result.
例如,对于第一组点对中的两点,其中一个点对应的第一比较结果记为 Μ。 , 另一个点对应的第二比较结果记为 M ,由于第一比较结果和第二比较结果均可 得到一个 48维向量,且该 48维向量中的每个向量维度上的值仅为数值 0或 1 , 则"。与 均为 2进制序列, 可用于表示无符号的数, 因此, 可通过比较 M。与 M 对应的二进制数值, 得到第一组点对对应的标量值。 例如, 若"。大于 M, 比较 结果为 1 , 将其作为第一组点对对应的标量值; 否则, 比较结果为 0 , 将其作 为第一组点对对应的标量值。 For example, for two of the first set of point pairs, the first comparison result corresponding to one of the points is denoted as Μ . The second comparison result corresponding to another point is recorded as M. Since the first comparison result and the second comparison result both obtain a 48-dimensional vector, and the value in each vector dimension in the 48-dimensional vector is only a value of 0. Or 1, then ". and both are binary sequences, which can be used to represent unsigned numbers. Therefore, by comparing M. The binary value corresponding to M , the scalar value corresponding to the first set of point pairs is obtained. For example, If "." If it is greater than M , the comparison result is 1 and it is taken as the corresponding scalar value of the first set of point pairs; otherwise, the comparison result is 0, which is used as the corresponding scalar value of the first set of point pairs.
208: 按第一组点对方式完成其他点对对应的标量值的计算, 组合预设组 数的点对的标量值, 得到待处理图像的特征向量。  208: Perform calculation of the corresponding scalar value of the other points according to the first set of point pairs, and combine the scalar values of the pair of preset groups to obtain the feature vector of the image to be processed.
针对该步骤,在按照上述步骤计算得到第一组点对对应的标量值之后,按 照第一组点对对应的标量值的计算方式可计算得到每组点对对应的标量值,将 预设组数的点对的标量值组合之后的结果作为待处理图像的特征向量。 例如, 上述步骤 201在处理后的图像中选取 1 00组点对, 则可得到 1 00组点对对应的标 量值, 将 1 00组点对对应的标量值组合之后可得到 1 00维的特征向量。  For this step, after calculating the scalar value corresponding to the first set of point pairs according to the above steps, according to the calculation method of the corresponding scalar value of the first set of point pairs, the scalar value corresponding to each set of point pairs can be calculated, and The result of combining the scalar values of the pair of points of the preset number is used as the feature vector of the image to be processed. For example, in the above step 201, if 100 pairs of points are selected in the processed image, the scalar value corresponding to the pair of 100 pairs can be obtained, and the scalar values corresponding to the pair of 100 pairs can be combined to obtain 100 00. Feature vector.
需要说明的时,上述图像特征的提取方法可应用于目标跟踪与检测等场景, 通过上述步骤实现的图像特征的提取过程,在融合了图像颜色与梯度信息的基 础上,通过对融合后的矩阵中的数据进行排序, 可使跟踪或检测目标在不同角 度具有相近的特征向量, 进而增加特征向量的抗旋转能力。 接下来, 为了更加 清楚地说明本实施例提供的上述方法所达到的有益效果,以及与现有技术的区 另 ij , 以将本实施例提供的图像特征的提取方法应用于目标跟踪器为例, 结合实 验数据进行说明。 When it is to be noted, the above image feature extraction method can be applied to a scene such as target tracking and detection, and the image feature extraction process realized by the above steps is based on the fusion of the image color and the gradient information, and the merged matrix is adopted. Sorting the data in the data, allowing tracking or detection of the target at different angles The degrees have similar feature vectors, which in turn increases the anti-rotation ability of the feature vectors. Next, in order to more clearly illustrate the beneficial effects achieved by the above method provided by the embodiment, and the prior art, the image feature extraction method provided by the embodiment is applied to the target tracker as an example. , combined with experimental data for explanation.
在实验中, 将已标记目标外接矩形区域的视频作为实验输入数据, 分别运 行基于本实施例提供的图像特征的提取技术的目标跟踪器与基于现有技术提 供的图像特征的提取技术的目标跟踪器, 输出在连续 125帧中被跟踪目标的外 接矩形区域数据。将被标记的目标区域被称为正样本,被标记样本区域周围的 区域以及与正样本区域重叠面积小于 的区域称为负样本。 4叚设目标跟踪器输 出目标区域与目标标记的区域重叠面积小于 ,则认为该目标跟踪器没有检测 到目标, 否则认为目标跟踪器检测到目标。 在该前提下, 釆用随机森林作为分 类器,分别计算基于现有技术提供的技术方案与本实施例提供的技术方案的目 标跟踪器的查准率 (prec i s ion ) 与查全率 (reca l l )数据。 在实验中, 可 根据具体应用场景进行设定,本实施例对此不作具体限定,仅以 0.30为例。  In the experiment, the video of the marked target circumscribed rectangular area is used as the experimental input data, and the target tracker based on the extraction feature of the image feature provided by the embodiment is separately operated and the target tracking of the image feature based on the prior art is used. Outputs the circumscribed rectangular area data of the target being tracked in 125 consecutive frames. The target area to be marked is referred to as a positive sample, and the area around the marked sample area and the area overlapping with the positive sample area are referred to as negative samples. 4. If the area of the target tracker output target area and the target mark overlaps less than, the target tracker is not detected to be the target, otherwise the target tracker is considered to have detected the target. Under this premise, the random forest is used as a classifier, and the precision of the target tracker based on the technical solution provided by the prior art and the technical solution provided by the embodiment is calculated separately (reca is ion) and recall rate (reca Ll) data. In the experiment, it can be set according to a specific application scenario, which is not specifically limited in this embodiment, and only 0.30 is taken as an example.
在本实验中, 实验数据准备如下:  In this experiment, the experimental data is prepared as follows:
1 )收集 2段具有光线变化场景的、 包含具有显著颜色特征的目标、 并且目 标出现部分或全部遮挡情况的视频;  1) Collecting 2 videos with light-changing scenes, targets with significant color features, and partial or total occlusion of the target;
2 )对每一段视频, 选取连续 125帧视频数据, 标记出被跟踪目标在视频中 出现的位置矩形区域, 具体标记时, 可釆用手工标记的方式实现, 本实施例对 此不作具体限定。标记出的位置矩形区域的信息可用位置矩形区域起始位置的 横、 纵坐标及位置矩形区域的长和宽表示。 其中, 可将位置矩形区域左上角看 作坐标原点,位置矩形区域起始位置的横、纵坐标即为位置矩形区域左上角的 原点坐标, 以像素为单位, 对位置矩形区域的每个像素位置进行量化表示, 位 置矩形区域的长和宽均可用两个像素点之间的距离表示, 单位是像素。 例如, 位置矩形区域的信息可表示为: 起始位置的坐标为( 256 , 108 ) , 长 100像素, 宽 200像素。 标记出被跟踪目标在视频中出现的位置矩形区域后, 将该位置矩 形区域的信息连同帧号记录在文件中(不直接画在视频中), 关于记录位置矩 形区域的信息的文件的类型、 存储位置等, 本实施例均不作具体限定。 对于完 全遮挡的目标, 则不记录目标的位置数据。 对于部分遮挡的目标, 仅记录目标 可见区域的坐标数据。标记目标区域的矩形应该尽可能贴近被跟踪目标的可见 区域的外轮廓, 上述标记的目标区域数据为正样本。 在本实验中, 以图 3所示 的实验运行效果示意图为例, 被跟踪目标为女士头部与男生上衣。 2) For each video, a continuous 125 frames of video data are selected, and a rectangular area of the position where the tracked object appears in the video is marked. The specific mark can be implemented by using a manual mark, which is not specifically limited in this embodiment. The information of the marked rectangular area of the position can be represented by the horizontal and vertical coordinates of the starting position of the rectangular area of the position and the length and width of the rectangular area of the position. The upper left corner of the position rectangular area can be regarded as the coordinate origin, and the horizontal and vertical coordinates of the starting position of the position rectangular area are the origin coordinates of the upper left corner of the position rectangular area, in pixels, for each pixel position of the position rectangular area. To quantify, the length and width of the rectangular area of the position can be represented by the distance between two pixels, and the unit is a pixel. For example, the information of the position rectangular area can be expressed as: The coordinates of the starting position are (256, 108), the length is 100 pixels, and the width is 200 pixels. After marking the rectangular area of the position where the tracked object appears in the video, the information of the rectangular area of the position is recorded in the file together with the frame number (not directly drawn in the video), the type of the file about the information of the rectangular area of the recorded position, The storage location and the like are not specifically limited in this embodiment. For a fully occluded target, the location data of the target is not recorded. For partially occluded targets, only record targets The coordinate data of the visible area. The rectangle marking the target area should be as close as possible to the outer contour of the visible area of the tracked target, and the target area data of the above mark is a positive sample. In this experiment, taking the schematic diagram of the experimental operation shown in Figure 3 as an example, the target to be tracked is the woman's head and the boy's shirt.
3)正、 负样本数据记录在文件中, 文件每一行存放一个样本数据。 每一 行共有 5个数据, 第一个数据表示帧号,接着 4个数据表示样本在视频图像中 的区域。  3) Positive and negative sample data are recorded in the file, and each sample of the file stores one sample data. There are 5 data in each row, the first data represents the frame number, and then the 4 data represents the area of the sample in the video image.
在本实验中, 实验数据统计过程如下:  In this experiment, the experimental data statistics process is as follows:
1)对视频段的帧编号, 用 1,2, ...,125表示, 由于视频段的第一帧不一定 包含跟踪目标, 因而可以不从视频第一帧开始编号, 而从出现跟踪目标的帧开 始编号;  1) The frame number of the video segment is represented by 1, 2, ..., 125. Since the first frame of the video segment does not necessarily contain the tracking target, the tracking target may not be numbered from the first frame of the video. Frame start number;
2 )在视频标记为 1号帧的前面一帧, 初始化目标跟踪器, 并运行目标跟 踪器, 以使目标跟踪器处于正常工作状态, 能够正常处理经过编号的帧数据; 2) Initialize the target tracker in the frame before the video is marked as frame 1, and run the target tracker to make the target tracker in normal working state, and can process the numbered frame data normally;
3)处理第 i帧数据, 暂停目标跟踪器, 记录目标跟踪器输出目标的位置 区域数据。 其中, i为 1至 125中任意数值, 处理第 i帧数据时包括提取第 i帧数据的图 像特征向量的过程,此处提取特征的方式详见上述步骤 201至步骤 206中的叙述, 此处不再赘述。 记录第 i帧时, 目标跟踪器输出矩形区域为 R;reifci, 正样本所在 区域为 R;a ei。 记函数0 ve^Pdw ")表示矩形 区域与区域 ^*"相互重 叠面积占 "面积的比率, 即 Overlap(Rpredwt,^get) = *100% , S表示求矩 形面积函数。 该比率取值区间为 [W], 其中 0表示矩形 "区域与区域 ^ ^没 有重叠区域, 1表示两区域完全重叠。 对于目标跟踪器输出待跟踪目标区域 R Ct ,
Figure imgf000017_0001
- x , 则第 i帧的正样本被分类器判为正样本, 即分类器输出目标区域与目标标记区域基本重叠; 务 Overlap、KpredictD<a, 则第 i帧的负样本被分类器判为正样本, 即分类器输出目标区域与目标标记区 域相距甚远。在本实验中, 需要统计每一帧中正样本被目标跟踪器判为正样本 的样本总数以及负样本被目标跟踪器判为正样本的样本总数。
3) Processing the ith frame data, suspending the target tracker, and recording the location area data of the target tracker output target. Where i is an arbitrary value from 1 to 125, and the process of extracting the image feature vector of the i-th frame data is included in the processing of the ith frame data, and the manner of extracting the feature here is described in the above steps 201 to 206, where No longer. When recording the ith frame, the target tracker outputs a rectangular area of R; reifci , where the positive sample is located; R; a ei . The function 0 ve^Pdw ") indicates the ratio of the area of the rectangle and the area ^*" to the area, that is, Overlap(R predwt , ^ get ) = * 100% , and S represents the function of the area of the rectangle. The interval is [W], where 0 means the rectangle "the area and the area ^ ^ have no overlapping area, and 1 means that the two areas completely overlap. For the target tracker to output the target area to be tracked R Ct ,
Figure imgf000017_0001
- x , the positive sample of the i-th frame is judged as a positive sample by the classifier, that is, the classifier output target area and the target mark area substantially overlap; the service O ver lap, K predict D <a , the negative sample of the i-th frame is The classifier is judged as a positive sample, that is, the classifier output target area is far from the target mark area. In this experiment, it is necessary to count the positive samples in each frame as positive samples by the target tracker. The total number of samples and the total number of samples in which the negative sample was judged as a positive sample by the target tracker.
4 )正对每一个视频目标, 统计正样本总数, 正样本被分类器判为正样本 的总数以及负样本被分类器误判为正样本的总数。按下述公式计算查全率、查 准率以及 F值;  4) For each video target, the total number of positive samples is counted, the positive sample is judged as the total number of positive samples by the classifier, and the negative sample is misclassified as the total number of positive samples by the classifier. Calculate the recall rate, the calibration rate, and the F value according to the following formula;
正样本被跟踪器判为正样本的总数  The positive sample is judged as the total number of positive samples by the tracker
查全率 =  Full recall rate =
正样本总数 正样本被跟踪器判为正样本的总数  The total number of positive samples The positive sample is judged as the total number of positive samples by the tracker
查准率 =  Precision rate =
正样本被跟踪器判为正样本的总数 +负样本被判为正样本的总数 正确率 *召回率 *2  The positive sample is judged as the total number of positive samples by the tracker + The negative sample is judged as the total number of positive samples. Correct rate * Recall rate *2
「值=  "value =
正确率 +召回率  Correct rate + recall rate
在本实验中, 实验运行效果如图 3所示。 图 3中, 第一排四幅图片及第三排 四幅图片分别为基于现有技术提供的图像特征的提取方案的目标跟踪器对应 的运行效果;第二排四幅图片及第四排四幅图片为基于本实施例提供的图像特 征的提取方案的目标跟踪器对应的运行效果。 左边 4幅图展示跟踪女士头部, 右边 4幅图为跟踪男士上衣。 实验数据如下面表 3所示。 通过实验数据分析, 在 光线变化明显,被跟踪目标具有明显颜色特征的情况下,基于本实施例提供的 图像特征的提取方案的目标跟踪器能去掉较好的结果。  In this experiment, the experimental results are shown in Figure 3. In FIG. 3, the first row of four pictures and the third row of four pictures are respectively corresponding to the operation effect of the target tracker based on the image feature extraction scheme provided by the prior art; the second row of four pictures and the fourth row of four pictures are based on The running effect corresponding to the target tracker of the image feature extraction scheme provided by this embodiment. The four pictures on the left show the head of the woman, and the four pictures on the right track the men's shirt. The experimental data is shown in Table 3 below. Through the experimental data analysis, the target tracker based on the image feature extraction scheme provided by the present embodiment can remove better results in the case where the light changes significantly and the tracked target has obvious color features.
基于现有技术提供的图像特征的提取方案的目标跟踪器实验数据如下面 表 1所示, 基于本实施例提供的图像特征的提取方案的目标跟踪器实验数据如 下面表 2所示:  Based on the target tracker experimental data of the image feature extraction scheme provided by the prior art, as shown in Table 1 below, the target tracker experimental data based on the image feature extraction scheme provided by the present embodiment is as shown in Table 2 below:
表 1  Table 1
被跟踪目标名词 TP FP P TP/P TP/ (TP+FP) F值 女士头部 81 15 1 03 0. 79 0. 84 0. 81 男士上衣 78 9 92 0. 85 0. 90 0. 87 摩托车 76 12 79 0. 96 0. 86 0. 90 表 2Tracked target noun TP FP P TP/P TP/ (TP+FP) F value Ms. head 81 15 1 03 0. 79 0. 84 0. 81 Men's shirt 78 9 92 0. 85 0. 90 0. 87 Motorcycle Car 76 12 79 0. 96 0. 86 0. 90 Table 2
Figure imgf000019_0001
Figure imgf000019_0001
注: TP表示正样本被目标跟踪器判为正的样本总数; FP 表示负样本被目 标跟踪器判为正的样本总数; P表示所标记的正样本总数。  Note: TP indicates the total number of samples whose positive samples are positive by the target tracker; FP indicates the total number of samples whose negative samples are positive by the target tracker; P indicates the total number of positive samples marked.
表 3 table 3
Figure imgf000019_0002
Figure imgf000019_0002
从上面表 3所示的实验数据中可以看出,本实施例提供的技术方案较现有 技术提供的技术方案而言, 其具有较高的查全率和查准率, 因而提高了提取出 的图像特征的准确性。  As can be seen from the experimental data shown in Table 3 above, the technical solution provided by this embodiment has a higher recall rate and precision than the technical solution provided by the prior art, thereby improving the extraction. The accuracy of the image features.
本实施例提供的方法, 由于梯度值能够描述图像的目标轮廓, 又由于颜色 往往和图像中所包含的物体或场景十分相关,且与其他的特征相比,颜色特征 对图像本身的尺寸、 方向、 视角的依赖性较小, 具有较高的鲁棒性, 因而通过 釆用梯度值及颜色分量进行图像特征的提取, 可提取出具有描述能力强、抗光 照变化能力的特征, 不仅能够提高提取出的图像特征的准确性, 且还可适应于 众多常见的目标跟踪与检测技术中的图像特征的提取; 另外,在融合图像颜色 与梯度值的基础上,通过将融合后的矩阵按行展开,将行向量中的向量元素按 照大小进行排序, 并据此得到特征向量,从而使得目标在不同角度具有相近的 特征向量, 增加特征向量的抗旋转能力。  The method provided in this embodiment, because the gradient value can describe the target contour of the image, and because the color is often closely related to the object or scene contained in the image, and compared with other features, the color feature has the size and direction of the image itself. The dependence of the angle of view is small and has high robustness. Therefore, by extracting the image features with gradient values and color components, features with strong descriptive ability and resistance to illumination can be extracted, which can not only improve extraction. The accuracy of the image features can be adapted to the extraction of image features in many common target tracking and detection techniques. In addition, based on the blended image color and gradient values, the merged matrix is expanded by row. The vector elements in the row vector are sorted according to the size, and the feature vector is obtained according to the result, so that the target has similar feature vectors at different angles, and the anti-rotation ability of the feature vector is increased.
实施例三 本实施例提供了一种图像特征的提取装置,该装置用于执行上述实施例一 或实施例二提供的图像特征的提取方法。 参见图 4 , 该图像特征的提取装置包 括: Embodiment 3 The embodiment provides an image feature extraction device, which is used to perform the image feature extraction method provided in the first embodiment or the second embodiment. Referring to FIG. 4, the image feature extraction device includes:
处理模块 401 , 用于对待处理图像进行灰度均衡化处理;  a processing module 401, configured to perform grayscale equalization processing on the image to be processed;
选取模块 402 ,用于在处理模块 401处理后的图像中选取预设组数的点对; 确定模块 403 , 用于取第一组点对, 并以第一组点对中的两个点为中心分 别确定预设范围的第一提取区域和第二提取区域;  The selecting module 402 is configured to select a pair of preset pairs of points in the image processed by the processing module 401; the determining module 403 is configured to take the first set of point pairs, and take two points in the first set of point pairs as The center respectively determines a first extraction area and a second extraction area of the preset range;
第一获取模块 404 , 用于获取第一提取区域范围内各像素的颜色分量, 得 到第一提取区域对应的颜色量化矩阵;  The first obtaining module 404 is configured to obtain color components of each pixel in the first extraction area, and obtain a color quantization matrix corresponding to the first extraction area;
第二获取模块 405 , 用于获取第一提取区域范围内各像素的梯度值, 得到 第一提取区域对应的梯度矩阵;  The second obtaining module 405 is configured to obtain a gradient value of each pixel in the first extraction area, and obtain a gradient matrix corresponding to the first extraction area.
融合模块 406 , 用于融合第一提取区域对应的颜色量化矩阵与梯度矩阵, 得到第一提取区域对应的第一融合矩阵;  The merging module 406 is configured to combine the color quantization matrix and the gradient matrix corresponding to the first extraction region to obtain a first fusion matrix corresponding to the first extraction region;
第一重复模块 407 , 用于按获取第一提取区域对应的第一融合矩阵的方式 获取第二提取区域对应的第二融合矩阵;  a first repetition module 407, configured to acquire a second fusion matrix corresponding to the second extraction region, by acquiring a first fusion matrix corresponding to the first extraction region;
计算模块 408 , 用于根据第一融合矩阵和第二融合矩阵计算得到对应第一 组点对的标量值;  The calculating module 408 is configured to calculate, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
第二重复模块 409 , 用于按第一组点对方式完成其他点对对应的标量值的 计算;  a second repeating module 409, configured to perform calculation of a corresponding scalar value of other point pairs according to the first set of point pairs;
组合模块 41 0 , 用于组合预设组数的点对的标量值, 得到待处理图像的特 征向量。  The combination module 41 0 is configured to combine the scalar values of the pair of preset groups to obtain the feature vector of the image to be processed.
进一步地, 参见图 5 , 第一获取模块 404 , 具体包括:  Further, referring to FIG. 5, the first obtaining module 404 specifically includes:
转换单元 4041 , 用于将第一提取区域的图像转换到对应的颜色空间, 得 到第一提取区域范围内每个像素对应的颜色分量;  a converting unit 4041, configured to convert an image of the first extraction area to a corresponding color space, to obtain a color component corresponding to each pixel in the first extraction area;
获取单元 4042 , 用于将转换单元 4041得到的每个像素对应的颜色分量加 权量化后, 得到第一提取区域对应的颜色量化矩阵。  The obtaining unit 4042 is configured to weight quantize the color component corresponding to each pixel obtained by the converting unit 4041 to obtain a color quantization matrix corresponding to the first extraction region.
进一步地, 获取单元 4042 , 具体用于通过公式/ = 0^ + 0^ + 0^将每个像 素对应的颜色分量加权量化, 得到第一提取区域对应的颜色量化矩阵; 其中, h为色调, s为饱和度, V为亮度, σ¾、 as . σν为加权系数。 进一步地, 参见图 6, 第二获取模块 405, 具体包括: Further, the obtaining unit 4042 is specifically configured to weight-quantize the color components corresponding to each pixel by using the formula /= 0^ + 0^ + 0^ to obtain a color quantization matrix corresponding to the first extraction region; wherein h is a hue, s is the saturation, V is the brightness, σ 3⁄4 , a s . σ ν is the weighting coefficient. Further, referring to FIG. 6, the second obtaining module 405 specifically includes:
运算单元 4051, 用于釆用索贝尔算子中的横向矩阵及纵向矩阵分别与第 一提取区域范围内各像素进行卷积运算, 得到横向与纵向的亮度差分近似值; 获取单元 4052, 用于根据运算单元 4051得到的横向与纵向的亮度差分近 似值得到第一提取区域对应的梯度矩阵。  The operation unit 4051 is configured to perform a convolution operation on each of the pixels in the first extraction region by using the horizontal matrix and the vertical matrix in the Sobel operator to obtain a luminance difference approximation between the horizontal and vertical directions. The obtaining unit 4052 is configured to The horizontal and vertical luminance difference approximation obtained by the operation unit 4051 obtains a gradient matrix corresponding to the first extraction region.
进一步地, 运算单元 4051 , 具体用于釆用索贝尔算子中的横向矩阵 gx = 分别与第一提取区域范围内各像
Figure imgf000021_0001
素进行卷积运算, 得到横向亮度差分近似值 ^= 与纵向亮度差分近似值 °y = gy * 1 ; 其中, I为第一提取区域范围内的像素; 获取单元 4052, 具体用于通过公式 =」Gx 2 +(Jy 2得到第一提取区域对应 的梯度矩阵 Gi¾y
Further, the operation unit 4051 is specifically configured to use the horizontal matrix g x = in the Sobel operator and each image in the first extraction region
Figure imgf000021_0001
The convolution operation is performed to obtain a lateral luminance difference approximation ^= and a longitudinal luminance difference approximation °y = g y * 1 ; where I is a pixel in the first extraction region; and an acquisition unit 4052 is specifically used to pass the formula = G x 2 + (J y 2 obtains a gradient matrix G i3⁄4y corresponding to the first extraction region.
进一步地, 融合模块 406, 具体用于将第一提取区域对应的颜色量化矩阵 与梯度矩阵进行乘积运算, 得到第一提取区域对应的第一融合矩阵。  Further, the merging module 406 is specifically configured to perform a product operation on the color quantization matrix corresponding to the first extraction region and the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
进一步地, 参见图 7, 计算模块 408, 具体包括:  Further, referring to FIG. 7, the calculating module 408 specifically includes:
展开单元 4081, 用于将第一融合矩阵按行展开, 形成行向量;  An expansion unit 4081, configured to expand the first fusion matrix in rows to form a row vector;
排序单元 4082, 用于将展开单元 4081展开得到的行向量中的向量元素按 照大小进行排序, 形成新的行向量;  a sorting unit 4082, wherein the vector elements in the row vector obtained by expanding the expansion unit 4081 are sorted according to the size to form a new row vector;
第一比较单元 4083, 用于将排序单元 4082得到的新的行向量中的每个向 量的元素值与第一提取区域的中心像素对应的向量的元素值进行比较,得到第 一比较结果;  The first comparing unit 4083 is configured to compare the element value of each vector in the new row vector obtained by the sorting unit 4082 with the element value of the vector corresponding to the central pixel of the first extraction region, to obtain a first comparison result;
重操作单元 4084, 用于按照第一融合矩阵方式处理第二融合矩阵, 得到 第二比较结果;  a re-operation unit 4084, configured to process the second fusion matrix according to the first fusion matrix manner to obtain a second comparison result;
第二比较单元 4085, 用于通过比较第一比较结果和第二比较结果得到第 一组点对对应的标量值。  The second comparing unit 4085 is configured to obtain a scalar value corresponding to the first pair of point pairs by comparing the first comparison result with the second comparison result.
本实施例提供的装置, 由于梯度值能够描述图像的目标轮廓, 又由于颜色 往往和图像中所包含的物体或场景十分相关,且与其他的特征相比,颜色特征 对图像本身的尺寸、 方向、 视角的依赖性较小, 具有较高的鲁棒性, 因而通过 釆用梯度值及颜色分量进行图像特征的提取, 可提取出具有描述能力强、抗光 照变化能力的特征, 不仅能够提高提取出的图像特征的准确性, 且还可适应于 众多常见的目标跟踪与检测技术中的图像特征的提取; 另外,在融合图像颜色 与梯度值的基础上,通过将融合后的矩阵按行展开,将行向量中的向量元素按 照大小进行排序, 并据此得到特征向量,从而使得目标在不同角度具有相近的 特征向量, 增加特征向量的抗旋转能力。 The device provided in this embodiment can describe the target contour of the image because the gradient value is closely related to the object or scene contained in the image, and the color feature is compared with other features. It has less dependence on the size, direction and angle of view of the image itself, and has higher robustness. Therefore, by extracting image features with gradient values and color components, it can extract strong ability to describe and resist light changes. The feature can not only improve the accuracy of the extracted image features, but also adapt to the extraction of image features in many common target tracking and detection techniques; in addition, based on the fusion image color and gradient values, The fused matrix is expanded by rows, and the vector elements in the row vector are sorted according to the size, and the eigenvectors are obtained according to the eigenvectors, so that the targets have similar eigenvectors at different angles, and the anti-rotation ability of the eigenvectors is increased.
实施例四  Embodiment 4
图 8为一个实施方式中特征提取装置的结构示意图,该特征提取装置包括 至少一个处理器(801 ), 例如 CPU , 至少一个网络接口 804或者其他用户接口 803 , 存储器 805 , 和至少一个通信总线 802。 通信总线 802用于实现这些装置 之间的连接通信。 用户接口 803 可以是显示器, 键盘或者点击设备。 存储器 805 可能包含高速 Ram 存储器, 也可能还包括非不稳定的存储器 ( non-vo l a t i le memory ), 例如至少一个磁盘存储器。 存储器 805可选的可以 包含至少一个位于远离前述 CPU802的存储装置。 在一些实施方式中, 存储器 805存储了如下的元素, 模块或者数据结构, 或者他们的子集, 或者他们的扩 展集:  8 is a block diagram showing the structure of a feature extraction device in an embodiment, the feature extraction device including at least one processor (801), such as a CPU, at least one network interface 804 or other user interface 803, a memory 805, and at least one communication bus 802. . Communication bus 802 is used to implement connection communication between these devices. User interface 803 can be a display, a keyboard or a pointing device. The memory 805 may include a high speed RAM memory and may also include a non-volatile memory, such as at least one disk memory. The memory 805 can optionally include at least one storage device located remotely from the aforementioned CPU 802. In some embodiments, memory 805 stores the following elements, modules or data structures, or a subset thereof, or their extensions:
操作系统 806 , 包含各种程序, 用于实现各种基础业务以及处理基于硬件 的任务;  Operating system 806, containing various programs for implementing various basic services and processing hardware-based tasks;
应用模块 807, 包含处理模块 401、 选取模块 402 , 确定模块 403 , 第一获 取模块 404 , 第二获取模块 405 , 融合模块 406 , 第一重复模块 407、 计算模块 408、 第二重复模块 409和组合模块 410。 上述模块的功能可以参考图 4的工 作原理图的说明部分, 此处不再赘述。  The application module 807 includes a processing module 401, a selection module 402, a determination module 403, a first acquisition module 404, a second acquisition module 405, a fusion module 406, a first repetition module 407, a calculation module 408, a second repetition module 409, and a combination. Module 410. For the functions of the above modules, refer to the description of the working principle diagram of Figure 4, and details are not described here.
本实施例提供的装置, 由于梯度值能够描述图像的目标轮廓, 又由于颜色 往往和图像中所包含的物体或场景十分相关,且与其他的特征相比,颜色特征 对图像本身的尺寸、 方向、 视角的依赖性较小, 具有较高的鲁棒性, 因而通过 釆用梯度值及颜色分量进行图像特征的提取, 可提取出具有描述能力强、抗光 照变化能力的特征, 不仅能够提高提取出的图像特征的准确性, 且还可适应于 众多常见的目标跟踪与检测技术中的图像特征的提取; 另外,在融合图像颜色 与梯度值的基础上,通过将融合后的矩阵按行展开,将行向量中的向量元素按 照大小进行排序, 并据此得到特征向量,从而使得目标在不同角度具有相近的 特征向量, 增加特征向量的抗旋转能力。 The device provided in this embodiment can describe the target contour of the image because the gradient value is closely related to the object or scene contained in the image, and the size and direction of the color feature on the image itself compared with other features. The dependence of the angle of view is small and has high robustness. Therefore, by extracting the image features with gradient values and color components, features with strong descriptive ability and resistance to illumination can be extracted, which can not only improve extraction. The accuracy of the image features, and can also be adapted to the extraction of image features in many common target tracking and detection techniques; On the basis of the gradient values, the vector elements in the row vector are sorted by size according to the scale, and the feature vectors are obtained according to the result, so that the target has similar feature vectors at different angles, and the feature is added. The anti-rotation ability of the vector.
需要说明的是:上述实施例提供的图像特征的提取装置在提取图像特征时, 仅以上述各功能模块的划分进行举例说明, 实际应用中, 可以根据需要而将上 述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模 块, 以完成以上描述的全部或者部分功能。 另外, 上述实施例提供的图像特征 的提取装置与图像特征的提取方法实施例属于同一构思,其具体实现过程详见 方法实施例, 这里不再赘述。  It should be noted that the image feature extraction device provided in the foregoing embodiment is only illustrated by the division of the above functional modules when extracting image features. In actual applications, the functions may be assigned to different functional modules according to needs. Completion, dividing the internal structure of the device into different functional modules to perform all or part of the functions described above. In addition, the image feature extraction device and the image feature extraction method embodiment provided by the above embodiments are in the same concept, and the specific implementation process is described in detail in the method embodiment, and details are not described herein again.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通 过硬件来完成,也可以通过程序来指令相关的硬件完成, 所述的程序可以存储 于一种计算机可读存储介质中, 上述提到的存储介质可以是只读存储器,磁盘 或光盘等。  A person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium. The storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的 精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的 保护范围之内。  The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., which are within the spirit and scope of the present invention, should be included in the protection of the present invention. Within the scope.

Claims

权 利 要 求 Rights request
1、 一种图像特征的提取方法, 其特征在于, 所述方法包括:  A method for extracting image features, the method comprising:
对待处理图像进行灰度均衡化处理,并在处理后的图像中选取预设组数的 点对;  Performing grayscale equalization processing on the image to be processed, and selecting a pair of preset pairs of points in the processed image;
取第一组点对,并以所述第一组点对中的两个点为中心分别确定预设范围 的第一提取区域和第二提取区域;  Taking a first set of point pairs, and determining a first extraction area and a second extraction area of the preset range respectively by using two of the first set of point pairs;
获取所述第一提取区域范围内各像素的颜色分量,得到所述第一提取区域 对应的颜色量化矩阵, 并获取所述第一提取区域范围内各像素的梯度值,得到 所述第一提取区域对应的梯度矩阵;  Acquiring a color component of each pixel in the first extraction area to obtain a color quantization matrix corresponding to the first extraction area, and acquiring a gradient value of each pixel in the first extraction area to obtain the first extraction The gradient matrix corresponding to the region;
融合所述第一提取区域对应的颜色量化矩阵与梯度矩阵,得到所述第一提 取区域对应的第一融合矩阵;  And merging the color quantization matrix corresponding to the first extraction area and the gradient matrix to obtain a first fusion matrix corresponding to the first extraction area;
按获取所述第一提取区域对应的第一融合矩阵的方式获取所述第二提取 区域对应的第二融合矩阵;  Obtaining, by acquiring the first fusion matrix corresponding to the first extraction area, a second fusion matrix corresponding to the second extraction area;
根据所述第一融合矩阵和第二融合矩阵计算得到所述第一组点对对应的 标量值;  Calculating, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
按第一组点对方式完成其他点对对应的标量值的计算,组合所述预设组数 的点对的标量值, 得到所述待处理图像的特征向量。  The calculation of the corresponding scalar value is performed by other points in the first set of point pairs, and the scalar value of the pair of the preset number is combined to obtain the feature vector of the image to be processed.
1、 根据权利要求 1所述的方法, 其特征在于, 所述获取所述第一提取区 域范围内各像素的颜色分量,得到所述第一提取区域对应的颜色量化矩阵, 具 体包括:  The method according to claim 1, wherein the acquiring a color component of each pixel in the first extraction area to obtain a color quantization matrix corresponding to the first extraction area, specifically includes:
将所述第一提取区域的图像转换到对应的颜色空间,得到所述第一提取区 域范围内每个像素对应的颜色分量;  Converting an image of the first extraction area to a corresponding color space to obtain a color component corresponding to each pixel in the first extraction area;
将每个像素对应的颜色分量加权量化后,得到所述第一提取区域对应的颜 色量化矩阵。  After the color components corresponding to each pixel are weighted and quantized, a color quantization matrix corresponding to the first extraction region is obtained.
3、 根据权利要求 2所述的方法, 其特征在于, 所述将每个像素对应的颜 色分量加权量化后, 得到所述第一提取区域对应的颜色量化矩阵, 具体包括: 通过公式 f = ohh + ass + σνν将每个像素对应的颜色分量加权量化,得到所述 第一提取区域对应的颜色量化矩阵; The method according to claim 2, wherein the color component corresponding to each pixel is weighted and quantized to obtain a color quantization matrix corresponding to the first extraction region, which specifically includes: h h + a s s + σ ν ν weight-quantize the color components corresponding to each pixel to obtain a color quantization matrix corresponding to the first extraction region;
其中, 所述 h为色调, s为饱和度, V为亮度, 所述 σ¾、 as , ^为加权系 数。 Wherein h is a hue, s is a saturation, V is a brightness, and σ 3⁄4 , a s , ^ are weighting systems Number.
4、 根据权利要求 1所述的方法, 其特征在于, 所述获取所第一述提取区 域范围内各像素的梯度值,得到所述第一提取区域对应的梯度矩阵,具体包括: 釆用索贝尔算子中的横向矩阵及纵向矩阵分别与所述第一提取区域范围 内各像素进行卷积运算, 得到横向与纵向的亮度差分近似值;  The method according to claim 1, wherein the acquiring the gradient value of each pixel in the range of the first extraction region to obtain the gradient matrix corresponding to the first extraction region, specifically includes: The horizontal matrix and the vertical matrix in the Bell operator are respectively convoluted with each pixel in the range of the first extraction region to obtain a horizontal and vertical luminance difference approximation;
根据所述横向与纵向的亮度差分近似值得到所述第一提取区域对应的梯 度矩阵。  A gradient matrix corresponding to the first extraction region is obtained according to the luminance difference approximation between the horizontal and vertical directions.
5、 根据权利要求 4所述的方法, 其特征在于, 所述釆用索贝尔算子中的 横向矩阵及纵向矩阵分别与所述第一提取区域范围内各像素进行卷积运算,得 到横向与纵向的亮度差分近似值, 具体包括:  The method according to claim 4, wherein the horizontal matrix and the vertical matrix in the Sobel operator are convoluted with each pixel in the first extraction region to obtain a horizontal The vertical brightness difference approximation includes:
-1 0  -1 0
釆用 索 贝 尔算子中 的横向矩阵 与纵向矩阵
Figure imgf000025_0001
g 分别与所述第一提取区域范围内各像素进行卷积运算,得到横
Figure imgf000025_0002
向亮度差分近似值 = 与纵向亮度差分近似值 1; 其中, 所述 I为 所述第一提取区域范围内的像素; 所述根据所述横向与纵向的亮度差分近似值得到所述第一提取区域对应 的梯度矩阵, 具体包括:
Using Horizontal and Vertical Matrices in Sobel Operators
Figure imgf000025_0001
g performing a convolution operation with each pixel in the range of the first extraction area to obtain a horizontal
Figure imgf000025_0002
The luminance difference approximation value = the longitudinal luminance difference approximation value 1 ; wherein, the I is a pixel in the range of the first extraction region; and the brightness difference approximation according to the horizontal and vertical directions is obtained by the first extraction region The gradient matrix specifically includes:
通过公式 = i + Gy 2得到所述第一提取区域对应的梯度矩阵 Gi¾yThe gradient matrix G i3⁄4y corresponding to the first extraction region is obtained by the formula = i + G y 2 .
6、 根据权利要求 1所述的方法, 其特征在于, 所述融合所述第一提取区 域对应的颜色量化矩阵与梯度矩阵,得到所述第一提取区域对应的第一融合矩 阵, 具体包括: The method according to claim 1, wherein the merging the color quantization matrix corresponding to the first extraction region and the gradient matrix to obtain the first fusion matrix corresponding to the first extraction region comprises:
将所述第一提取区域对应的颜色量化矩阵与梯度矩阵进行乘积运算,得到 所述第一提取区域对应的第一融合矩阵。  And performing a product operation on the color quantization matrix corresponding to the first extraction region and the gradient matrix to obtain a first fusion matrix corresponding to the first extraction region.
7、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述第一融合矩 阵和第二融合矩阵计算得到所述第一组点对对应的标量值, 具体包括: 将所述第一融合矩阵按行展开, 形成行向量; The method according to claim 1, wherein the calculating the scalar value corresponding to the first set of point pairs according to the first fusion matrix and the second fusion matrix comprises: Expanding the first fusion matrix in rows to form a row vector;
将所述行向量中的向量元素按照大小进行排序, 形成新的行向量; 将所述新的行向量中的每个向量的元素值与所述第一提取区域的中心像 素对应的向量的元素值进行比较, 得到第一比较结果;  Sorting vector elements in the row vector by size to form a new row vector; elements of a vector corresponding to an element value of each vector in the new row vector and a center pixel of the first extraction region The values are compared to obtain a first comparison result;
按照所述第一融合矩阵方式处理所述第二融合矩阵, 得到第二比较结果; 通过比较第一比较结果和第二比较结果得到所述第一组点对对应的标量 值。  Processing the second fusion matrix according to the first fusion matrix manner to obtain a second comparison result; obtaining a scalar value corresponding to the first set of point pairs by comparing the first comparison result with the second comparison result.
8、 一种图像特征的提取装置, 其特征在于, 所述装置包括:  8. An apparatus for extracting image features, the apparatus comprising:
处理模块, 用于对待处理图像进行灰度均衡化处理;  a processing module, configured to perform gray level equalization processing on the image to be processed;
选取模块, 用于在所述处理模块处理后的图像中选取预设组数的点对; 确定模块, 用于取第一组点对, 并以所述第一组点对中的两个点为中心分 别确定预设范围的第一提取区域和第二提取区域;  a selection module, configured to select a pair of preset pairs of points in the image processed by the processing module; and a determining module, configured to take a first set of point pairs, and use two points in the first set of point pairs Determining a first extraction area and a second extraction area of a preset range for the center;
第一获取模块, 用于获取所述第一提取区域范围内各像素的颜色分量,得 到所述第一提取区域对应的颜色量化矩阵;  a first obtaining module, configured to acquire color components of each pixel in the first extraction area, and obtain a color quantization matrix corresponding to the first extraction area;
第二获取模块, 用于获取所述第一提取区域范围内各像素的梯度值,得到 所述第一提取区域对应的梯度矩阵;  a second acquiring module, configured to acquire a gradient value of each pixel in the first extraction area, to obtain a gradient matrix corresponding to the first extraction area;
融合模块, 用于融合所述第一提取区域对应的颜色量化矩阵与梯度矩阵, 得到所述第一提取区域对应的第一融合矩阵;  a merging module, configured to combine a color quantization matrix and a gradient matrix corresponding to the first extraction region, to obtain a first fusion matrix corresponding to the first extraction region;
第一重复模块,用于按获取所述第一提取区域对应的第一融合矩阵的方式 获取所述第二提取区域对应的第二融合矩阵;  a first repetition module, configured to acquire, according to the first fusion matrix corresponding to the first extraction area, a second fusion matrix corresponding to the second extraction area;
计算模块,用于根据所述第一融合矩阵和第二融合矩阵计算得到对应第一 组点对的标量值;  a calculation module, configured to calculate, according to the first fusion matrix and the second fusion matrix, a scalar value corresponding to the first set of point pairs;
第二重复模块,用于按第一组点对方式完成其他点对对应的标量值的计算; 组合模块, 用于组合所述预设组数的点对的标量值,得到所述待处理图像 的特征向量。  a second repeating module, configured to perform calculation of a corresponding scalar value of the other point pair according to the first set of point pairs; a combination module, configured to combine the scalar value of the pair of the preset number of points, to obtain the Process the feature vector of the image.
9、 根据权利要求 8所述的装置, 其特征在于, 所述第一获取模块, 具体 包括:  The device according to claim 8, wherein the first acquiring module specifically includes:
转换单元, 用于将所第一述提取区域的图像转换到对应的颜色空间,得到 所述第一提取区域范围内每个像素对应的颜色分量; 获取单元,用于将所述转换单元得到的每个像素对应的颜色分量加权量化 后, 得到所述第一提取区域对应的颜色量化矩阵。 a converting unit, configured to convert an image of the first extraction region to a corresponding color space, to obtain a color component corresponding to each pixel in the first extraction region; And an obtaining unit, configured to weight quantize the color component corresponding to each pixel obtained by the converting unit, to obtain a color quantization matrix corresponding to the first extraction region.
10、 根据权利要求 9所述的装置, 其特征在于, 所述获取单元, 具体用于 通过公式 f = ohh + ass + σνν将每个像素对应的颜色分量加权量化,得到所述第一 提取区域对应的颜色量化矩阵; 其中, 所述 h为色调, s为饱和度, V为亮度, 所述 σ¾、 as , σν为加权系数。 The device according to claim 9, wherein the acquiring unit is specifically configured to weight-quantize the color components corresponding to each pixel by using a formula f = o h h + a s s + σ ν ν a color quantization matrix corresponding to the first extraction region; wherein h is a hue, s is a saturation, V is a luminance, and σ 3⁄4 , a s , and σ ν are weighting coefficients.
11、 根据权利要求 8所述的装置, 其特征在于, 所述第二获取模块, 具体 包括:  The device according to claim 8, wherein the second acquiring module specifically includes:
运算单元,用于釆用索贝尔算子中的横向矩阵及纵向矩阵分别与所述第一 提取区域范围内各像素进行卷积运算, 得到横向与纵向的亮度差分近似值; 获取单元,用于根据所述运算单元得到的横向与纵向的亮度差分近似值得 到所述第一提取区域对应的梯度矩阵。  An operation unit, configured to perform a convolution operation with each of the pixels in the first extraction region by using a horizontal matrix and a vertical matrix in the Sobel operator, to obtain a horizontal and vertical luminance difference approximation; and an acquisition unit, configured to The horizontal and vertical luminance difference approximation obtained by the operation unit obtains a gradient matrix corresponding to the first extraction region.
12、 根据权利要求 11所述的装置, 其特征在于, 所述运算单元, 具体用  The device according to claim 11, wherein the operation unit is specifically used
- 1 0 +1、 f+\ +2 +1 于釆用索贝尔算子中的横向矩阵 -2 0 +2 与纵向矩阵 0 0 0  - 1 0 +1, f+\ +2 +1 The horizontal matrix in the Sobel operator -2 0 +2 and the vertical matrix 0 0 0
-1 0 +1 -1 -2 -1 分别与所述第一提取区域范围内各像素进行卷积运算,得到横向亮度差分近似 值 与纵向亮度差分近似值 Gy = g / ; 其中, 所述 I为所述第一提取区 域范围内的像素; 所述获取单元,具体用于通过公式 = ^^得到所述第一提取区域对 应的梯度矩阵 。 -1 0 +1 -1 -2 -1 are respectively convoluted with each pixel in the first extraction region to obtain a lateral luminance difference approximation and a longitudinal luminance difference approximation G y = g / ; a pixel in the range of the first extraction area; the acquiring unit is specifically configured to obtain a gradient matrix corresponding to the first extraction area by using a formula=^^.
13、 根据权利要求 8所述的装置, 其特征在于, 所述融合模块, 具体用于 将所述第一提取区域对应的颜色量化矩阵与梯度矩阵进行乘积运算,得到所述 第一提取区域对应的第一融合矩阵。  The device according to claim 8, wherein the merging module is configured to perform a product operation on the color quantization matrix corresponding to the first extraction region and the gradient matrix to obtain the first extraction region. The first fusion matrix.
14、根据权利要求 8所述的装置,其特征在于,所述计算模块,具体包括: 展开单元, 用于将所述第一融合矩阵按行展开, 形成行向量;  The device according to claim 8, wherein the calculating module comprises: an unfolding unit, configured to expand the first fusion matrix in a row to form a row vector;
排序单元,用于将所述展开单元展开得到的行向量中的向量元素按照大小 进行排序, 形成新的行向量; 第一比较单元,用于将所述排序单元得到的新的行向量中的每个向量的元 素值与所述第一提取区域的中心像素对应的向量的元素值进行比较,得到第一 比较结果; a sorting unit, configured to sort the vector elements in the row vector obtained by expanding the expansion unit by size, to form a new row vector; a first comparing unit, configured to compare an element value of each vector in the new row vector obtained by the sorting unit with an element value of a vector corresponding to a central pixel of the first extraction region, to obtain a first comparison result ;
重操作单元, 用于按照所述第一融合矩阵方式处理所述第二融合矩阵,得 到第二比较结果;  a re-operation unit, configured to process the second fusion matrix according to the first fusion matrix manner, to obtain a second comparison result;
第二比较单元,用于通过比较第一比较结果和第二比较结果得到所述第一 组点对对应的标量值。  And a second comparing unit, configured to obtain a scalar value corresponding to the first set of point pairs by comparing the first comparison result with the second comparison result.
PCT/CN2013/071183 2012-09-10 2013-01-31 Method and device for extracting image features WO2014036813A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210332125.5 2012-09-10
CN201210332125.5A CN103679169B (en) 2012-09-10 2012-09-10 The extracting method of characteristics of image and device

Publications (1)

Publication Number Publication Date
WO2014036813A1 true WO2014036813A1 (en) 2014-03-13

Family

ID=50236494

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/071183 WO2014036813A1 (en) 2012-09-10 2013-01-31 Method and device for extracting image features

Country Status (2)

Country Link
CN (1) CN103679169B (en)
WO (1) WO2014036813A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250835A (en) * 2016-07-26 2016-12-21 国网福建省电力有限公司 Bird's Nest recognition methods on the transmission line of electricity of feature based identification
CN109190471A (en) * 2018-07-27 2019-01-11 天津大学 The attention model method of video monitoring pedestrian search based on natural language description
CN111753949A (en) * 2019-03-28 2020-10-09 杭州海康威视数字技术股份有限公司 Data block processing method and device and electronic equipment
CN112200878A (en) * 2020-10-12 2021-01-08 长春希达电子技术有限公司 Ink color sequencing method of LED display modules in LED display unit
CN113469928A (en) * 2021-07-09 2021-10-01 西北核技术研究所 Image fusion method based on image gradient comparison, storage medium and terminal equipment
CN117237384A (en) * 2023-11-16 2023-12-15 潍坊科技学院 Visual detection method and system for intelligent agricultural planted crops

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106203448B (en) * 2016-07-08 2019-03-12 南京信息工程大学 A kind of scene classification method based on Nonlinear Scale Space Theory
CN110378376A (en) * 2019-06-12 2019-10-25 西安交通大学 A kind of oil filler object recognition and detection method based on machine vision
CN113291055A (en) * 2021-04-14 2021-08-24 西安理工大学 Artificial intelligent flexographic printing pressure prediction method
CN113409278B (en) * 2021-06-22 2024-04-26 平安健康保险股份有限公司 Image quality detection method, device, equipment and medium
CN114998614B (en) * 2022-08-08 2023-01-24 浪潮电子信息产业股份有限公司 Image processing method, device and equipment and readable storage medium
CN115266538B (en) * 2022-09-30 2022-12-09 维柏思特衬布(南通)有限公司 Woven belt water permeability detection device and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090026879A (en) * 2007-09-11 2009-03-16 한국전자통신연구원 Apparatus and method for abstracting feature to recognition of a face feature based on a color picture
CN101551823A (en) * 2009-04-20 2009-10-07 浙江师范大学 Comprehensive multi-feature image retrieval method
CN101833767A (en) * 2010-05-10 2010-09-15 河南理工大学 Gradient and color characteristics-based automatic straight line matching method in digital image
CN102156888A (en) * 2011-04-27 2011-08-17 西安电子科技大学 Image sorting method based on local colors and distribution characteristics of characteristic points

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100573523C (en) * 2006-12-30 2009-12-23 中国科学院计算技术研究所 A kind of image inquiry method based on marking area

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090026879A (en) * 2007-09-11 2009-03-16 한국전자통신연구원 Apparatus and method for abstracting feature to recognition of a face feature based on a color picture
CN101551823A (en) * 2009-04-20 2009-10-07 浙江师范大学 Comprehensive multi-feature image retrieval method
CN101833767A (en) * 2010-05-10 2010-09-15 河南理工大学 Gradient and color characteristics-based automatic straight line matching method in digital image
CN102156888A (en) * 2011-04-27 2011-08-17 西安电子科技大学 Image sorting method based on local colors and distribution characteristics of characteristic points

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZOU, YU: "Image Retrieval Method based on Color Histogram and Contour Extraction", ELECTRONIC TECHNOLOGY & INFORMATION SCIENCE, CHINA MASTER'S S THESES FULL-TEXT DATABASE, September 2011 (2011-09-01), pages 1138 - 1150 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250835A (en) * 2016-07-26 2016-12-21 国网福建省电力有限公司 Bird's Nest recognition methods on the transmission line of electricity of feature based identification
CN109190471A (en) * 2018-07-27 2019-01-11 天津大学 The attention model method of video monitoring pedestrian search based on natural language description
CN109190471B (en) * 2018-07-27 2021-07-13 天津大学 Attention model method for video monitoring pedestrian search based on natural language description
CN111753949A (en) * 2019-03-28 2020-10-09 杭州海康威视数字技术股份有限公司 Data block processing method and device and electronic equipment
CN111753949B (en) * 2019-03-28 2024-06-07 杭州海康威视数字技术股份有限公司 Data block processing method and device and electronic equipment
CN112200878A (en) * 2020-10-12 2021-01-08 长春希达电子技术有限公司 Ink color sequencing method of LED display modules in LED display unit
CN112200878B (en) * 2020-10-12 2024-04-02 长春希达电子技术有限公司 Ink color sequencing method for LED display modules in LED display unit
CN113469928A (en) * 2021-07-09 2021-10-01 西北核技术研究所 Image fusion method based on image gradient comparison, storage medium and terminal equipment
CN113469928B (en) * 2021-07-09 2023-06-20 西北核技术研究所 Image fusion method based on image gradient comparison, storage medium and terminal equipment
CN117237384A (en) * 2023-11-16 2023-12-15 潍坊科技学院 Visual detection method and system for intelligent agricultural planted crops
CN117237384B (en) * 2023-11-16 2024-02-02 潍坊科技学院 Visual detection method and system for intelligent agricultural planted crops

Also Published As

Publication number Publication date
CN103679169A (en) 2014-03-26
CN103679169B (en) 2016-12-21

Similar Documents

Publication Publication Date Title
WO2014036813A1 (en) Method and device for extracting image features
JP6438403B2 (en) Generation of depth maps from planar images based on combined depth cues
US10872262B2 (en) Information processing apparatus and information processing method for detecting position of object
WO2020125216A1 (en) Pedestrian re-identification method, device, electronic device and computer-readable storage medium
CN103098076B (en) Gesture recognition system for TV control
US7664315B2 (en) Integrated image processor
US7606414B2 (en) Fusion of color space data to extract dominant color
WO2023082784A1 (en) Person re-identification method and apparatus based on local feature attention
CN110097115B (en) Video salient object detection method based on attention transfer mechanism
US20140079319A1 (en) Methods for enhancing images and apparatuses using the same
CN112287866A (en) Human body action recognition method and device based on human body key points
US9401027B2 (en) Method and apparatus for scene segmentation from focal stack images
CN112287867B (en) Multi-camera human body action recognition method and device
CN109791695A (en) Motion vector image block based determines described piece of variance
US10582179B2 (en) Method and apparatus for processing binocular disparity image
WO2018082308A1 (en) Image processing method and terminal
CN107506738A (en) Feature extracting method, image-recognizing method, device and electronic equipment
CN108229281B (en) Neural network generation method, face detection device and electronic equipment
CN111784658A (en) Quality analysis method and system for face image
CN109064444B (en) Track slab disease detection method based on significance analysis
Tien et al. Shot classification of basketball videos and its application in shooting position extraction
CN111708907A (en) Target person query method, device, equipment and storage medium
Ghosal et al. A geometry-sensitive approach for photographic style classification
CN106402717B (en) A kind of AR control method for playing back and intelligent desk lamp
US20220207261A1 (en) Method and apparatus for detecting associated objects

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13834759

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13834759

Country of ref document: EP

Kind code of ref document: A1