WO2019024610A1 - Image recognition method, apparatus, computer device, and readable storage medium - Google Patents

Image recognition method, apparatus, computer device, and readable storage medium Download PDF

Info

Publication number
WO2019024610A1
WO2019024610A1 PCT/CN2018/090970 CN2018090970W WO2019024610A1 WO 2019024610 A1 WO2019024610 A1 WO 2019024610A1 CN 2018090970 W CN2018090970 W CN 2018090970W WO 2019024610 A1 WO2019024610 A1 WO 2019024610A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
feature
preset
matching degree
shape
Prior art date
Application number
PCT/CN2018/090970
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 WO2019024610A1 publication Critical patent/WO2019024610A1/en

Links

Images

Classifications

    • 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/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/68Food, e.g. fruit or vegetables

Definitions

  • the present invention relates to the field of image recognition technology, and in particular to an image recognition method, an image recognition device, a computer device, and a computer readable storage medium.
  • image recognition of food materials is generally implemented based on a neural network model for machine training learning to mark a large number of sample food images, and the following technical defects exist:
  • the present invention aims to solve at least one of the technical problems existing in the prior art or related art.
  • Another object of the present invention is to provide an image recognition apparatus.
  • the technical solution of the first aspect of the present invention provides an image recognition method, including: determining a shape feature of an image to be recognized; extracting a texture feature and a color feature of the image to be recognized; according to the first preset image library The image feature weight table, determining the weight of each texture feature of the image to be identified and the weight of each color feature; the filtering weight is greater than the texture feature and the color feature of the preset weight to form the texture feature set and the color feature set respectively; Determining, according to the shape feature, the texture feature set and the color feature set, a first evolution image corresponding to the image to be identified; comparing a matching degree of the first evolution image with any one of the second preset image library, and determining a matching image of the image to be recognized .
  • the feature of the image to be recognized is extracted, by using the image feature weight table in the first preset image library. Determining the weight of each texture feature of the image to be identified and the weight of each color feature, and then filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively, further optimizing the waiting for Identifying the features extracted from the image is beneficial to improve the recognition accuracy of the image to be recognized.
  • the first evolution image corresponding to the image to be identified is determined according to the shape feature, the texture feature set and the color feature set, and the image to be recognized is further optimized.
  • the main image feature of the image to be recognized is highlighted in the first evolution image, which is beneficial to reduce the matching difficulty by comparing any image in the first evolution image and the second preset image library.
  • Matching degree determine the matching image of the image to be identified, and realize The recognition of the image to be recognized improves the accuracy of the image recognition, and the number of sample images in the second preset image library only needs to include a small number of sample images containing the main image features to realize the recognition of the image to be recognized, and the sample image is reduced. The number saves hardware resources and reduces the difficulty of machine training.
  • the area suggestion frame is divided by the area suggestion network, and the image in the area suggestion frame is the image to be recognized, and the image to be recognized includes the image of the food material and the background image of the position, and is other
  • the image of the object is occluded, and the method of the present invention can screen the image features of the food material, and then obtain the first evolution image, so that the image of the sample material in the second preset image library can be matched, and then the matching degree is compared. To achieve image recognition of the image to be recognized.
  • the preset weight is 0.4
  • the first preset image library is a user's preference library
  • the image feature weight table in the first preset image library is based on any image feature in the first preset image library in all image features.
  • the weight of the image to be identified is determined by the gray level co-occurrence matrix algorithm, and the color feature of the image to be recognized can be extracted by a histogram algorithm.
  • the size of the image to be identified is M ⁇ N
  • the gray level is L
  • G ⁇ 0, 1, 2, ..., L-1 ⁇
  • f(x, y) is the gray of the pixel at the coordinates (x, y).
  • Degree level a co-occurrence matrix of each image is an L ⁇ L matrix T[t ij ] L ⁇ L
  • the elements in T are the spatial relationship of the gray level of the image, Extracted texture features p ij ,
  • the number of values, nk is the number of pixels in the image with a pixel feature value of k, and N is the total number of image pixels.
  • determining a shape feature of the image to be identified includes: extracting a corner feature of the image to be recognized; calculating a matching degree of the corner feature with any shape in the preset shape library to determine a maximum matching degree. Determining whether the maximum matching degree is greater than the first preset matching degree threshold; if it is determined that the maximum matching degree is greater than the first preset matching degree threshold, determining that the shape corresponding to the maximum matching degree is the shape feature of the image to be identified; if determining the maximum matching degree If it is not greater than the first preset matching degree threshold, the corner feature of the image to be recognized is continuously extracted.
  • the maximum matching degree is determined by extracting the corner feature of the image to be recognized, and calculating the matching degree of the corner feature with any shape in the preset shape library, and then the maximum matching degree is greater than the first preset matching.
  • the threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be recognized, the shape feature of the image to be recognized is determined, and the accuracy of the shape feature is determined, which is beneficial to further improve the accuracy of image recognition. .
  • the first preset matching degree threshold is 0.5-0.8, and the corner feature extraction of the image to be identified can be implemented by a Harris corner feature extraction algorithm.
  • the corner response value D is greater than the set threshold and is the local maximum in the neighborhood of the point, the point is extracted as a corner feature.
  • determining, according to the shape feature, the texture feature set, and the color feature set, the first evolution image corresponding to the image to be identified including: constructing a shape space according to the shape feature; randomly selecting the texture feature set The color features in the texture feature and the color feature set are respectively set in the shape space to form a second evolution image; determining whether the second evolution image satisfies the first preset condition; and if the second evolution image satisfies the first pre-determination Setting a condition, determining that the second evolution image is the first evolution image; if it is determined that the second evolution image does not satisfy the first preset condition, then re-selecting the texture feature in the texture feature set and the color feature in the color feature set are sequentially And being disposed in the shape space to form a new second evolution image, wherein the first preset condition is that the maximum matching degree between the second evolution image and the image in the second preset image library is not less than a second preset matching degree threshold And/or
  • the shape space is constructed according to the shape feature, and then the texture feature in the texture feature set and the color feature in the color feature set are randomly selected and sequentially set in the shape space to form a second evolution image, and the second evolution image is improved.
  • the diversity of the evolved image is advantageous for improving the efficiency of image recognition, and is also beneficial for reducing the number of sample images, by judging whether the second evolved image satisfies the first preset condition, and when the second evolved image satisfies the first preset condition, Determining that the second evolution image is the first evolution image, and continuing to form a new second evolution image when the second evolution image does not satisfy the first preset condition, further reducing the first evolution image and the second preset image library
  • the image matching difficulty increases the accuracy of the recognition of the image to be recognized.
  • the second preset matching degree threshold is 0.6-0.9, and the first preset number of thresholds is 8000-11000.
  • determining, according to the shape feature, the texture feature set, and the color feature set, the first evolution image corresponding to the image to be identified including: determining the shape feature, the texture feature set, and the color feature set to initialize a group; mutating, intersecting, and selecting operations are sequentially performed on the initialization group to form an evolutionary group; determining whether the evolutionary group satisfies a second predetermined condition; if the evolutionary group is determined to satisfy the second predetermined condition, determining an image corresponding to the evolved group as The first evolutionary image; if it is determined that the evolutionary group does not satisfy the second predetermined condition, the evolutionary group is used as an initialization group, and the mutation, intersection, and selection operations are sequentially performed, wherein the second preset condition is mutation, intersection, and selection operation.
  • the number of times is not less than the second preset number threshold and/or the maximum matching degree of the image corresponding to the evolution group and the image in the preset image library is not less than the third preset matching degree threshold
  • the second preset number threshold is 8000-11000
  • the third preset matching threshold is 0.6-0.9.
  • the mutation, crossover, and selection operations can be implemented by a differential evolution algorithm.
  • the method further includes: adding the matching image to the first A preset image library and update the image feature weight table.
  • the association between the image feature weight table and the user's preference is realized, and the image to be identified is filtered according to the user's preference.
  • the realization of the image features further improves the accuracy of image recognition of the image to be recognized.
  • the technical solution of the second aspect of the present invention provides an image recognition apparatus, including: a determining unit, configured to determine a shape feature of an image to be recognized; an extracting unit, configured to extract a texture feature and a color feature of the image to be identified; The method is further configured to: determine, according to an image feature weight table in the first preset image library, a weight of each texture feature of the image to be identified and a weight of each color feature; and a screening unit, configured to filter a texture whose weight is greater than a preset weight a feature and a color feature to respectively form a texture feature set and a color feature set; the determining unit is further configured to: determine a first evolution image corresponding to the image to be identified according to the shape feature, the texture feature set, and the color feature set; and the comparing unit is configured to: Comparing the matching degree of the first evolved image with any of the second preset image libraries to determine a matching image of the image to be recognized.
  • the feature of the image to be recognized is extracted, by using the image feature weight table in the first preset image library. Determining the weight of each texture feature of the image to be identified and the weight of each color feature, and then filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively, further optimizing the waiting for Identifying the features extracted from the image is beneficial to improve the recognition accuracy of the image to be recognized.
  • the first evolution image corresponding to the image to be identified is determined according to the shape feature, the texture feature set and the color feature set, and the image to be recognized is further optimized.
  • the main image feature of the image to be recognized is highlighted in the first evolution image, which is beneficial to reduce the matching difficulty by comparing any image in the first evolution image and the second preset image library.
  • Matching degree determine the matching image of the image to be identified, and realize The recognition of the image to be recognized improves the accuracy of the image recognition, and the number of sample images in the second preset image library only needs to include a small number of sample images containing the main image features to realize the recognition of the image to be recognized, and the sample image is reduced. The number saves hardware resources and reduces the difficulty of machine training.
  • the area suggestion frame is divided by the area suggestion network, and the image in the area suggestion frame is the image to be recognized, and the image to be recognized includes the image of the food material and the background image of the position, and is other
  • the image of the object is occluded, and the method of the present invention can screen the image features of the food material, and then obtain the first evolution image, so that the image of the sample material in the second preset image library can be matched, and then the matching degree is compared. To achieve image recognition of the image to be recognized.
  • the preset weight is 0.4
  • the first preset image library is a user's preference library
  • the image feature weight table in the first preset image library is based on any image feature in the first preset image library in all image features.
  • the weight of the image to be identified is determined by the gray level co-occurrence matrix algorithm, and the color feature of the image to be recognized can be extracted by a histogram algorithm.
  • the size of the image to be identified is M ⁇ N
  • the gray level is L
  • G ⁇ 0, 1, 2, ..., L-1 ⁇
  • f(x, y) is the gray of the pixel at the coordinates (x, y).
  • Degree level a co-occurrence matrix of each image is an L ⁇ L matrix T[t ij ] L ⁇ L
  • the elements in T are the spatial relationship of the gray level of the image, Extracted texture features p ij ,
  • the number of values, nk is the number of pixels in the image with a pixel feature value of k, and N is the total number of image pixels.
  • the extracting unit is further configured to: extract a corner feature of the image to be recognized;
  • the image recognition device further includes: a calculating unit, configured to calculate a corner feature and any shape in the preset shape library Matching degree to determine a maximum matching degree;
  • the first determining unit is configured to determine whether the maximum matching degree is greater than the first preset matching degree threshold;
  • the determining unit is further configured to: determine, in the first determining unit, that the maximum matching degree is greater than the first preset
  • the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be identified;
  • the extracting unit is further configured to: when the first determining unit determines that the maximum matching degree is not greater than the first preset matching degree threshold, continue to extract the to-be-identified The corner feature of the image.
  • the maximum matching degree is determined by extracting the corner feature of the image to be recognized, and calculating the matching degree of the corner feature with any shape in the preset shape library, and then the maximum matching degree is greater than the first preset matching.
  • the threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be recognized, the shape feature of the image to be recognized is determined, and the accuracy of the shape feature is determined, which is beneficial to further improve the accuracy of image recognition. .
  • the first preset matching degree threshold is 0.5-0.8, and the corner feature extraction of the image to be identified can be implemented by a Harris corner feature extraction algorithm.
  • the corner response value D is greater than the set threshold and is the local maximum in the neighborhood of the point, the point is extracted as a corner feature.
  • the method further includes: a building unit configured to construct a shape space according to the shape feature; and a selecting unit configured to randomly select the texture feature in the texture feature set and the color feature in the color feature set
  • the second determining unit is configured to determine whether the second evolved image satisfies the first preset condition, and the determining unit is further configured to determine the second evolution in the second determining unit.
  • the selecting unit is further configured to: re-randomly select the texture feature when the second determining unit determines that the second evolved image does not satisfy the first preset condition
  • the texture features in the collection and the color features in the color feature set are respectively disposed in the shape space to form a new second evolution image, wherein the first preset condition is in the second evolution image and the second preset image library.
  • the maximum matching degree of the image is not less than the second preset matching degree threshold and/or the number of judgments is not less than the first preset number of times threshold.
  • the shape space is constructed according to the shape feature, and then the texture feature in the texture feature set and the color feature in the color feature set are randomly selected and sequentially set in the shape space to form a second evolution image, and the second evolution image is improved.
  • the diversity of the evolved image is advantageous for improving the efficiency of image recognition, and is also beneficial for reducing the number of sample images, by judging whether the second evolved image satisfies the first preset condition, and when the second evolved image satisfies the first preset condition, Determining that the second evolution image is the first evolution image, and continuing to form a new second evolution image when the second evolution image does not satisfy the first preset condition, further reducing the first evolution image and the second preset image library
  • the image matching difficulty increases the accuracy of the recognition of the image to be recognized.
  • the second preset matching degree threshold is 0.6-0.9, and the first preset number of thresholds is 8000-11000.
  • the determining unit is further configured to: determine the shape feature, the texture feature set, and the color feature set as an initialization group; and the image recognition device further includes: an operation unit, configured to sequentially perform the initialization group The mutation, the intersection and the selection operation are performed to form an evolutionary group; the third determining unit is configured to determine whether the evolutionary group satisfies the second predetermined condition; and the determining unit is further configured to: when the evolutionary group satisfies the second predetermined condition, the evolutionary group is The corresponding image is determined as a first evolved image; the operation unit is further configured to: when the evolved group does not satisfy the second preset condition, use the evolved group as an initialization group, and continue to perform mutation, crossover, and selection operations, wherein the second pre- The condition that the number of the mutation, the intersection, and the selection operation is not less than the second preset number threshold and/or the maximum matching degree of the image corresponding to the evolution group and the image in the preset image library is not less than the third preset matching degree
  • the second preset number threshold is 8000-11000
  • the third preset matching threshold is 0.6-0.9.
  • the mutation, crossover, and selection operations can be implemented by a differential evolution algorithm.
  • the method further includes: an updating unit, configured to add the matching image to the first preset image library, and update the image feature weight table.
  • the association between the image feature weight table and the user's preference is realized, and the image to be identified is filtered according to the user's preference.
  • the realization of the image features further improves the accuracy of image recognition of the image to be recognized.
  • the technical solution of the third aspect of the present invention provides a computer device including a processor for implementing any one of the technical solutions of the first aspect of the present invention when the processor is configured to execute a computer program stored in the memory.
  • the steps of the image recognition method are described in detail below.
  • the computer device includes a processor, and the processor is configured to implement the steps of the image recognition method according to any one of the technical solutions of the first aspect of the present invention when the computer program stored in the memory is executed, thereby having the above All the beneficial effects of the image recognition method according to any one of the technical solutions of the first aspect of the present invention are not described herein.
  • the technical solution of the fourth aspect of the present invention provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements an image of any one of the technical solutions of the first aspect of the present invention The steps to identify the method.
  • the computer readable storage medium has stored thereon a computer program, and when the computer program is executed by the processor, implements the steps of the image recognition method according to any one of the technical solutions of the first aspect of the present invention, and thus has All the beneficial effects of the image recognition method according to any one of the technical solutions of the first aspect of the present invention are not described herein.
  • FIG. 1 shows a schematic flow chart of an image recognition method according to an embodiment of the present invention
  • FIG. 2 shows a schematic block diagram of an image recognition apparatus in accordance with one embodiment of the present invention
  • FIG. 3 shows a schematic flow chart of an image recognition method according to another embodiment of the present invention.
  • FIG. 1 shows a schematic flow chart of an image recognition method in accordance with one embodiment of the present invention.
  • an image recognition method includes: step S102, determining a shape feature of an image to be recognized; and step S104, extracting a texture feature and a color feature of the image to be identified; and step S106, according to the first Determining an image feature weight table in the image library, determining a weight of each texture feature of the image to be recognized and a weight of each color feature; and in step S108, filtering the texture feature and the color feature that are greater than the preset weight to form a texture respectively a feature set and a color feature set; step S110, determining a first evolved image corresponding to the image to be recognized according to the shape feature, the texture feature set, and the color feature set; and step S112, comparing the first evolved image with the second preset image library The matching degree of an image determines the matching image of the image to be identified.
  • the feature of the image to be recognized is extracted, by using the image feature weight table in the first preset image library. Determining the weight of each texture feature of the image to be identified and the weight of each color feature, and then filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively, further optimizing the waiting for Identifying the features extracted from the image is beneficial to improve the recognition accuracy of the image to be recognized.
  • the first evolution image corresponding to the image to be identified is determined according to the shape feature, the texture feature set and the color feature set, and the image to be recognized is further optimized.
  • the matching degree, the matching image of the image to be identified is determined, and the The recognition of the image to be recognized improves the accuracy of the image recognition, and the number of sample images in the second preset image library only needs to include a small number of sample images containing the main image features to realize the recognition of the image to be recognized, and the sample image is reduced. The number saves hardware resources and reduces the difficulty of machine training.
  • the area suggestion frame is divided by the area suggestion network, and the image in the area suggestion frame is the image to be recognized, and the image to be recognized includes the image of the food material and the background image of the position, and is other
  • the image of the object is occluded, and the method of the present invention can screen the image features of the food material, and then obtain the first evolution image, so that the image of the sample material in the second preset image library can be matched, and then the matching degree is compared. To achieve image recognition of the image to be recognized.
  • the preset weight is 0.4
  • the first preset image library is a user's preference library
  • the image feature weight table in the first preset image library is based on any image feature in the first preset image library in all image features.
  • the weight of the image to be identified is determined by the gray level co-occurrence matrix algorithm, and the color feature of the image to be recognized can be extracted by a histogram algorithm.
  • the size of the image to be identified is M ⁇ N
  • the gray level is L
  • G ⁇ 0, 1, 2, ..., L-1 ⁇
  • f(x, y) is the gray of the pixel at the coordinates (x, y).
  • Degree level a co-occurrence matrix of each image is an L ⁇ L matrix T[t ij ] L ⁇ L
  • the elements in T are the spatial relationship of the gray level of the image, Extracted texture features p ij ,
  • the number of values, nk is the number of pixels in the image with a pixel feature value of k, and N is the total number of image pixels.
  • determining a shape feature of the image to be recognized includes: extracting a corner feature of the image to be recognized; calculating a matching degree of the corner feature with any shape in the preset shape library to determine a maximum matching degree. Determining whether the maximum matching degree is greater than the first preset matching degree threshold; if it is determined that the maximum matching degree is greater than the first preset matching degree threshold, determining that the shape corresponding to the maximum matching degree is the shape feature of the image to be identified; if determining the maximum matching degree If it is not greater than the first preset matching degree threshold, the corner feature of the image to be recognized is continuously extracted.
  • the maximum matching degree is determined by extracting the corner feature of the image to be recognized, the matching degree of the corner feature with any shape in the preset shape library, and then the maximum matching degree is greater than the first preset matching.
  • the threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be recognized, the shape feature of the image to be recognized is determined, and the accuracy of the shape feature is determined, which is beneficial to further improve the accuracy of image recognition. .
  • the first preset matching degree threshold is 0.5-0.8, and the corner feature extraction of the image to be identified can be implemented by a Harris corner feature extraction algorithm.
  • the shape space is constructed according to the shape feature, and then the texture feature in the texture feature set and the color feature in the color feature set are randomly selected and sequentially set in the shape space to form a second evolution image, and the second evolution image is improved.
  • the diversity of the evolved image is advantageous for improving the efficiency of image recognition, and is also beneficial for reducing the number of sample images, by judging whether the second evolved image satisfies the first preset condition, and when the second evolved image satisfies the first preset condition, Determining that the second evolution image is the first evolution image, and continuing to form a new second evolution image when the second evolution image does not satisfy the first preset condition, further reducing the first evolution image and the second preset image library
  • the image matching difficulty increases the accuracy of the recognition of the image to be recognized.
  • the second preset matching degree threshold is 0.6-0.9, and the first preset number of thresholds is 8000-11000.
  • determining, according to the shape feature, the texture feature set, and the color feature set, the first evolution image corresponding to the image to be identified including: determining the shape feature, the texture feature set, and the color feature set to be initialized a group; mutating, intersecting, and selecting operations are sequentially performed on the initialization group to form an evolutionary group; determining whether the evolutionary group satisfies a second predetermined condition; if the evolutionary group is determined to satisfy the second predetermined condition, determining an image corresponding to the evolved group as The first evolutionary image; if it is determined that the evolutionary group does not satisfy the second predetermined condition, the evolutionary group is used as an initialization group, and the mutation, intersection, and selection operations are sequentially performed, wherein the second preset condition is mutation, intersection, and selection operation.
  • the number of times is not less than the second preset number threshold and/or the maximum matching degree of the image corresponding to the evolution group and the image in the preset image library is not less than the third preset matching degree threshold
  • the second preset number threshold is 8000-11000
  • the third preset matching threshold is 0.6-0.9.
  • the mutation, crossover, and selection operations can be implemented by a differential evolution algorithm.
  • the method further includes: adding the matching image to the first A preset image library and update the image feature weight table.
  • the association between the image feature weight table and the user's preference is realized, and the image to be identified is filtered according to the user's preference.
  • the realization of the image features further improves the accuracy of image recognition of the image to be recognized.
  • FIG. 2 shows a schematic block diagram of an image recognition device 200 in accordance with one embodiment of the present invention.
  • an image recognition apparatus 200 includes: a determining unit 204, configured to determine a shape feature of an image to be recognized; and an extracting unit, configured to extract a texture feature and a color feature of the image to be recognized;
  • the determining unit 204 is further configured to: determine, according to the image feature weight table in the first preset image library, the weight of each texture feature of the image to be identified and the weight of each color feature;
  • the screening unit 206 is configured to use the screening weight to be greater than Determining the texture feature and the color feature to form the texture feature set and the color feature set respectively;
  • the determining unit 204 is further configured to: determine the first evolution image corresponding to the image to be identified according to the shape feature, the texture feature set, and the color feature set;
  • the comparing unit 208 is configured to compare the matching degree of any one of the first evolution image and the second preset image library to determine a matching image of the image to be identified.
  • the feature of the image to be recognized is extracted, by using the image feature weight table in the first preset image library. Determining the weight of each texture feature of the image to be identified and the weight of each color feature, and then filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively, further optimizing the waiting for Identifying the features extracted from the image is beneficial to improve the recognition accuracy of the image to be recognized.
  • the first evolution image corresponding to the image to be identified is determined according to the shape feature, the texture feature set and the color feature set, and the image to be recognized is further optimized.
  • the matching degree, the matching image of the image to be identified is determined, and the The recognition of the image to be recognized improves the accuracy of the image recognition, and the number of sample images in the second preset image library only needs to include a small number of sample images containing the main image features to realize the recognition of the image to be recognized, and the sample image is reduced. The number saves hardware resources and reduces the difficulty of machine training.
  • the area suggestion frame is divided by the area suggestion network, and the image in the area suggestion frame is the image to be recognized, and the image to be recognized includes the image of the food material and the background image of the position, and is other
  • the image of the object is occluded, and the method of the present invention can screen the image features of the food material, and then obtain the first evolution image, so that the image of the sample material in the second preset image library can be matched, and then the matching degree is compared. To achieve image recognition of the image to be recognized.
  • the preset weight is 0.4
  • the first preset image library is a user's preference library
  • the image feature weight table in the first preset image library is based on any image feature in the first preset image library in all image features.
  • the weight of the image to be identified is determined by the gray level co-occurrence matrix algorithm, and the color feature of the image to be recognized can be extracted by a histogram algorithm.
  • the size of the image to be identified is M ⁇ N
  • the gray level is L
  • G ⁇ 0, 1, 2, ..., L-1 ⁇
  • f(x, y) is the gray of the pixel at the coordinates (x, y).
  • Degree level a co-occurrence matrix of each image is an L ⁇ L matrix T[t ij ] L ⁇ L
  • the elements in T are the spatial relationship of the gray level of the image, Extracted texture features p ij ,
  • the number of values, nk is the number of pixels in the image with a pixel feature value of k, and N is the total number of image pixels.
  • the extracting unit is further configured to: extract a corner feature of the image to be recognized;
  • the image recognition device 200 further includes: a calculating unit 210, configured to calculate any one of the corner feature and the preset shape library The matching degree of the shape to determine the maximum matching degree;
  • the first determining unit 212 is configured to determine whether the maximum matching degree is greater than the first preset matching degree threshold;
  • the determining unit 204 is further configured to: determine the maximum matching degree in the first determining unit 212 When the value is greater than the first preset matching degree threshold, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be identified;
  • the extracting unit is further configured to: determine, in the first determining unit 212, that the maximum matching degree is not greater than the first preset matching degree threshold.
  • the corner feature of the image to be recognized is continuously extracted.
  • the maximum matching degree is determined by extracting the corner feature of the image to be recognized, the matching degree of the corner feature with any shape in the preset shape library, and then the maximum matching degree is greater than the first preset matching.
  • the threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be recognized, the shape feature of the image to be recognized is determined, and the accuracy of the shape feature is determined, which is beneficial to further improve the accuracy of image recognition. .
  • the first preset matching degree threshold is 0.5-0.8, and the corner feature extraction of the image to be identified can be implemented by a Harris corner feature extraction algorithm.
  • the corner response value D is greater than the set threshold and is the local maximum in the neighborhood of the point, the point is extracted as a corner feature.
  • the method further includes: a construction unit 214, configured to construct a shape space according to the shape feature; and a selection unit 216, configured to randomly select the texture feature and the color feature set in the texture feature set
  • the color features are respectively disposed in the shape space to form a second evolution image
  • the second determining unit 218 is configured to determine whether the second evolution image satisfies the first preset condition
  • the determining unit 204 is further configured to: in the second determining unit 218: determining that the second evolution image is the first evolution image when the second evolution image meets the first preset condition
  • the selecting unit 216 is further configured to: determine, by the second determining unit 218, that the second evolution image does not satisfy the first preset condition And re-randomly selecting the texture features in the texture feature set and the color features in the color feature set are respectively set in the shape space to form a new second evolution image, wherein the first preset condition is the second evolution image and The maximum matching degree of the image in the second preset image library is not less
  • the shape space is constructed according to the shape feature, and then the texture feature in the texture feature set and the color feature in the color feature set are randomly selected and sequentially set in the shape space to form a second evolution image, and the second evolution image is improved.
  • the diversity of the evolved image is advantageous for improving the efficiency of image recognition, and is also beneficial for reducing the number of sample images, by judging whether the second evolved image satisfies the first preset condition, and when the second evolved image satisfies the first preset condition, Determining that the second evolution image is the first evolution image, and continuing to form a new second evolution image when the second evolution image does not satisfy the first preset condition, further reducing the first evolution image and the second preset image library
  • the image matching difficulty increases the accuracy of the recognition of the image to be recognized.
  • the second preset matching degree threshold is 0.6-0.9, and the first preset number of thresholds is 8000-11000.
  • the determining unit 204 is further configured to: determine the shape feature, the texture feature set, and the color feature set as an initialization group; the image recognition apparatus 200 further includes: an operation unit 220, configured to perform initialization The group sequentially performs mutation, crossover, and selection operations to form an evolutionary group.
  • the third determining unit 222 is configured to determine whether the evolved group satisfies the second preset condition.
  • the determining unit 204 is further configured to: meet the second preset condition in the evolved group.
  • the image corresponding to the evolutionary group is determined as the first evolution image; the operation unit 220 is further configured to: when the evolutionary group does not satisfy the second preset condition, use the evolutionary group as the initialization group, and continue to perform mutation, crossover, and selection operations in sequence.
  • the second preset condition is that the number of the mutation, the intersection, and the selection operation is not less than the second preset number threshold and/or the maximum matching degree between the image corresponding to the evolution group and the image in the preset image library is not less than the third pre-predetermined Set the match threshold.
  • the shape feature, the texture feature set, and the color feature set as the initialization group, and then performing multiple mutations, intersections, and selection operations, multiple evolutions are performed to obtain the first evolution image, which further reduces the
  • the matching difficulty of the images in the two preset image libraries improves the accuracy of image recognition and improves the efficiency of image recognition.
  • the second preset number threshold is 8000-11000
  • the third preset matching threshold is 0.6-0.9.
  • the mutation, crossover, and selection operations can be implemented by a differential evolution algorithm.
  • the method further includes: an updating unit 224, configured to add a matching image to the first preset image library, and update the image feature weight table.
  • the association between the image feature weight table and the user's preference is realized, and the image to be identified is filtered according to the user's preference.
  • the realization of the image features further improves the accuracy of image recognition of the image to be recognized.
  • the computer apparatus comprises a processor for performing the steps of the image recognition method according to any one of the embodiments of the present invention described above when executing the computer program stored in the memory.
  • the computer device comprises a processor for performing the steps of the image recognition method according to any of the above-mentioned embodiments of the present invention when executing the computer program stored in the memory, and thus having the above-described implementation of the present invention
  • a processor for performing the steps of the image recognition method according to any of the above-mentioned embodiments of the present invention when executing the computer program stored in the memory, and thus having the above-described implementation of the present invention.
  • a computer readable storage medium according to an embodiment of the present invention, wherein a computer program is stored thereon, and when the computer program is executed by the processor, the steps of the image recognition method according to any one of the embodiments of the present invention described above are implemented.
  • a computer readable storage medium having stored thereon a computer program executed by a processor to implement the steps of the image recognition method of any of the above-described embodiments of the present invention, and thus having the above-described present invention
  • the entire beneficial effects of the image recognition method of any of the embodiments proposed in the embodiments are not described herein.
  • FIG. 3 shows a schematic flow chart of an image recognition method according to another embodiment of the present invention.
  • step S312 the image recognition method according to another embodiment of the present invention, after inputting the food material image in step S302, performing step S304 area suggestion box division, step S306, selecting a certain area suggestion box, step S308, extracting Corner feature, then proceeding to step S312 to match the shape trend in the shape library, step S314, determining the shape feature of the food item, step S318, adding to the initialization group, and performing step S310 in the selected certain area suggestion box, Extracting the color feature and the texture feature, step S318, adding to the initialization group, and then performing step S320 according to the user ingredient preference library, initializing the color feature weight and step S324, initializing the texture feature weight, and performing step S322 after step S320 to filter out the weight is greater than a color feature set of 0.4, after step S324, step S326 is performed to filter out a texture feature set having a weight greater than 0.4, in which the step S328 randomly selects the color feature and the step S330 randomly selects the texture feature, and then proceeds to step S3
  • Image library, evaluating evolution results, step S334, according to The food image library calculates the matching degree, and proceeds to step S336 to determine whether the evaluation condition is satisfied. If the determination is yes, the process proceeds to step S338 to form a first evolution image. If the evaluation condition is not satisfied, the process proceeds to step S328 to re-randomly select the color feature and reselect. Texture features.
  • the present invention provides an image recognition method, apparatus, computer device and readable storage medium, according to a shape feature, a texture feature set and a color feature set according to an image to be recognized. Determining a first evolution image corresponding to the image to be identified, and then comparing a matching degree of the image of the first evolution image with the second preset image library, determining a matching image of the image to be recognized, improving the accuracy of image recognition, and reducing The number of sample images saves hardware resources.
  • the units in the apparatus of the present invention can be combined, divided, and deleted according to actual needs.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • PROM Programmable Read-Only Memory
  • EPROM Erasable Programmable Read Only Memory
  • OTPROM One-Time Programmable Read-Only Memory
  • EEPROM Electronically-Erasable Programmable Read-Only Memory
  • CD-ROM Compact Disc Read-Only Memory

Abstract

An image recognition method, apparatus, computer device, and a readable storage medium, the image recognition method comprising: determining a shape characteristic of an image to be recognized (S102); extracting texture characteristics and color characteristics of the image to be recognized (S104); according to an image characteristic weight table in a first preset image library, determining the weights of each texture characteristic and the weights of each color characteristic of the image to be recognized (S106); screening texture characteristics and color characteristics having weights that are greater than a preset weight so as to form a texture characteristic set and a color characteristic set respectively (S108); according to the shape characteristic, the texture characteristic set, and the color characteristic set, determining a first evolution image corresponding to the image to be recognized (S110); comparing a degree of matching between the first evolution image and any image in a second preset image library, and determining a matching image for the image to be recognized (S112). The present method increases accuracy in image recognition, reduces the number of sample images, and saves hardware resources.

Description

图像识别方法、装置、计算机设备和可读存储介质Image recognition method, device, computer device and readable storage medium
本申请要求于2017年08月04日提交中国专利局、申请号为201710661653.8、发明名称为“图像识别方法、装置、计算机设备和可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application entitled "Image Recognition Method, Apparatus, Computer Equipment, and Readable Storage Medium" by the Chinese Patent Office, the application number is 201710661653.8, which is filed on August 4, 2017. The citations are incorporated herein by reference.
技术领域Technical field
本发明涉及图像识别技术领域,具体而言,涉及一种图像识别方法、一种图像识别装置、一种计算机设备和一种计算机可读存储介质。The present invention relates to the field of image recognition technology, and in particular to an image recognition method, an image recognition device, a computer device, and a computer readable storage medium.
背景技术Background technique
相关技术中,食材图像识别通常基于神经网络模型进行机器训练学习标记大量的样本食材图像来实现,存在以下技术缺陷:In the related art, image recognition of food materials is generally implemented based on a neural network model for machine training learning to mark a large number of sample food images, and the following technical defects exist:
(1)识别同一种食材需要根据摆放位置、食材组合、食材遮挡情况等,标记大量的样本食材图像,样本食材图像数量过大,机器训练学习较困难,图像识别准确度较低。(1) Identifying the same food material According to the placement position, food composition, and food occlusion, a large number of sample food images are marked. The number of sample food images is too large, the machine training is difficult, and the image recognition accuracy is low.
(2)机器训练学习需要投入大量的硬件资源,成本较高。(2) Machine training requires a lot of hardware resources and costs are high.
发明内容Summary of the invention
本发明旨在至少解决现有技术或相关技术中存在的技术问题之一。The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
为此,本发明的一个目的在于提供一种图像识别方法。Accordingly, it is an object of the present invention to provide an image recognition method.
本发明的另一个目的在于提供一种图像识别装置。Another object of the present invention is to provide an image recognition apparatus.
本发明的再一个目的在于提供一种计算机设备。It is still another object of the present invention to provide a computer device.
本发明的又一个目的在于提供一种计算机可读存储介质。It is still another object of the present invention to provide a computer readable storage medium.
为了实现上述目的,本发明的第一方面的技术方案提供了一种图像识别方法,包括:确定待识别图像的形状特征;提取待识别图像的纹理特征 和颜色特征;根据第一预设图像库中的图像特征权重表,确定待识别图像的每一纹理特征的权重和每一颜色特征的权重;筛选权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合;根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像;比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像。In order to achieve the above object, the technical solution of the first aspect of the present invention provides an image recognition method, including: determining a shape feature of an image to be recognized; extracting a texture feature and a color feature of the image to be recognized; according to the first preset image library The image feature weight table, determining the weight of each texture feature of the image to be identified and the weight of each color feature; the filtering weight is greater than the texture feature and the color feature of the preset weight to form the texture feature set and the color feature set respectively; Determining, according to the shape feature, the texture feature set and the color feature set, a first evolution image corresponding to the image to be identified; comparing a matching degree of the first evolution image with any one of the second preset image library, and determining a matching image of the image to be recognized .
在该技术方案中,通过确定待识别图像的形状特征,提取待识别图像的纹理特征和颜色特征,实现了对待识别图像的特征的提取,通过根据第一预设图像库中的图像特征权重表,确定待识别图像的每一纹理特征的权重和每一颜色特征的权重,然后筛选权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合,进一步优化了从待识别图像中提取出来的特征,有利于提高对待识别图像的识别准确度,通过根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,进一步优化了待识别图像,有利于提高对待识别图像的识别准确度,第一进化图像中凸出了待识别图像的主要图像特征,有利于降低匹配难度,通过比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像,实现了对待识别图像的识别,提高了图像识别的准确度,而且第二预设图像库中的样本图像数只需囊括含有主要图像特征的少量样本图像就可以实现对待识别图像的识别,减少了样本图像数,节约了硬件资源,同时也降低了机器训练学习的难度。In the technical solution, by determining the shape feature of the image to be recognized, extracting the texture feature and the color feature of the image to be recognized, the feature of the image to be recognized is extracted, by using the image feature weight table in the first preset image library. Determining the weight of each texture feature of the image to be identified and the weight of each color feature, and then filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively, further optimizing the waiting for Identifying the features extracted from the image is beneficial to improve the recognition accuracy of the image to be recognized. The first evolution image corresponding to the image to be identified is determined according to the shape feature, the texture feature set and the color feature set, and the image to be recognized is further optimized. It is beneficial to improve the recognition accuracy of the image to be recognized, and the main image feature of the image to be recognized is highlighted in the first evolution image, which is beneficial to reduce the matching difficulty by comparing any image in the first evolution image and the second preset image library. Matching degree, determine the matching image of the image to be identified, and realize The recognition of the image to be recognized improves the accuracy of the image recognition, and the number of sample images in the second preset image library only needs to include a small number of sample images containing the main image features to realize the recognition of the image to be recognized, and the sample image is reduced. The number saves hardware resources and reduces the difficulty of machine training.
具体地,以食材为例,以区域建议网络划分区域建议框,区域建议框内的图像即待识别图像,这个待识别图像里包括有食材的图像还有所处位置的背景图像,以及被其他物品遮挡的图像,而本发明的方法,可以将食材的图像特征筛选出来,然后得到第一进化图像,这样就可以跟第二预设图像库中的样本食材图像匹配,然后通过比较匹配度,来实现对待识别图像的图像识别。Specifically, taking the food material as an example, the area suggestion frame is divided by the area suggestion network, and the image in the area suggestion frame is the image to be recognized, and the image to be recognized includes the image of the food material and the background image of the position, and is other The image of the object is occluded, and the method of the present invention can screen the image features of the food material, and then obtain the first evolution image, so that the image of the sample material in the second preset image library can be matched, and then the matching degree is compared. To achieve image recognition of the image to be recognized.
其中,预设权重为0.4,第一预设图像库是用户的偏好库,第一预设图像库中的图像特征权重表是根据第一预设图像库中的任一图像特征在所有图像特征中的比重确定的,待识别图像的纹理特征提取可以通过灰度共生矩阵算法来实现,待识别图像的颜色特征的提取可以通过直方图算法来实 现。Wherein, the preset weight is 0.4, the first preset image library is a user's preference library, and the image feature weight table in the first preset image library is based on any image feature in the first preset image library in all image features. The weight of the image to be identified is determined by the gray level co-occurrence matrix algorithm, and the color feature of the image to be recognized can be extracted by a histogram algorithm.
待识别图像的纹理特征提取的具体过程如下:The specific process of texture feature extraction of the image to be identified is as follows:
假设待识别图像的大小为M×N,灰度级为L,G={0,1,2……,L-1},f(x,y)是坐标(x,y)处像素的灰度级,每幅图像的一个共生矩阵是一个L×L的矩阵T[t ij] L×L,T中的元素是图像灰度级的空间关系,
Figure PCTCN2018090970-appb-000001
提取的纹理特征p ij
Figure PCTCN2018090970-appb-000002
Suppose the size of the image to be identified is M×N, the gray level is L, G={0, 1, 2, ..., L-1}, and f(x, y) is the gray of the pixel at the coordinates (x, y). Degree level, a co-occurrence matrix of each image is an L × L matrix T[t ij ] L × L , the elements in T are the spatial relationship of the gray level of the image,
Figure PCTCN2018090970-appb-000001
Extracted texture features p ij ,
Figure PCTCN2018090970-appb-000002
待识别图像的颜色特征的提取的具体过程如下:The specific process of extracting the color features of the image to be identified is as follows:
提取颜色特征H(k),H(k)=nk/N,(k=0,1,……,L-1),其中,k是图像的像素特征取值,L是图像的像素特征可取值的个数,nk是图像中具有像素特征取值为k的像素的个数,N是图像像素的总数。Extract the color features H(k), H(k)=nk/N, (k=0,1,...,L-1), where k is the pixel feature value of the image, and L is the pixel feature of the image. The number of values, nk is the number of pixels in the image with a pixel feature value of k, and N is the total number of image pixels.
在上述技术方案中,优选地,确定待识别图像的形状特征,包括:提取待识别图像的角点特征;计算角点特征与预设形状库中任一形状的匹配度,以确定最大匹配度;判断最大匹配度是否大于第一预设匹配度阈值;若判定最大匹配度大于第一预设匹配度阈值,则确定最大匹配度对应的形状为待识别图像的形状特征;若判定最大匹配度不大于第一预设匹配度阈值,则继续提取待识别图像的角点特征。In the above technical solution, preferably, determining a shape feature of the image to be identified includes: extracting a corner feature of the image to be recognized; calculating a matching degree of the corner feature with any shape in the preset shape library to determine a maximum matching degree. Determining whether the maximum matching degree is greater than the first preset matching degree threshold; if it is determined that the maximum matching degree is greater than the first preset matching degree threshold, determining that the shape corresponding to the maximum matching degree is the shape feature of the image to be identified; if determining the maximum matching degree If it is not greater than the first preset matching degree threshold, the corner feature of the image to be recognized is continuously extracted.
在该技术方案中,通过提取待识别图像的角点特征,计算角点特征与预设形状库中任一形状的匹配度,来确定最大匹配度,然后在最大匹配度大于第一预设匹配度阈值时,确定最大匹配度对应的形状为待识别图像的形状特征,实现了待识别图像的形状特征的确定,而且形状特征的确定的准确度较高,有利于进一步提高图像识别的准确度。In the technical solution, the maximum matching degree is determined by extracting the corner feature of the image to be recognized, and calculating the matching degree of the corner feature with any shape in the preset shape library, and then the maximum matching degree is greater than the first preset matching. When the threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be recognized, the shape feature of the image to be recognized is determined, and the accuracy of the shape feature is determined, which is beneficial to further improve the accuracy of image recognition. .
其中,第一预设匹配度阈值为0.5-0.8,待识别图像的角点特征提取可以通过Harris角点特征提取算法来实现。The first preset matching degree threshold is 0.5-0.8, and the corner feature extraction of the image to be identified can be implemented by a Harris corner feature extraction algorithm.
待识别图像的角点特征提取的具体过程如下:The specific process of corner feature extraction of the image to be identified is as follows:
定义2×2的Harris矩阵,
Figure PCTCN2018090970-appb-000003
其中,C x和C y分别为点x=(x,y)在x和y方向上的强度信息的一阶导数,ω(x,y)为对应位置的权重,通过计算Harris矩阵的角点响应值D来判断 是否为角点特征,D=det A-m(traceA) 2=(ac-b) 2-m(a+c) 2,其中,det和trace为行列式和迹的操作符,m是取值为0.04-0.06的常数,当角点响应值D大于设置的门限,且为该点邻域内的局部最大值时,就把该点提取为角点特征。
Define a 2×2 Harris matrix,
Figure PCTCN2018090970-appb-000003
Where C x and C y are the first derivative of the intensity information of the point x=(x, y) in the x and y directions, respectively, and ω(x, y) is the weight of the corresponding position, by calculating the corner point of the Harris matrix The response value D is used to determine whether it is a corner feature, D=det Am(traceA) 2 =(ac-b) 2 -m(a+c) 2 , where det and trace are determinant and trace operators, m It is a constant with a value of 0.04-0.06. When the corner response value D is greater than the set threshold and is the local maximum in the neighborhood of the point, the point is extracted as a corner feature.
在上述任一项技术方案中,优选地,根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,包括:根据形状特征,构建形状空间;随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内,以形成第二进化图像;判断第二进化图像是否满足第一预设条件;若判定第二进化图像满足第一预设条件,则确定第二进化图像为第一进化图像;若判定第二进化图像不满足第一预设条件,则重新随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内,以形成新的第二进化图像,其中,第一预设条件为第二进化图像与第二预设图像库中的图像的最大匹配度不小于第二预设匹配度阈值和/或判断次数不小于第一预设次数阈值。In any one of the foregoing technical solutions, preferably, determining, according to the shape feature, the texture feature set, and the color feature set, the first evolution image corresponding to the image to be identified, including: constructing a shape space according to the shape feature; randomly selecting the texture feature set The color features in the texture feature and the color feature set are respectively set in the shape space to form a second evolution image; determining whether the second evolution image satisfies the first preset condition; and if the second evolution image satisfies the first pre-determination Setting a condition, determining that the second evolution image is the first evolution image; if it is determined that the second evolution image does not satisfy the first preset condition, then re-selecting the texture feature in the texture feature set and the color feature in the color feature set are sequentially And being disposed in the shape space to form a new second evolution image, wherein the first preset condition is that the maximum matching degree between the second evolution image and the image in the second preset image library is not less than a second preset matching degree threshold And/or the number of judgments is not less than the first preset number of thresholds.
在该技术方案中,根据形状特征,构建形状空间,然后随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内来形成第二进化图像,提升了第二进化图像的多样性,有利于提高图像识别的效率,也有利于减少样本图像数,通过判断第二进化图像是否满足第一预设条件,并在第二进化图像满足第一预设条件时,确定第二进化图像为第一进化图像,在第二进化图像不满足第一预设条件时,继续形成新的第二进化图像,进一步降低了第一进化图像与第二预设图像库中的图像匹配难度,从而提高了对待识别图像的识别的准确度。In the technical solution, the shape space is constructed according to the shape feature, and then the texture feature in the texture feature set and the color feature in the color feature set are randomly selected and sequentially set in the shape space to form a second evolution image, and the second evolution image is improved. The diversity of the evolved image is advantageous for improving the efficiency of image recognition, and is also beneficial for reducing the number of sample images, by judging whether the second evolved image satisfies the first preset condition, and when the second evolved image satisfies the first preset condition, Determining that the second evolution image is the first evolution image, and continuing to form a new second evolution image when the second evolution image does not satisfy the first preset condition, further reducing the first evolution image and the second preset image library The image matching difficulty increases the accuracy of the recognition of the image to be recognized.
其中,第二预设匹配度阈值为0.6-0.9,第一预设次数阈值为8000-11000。The second preset matching degree threshold is 0.6-0.9, and the first preset number of thresholds is 8000-11000.
在上述任一项技术方案中,优选地,根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,包括:确定形状特征、纹理特征集合和颜色特征集合为初始化群体;对初始化群体依次进行变异、交叉和选择操作,以形成进化群体;判断进化群体是否满足第二预设条件;若判定进化群体满足第二预设条件,则将进化群体对应的图像确定为第一进化图像;若判定进化群体不满足第二预设条件,则将进化群体 作为初始化群体,继续依次进行变异、交叉和选择操作,其中,第二预设条件为变异、交叉和选择操作的次数不小于第二预设次数阈值和/或进化群体对应的图像与预设图像库中的图像的最大匹配度不小于第三预设匹配度阈值。In any one of the foregoing technical solutions, preferably, determining, according to the shape feature, the texture feature set, and the color feature set, the first evolution image corresponding to the image to be identified, including: determining the shape feature, the texture feature set, and the color feature set to initialize a group; mutating, intersecting, and selecting operations are sequentially performed on the initialization group to form an evolutionary group; determining whether the evolutionary group satisfies a second predetermined condition; if the evolutionary group is determined to satisfy the second predetermined condition, determining an image corresponding to the evolved group as The first evolutionary image; if it is determined that the evolutionary group does not satisfy the second predetermined condition, the evolutionary group is used as an initialization group, and the mutation, intersection, and selection operations are sequentially performed, wherein the second preset condition is mutation, intersection, and selection operation. The number of times is not less than the second preset number threshold and/or the maximum matching degree of the image corresponding to the evolution group and the image in the preset image library is not less than the third preset matching degree threshold.
在该技术方案中,通过确定形状特征、纹理特征集合和颜色特征集合为初始化群体,然后进行多次变异、交叉和选择操作,实现多次进化,来得到第一进化图像,进一步降低了与第二预设图像库中的图像的匹配难度,提高了图像识别的准确度,同时也提高了图像识别的效率。In the technical solution, by determining shape features, texture feature sets, and color feature sets as initialization groups, and then performing multiple mutations, intersections, and selection operations, multiple evolutions are performed to obtain a first evolution image, which further reduces The matching difficulty of the images in the two preset image libraries improves the accuracy of image recognition and improves the efficiency of image recognition.
其中,第二预设次数阈值为8000-11000,第三预设匹配度阈值为0.6-0.9,变异、交叉和选择操作可以通过差分进化算法来实现。The second preset number threshold is 8000-11000, and the third preset matching threshold is 0.6-0.9. The mutation, crossover, and selection operations can be implemented by a differential evolution algorithm.
具体地,从初始化群体中随机选择3个样本,x p1,x p2,x p3,变异操作v ij(t+1)=x p1j(t)+η(x p2j(t)‐x p3j(t))其中,x p2j(t)‐x p3j(t)为差异化向量,η为缩放因子,交叉操作
Figure PCTCN2018090970-appb-000004
其中,randl ij是在[0,1]之间的随机小数,CR为交叉概率,CR∈[0,1],rand(i)是在[1,n]之间的随机整数,这种交叉操作的策略可以确保x i(t+1)至少有一份量由x i(t)的相应分量贡献,选择操作,
Figure PCTCN2018090970-appb-000005
Specifically, three samples are randomly selected from the initialization population, x p1 , x p2 , x p3 , and the mutation operation v ij (t+1)=x p1j (t)+η(x p2j (t)‐x p3j (t )) where x p2j (t)‐x p3j (t) is the differentiation vector, η is the scaling factor, cross operation
Figure PCTCN2018090970-appb-000004
Where randl ij is a random fraction between [0,1], CR is the crossover probability, CR∈[0,1], rand(i) is a random integer between [1,n], this intersection The strategy of operation can ensure that x i (t+1) has at least one quantity contributed by the corresponding component of x i (t), the selection operation,
Figure PCTCN2018090970-appb-000005
在上述任一项技术方案中,优选地,在比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像之后,还包括:增加匹配图像至第一预设图像库,并更新图像特征权重表。In any one of the above aspects, preferably, after comparing the matching degree of any one of the first evolution image and the second preset image library to determine the matching image of the image to be identified, the method further includes: adding the matching image to the first A preset image library and update the image feature weight table.
在该技术方案中,通过增加匹配图像至第一预设图像库,并更新图像特征权重表,实现了将图像特征权重表跟用户的偏好的关联,有利于根据用户的偏好来筛选待识别图像的图像特征的实现,进一步提高了对待识别图像的图像识别的准确度。In the technical solution, by adding the matching image to the first preset image library and updating the image feature weight table, the association between the image feature weight table and the user's preference is realized, and the image to be identified is filtered according to the user's preference. The realization of the image features further improves the accuracy of image recognition of the image to be recognized.
本发明的第二方面的技术方案提供了一种图像识别装置,包括:确定单元,用于确定待识别图像的形状特征;提取单元,用于提取待识别图像的纹理特征和颜色特征;确定单元还用于:根据第一预设图像库中的图像特征权重表,确定待识别图像的每一纹理特征的权重和每一颜色特征的权重;筛选单元,用于筛选权重大于预设权重的纹理特征和颜色特征,以分 别形成纹理特征集合和颜色特征集合;确定单元还用于:根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像;比较单元,用于比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像。The technical solution of the second aspect of the present invention provides an image recognition apparatus, including: a determining unit, configured to determine a shape feature of an image to be recognized; an extracting unit, configured to extract a texture feature and a color feature of the image to be identified; The method is further configured to: determine, according to an image feature weight table in the first preset image library, a weight of each texture feature of the image to be identified and a weight of each color feature; and a screening unit, configured to filter a texture whose weight is greater than a preset weight a feature and a color feature to respectively form a texture feature set and a color feature set; the determining unit is further configured to: determine a first evolution image corresponding to the image to be identified according to the shape feature, the texture feature set, and the color feature set; and the comparing unit is configured to: Comparing the matching degree of the first evolved image with any of the second preset image libraries to determine a matching image of the image to be recognized.
在该技术方案中,通过确定待识别图像的形状特征,提取待识别图像的纹理特征和颜色特征,实现了对待识别图像的特征的提取,通过根据第一预设图像库中的图像特征权重表,确定待识别图像的每一纹理特征的权重和每一颜色特征的权重,然后筛选权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合,进一步优化了从待识别图像中提取出来的特征,有利于提高对待识别图像的识别准确度,通过根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,进一步优化了待识别图像,有利于提高对待识别图像的识别准确度,第一进化图像中凸出了待识别图像的主要图像特征,有利于降低匹配难度,通过比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像,实现了对待识别图像的识别,提高了图像识别的准确度,而且第二预设图像库中的样本图像数只需囊括含有主要图像特征的少量样本图像就可以实现对待识别图像的识别,减少了样本图像数,节约了硬件资源,同时也降低了机器训练学习的难度。In the technical solution, by determining the shape feature of the image to be recognized, extracting the texture feature and the color feature of the image to be recognized, the feature of the image to be recognized is extracted, by using the image feature weight table in the first preset image library. Determining the weight of each texture feature of the image to be identified and the weight of each color feature, and then filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively, further optimizing the waiting for Identifying the features extracted from the image is beneficial to improve the recognition accuracy of the image to be recognized. The first evolution image corresponding to the image to be identified is determined according to the shape feature, the texture feature set and the color feature set, and the image to be recognized is further optimized. It is beneficial to improve the recognition accuracy of the image to be recognized, and the main image feature of the image to be recognized is highlighted in the first evolution image, which is beneficial to reduce the matching difficulty by comparing any image in the first evolution image and the second preset image library. Matching degree, determine the matching image of the image to be identified, and realize The recognition of the image to be recognized improves the accuracy of the image recognition, and the number of sample images in the second preset image library only needs to include a small number of sample images containing the main image features to realize the recognition of the image to be recognized, and the sample image is reduced. The number saves hardware resources and reduces the difficulty of machine training.
具体地,以食材为例,以区域建议网络划分区域建议框,区域建议框内的图像即待识别图像,这个待识别图像里包括有食材的图像还有所处位置的背景图像,以及被其他物品遮挡的图像,而本发明的方法,可以将食材的图像特征筛选出来,然后得到第一进化图像,这样就可以跟第二预设图像库中的样本食材图像匹配,然后通过比较匹配度,来实现对待识别图像的图像识别。Specifically, taking the food material as an example, the area suggestion frame is divided by the area suggestion network, and the image in the area suggestion frame is the image to be recognized, and the image to be recognized includes the image of the food material and the background image of the position, and is other The image of the object is occluded, and the method of the present invention can screen the image features of the food material, and then obtain the first evolution image, so that the image of the sample material in the second preset image library can be matched, and then the matching degree is compared. To achieve image recognition of the image to be recognized.
其中,预设权重为0.4,第一预设图像库是用户的偏好库,第一预设图像库中的图像特征权重表是根据第一预设图像库中的任一图像特征在所有图像特征中的比重确定的,待识别图像的纹理特征提取可以通过灰度共生矩阵算法来实现,待识别图像的颜色特征的提取可以通过直方图算法来实现。Wherein, the preset weight is 0.4, the first preset image library is a user's preference library, and the image feature weight table in the first preset image library is based on any image feature in the first preset image library in all image features. The weight of the image to be identified is determined by the gray level co-occurrence matrix algorithm, and the color feature of the image to be recognized can be extracted by a histogram algorithm.
待识别图像的纹理特征提取的具体过程如下:The specific process of texture feature extraction of the image to be identified is as follows:
假设待识别图像的大小为M×N,灰度级为L,G={0,1,2……,L-1},f(x,y)是坐标(x,y)处像素的灰度级,每幅图像的一个共生矩阵是一个L×L的矩阵T[t ij] L×L,T中的元素是图像灰度级的空间关系,
Figure PCTCN2018090970-appb-000006
提取的纹理特征p ij
Figure PCTCN2018090970-appb-000007
Suppose the size of the image to be identified is M×N, the gray level is L, G={0, 1, 2, ..., L-1}, and f(x, y) is the gray of the pixel at the coordinates (x, y). Degree level, a co-occurrence matrix of each image is an L × L matrix T[t ij ] L × L , the elements in T are the spatial relationship of the gray level of the image,
Figure PCTCN2018090970-appb-000006
Extracted texture features p ij ,
Figure PCTCN2018090970-appb-000007
待识别图像的颜色特征的提取的具体过程如下:The specific process of extracting the color features of the image to be identified is as follows:
提取颜色特征H(k),H(k)=nk/N,(k=0,1,……,L-1),其中,k是图像的像素特征取值,L是图像的像素特征可取值的个数,nk是图像中具有像素特征取值为k的像素的个数,N是图像像素的总数。Extract the color features H(k), H(k)=nk/N, (k=0,1,...,L-1), where k is the pixel feature value of the image, and L is the pixel feature of the image. The number of values, nk is the number of pixels in the image with a pixel feature value of k, and N is the total number of image pixels.
在上述技术方案中,优选地,提取单元还用于:提取待识别图像的角点特征;图像识别装置,还包括:计算单元,用于计算角点特征与预设形状库中任一形状的匹配度,以确定最大匹配度;第一判断单元,用于判断最大匹配度是否大于第一预设匹配度阈值;确定单元还用于:在第一判断单元判定最大匹配度大于第一预设匹配度阈值时,确定最大匹配度对应的形状为待识别图像的形状特征;提取单元还用于:在第一判断单元判定最大匹配度不大于第一预设匹配度阈值时,继续提取待识别图像的角点特征。In the above technical solution, preferably, the extracting unit is further configured to: extract a corner feature of the image to be recognized; the image recognition device further includes: a calculating unit, configured to calculate a corner feature and any shape in the preset shape library Matching degree to determine a maximum matching degree; the first determining unit is configured to determine whether the maximum matching degree is greater than the first preset matching degree threshold; the determining unit is further configured to: determine, in the first determining unit, that the maximum matching degree is greater than the first preset When the matching degree threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be identified; the extracting unit is further configured to: when the first determining unit determines that the maximum matching degree is not greater than the first preset matching degree threshold, continue to extract the to-be-identified The corner feature of the image.
在该技术方案中,通过提取待识别图像的角点特征,计算角点特征与预设形状库中任一形状的匹配度,来确定最大匹配度,然后在最大匹配度大于第一预设匹配度阈值时,确定最大匹配度对应的形状为待识别图像的形状特征,实现了待识别图像的形状特征的确定,而且形状特征的确定的准确度较高,有利于进一步提高图像识别的准确度。In the technical solution, the maximum matching degree is determined by extracting the corner feature of the image to be recognized, and calculating the matching degree of the corner feature with any shape in the preset shape library, and then the maximum matching degree is greater than the first preset matching. When the threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be recognized, the shape feature of the image to be recognized is determined, and the accuracy of the shape feature is determined, which is beneficial to further improve the accuracy of image recognition. .
其中,第一预设匹配度阈值为0.5-0.8,待识别图像的角点特征提取可以通过Harris角点特征提取算法来实现。The first preset matching degree threshold is 0.5-0.8, and the corner feature extraction of the image to be identified can be implemented by a Harris corner feature extraction algorithm.
待识别图像的角点特征提取的具体过程如下:The specific process of corner feature extraction of the image to be identified is as follows:
定义2×2的Harris矩阵,
Figure PCTCN2018090970-appb-000008
其中,C x和C y分别为点x=(x,y)在x和y方向上的强度信息的一阶导数,ω(x,y)为对应位置的权重,通过计算Harris矩阵的角点响应值D来判断是否为角点特征,D=det A-m(traceA) 2=(ac-b) 2-m(a+c) 2,其中,det和trace 为行列式和迹的操作符,m是取值为0.04-0.06的常数,当角点响应值D大于设置的门限,且为该点邻域内的局部最大值时,就把该点提取为角点特征。
Define a 2×2 Harris matrix,
Figure PCTCN2018090970-appb-000008
Where C x and C y are the first derivative of the intensity information of the point x=(x, y) in the x and y directions, respectively, and ω(x, y) is the weight of the corresponding position, by calculating the corner point of the Harris matrix The response value D is used to determine whether it is a corner feature, D=det Am(traceA) 2 =(ac-b) 2 -m(a+c) 2 , where det and trace are determinant and trace operators, m It is a constant with a value of 0.04-0.06. When the corner response value D is greater than the set threshold and is the local maximum in the neighborhood of the point, the point is extracted as a corner feature.
在上述任一项技术方案中,优选地,还包括:构建单元,用于根据形状特征,构建形状空间;选择单元,用于随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内,以形成第二进化图像;第二判断单元,用于判断第二进化图像是否满足第一预设条件;确定单元还用于:在第二判断单元判定第二进化图像满足第一预设条件时,确定第二进化图像为第一进化图像;选择单元还用于:在第二判断单元判定第二进化图像不满足第一预设条件时,重新随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内,以形成新的第二进化图像,其中,第一预设条件为第二进化图像与第二预设图像库中的图像的最大匹配度不小于第二预设匹配度阈值和/或判断次数不小于第一预设次数阈值。In any one of the above aspects, preferably, the method further includes: a building unit configured to construct a shape space according to the shape feature; and a selecting unit configured to randomly select the texture feature in the texture feature set and the color feature in the color feature set The second determining unit is configured to determine whether the second evolved image satisfies the first preset condition, and the determining unit is further configured to determine the second evolution in the second determining unit. When the image satisfies the first preset condition, determining that the second evolved image is the first evolved image; the selecting unit is further configured to: re-randomly select the texture feature when the second determining unit determines that the second evolved image does not satisfy the first preset condition The texture features in the collection and the color features in the color feature set are respectively disposed in the shape space to form a new second evolution image, wherein the first preset condition is in the second evolution image and the second preset image library. The maximum matching degree of the image is not less than the second preset matching degree threshold and/or the number of judgments is not less than the first preset number of times threshold.
在该技术方案中,根据形状特征,构建形状空间,然后随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内来形成第二进化图像,提升了第二进化图像的多样性,有利于提高图像识别的效率,也有利于减少样本图像数,通过判断第二进化图像是否满足第一预设条件,并在第二进化图像满足第一预设条件时,确定第二进化图像为第一进化图像,在第二进化图像不满足第一预设条件时,继续形成新的第二进化图像,进一步降低了第一进化图像与第二预设图像库中的图像匹配难度,从而提高了对待识别图像的识别的准确度。In the technical solution, the shape space is constructed according to the shape feature, and then the texture feature in the texture feature set and the color feature in the color feature set are randomly selected and sequentially set in the shape space to form a second evolution image, and the second evolution image is improved. The diversity of the evolved image is advantageous for improving the efficiency of image recognition, and is also beneficial for reducing the number of sample images, by judging whether the second evolved image satisfies the first preset condition, and when the second evolved image satisfies the first preset condition, Determining that the second evolution image is the first evolution image, and continuing to form a new second evolution image when the second evolution image does not satisfy the first preset condition, further reducing the first evolution image and the second preset image library The image matching difficulty increases the accuracy of the recognition of the image to be recognized.
其中,第二预设匹配度阈值为0.6-0.9,第一预设次数阈值为8000-11000。The second preset matching degree threshold is 0.6-0.9, and the first preset number of thresholds is 8000-11000.
在上述任一项技术方案中,优选地,确定单元还用于:确定形状特征、纹理特征集合和颜色特征集合为初始化群体;图像识别装置,还包括:操作单元,用于对初始化群体依次进行变异、交叉和选择操作,以形成进化群体;第三判断单元,用于判断进化群体是否满足第二预设条件;确定单元还用于:在进化群体满足第二预设条件时,将进化群体对应的图像确定为第一进化图像;操作单元还用于:在进化群体不满足第二预设条件时, 将进化群体作为初始化群体,继续依次进行变异、交叉和选择操作,其中,第二预设条件为变异、交叉和选择操作的次数不小于第二预设次数阈值和/或进化群体对应的图像与预设图像库中的图像的最大匹配度不小于第三预设匹配度阈值。In any one of the above aspects, preferably, the determining unit is further configured to: determine the shape feature, the texture feature set, and the color feature set as an initialization group; and the image recognition device further includes: an operation unit, configured to sequentially perform the initialization group The mutation, the intersection and the selection operation are performed to form an evolutionary group; the third determining unit is configured to determine whether the evolutionary group satisfies the second predetermined condition; and the determining unit is further configured to: when the evolutionary group satisfies the second predetermined condition, the evolutionary group is The corresponding image is determined as a first evolved image; the operation unit is further configured to: when the evolved group does not satisfy the second preset condition, use the evolved group as an initialization group, and continue to perform mutation, crossover, and selection operations, wherein the second pre- The condition that the number of the mutation, the intersection, and the selection operation is not less than the second preset number threshold and/or the maximum matching degree of the image corresponding to the evolution group and the image in the preset image library is not less than the third preset matching degree threshold.
在该技术方案中,通过确定形状特征、纹理特征集合和颜色特征集合为初始化群体,然后进行多次变异、交叉和选择操作,实现多次进化,来得到第一进化图像,进一步降低了与第二预设图像库中的图像的匹配难度,提高了图像识别的准确度,同时也提高了图像识别的效率。In the technical solution, by determining shape features, texture feature sets, and color feature sets as initialization groups, and then performing multiple mutations, intersections, and selection operations, multiple evolutions are performed to obtain a first evolution image, which further reduces The matching difficulty of the images in the two preset image libraries improves the accuracy of image recognition and improves the efficiency of image recognition.
其中,第二预设次数阈值为8000-11000,第三预设匹配度阈值为0.6-0.9,变异、交叉和选择操作可以通过差分进化算法来实现。The second preset number threshold is 8000-11000, and the third preset matching threshold is 0.6-0.9. The mutation, crossover, and selection operations can be implemented by a differential evolution algorithm.
具体地,从初始化群体中随机选择3个样本,x p1,x p2,x p3,变异操作v ij(t+1)=x p1j(t)+η(x p2j(t)‐x p3j(t))其中,x p2j(t)‐x p3j(t)为差异化向量,η为缩放因子,交叉操作
Figure PCTCN2018090970-appb-000009
其中,randl ij是在[0,1]之间的随机小数,CR为交叉概率,CR∈[0,1],rand(i)是在[1,n]之间的随机整数,这种交叉操作的策略可以确保x i(t+1)至少有一份量由x i(t)的相应分量贡献,选择操作,
Figure PCTCN2018090970-appb-000010
Specifically, three samples are randomly selected from the initialization population, x p1 , x p2 , x p3 , and the mutation operation v ij (t+1)=x p1j (t)+η(x p2j (t)‐x p3j (t )) where x p2j (t)‐x p3j (t) is the differentiation vector, η is the scaling factor, cross operation
Figure PCTCN2018090970-appb-000009
Where randl ij is a random fraction between [0,1], CR is the crossover probability, CR∈[0,1], rand(i) is a random integer between [1,n], this intersection The strategy of operation can ensure that x i (t+1) has at least one quantity contributed by the corresponding component of x i (t), the selection operation,
Figure PCTCN2018090970-appb-000010
在上述任一项技术方案中,优选地,还包括:更新单元,用于增加匹配图像至第一预设图像库,并更新图像特征权重表。In any of the above technical solutions, preferably, the method further includes: an updating unit, configured to add the matching image to the first preset image library, and update the image feature weight table.
在该技术方案中,通过增加匹配图像至第一预设图像库,并更新图像特征权重表,实现了将图像特征权重表跟用户的偏好的关联,有利于根据用户的偏好来筛选待识别图像的图像特征的实现,进一步提高了对待识别图像的图像识别的准确度。In the technical solution, by adding the matching image to the first preset image library and updating the image feature weight table, the association between the image feature weight table and the user's preference is realized, and the image to be identified is filtered according to the user's preference. The realization of the image features further improves the accuracy of image recognition of the image to be recognized.
本发明的第三方面的技术方案提出了一种计算机设备,计算机设备包括处理器,处理器用于执行存储器中存储的计算机程序时实现如上述本发明的第一方面的技术方案提出的任一项的图像识别方法的步骤。The technical solution of the third aspect of the present invention provides a computer device including a processor for implementing any one of the technical solutions of the first aspect of the present invention when the processor is configured to execute a computer program stored in the memory. The steps of the image recognition method.
在该技术方案中,计算机设备包括处理器,处理器用于执行存储器中存储的计算机程序时实现如上述本发明的第一方面的技术方案提出的任一项的图像识别方法的步骤,因此具有上述本发明的第一方面的技术方案提 出的任一项的图像识别方法的全部有益效果,在此不再赘述。In the technical solution, the computer device includes a processor, and the processor is configured to implement the steps of the image recognition method according to any one of the technical solutions of the first aspect of the present invention when the computer program stored in the memory is executed, thereby having the above All the beneficial effects of the image recognition method according to any one of the technical solutions of the first aspect of the present invention are not described herein.
本发明的第四方面的技术方案提出了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现本发明的第一方面的技术方案提出的任一项的图像识别方法的步骤。The technical solution of the fourth aspect of the present invention provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements an image of any one of the technical solutions of the first aspect of the present invention The steps to identify the method.
在该技术方案中,计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现本发明的第一方面的技术方案提出的任一项的图像识别方法的步骤,因此具有上述本发明的第一方面的技术方案提出的任一项的图像识别方法的全部有益效果,在此不再赘述。In the technical solution, the computer readable storage medium has stored thereon a computer program, and when the computer program is executed by the processor, implements the steps of the image recognition method according to any one of the technical solutions of the first aspect of the present invention, and thus has All the beneficial effects of the image recognition method according to any one of the technical solutions of the first aspect of the present invention are not described herein.
本发明的附加方面和优点将在下面的描述部分中给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。The additional aspects and advantages of the invention will be set forth in the description which follows, and
附图说明DRAWINGS
本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from
图1示出了根据本发明的一个实施例的图像识别方法的示意流程图;FIG. 1 shows a schematic flow chart of an image recognition method according to an embodiment of the present invention; FIG.
图2示出了根据本发明的一个实施例的图像识别装置的示意框图;Figure 2 shows a schematic block diagram of an image recognition apparatus in accordance with one embodiment of the present invention;
图3示出了根据本发明的另一个实施例的图像识别方法的示意流程图。FIG. 3 shows a schematic flow chart of an image recognition method according to another embodiment of the present invention.
具体实施方式Detailed ways
为了能够更清楚地理解本发明的上述目的、特征和优点,下面结合附图和具体实施方式对本发明进行进一步的详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。The present invention will be further described in detail below with reference to the drawings and specific embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
在下面的描述中阐述了很多具体细节以便于充分理解本发明,但是,本发明还可以采用其他不同于在此描述的其他方式来实施,因此,本发明的保护范围并不受下面公开的具体实施例的限制。In the following description, numerous specific details are set forth in order to provide a full understanding of the invention, but the invention may be practiced otherwise than as described herein. Limitations of the embodiments.
实施例1Example 1
图1示出了根据本发明的一个实施例的图像识别方法的示意流程图。FIG. 1 shows a schematic flow chart of an image recognition method in accordance with one embodiment of the present invention.
如图1所示,根据本发明的实施例的图像识别方法,包括:步骤S102, 确定待识别图像的形状特征;步骤S104,提取待识别图像的纹理特征和颜色特征;步骤S106,根据第一预设图像库中的图像特征权重表,确定待识别图像的每一纹理特征的权重和每一颜色特征的权重;步骤S108,筛选权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合;步骤S110,根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像;步骤S112,比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像。As shown in FIG. 1 , an image recognition method according to an embodiment of the present invention includes: step S102, determining a shape feature of an image to be recognized; and step S104, extracting a texture feature and a color feature of the image to be identified; and step S106, according to the first Determining an image feature weight table in the image library, determining a weight of each texture feature of the image to be recognized and a weight of each color feature; and in step S108, filtering the texture feature and the color feature that are greater than the preset weight to form a texture respectively a feature set and a color feature set; step S110, determining a first evolved image corresponding to the image to be recognized according to the shape feature, the texture feature set, and the color feature set; and step S112, comparing the first evolved image with the second preset image library The matching degree of an image determines the matching image of the image to be identified.
在该实施例中,通过确定待识别图像的形状特征,提取待识别图像的纹理特征和颜色特征,实现了对待识别图像的特征的提取,通过根据第一预设图像库中的图像特征权重表,确定待识别图像的每一纹理特征的权重和每一颜色特征的权重,然后筛选权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合,进一步优化了从待识别图像中提取出来的特征,有利于提高对待识别图像的识别准确度,通过根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,进一步优化了待识别图像,有利于提高对待识别图像的识别准确度,第一进化图像中凸出了待识别图像的主要图像特征,有利于降低匹配难度,通过比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像,实现了对待识别图像的识别,提高了图像识别的准确度,而且第二预设图像库中的样本图像数只需囊括含有主要图像特征的少量样本图像就可以实现对待识别图像的识别,减少了样本图像数,节约了硬件资源,同时也降低了机器训练学习的难度。In this embodiment, by determining the shape feature of the image to be recognized, extracting the texture feature and the color feature of the image to be recognized, the feature of the image to be recognized is extracted, by using the image feature weight table in the first preset image library. Determining the weight of each texture feature of the image to be identified and the weight of each color feature, and then filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively, further optimizing the waiting for Identifying the features extracted from the image is beneficial to improve the recognition accuracy of the image to be recognized. The first evolution image corresponding to the image to be identified is determined according to the shape feature, the texture feature set and the color feature set, and the image to be recognized is further optimized. It is beneficial to improve the recognition accuracy of the image to be recognized, and the main image feature of the image to be recognized is highlighted in the first evolution image, which is beneficial to reduce the matching difficulty by comparing any image in the first evolution image and the second preset image library. The matching degree, the matching image of the image to be identified is determined, and the The recognition of the image to be recognized improves the accuracy of the image recognition, and the number of sample images in the second preset image library only needs to include a small number of sample images containing the main image features to realize the recognition of the image to be recognized, and the sample image is reduced. The number saves hardware resources and reduces the difficulty of machine training.
具体地,以食材为例,以区域建议网络划分区域建议框,区域建议框内的图像即待识别图像,这个待识别图像里包括有食材的图像还有所处位置的背景图像,以及被其他物品遮挡的图像,而本发明的方法,可以将食材的图像特征筛选出来,然后得到第一进化图像,这样就可以跟第二预设图像库中的样本食材图像匹配,然后通过比较匹配度,来实现对待识别图像的图像识别。Specifically, taking the food material as an example, the area suggestion frame is divided by the area suggestion network, and the image in the area suggestion frame is the image to be recognized, and the image to be recognized includes the image of the food material and the background image of the position, and is other The image of the object is occluded, and the method of the present invention can screen the image features of the food material, and then obtain the first evolution image, so that the image of the sample material in the second preset image library can be matched, and then the matching degree is compared. To achieve image recognition of the image to be recognized.
其中,预设权重为0.4,第一预设图像库是用户的偏好库,第一预设图像库中的图像特征权重表是根据第一预设图像库中的任一图像特征在所有图像特征中的比重确定的,待识别图像的纹理特征提取可以通过灰度共生 矩阵算法来实现,待识别图像的颜色特征的提取可以通过直方图算法来实现。Wherein, the preset weight is 0.4, the first preset image library is a user's preference library, and the image feature weight table in the first preset image library is based on any image feature in the first preset image library in all image features. The weight of the image to be identified is determined by the gray level co-occurrence matrix algorithm, and the color feature of the image to be recognized can be extracted by a histogram algorithm.
待识别图像的纹理特征提取的具体过程如下:The specific process of texture feature extraction of the image to be identified is as follows:
假设待识别图像的大小为M×N,灰度级为L,G={0,1,2……,L-1},f(x,y)是坐标(x,y)处像素的灰度级,每幅图像的一个共生矩阵是一个L×L的矩阵T[t ij] L×L,T中的元素是图像灰度级的空间关系,
Figure PCTCN2018090970-appb-000011
提取的纹理特征p ij
Figure PCTCN2018090970-appb-000012
Suppose the size of the image to be identified is M×N, the gray level is L, G={0, 1, 2, ..., L-1}, and f(x, y) is the gray of the pixel at the coordinates (x, y). Degree level, a co-occurrence matrix of each image is an L × L matrix T[t ij ] L × L , the elements in T are the spatial relationship of the gray level of the image,
Figure PCTCN2018090970-appb-000011
Extracted texture features p ij ,
Figure PCTCN2018090970-appb-000012
待识别图像的颜色特征的提取的具体过程如下:The specific process of extracting the color features of the image to be identified is as follows:
提取颜色特征H(k),H(k)=nk/N,(k=0,1,……,L-1),其中,k是图像的像素特征取值,L是图像的像素特征可取值的个数,nk是图像中具有像素特征取值为k的像素的个数,N是图像像素的总数。Extract the color features H(k), H(k)=nk/N, (k=0,1,...,L-1), where k is the pixel feature value of the image, and L is the pixel feature of the image. The number of values, nk is the number of pixels in the image with a pixel feature value of k, and N is the total number of image pixels.
在上述实施例中,优选地,确定待识别图像的形状特征,包括:提取待识别图像的角点特征;计算角点特征与预设形状库中任一形状的匹配度,以确定最大匹配度;判断最大匹配度是否大于第一预设匹配度阈值;若判定最大匹配度大于第一预设匹配度阈值,则确定最大匹配度对应的形状为待识别图像的形状特征;若判定最大匹配度不大于第一预设匹配度阈值,则继续提取待识别图像的角点特征。In the above embodiment, preferably, determining a shape feature of the image to be recognized includes: extracting a corner feature of the image to be recognized; calculating a matching degree of the corner feature with any shape in the preset shape library to determine a maximum matching degree. Determining whether the maximum matching degree is greater than the first preset matching degree threshold; if it is determined that the maximum matching degree is greater than the first preset matching degree threshold, determining that the shape corresponding to the maximum matching degree is the shape feature of the image to be identified; if determining the maximum matching degree If it is not greater than the first preset matching degree threshold, the corner feature of the image to be recognized is continuously extracted.
在该实施例中,通过提取待识别图像的角点特征,计算角点特征与预设形状库中任一形状的匹配度,来确定最大匹配度,然后在最大匹配度大于第一预设匹配度阈值时,确定最大匹配度对应的形状为待识别图像的形状特征,实现了待识别图像的形状特征的确定,而且形状特征的确定的准确度较高,有利于进一步提高图像识别的准确度。In this embodiment, the maximum matching degree is determined by extracting the corner feature of the image to be recognized, the matching degree of the corner feature with any shape in the preset shape library, and then the maximum matching degree is greater than the first preset matching. When the threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be recognized, the shape feature of the image to be recognized is determined, and the accuracy of the shape feature is determined, which is beneficial to further improve the accuracy of image recognition. .
其中,第一预设匹配度阈值为0.5-0.8,待识别图像的角点特征提取可以通过Harris角点特征提取算法来实现。The first preset matching degree threshold is 0.5-0.8, and the corner feature extraction of the image to be identified can be implemented by a Harris corner feature extraction algorithm.
待识别图像的角点特征提取的具体过程如下:The specific process of corner feature extraction of the image to be identified is as follows:
定义2×2的Harris矩阵,
Figure PCTCN2018090970-appb-000013
其中,C x和C y分别为点x=(x,y)在x和y方向上的强度信息的一阶导数,ω (x,y)为对应位置的权重,通过计算Harris矩阵的角点响应值D来判断是否为角点特征,D=det A-m(traceA) 2=(ac-b) 2-m(a+c) 2,其中,det和trace为行列式和迹的操作符,m是取值为0.04-0.06的常数,当角点响应值D大于设置的门限,且为该点邻域内的局部最大值时,就把该点提取为角点特征。
Define a 2×2 Harris matrix,
Figure PCTCN2018090970-appb-000013
Where C x and C y are the first derivative of the intensity information of the point x=(x, y) in the x and y directions, respectively, and ω (x, y) is the weight of the corresponding position, by calculating the corner point of the Harris matrix The response value D is used to determine whether it is a corner feature, D=det Am(traceA) 2 =(ac-b) 2 -m(a+c) 2 , where det and trace are determinant and trace operators, m It is a constant with a value of 0.04-0.06. When the corner response value D is greater than the set threshold and is the local maximum in the neighborhood of the point, the point is extracted as a corner feature.
在上述任一项实施例中,优选地,根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,包括:根据形状特征,构建形状空间;随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内,以形成第二进化图像;判断第二进化图像是否满足第一预设条件;若判定第二进化图像满足第一预设条件,则确定第二进化图像为第一进化图像;若判定第二进化图像不满足第一预设条件,则重新随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内,以形成新的第二进化图像,其中,第一预设条件为第二进化图像与第二预设图像库中的图像的最大匹配度不小于第二预设匹配度阈值和/或判断次数不小于第一预设次数阈值。In any of the foregoing embodiments, preferably, determining, according to the shape feature, the texture feature set, and the color feature set, the first evolution image corresponding to the image to be identified, including: constructing a shape space according to the shape feature; randomly selecting the texture feature set The color features in the texture feature and the color feature set are respectively set in the shape space to form a second evolution image; determining whether the second evolution image satisfies the first preset condition; and if the second evolution image satisfies the first pre-determination Setting a condition, determining that the second evolution image is the first evolution image; if it is determined that the second evolution image does not satisfy the first preset condition, then re-selecting the texture feature in the texture feature set and the color feature in the color feature set are sequentially And being disposed in the shape space to form a new second evolution image, wherein the first preset condition is that the maximum matching degree between the second evolution image and the image in the second preset image library is not less than a second preset matching degree threshold And/or the number of judgments is not less than the first preset number of thresholds.
在该实施例中,根据形状特征,构建形状空间,然后随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内来形成第二进化图像,提升了第二进化图像的多样性,有利于提高图像识别的效率,也有利于减少样本图像数,通过判断第二进化图像是否满足第一预设条件,并在第二进化图像满足第一预设条件时,确定第二进化图像为第一进化图像,在第二进化图像不满足第一预设条件时,继续形成新的第二进化图像,进一步降低了第一进化图像与第二预设图像库中的图像匹配难度,从而提高了对待识别图像的识别的准确度。In this embodiment, the shape space is constructed according to the shape feature, and then the texture feature in the texture feature set and the color feature in the color feature set are randomly selected and sequentially set in the shape space to form a second evolution image, and the second evolution image is improved. The diversity of the evolved image is advantageous for improving the efficiency of image recognition, and is also beneficial for reducing the number of sample images, by judging whether the second evolved image satisfies the first preset condition, and when the second evolved image satisfies the first preset condition, Determining that the second evolution image is the first evolution image, and continuing to form a new second evolution image when the second evolution image does not satisfy the first preset condition, further reducing the first evolution image and the second preset image library The image matching difficulty increases the accuracy of the recognition of the image to be recognized.
其中,第二预设匹配度阈值为0.6-0.9,第一预设次数阈值为8000-11000。The second preset matching degree threshold is 0.6-0.9, and the first preset number of thresholds is 8000-11000.
在上述任一项实施例中,优选地,根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,包括:确定形状特征、纹理特征集合和颜色特征集合为初始化群体;对初始化群体依次进行变异、交叉和选择操作,以形成进化群体;判断进化群体是否满足第二预设条件;若判定进化群体满足第二预设条件,则将进化群体对应的图像确定为第一 进化图像;若判定进化群体不满足第二预设条件,则将进化群体作为初始化群体,继续依次进行变异、交叉和选择操作,其中,第二预设条件为变异、交叉和选择操作的次数不小于第二预设次数阈值和/或进化群体对应的图像与预设图像库中的图像的最大匹配度不小于第三预设匹配度阈值。In any of the foregoing embodiments, preferably, determining, according to the shape feature, the texture feature set, and the color feature set, the first evolution image corresponding to the image to be identified, including: determining the shape feature, the texture feature set, and the color feature set to be initialized a group; mutating, intersecting, and selecting operations are sequentially performed on the initialization group to form an evolutionary group; determining whether the evolutionary group satisfies a second predetermined condition; if the evolutionary group is determined to satisfy the second predetermined condition, determining an image corresponding to the evolved group as The first evolutionary image; if it is determined that the evolutionary group does not satisfy the second predetermined condition, the evolutionary group is used as an initialization group, and the mutation, intersection, and selection operations are sequentially performed, wherein the second preset condition is mutation, intersection, and selection operation. The number of times is not less than the second preset number threshold and/or the maximum matching degree of the image corresponding to the evolution group and the image in the preset image library is not less than the third preset matching degree threshold.
在该实施例中,通过确定形状特征、纹理特征集合和颜色特征集合为初始化群体,然后进行多次变异、交叉和选择操作,实现多次进化,来得到第一进化图像,进一步降低了与第二预设图像库中的图像的匹配难度,提高了图像识别的准确度,同时也提高了图像识别的效率。In this embodiment, by determining the shape feature, the texture feature set, and the color feature set as the initialization group, and then performing multiple mutations, intersections, and selection operations, multiple evolutions are performed to obtain the first evolution image, which further reduces the The matching difficulty of the images in the two preset image libraries improves the accuracy of image recognition and improves the efficiency of image recognition.
其中,第二预设次数阈值为8000-11000,第三预设匹配度阈值为0.6-0.9,变异、交叉和选择操作可以通过差分进化算法来实现。The second preset number threshold is 8000-11000, and the third preset matching threshold is 0.6-0.9. The mutation, crossover, and selection operations can be implemented by a differential evolution algorithm.
具体地,从初始化群体中随机选择3个样本,x p1,x p2,x p3,变异操作v ij(t+1)=x p1j(t)+η(x p2j(t)‐x p3j(t))其中,x p2j(t)‐x p3j(t)为差异化向量,η为缩放因子,交叉操作
Figure PCTCN2018090970-appb-000014
其中,randl ij是在[0,1]之间的随机小数,CR为交叉概率,CR∈[0,1],rand(i)是在[1,n]之间的随机整数,这种交叉操作的策略可以确保x i(t+1)至少有一份量由x i(t)的相应分量贡献,选择操作,
Figure PCTCN2018090970-appb-000015
Specifically, three samples are randomly selected from the initialization population, x p1 , x p2 , x p3 , and the mutation operation v ij (t+1)=x p1j (t)+η(x p2j (t)‐x p3j (t )) where x p2j (t)‐x p3j (t) is the differentiation vector, η is the scaling factor, cross operation
Figure PCTCN2018090970-appb-000014
Where randl ij is a random fraction between [0,1], CR is the crossover probability, CR∈[0,1], rand(i) is a random integer between [1,n], this intersection The strategy of operation can ensure that x i (t+1) has at least one quantity contributed by the corresponding component of x i (t), the selection operation,
Figure PCTCN2018090970-appb-000015
在上述任一项实施例中,优选地,在比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像之后,还包括:增加匹配图像至第一预设图像库,并更新图像特征权重表。In any of the above embodiments, after comparing the matching degree of any one of the first evolution image and the second preset image library to determine the matching image of the image to be identified, the method further includes: adding the matching image to the first A preset image library and update the image feature weight table.
在该实施例中,通过增加匹配图像至第一预设图像库,并更新图像特征权重表,实现了将图像特征权重表跟用户的偏好的关联,有利于根据用户的偏好来筛选待识别图像的图像特征的实现,进一步提高了对待识别图像的图像识别的准确度。In this embodiment, by adding the matching image to the first preset image library and updating the image feature weight table, the association between the image feature weight table and the user's preference is realized, and the image to be identified is filtered according to the user's preference. The realization of the image features further improves the accuracy of image recognition of the image to be recognized.
实施例2Example 2
图2示出了根据本发明的一个实施例的图像识别装置200的示意框图。FIG. 2 shows a schematic block diagram of an image recognition device 200 in accordance with one embodiment of the present invention.
如图2所示,根据本发明的实施例的图像识别装置200,包括:确定单元204,用于确定待识别图像的形状特征;提取单元,用于提取待识别图像的纹理特征和颜色特征;确定单元204还用于:根据第一预设图像库 中的图像特征权重表,确定待识别图像的每一纹理特征的权重和每一颜色特征的权重;筛选单元206,用于筛选权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合;确定单元204还用于:根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像;比较单元208,用于比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像。As shown in FIG. 2, an image recognition apparatus 200 according to an embodiment of the present invention includes: a determining unit 204, configured to determine a shape feature of an image to be recognized; and an extracting unit, configured to extract a texture feature and a color feature of the image to be recognized; The determining unit 204 is further configured to: determine, according to the image feature weight table in the first preset image library, the weight of each texture feature of the image to be identified and the weight of each color feature; the screening unit 206 is configured to use the screening weight to be greater than Determining the texture feature and the color feature to form the texture feature set and the color feature set respectively; the determining unit 204 is further configured to: determine the first evolution image corresponding to the image to be identified according to the shape feature, the texture feature set, and the color feature set; The comparing unit 208 is configured to compare the matching degree of any one of the first evolution image and the second preset image library to determine a matching image of the image to be identified.
在该实施例中,通过确定待识别图像的形状特征,提取待识别图像的纹理特征和颜色特征,实现了对待识别图像的特征的提取,通过根据第一预设图像库中的图像特征权重表,确定待识别图像的每一纹理特征的权重和每一颜色特征的权重,然后筛选权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合,进一步优化了从待识别图像中提取出来的特征,有利于提高对待识别图像的识别准确度,通过根据形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,进一步优化了待识别图像,有利于提高对待识别图像的识别准确度,第一进化图像中凸出了待识别图像的主要图像特征,有利于降低匹配难度,通过比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像,实现了对待识别图像的识别,提高了图像识别的准确度,而且第二预设图像库中的样本图像数只需囊括含有主要图像特征的少量样本图像就可以实现对待识别图像的识别,减少了样本图像数,节约了硬件资源,同时也降低了机器训练学习的难度。In this embodiment, by determining the shape feature of the image to be recognized, extracting the texture feature and the color feature of the image to be recognized, the feature of the image to be recognized is extracted, by using the image feature weight table in the first preset image library. Determining the weight of each texture feature of the image to be identified and the weight of each color feature, and then filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively, further optimizing the waiting for Identifying the features extracted from the image is beneficial to improve the recognition accuracy of the image to be recognized. The first evolution image corresponding to the image to be identified is determined according to the shape feature, the texture feature set and the color feature set, and the image to be recognized is further optimized. It is beneficial to improve the recognition accuracy of the image to be recognized, and the main image feature of the image to be recognized is highlighted in the first evolution image, which is beneficial to reduce the matching difficulty by comparing any image in the first evolution image and the second preset image library. The matching degree, the matching image of the image to be identified is determined, and the The recognition of the image to be recognized improves the accuracy of the image recognition, and the number of sample images in the second preset image library only needs to include a small number of sample images containing the main image features to realize the recognition of the image to be recognized, and the sample image is reduced. The number saves hardware resources and reduces the difficulty of machine training.
具体地,以食材为例,以区域建议网络划分区域建议框,区域建议框内的图像即待识别图像,这个待识别图像里包括有食材的图像还有所处位置的背景图像,以及被其他物品遮挡的图像,而本发明的方法,可以将食材的图像特征筛选出来,然后得到第一进化图像,这样就可以跟第二预设图像库中的样本食材图像匹配,然后通过比较匹配度,来实现对待识别图像的图像识别。Specifically, taking the food material as an example, the area suggestion frame is divided by the area suggestion network, and the image in the area suggestion frame is the image to be recognized, and the image to be recognized includes the image of the food material and the background image of the position, and is other The image of the object is occluded, and the method of the present invention can screen the image features of the food material, and then obtain the first evolution image, so that the image of the sample material in the second preset image library can be matched, and then the matching degree is compared. To achieve image recognition of the image to be recognized.
其中,预设权重为0.4,第一预设图像库是用户的偏好库,第一预设图像库中的图像特征权重表是根据第一预设图像库中的任一图像特征在所有图像特征中的比重确定的,待识别图像的纹理特征提取可以通过灰度共生矩阵算法来实现,待识别图像的颜色特征的提取可以通过直方图算法来实 现。Wherein, the preset weight is 0.4, the first preset image library is a user's preference library, and the image feature weight table in the first preset image library is based on any image feature in the first preset image library in all image features. The weight of the image to be identified is determined by the gray level co-occurrence matrix algorithm, and the color feature of the image to be recognized can be extracted by a histogram algorithm.
待识别图像的纹理特征提取的具体过程如下:The specific process of texture feature extraction of the image to be identified is as follows:
假设待识别图像的大小为M×N,灰度级为L,G={0,1,2……,L-1},f(x,y)是坐标(x,y)处像素的灰度级,每幅图像的一个共生矩阵是一个L×L的矩阵T[t ij] L×L,T中的元素是图像灰度级的空间关系,
Figure PCTCN2018090970-appb-000016
提取的纹理特征p ij
Figure PCTCN2018090970-appb-000017
Suppose the size of the image to be identified is M×N, the gray level is L, G={0, 1, 2, ..., L-1}, and f(x, y) is the gray of the pixel at the coordinates (x, y). Degree level, a co-occurrence matrix of each image is an L × L matrix T[t ij ] L × L , the elements in T are the spatial relationship of the gray level of the image,
Figure PCTCN2018090970-appb-000016
Extracted texture features p ij ,
Figure PCTCN2018090970-appb-000017
待识别图像的颜色特征的提取的具体过程如下:The specific process of extracting the color features of the image to be identified is as follows:
提取颜色特征H(k),H(k)=nk/N,(k=0,1,……,L-1),其中,k是图像的像素特征取值,L是图像的像素特征可取值的个数,nk是图像中具有像素特征取值为k的像素的个数,N是图像像素的总数。Extract the color features H(k), H(k)=nk/N, (k=0,1,...,L-1), where k is the pixel feature value of the image, and L is the pixel feature of the image. The number of values, nk is the number of pixels in the image with a pixel feature value of k, and N is the total number of image pixels.
在上述实施例中,优选地,提取单元还用于:提取待识别图像的角点特征;图像识别装置200,还包括:计算单元210,用于计算角点特征与预设形状库中任一形状的匹配度,以确定最大匹配度;第一判断单元212,用于判断最大匹配度是否大于第一预设匹配度阈值;确定单元204还用于:在第一判断单元212判定最大匹配度大于第一预设匹配度阈值时,确定最大匹配度对应的形状为待识别图像的形状特征;提取单元还用于:在第一判断单元212判定最大匹配度不大于第一预设匹配度阈值时,继续提取待识别图像的角点特征。In the above embodiment, preferably, the extracting unit is further configured to: extract a corner feature of the image to be recognized; the image recognition device 200 further includes: a calculating unit 210, configured to calculate any one of the corner feature and the preset shape library The matching degree of the shape to determine the maximum matching degree; the first determining unit 212 is configured to determine whether the maximum matching degree is greater than the first preset matching degree threshold; the determining unit 204 is further configured to: determine the maximum matching degree in the first determining unit 212 When the value is greater than the first preset matching degree threshold, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be identified; the extracting unit is further configured to: determine, in the first determining unit 212, that the maximum matching degree is not greater than the first preset matching degree threshold. At the same time, the corner feature of the image to be recognized is continuously extracted.
在该实施例中,通过提取待识别图像的角点特征,计算角点特征与预设形状库中任一形状的匹配度,来确定最大匹配度,然后在最大匹配度大于第一预设匹配度阈值时,确定最大匹配度对应的形状为待识别图像的形状特征,实现了待识别图像的形状特征的确定,而且形状特征的确定的准确度较高,有利于进一步提高图像识别的准确度。In this embodiment, the maximum matching degree is determined by extracting the corner feature of the image to be recognized, the matching degree of the corner feature with any shape in the preset shape library, and then the maximum matching degree is greater than the first preset matching. When the threshold is determined, the shape corresponding to the maximum matching degree is determined as the shape feature of the image to be recognized, the shape feature of the image to be recognized is determined, and the accuracy of the shape feature is determined, which is beneficial to further improve the accuracy of image recognition. .
其中,第一预设匹配度阈值为0.5-0.8,待识别图像的角点特征提取可以通过Harris角点特征提取算法来实现。The first preset matching degree threshold is 0.5-0.8, and the corner feature extraction of the image to be identified can be implemented by a Harris corner feature extraction algorithm.
待识别图像的角点特征提取的具体过程如下:The specific process of corner feature extraction of the image to be identified is as follows:
定义2×2的Harris矩阵,
Figure PCTCN2018090970-appb-000018
其中,C x和C y分别为点x=(x,y)在x和y方向上的强度信息的一阶导数,ω(x,y)为对应位置的权重,通过计算Harris矩阵的角点响应值D来判断是否为角点特征,D=det A-m(traceA) 2=(ac-b) 2-m(a+c) 2,其中,det和trace为行列式和迹的操作符,m是取值为0.04-0.06的常数,当角点响应值D大于设置的门限,且为该点邻域内的局部最大值时,就把该点提取为角点特征。
Define a 2×2 Harris matrix,
Figure PCTCN2018090970-appb-000018
Where C x and C y are the first derivative of the intensity information of the point x=(x, y) in the x and y directions, respectively, and ω(x, y) is the weight of the corresponding position, by calculating the corner point of the Harris matrix The response value D is used to determine whether it is a corner feature, D=det Am(traceA) 2 =(ac-b) 2 -m(a+c) 2 , where det and trace are determinant and trace operators, m It is a constant with a value of 0.04-0.06. When the corner response value D is greater than the set threshold and is the local maximum in the neighborhood of the point, the point is extracted as a corner feature.
在上述任一项实施例中,优选地,还包括:构建单元214,用于根据形状特征,构建形状空间;选择单元216,用于随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内,以形成第二进化图像;第二判断单元218,用于判断第二进化图像是否满足第一预设条件;确定单元204还用于:在第二判断单元218判定第二进化图像满足第一预设条件时,确定第二进化图像为第一进化图像;选择单元216还用于:在第二判断单元218判定第二进化图像不满足第一预设条件时,重新随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内,以形成新的第二进化图像,其中,第一预设条件为第二进化图像与第二预设图像库中的图像的最大匹配度不小于第二预设匹配度阈值和/或判断次数不小于第一预设次数阈值。In any of the above embodiments, preferably, the method further includes: a construction unit 214, configured to construct a shape space according to the shape feature; and a selection unit 216, configured to randomly select the texture feature and the color feature set in the texture feature set The color features are respectively disposed in the shape space to form a second evolution image; the second determining unit 218 is configured to determine whether the second evolution image satisfies the first preset condition; the determining unit 204 is further configured to: in the second determining unit 218: determining that the second evolution image is the first evolution image when the second evolution image meets the first preset condition; the selecting unit 216 is further configured to: determine, by the second determining unit 218, that the second evolution image does not satisfy the first preset condition And re-randomly selecting the texture features in the texture feature set and the color features in the color feature set are respectively set in the shape space to form a new second evolution image, wherein the first preset condition is the second evolution image and The maximum matching degree of the image in the second preset image library is not less than the second preset matching degree threshold and/or the number of judgments is not less than the first preset number threshold value.
在该实施例中,根据形状特征,构建形状空间,然后随机选择纹理特征集合中的纹理特征和颜色特征集合中的颜色特征分别依次设于形状空间内来形成第二进化图像,提升了第二进化图像的多样性,有利于提高图像识别的效率,也有利于减少样本图像数,通过判断第二进化图像是否满足第一预设条件,并在第二进化图像满足第一预设条件时,确定第二进化图像为第一进化图像,在第二进化图像不满足第一预设条件时,继续形成新的第二进化图像,进一步降低了第一进化图像与第二预设图像库中的图像匹配难度,从而提高了对待识别图像的识别的准确度。In this embodiment, the shape space is constructed according to the shape feature, and then the texture feature in the texture feature set and the color feature in the color feature set are randomly selected and sequentially set in the shape space to form a second evolution image, and the second evolution image is improved. The diversity of the evolved image is advantageous for improving the efficiency of image recognition, and is also beneficial for reducing the number of sample images, by judging whether the second evolved image satisfies the first preset condition, and when the second evolved image satisfies the first preset condition, Determining that the second evolution image is the first evolution image, and continuing to form a new second evolution image when the second evolution image does not satisfy the first preset condition, further reducing the first evolution image and the second preset image library The image matching difficulty increases the accuracy of the recognition of the image to be recognized.
其中,第二预设匹配度阈值为0.6-0.9,第一预设次数阈值为8000-11000。The second preset matching degree threshold is 0.6-0.9, and the first preset number of thresholds is 8000-11000.
在上述任一项实施例中,优选地,确定单元204还用于:确定形状特征、纹理特征集合和颜色特征集合为初始化群体;图像识别装置200,还包括:操作单元220,用于对初始化群体依次进行变异、交叉和选择操作, 以形成进化群体;第三判断单元222,用于判断进化群体是否满足第二预设条件;确定单元204还用于:在进化群体满足第二预设条件时,将进化群体对应的图像确定为第一进化图像;操作单元220还用于:在进化群体不满足第二预设条件时,将进化群体作为初始化群体,继续依次进行变异、交叉和选择操作,其中,第二预设条件为变异、交叉和选择操作的次数不小于第二预设次数阈值和/或进化群体对应的图像与预设图像库中的图像的最大匹配度不小于第三预设匹配度阈值。In any of the above embodiments, the determining unit 204 is further configured to: determine the shape feature, the texture feature set, and the color feature set as an initialization group; the image recognition apparatus 200 further includes: an operation unit 220, configured to perform initialization The group sequentially performs mutation, crossover, and selection operations to form an evolutionary group. The third determining unit 222 is configured to determine whether the evolved group satisfies the second preset condition. The determining unit 204 is further configured to: meet the second preset condition in the evolved group. The image corresponding to the evolutionary group is determined as the first evolution image; the operation unit 220 is further configured to: when the evolutionary group does not satisfy the second preset condition, use the evolutionary group as the initialization group, and continue to perform mutation, crossover, and selection operations in sequence. The second preset condition is that the number of the mutation, the intersection, and the selection operation is not less than the second preset number threshold and/or the maximum matching degree between the image corresponding to the evolution group and the image in the preset image library is not less than the third pre-predetermined Set the match threshold.
在该实施例中,通过确定形状特征、纹理特征集合和颜色特征集合为初始化群体,然后进行多次变异、交叉和选择操作,实现多次进化,来得到第一进化图像,进一步降低了与第二预设图像库中的图像的匹配难度,提高了图像识别的准确度,同时也提高了图像识别的效率。其中,第二预设次数阈值为8000-11000,第三预设匹配度阈值为0.6-0.9,变异、交叉和选择操作可以通过差分进化算法来实现。In this embodiment, by determining the shape feature, the texture feature set, and the color feature set as the initialization group, and then performing multiple mutations, intersections, and selection operations, multiple evolutions are performed to obtain the first evolution image, which further reduces the The matching difficulty of the images in the two preset image libraries improves the accuracy of image recognition and improves the efficiency of image recognition. The second preset number threshold is 8000-11000, and the third preset matching threshold is 0.6-0.9. The mutation, crossover, and selection operations can be implemented by a differential evolution algorithm.
具体地,从初始化群体中随机选择3个样本,x p1,x p2,x p3,变异操作v ij(t+1)=x p1j(t)+η(x p2j(t)‐x p3j(t))其中,x p2j(t)‐x p3j(t)为差异化向量,η为缩放因子,交叉操作
Figure PCTCN2018090970-appb-000019
其中,randl ij是在[0,1]之间的随机小数,CR为交叉概率,CR∈[0,1],rand(i)是在[1,n]之间的随机整数,这种交叉操作的策略可以确保x i(t+1)至少有一份量由x i(t)的相应分量贡献,选择操作,
Figure PCTCN2018090970-appb-000020
Specifically, three samples are randomly selected from the initialization population, x p1 , x p2 , x p3 , and the mutation operation v ij (t+1)=x p1j (t)+η(x p2j (t)‐x p3j (t )) where x p2j (t)‐x p3j (t) is the differentiation vector, η is the scaling factor, cross operation
Figure PCTCN2018090970-appb-000019
Where randl ij is a random fraction between [0,1], CR is the crossover probability, CR∈[0,1], rand(i) is a random integer between [1,n], this intersection The strategy of operation can ensure that x i (t+1) has at least one quantity contributed by the corresponding component of x i (t), the selection operation,
Figure PCTCN2018090970-appb-000020
在上述任一项实施例中,优选地,还包括:更新单元224,用于增加匹配图像至第一预设图像库,并更新图像特征权重表。In any of the above embodiments, preferably, the method further includes: an updating unit 224, configured to add a matching image to the first preset image library, and update the image feature weight table.
在该实施例中,通过增加匹配图像至第一预设图像库,并更新图像特征权重表,实现了将图像特征权重表跟用户的偏好的关联,有利于根据用户的偏好来筛选待识别图像的图像特征的实现,进一步提高了对待识别图像的图像识别的准确度。In this embodiment, by adding the matching image to the first preset image library and updating the image feature weight table, the association between the image feature weight table and the user's preference is realized, and the image to be identified is filtered according to the user's preference. The realization of the image features further improves the accuracy of image recognition of the image to be recognized.
实施例3Example 3
根据本发明的实施例的计算机设备,计算机设备包括处理器,处理器用于执行存储器中存储的计算机程序时实现如上述本发明的实施例提出的 任一项的图像识别方法的步骤。According to a computer apparatus of an embodiment of the present invention, the computer apparatus comprises a processor for performing the steps of the image recognition method according to any one of the embodiments of the present invention described above when executing the computer program stored in the memory.
在该实施例中,计算机设备包括处理器,处理器用于执行存储器中存储的计算机程序时实现如上述本发明的实施例提出的任一项的图像识别方法的步骤,因此具有上述本发明的实施例提出的任一项的图像识别方法的全部有益效果,在此不再赘述。In this embodiment, the computer device comprises a processor for performing the steps of the image recognition method according to any of the above-mentioned embodiments of the present invention when executing the computer program stored in the memory, and thus having the above-described implementation of the present invention The full beneficial effects of the image recognition method of any of the examples proposed herein are not described herein.
实施例4Example 4
本发明的实施例的计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述本发明的实施例提出的任一项的图像识别方法的步骤。A computer readable storage medium according to an embodiment of the present invention, wherein a computer program is stored thereon, and when the computer program is executed by the processor, the steps of the image recognition method according to any one of the embodiments of the present invention described above are implemented.
在该实施例中,计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述本发明的实施例提出的任一项的图像识别方法的步骤,因此具有上述本发明的实施例提出的任一项的图像识别方法的全部有益效果,在此不再赘述。In this embodiment, a computer readable storage medium having stored thereon a computer program executed by a processor to implement the steps of the image recognition method of any of the above-described embodiments of the present invention, and thus having the above-described present invention The entire beneficial effects of the image recognition method of any of the embodiments proposed in the embodiments are not described herein.
实施例5Example 5
图3示出了根据本发明的另一个实施例的图像识别方法的示意流程图。FIG. 3 shows a schematic flow chart of an image recognition method according to another embodiment of the present invention.
如图3所示,根据本发明的另一个实施例的图像识别方法,在步骤S302输入食材图像后,进行步骤S304区域建议框划分,步骤S306,,选取某一区域建议框,步骤S308,提取角点特征,然后进行步骤S312,跟形状库中的形状趋势匹配,步骤S314,确定食材的形状特征,步骤S318,加入到初始化群体中,同时在选取的某一区域建议框中进行步骤S310,提取颜色特征、纹理特征,步骤S318,加入到初始化群体中,然后根据用户食材偏好库进行步骤S320,初始化颜色特征权重和步骤S324,初始化纹理特征权重,在步骤S320之后进行步骤S322筛选出权重大于0.4的颜色特征集合,在步骤S324之后进行步骤S326筛选出权重大于0.4的纹理特征集合,在这两个集合中进行步骤S328随机选择颜色特征和步骤S330随机选择纹理特征,然后进入步骤S332根据食材图片库,评估进化结果,步骤S334,根据与食材图片库计算匹配度,进入步骤S336,判断是否满足评估条件,如果判定为是就进入步骤S338,形成第一进化图像,如果不满足评估条件, 就进入步骤S328重新随机选择颜色特征和重新选择纹理特征。As shown in FIG. 3, the image recognition method according to another embodiment of the present invention, after inputting the food material image in step S302, performing step S304 area suggestion box division, step S306, selecting a certain area suggestion box, step S308, extracting Corner feature, then proceeding to step S312 to match the shape trend in the shape library, step S314, determining the shape feature of the food item, step S318, adding to the initialization group, and performing step S310 in the selected certain area suggestion box, Extracting the color feature and the texture feature, step S318, adding to the initialization group, and then performing step S320 according to the user ingredient preference library, initializing the color feature weight and step S324, initializing the texture feature weight, and performing step S322 after step S320 to filter out the weight is greater than a color feature set of 0.4, after step S324, step S326 is performed to filter out a texture feature set having a weight greater than 0.4, in which the step S328 randomly selects the color feature and the step S330 randomly selects the texture feature, and then proceeds to step S332 according to the food material. Image library, evaluating evolution results, step S334, according to The food image library calculates the matching degree, and proceeds to step S336 to determine whether the evaluation condition is satisfied. If the determination is yes, the process proceeds to step S338 to form a first evolution image. If the evaluation condition is not satisfied, the process proceeds to step S328 to re-randomly select the color feature and reselect. Texture features.
以上结合附图详细说明了本发明的技术方案,本发明提出了一种图像识别方法,装置,计算机设备和可读存储介质,通过根据待识别图像的形状特征、纹理特征集合和颜色特征集合,确定待识别图像对应的第一进化图像,然后比较第一进化图像与第二预设图像库中任一图像的匹配度,确定待识别图像的匹配图像,提高了图像识别的准确度,而且减少了样本图像数,节约了硬件资源。The technical solution of the present invention is described in detail above with reference to the accompanying drawings. The present invention provides an image recognition method, apparatus, computer device and readable storage medium, according to a shape feature, a texture feature set and a color feature set according to an image to be recognized. Determining a first evolution image corresponding to the image to be identified, and then comparing a matching degree of the image of the first evolution image with the second preset image library, determining a matching image of the image to be recognized, improving the accuracy of image recognition, and reducing The number of sample images saves hardware resources.
本发明方法中的步骤可根据实际需要进行顺序调整、合并和删减。The steps in the method of the present invention can be sequentially adjusted, combined, and deleted according to actual needs.
本发明装置中的单元可根据实际需要进行合并、划分和删减。The units in the apparatus of the present invention can be combined, divided, and deleted according to actual needs.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质包括只读存储器(Read-Only Memory,ROM)、随机存储器(Random Access Memory,RAM)、可编程只读存储器(Programmable Read-only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、一次可编程只读存储器(One-time Programmable Read-Only Memory,OTPROM)、电子抹除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器、或者能够用于携带或存储数据的计算机可读的任何其他介质。One of ordinary skill in the art can understand that all or part of the various methods of the above embodiments can be completed by a program to instruct related hardware, the program can be stored in a computer readable storage medium, and the storage medium includes read only Read-Only Memory (ROM), Random Access Memory (RAM), Programmable Read-Only Memory (PROM), Erasable Programmable Read Only Memory (Erasable Programmable Read Only Memory) EPROM), One-Time Programmable Read-Only Memory (OTPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM), Read-Only Disc (Compact Disc) Read-Only Memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other medium readable by a computer that can be used to carry or store data.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims (12)

  1. 一种图像识别方法,其特征在于,包括:An image recognition method, comprising:
    确定待识别图像的形状特征;Determining a shape feature of the image to be identified;
    提取所述待识别图像的纹理特征和颜色特征;Extracting texture features and color features of the image to be identified;
    根据第一预设图像库中的图像特征权重表,确定所述待识别图像的每一纹理特征的权重和每一颜色特征的权重;Determining a weight of each texture feature of the image to be recognized and a weight of each color feature according to an image feature weight table in the first preset image library;
    筛选所述权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合;Filtering the texture features and color features that are greater than the preset weights to form the texture feature set and the color feature set respectively;
    根据所述形状特征、所述纹理特征集合和所述颜色特征集合,确定所述待识别图像对应的第一进化图像;Determining, according to the shape feature, the texture feature set, and the color feature set, a first evolution image corresponding to the image to be identified;
    比较所述第一进化图像与第二预设图像库中任一图像的匹配度,确定所述待识别图像的匹配图像。Comparing the matching degree of the first evolution image with any of the second preset image libraries to determine a matching image of the image to be recognized.
  2. 根据权利要求1所述的图像识别方法,其特征在于,所述确定待识别图像的形状特征,包括:The image recognition method according to claim 1, wherein the determining the shape feature of the image to be recognized comprises:
    提取所述待识别图像的角点特征;Extracting a corner feature of the image to be identified;
    计算所述角点特征与预设形状库中任一形状的匹配度,以确定最大匹配度;Calculating a degree of matching between the corner feature and any shape in the preset shape library to determine a maximum matching degree;
    判断所述最大匹配度是否大于第一预设匹配度阈值;Determining whether the maximum matching degree is greater than a first preset matching degree threshold;
    若判定所述最大匹配度大于所述第一预设匹配度阈值,则确定所述最大匹配度对应的形状为所述待识别图像的形状特征;If it is determined that the maximum matching degree is greater than the first preset matching degree threshold, determining that the shape corresponding to the maximum matching degree is a shape feature of the image to be identified;
    若判定所述最大匹配度不大于所述第一预设匹配度阈值,则继续提取所述待识别图像的角点特征。If it is determined that the maximum matching degree is not greater than the first preset matching degree threshold, the corner feature of the image to be recognized is continuously extracted.
  3. 根据权利要求1或2所述的图像识别方法,其特征在于,所述根据所述形状特征、所述纹理特征集合和所述颜色特征集合,确定所述待识别图像对应的第一进化图像,包括:The image recognition method according to claim 1 or 2, wherein the determining, according to the shape feature, the texture feature set, and the color feature set, a first evolution image corresponding to the image to be recognized, include:
    根据所述形状特征,构建形状空间;Forming a shape space according to the shape feature;
    随机选择所述纹理特征集合中的纹理特征和所述颜色特征集合中的颜色特征分别依次设于所述形状空间内,以形成第二进化图像;Randomly selecting a texture feature in the texture feature set and a color feature in the color feature set are respectively disposed in the shape space to form a second evolution image;
    判断所述第二进化图像是否满足第一预设条件;Determining whether the second evolved image satisfies a first preset condition;
    若判定所述第二进化图像满足所述第一预设条件,则确定所述第二进化图像为所述第一进化图像;If it is determined that the second evolved image satisfies the first preset condition, determining that the second evolved image is the first evolved image;
    若判定所述第二进化图像不满足所述第一预设条件,则重新随机选择所述纹理特征集合中的纹理特征和所述颜色特征集合中的颜色特征分别依次设于所述形状空间内,以形成新的第二进化图像,If it is determined that the second evolved image does not satisfy the first preset condition, re-randomly selecting the texture feature in the texture feature set and the color feature in the color feature set are respectively sequentially disposed in the shape space To form a new second evolutionary image,
    其中,所述第一预设条件为所述第二进化图像与所述第二预设图像库中的图像的最大匹配度不小于第二预设匹配度阈值和/或判断次数不小于第一预设次数阈值。The first preset condition is that the maximum matching degree between the second evolved image and the image in the second preset image library is not less than a second preset matching degree threshold and/or the number of judgments is not less than the first The preset number of thresholds.
  4. 根据权利要求1或2所述的图像识别方法,其特征在于,所述根据所述形状特征、所述纹理特征集合和所述颜色特征集合,确定所述待识别图像对应的第一进化图像,包括:The image recognition method according to claim 1 or 2, wherein the determining, according to the shape feature, the texture feature set, and the color feature set, a first evolution image corresponding to the image to be recognized, include:
    确定所述形状特征、所述纹理特征集合和所述颜色特征集合为初始化群体;Determining, the shape feature, the texture feature set, and the color feature set are initialization groups;
    对所述初始化群体依次进行变异、交叉和选择操作,以形成进化群体;Performing mutation, crossover, and selection operations on the initialization population in order to form an evolutionary population;
    判断所述进化群体是否满足第二预设条件;Determining whether the evolved group satisfies a second preset condition;
    若判定所述进化群体满足所述第二预设条件,则将所述进化群体对应的图像确定为所述第一进化图像;If it is determined that the evolved group satisfies the second preset condition, determining an image corresponding to the evolved group as the first evolved image;
    若判定所述进化群体不满足所述第二预设条件,则将所述进化群体作为所述初始化群体,继续依次进行所述变异、交叉和选择操作,If it is determined that the evolved group does not satisfy the second preset condition, the evolved group is used as the initialization group, and the mutation, intersection, and selection operations are sequentially performed,
    其中,所述第二预设条件为所述变异、交叉和选择操作的次数不小于第二预设次数阈值和/或所述进化群体对应的图像与所述预设图像库中的图像的最大匹配度不小于第三预设匹配度阈值。The second preset condition is that the number of the mutation, intersection, and selection operations is not less than a second preset number threshold and/or an image corresponding to the evolved group and an image of the preset image library. The matching degree is not less than the third preset matching degree threshold.
  5. 根据权利要求1或2所述的图像识别方法,其特征在于,在所述比较所述第一进化图像与第二预设图像库中任一图像的匹配度,确定所述待识别图像的匹配图像之后,还包括:The image recognition method according to claim 1 or 2, wherein the matching of the image to be recognized is determined by comparing the matching degree of any one of the first evolution image and the second preset image library After the image, it also includes:
    增加所述匹配图像至所述第一预设图像库,并更新所述图像特征权重表。Adding the matching image to the first preset image library and updating the image feature weight table.
  6. 一种图像识别装置,其特征在于,包括:An image recognition device, comprising:
    确定单元,用于确定待识别图像的形状特征;a determining unit, configured to determine a shape feature of the image to be identified;
    提取单元,用于提取所述待识别图像的纹理特征和颜色特征;An extracting unit, configured to extract a texture feature and a color feature of the image to be identified;
    所述确定单元还用于:根据第一预设图像库中的图像特征权重表,确 定所述待识别图像的每一纹理特征的权重和每一颜色特征的权重;The determining unit is further configured to: determine, according to the image feature weight table in the first preset image library, a weight of each texture feature of the to-be-identified image and a weight of each color feature;
    筛选单元,用于筛选所述权重大于预设权重的纹理特征和颜色特征,以分别形成纹理特征集合和颜色特征集合;a screening unit, configured to filter the texture feature and the color feature that are greater than the preset weight to form a texture feature set and a color feature set respectively;
    所述确定单元还用于:根据所述形状特征、所述纹理特征集合和所述颜色特征集合,确定所述待识别图像对应的第一进化图像;The determining unit is further configured to: determine, according to the shape feature, the texture feature set, and the color feature set, a first evolution image corresponding to the image to be identified;
    比较单元,用于比较所述第一进化图像与第二预设图像库中任一图像的匹配度,确定所述待识别图像的匹配图像。And a comparing unit, configured to compare a matching degree between the first evolved image and any one of the second preset image libraries, and determine a matching image of the image to be recognized.
  7. 根据权利要求6所述的图像识别装置,其特征在于,The image recognition device according to claim 6, wherein
    所述提取单元还用于:提取所述待识别图像的角点特征;The extracting unit is further configured to: extract a corner feature of the image to be identified;
    所述图像识别装置,还包括:The image recognition device further includes:
    计算单元,用于计算所述角点特征与预设形状库中任一形状的匹配度,以确定最大匹配度;a calculating unit, configured to calculate a matching degree between the corner feature and any shape in the preset shape library to determine a maximum matching degree;
    第一判断单元,用于判断所述最大匹配度是否大于第一预设匹配度阈值;a first determining unit, configured to determine whether the maximum matching degree is greater than a first preset matching degree threshold;
    所述确定单元还用于:在所述第一判断单元判定所述最大匹配度大于所述第一预设匹配度阈值时,确定所述最大匹配度对应的形状为所述待识别图像的形状特征;The determining unit is further configured to: when the first determining unit determines that the maximum matching degree is greater than the first preset matching degree threshold, determine that the shape corresponding to the maximum matching degree is the shape of the image to be recognized feature;
    所述提取单元还用于:在所述第一判断单元判定所述最大匹配度不大于所述第一预设匹配度阈值时,继续提取所述待识别图像的角点特征。The extracting unit is further configured to: when the first determining unit determines that the maximum matching degree is not greater than the first preset matching degree threshold, continue to extract a corner feature of the to-be-identified image.
  8. 根据权利要求6或7所述的图像识别装置,其特征在于,还包括:The image recognition device according to claim 6 or 7, further comprising:
    构建单元,用于根据所述形状特征,构建形状空间;a building unit, configured to construct a shape space according to the shape feature;
    选择单元,用于随机选择所述纹理特征集合中的纹理特征和所述颜色特征集合中的颜色特征分别依次设于所述形状空间内,以形成第二进化图像;a selection unit, configured to randomly select a texture feature in the texture feature set and a color feature in the color feature set to be sequentially disposed in the shape space, respectively, to form a second evolution image;
    第二判断单元,用于判断所述第二进化图像是否满足第一预设条件;a second determining unit, configured to determine whether the second evolved image meets a first preset condition;
    所述确定单元还用于:在所述第二判断单元判定所述第二进化图像满足所述第一预设条件时,确定所述第二进化图像为所述第一进化图像;The determining unit is further configured to: when the second determining unit determines that the second evolved image meets the first preset condition, determine that the second evolved image is the first evolved image;
    所述选择单元还用于:在所述第二判断单元判定所述第二进化图像不满足所述第一预设条件时,重新随机选择所述纹理特征集合中的纹理特征和所述颜色特征集合中的颜色特征分别依次设于所述形状空间内,以形成新的第二进化图像,The selecting unit is further configured to: when the second determining unit determines that the second evolved image does not satisfy the first preset condition, re-randomly select a texture feature and the color feature in the texture feature set Color features in the set are respectively disposed in the shape space to form a new second evolution image.
    其中,所述第一预设条件为所述第二进化图像与所述第二预设图像库中的图像的最大匹配度不小于第二预设匹配度阈值和/或判断次数不小于第一预设次数阈值。The first preset condition is that the maximum matching degree between the second evolved image and the image in the second preset image library is not less than a second preset matching degree threshold and/or the number of judgments is not less than the first The preset number of thresholds.
  9. 根据权利要求6或7所述的图像识别装置,其特征在于,The image recognition device according to claim 6 or 7, wherein
    所述确定单元还用于:确定所述形状特征、所述纹理特征集合和所述颜色特征集合为初始化群体;The determining unit is further configured to: determine the shape feature, the texture feature set, and the color feature set as an initialization group;
    所述图像识别装置,还包括:The image recognition device further includes:
    操作单元,用于对所述初始化群体依次进行变异、交叉和选择操作,以形成进化群体;An operation unit, configured to sequentially perform mutation, crossover, and selection operations on the initialization population to form an evolutionary group;
    第三判断单元,用于判断所述进化群体是否满足第二预设条件;a third determining unit, configured to determine whether the evolved group satisfies a second preset condition;
    所述确定单元还用于:在所述进化群体满足所述第二预设条件时,将所述进化群体对应的图像确定为所述第一进化图像;The determining unit is further configured to: determine, when the evolved group satisfies the second preset condition, an image corresponding to the evolved group as the first evolution image;
    所述操作单元还用于:在所述进化群体不满足所述第二预设条件时,将所述进化群体作为所述初始化群体,继续依次进行所述变异、交叉和选择操作,The operating unit is further configured to: when the evolved group does not satisfy the second preset condition, use the evolved group as the initialization group, and continue to perform the mutation, crossover, and selection operations sequentially,
    其中,所述第二预设条件为所述变异、交叉和选择操作的次数不小于第二预设次数阈值和/或所述进化群体对应的图像与所述预设图像库中的图像的最大匹配度不小于第三预设匹配度阈值。The second preset condition is that the number of the mutation, intersection, and selection operations is not less than a second preset number threshold and/or an image corresponding to the evolved group and an image of the preset image library. The matching degree is not less than the third preset matching degree threshold.
  10. 根据权利要求6或7所述的图像识别装置,其特征在于,还包括:The image recognition device according to claim 6 or 7, further comprising:
    更新单元,用于增加所述匹配图像至所述第一预设图像库,并更新所述图像特征权重表。And an updating unit, configured to add the matching image to the first preset image library, and update the image feature weight table.
  11. 一种计算机设备,其特征在于,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如权利要求1至5中任一项所述的图像识别方法的步骤。A computer apparatus, comprising: a processor, wherein the processor is operative to perform the steps of the image recognition method according to any one of claims 1 to 5 when the computer program stored in the memory is executed.
  12. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至5中任一项所述的图像识别方法的步骤。A computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to implement the steps of the image recognition method according to any one of claims 1 to 5.
PCT/CN2018/090970 2017-08-04 2018-06-13 Image recognition method, apparatus, computer device, and readable storage medium WO2019024610A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710661653.8 2017-08-04
CN201710661653.8A CN107480711B (en) 2017-08-04 2017-08-04 Image recognition method and device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
WO2019024610A1 true WO2019024610A1 (en) 2019-02-07

Family

ID=60597512

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/090970 WO2019024610A1 (en) 2017-08-04 2018-06-13 Image recognition method, apparatus, computer device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN107480711B (en)
WO (1) WO2019024610A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113642552A (en) * 2020-04-27 2021-11-12 上海高德威智能交通系统有限公司 Method, device and system for identifying target object in image and electronic equipment

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107480711B (en) * 2017-08-04 2020-09-01 合肥美的智能科技有限公司 Image recognition method and device, computer equipment and readable storage medium
CN109993178B (en) * 2017-12-29 2024-02-02 华为技术有限公司 Feature data generation and feature matching method and device
CN108224894B (en) * 2018-01-08 2020-04-28 合肥美的智能科技有限公司 Food material freshness identification method and device based on deep learning, refrigerator and medium
CN109030480B (en) * 2018-08-16 2021-03-19 湖南友哲科技有限公司 Sample analysis method, sample analysis device, readable storage medium and computer equipment
CN111353333B (en) * 2018-12-21 2023-10-20 九阳股份有限公司 Food material identification method, household electrical appliance and food material identification system
CN110222789B (en) * 2019-06-14 2023-05-26 腾讯科技(深圳)有限公司 Image recognition method and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211341A (en) * 2006-12-29 2008-07-02 上海芯盛电子科技有限公司 Image intelligent mode recognition and searching method
US20090289942A1 (en) * 2008-05-20 2009-11-26 Timothee Bailloeul Image learning, automatic annotation, retrieval method, and device
CN101635835A (en) * 2008-07-25 2010-01-27 深圳市信义科技有限公司 Intelligent video monitoring method and system thereof
CN104537376A (en) * 2014-11-25 2015-04-22 深圳创维数字技术有限公司 A method, a relevant device, and a system for identifying a station caption
CN107480711A (en) * 2017-08-04 2017-12-15 合肥美的智能科技有限公司 Image-recognizing method, device, computer equipment and readable storage medium storing program for executing

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8538184B2 (en) * 2007-11-06 2013-09-17 Gruntworx, Llc Systems and methods for handling and distinguishing binarized, background artifacts in the vicinity of document text and image features indicative of a document category
CN104298988B (en) * 2014-08-21 2017-08-25 华南理工大学 A kind of property guard method matched based on video image local feature

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211341A (en) * 2006-12-29 2008-07-02 上海芯盛电子科技有限公司 Image intelligent mode recognition and searching method
US20090289942A1 (en) * 2008-05-20 2009-11-26 Timothee Bailloeul Image learning, automatic annotation, retrieval method, and device
CN101635835A (en) * 2008-07-25 2010-01-27 深圳市信义科技有限公司 Intelligent video monitoring method and system thereof
CN104537376A (en) * 2014-11-25 2015-04-22 深圳创维数字技术有限公司 A method, a relevant device, and a system for identifying a station caption
CN107480711A (en) * 2017-08-04 2017-12-15 合肥美的智能科技有限公司 Image-recognizing method, device, computer equipment and readable storage medium storing program for executing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113642552A (en) * 2020-04-27 2021-11-12 上海高德威智能交通系统有限公司 Method, device and system for identifying target object in image and electronic equipment
CN113642552B (en) * 2020-04-27 2024-03-08 上海高德威智能交通系统有限公司 Method, device and system for identifying target object in image and electronic equipment

Also Published As

Publication number Publication date
CN107480711B (en) 2020-09-01
CN107480711A (en) 2017-12-15

Similar Documents

Publication Publication Date Title
WO2019024610A1 (en) Image recognition method, apparatus, computer device, and readable storage medium
CN109409398A (en) Image processing apparatus, image processing method and storage medium
CN115017418B (en) Remote sensing image recommendation system and method based on reinforcement learning
WO2019134531A1 (en) Method for finding optimal stitching line of panoramic image
JP2013125322A (en) Learning device, program and learning method
US11373309B2 (en) Image analysis in pathology
US20220414892A1 (en) High-precision semi-automatic image data labeling method, electronic apparatus, and storage medium
CN115830335A (en) ORB image feature extraction method based on adaptive threshold algorithm
CN116012721B (en) Deep learning-based rice leaf spot detection method
CN110910401A (en) Semi-automatic image segmentation data annotation method, electronic device and storage medium
CN115937065A (en) Foreign matter detection method, device and equipment of display module and storage medium
JP2020160543A (en) Information processing system and information processing method
CN113836373B (en) Bidding information processing method and device based on density clustering and storage medium
CN111612099B (en) Texture image classification method and system based on local sorting difference refinement mode
CN108876776A (en) A kind of method of generating classification model, eye fundus image classification method and device
CN114707014B (en) FOV-based image data fusion indexing method
CN112734747A (en) Target detection method and device, electronic equipment and storage medium
da Silva Teixeira et al. Reconstruction of frescoes by sequential layers of feature extraction
JP2011150626A (en) Method, device, and program for classifying image
CN114972702A (en) Sampling method and storage medium for industrial image target detection image training set
CN114418898A (en) Data enhancement method based on target overlapping degree calculation and self-adaptive adjustment
CN114359090A (en) Data enhancement method for oral cavity CT image
CN114359300A (en) Method, device and system for optimizing image segmentation model and storage medium
GB2604093A (en) System for clustering data points
CN112100540B (en) CANVAS-based picture cross mirror tiling method and storage medium

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: 18840184

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: 18840184

Country of ref document: EP

Kind code of ref document: A1