Image recognition method, device, apparatus and computer readable medium

By expanding the image based on texture features, the problem of low success rate of small-size and low-resolution texture images is solved, and efficient recognition rate improvement and calculation optimization are achieved.

CN112529013BActive Publication Date: 2024-11-08CHIPONE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011470251.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-14
Publication Date
2024-11-08
Estimated Expiration
2040-12-14

AI Technical Summary

Technical Problem

The prior art has low recognition success rate and high calculation overhead when identifying small-size and low-resolution texture images, which cannot effectively improve the recognition rate.

Method used

By extending the image according to the characteristics of the original texture, an extended image is generated, including extending according to the extension direction and repetition period of the texture, increasing the recognizable area of ​​the image, so that the texture features remain consistent in the extended image.

Benefits of technology

It improves the success rate of image recognition, reduces the calculation overhead of the recognition process, enhances the recognizable texture, and improves the recognition probability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112529013B_ABST
    Figure CN112529013B_ABST
Patent Text Reader

Abstract

The present invention provides an image recognition method, device, equipment and computer readable medium. The image recognition method comprises: obtaining an original image with an original texture; expanding the original image according to the characteristics of the original texture to obtain an expanded image; and recognizing the expanded image. The image recognition technology according to the present invention has the advantages of high recognition success rate and simple operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine vision, and in particular to an image recognition method, device, equipment and computer-readable medium. Background Art

[0002] Image recognition technology is known in the art. Currently, the recognition of some images, especially those with small size and low resolution texture, has the problem of low recognition success rate and high miss rate. Some existing solutions cannot significantly improve the recognition rate or have high computational overhead. Summary of the invention

[0003] In view of this, the embodiments of the present invention are dedicated to providing an image recognition method that can significantly improve the recognition success rate and has low computational overhead.

[0004] In one aspect, the present invention provides an image recognition method, comprising: acquiring an original image with an original texture; expanding the original image according to features of the original texture to obtain an extended image; and recognizing the extended image.

[0005] According to a specific embodiment of the present invention, the extended image includes an original image and an outer image generated outside the original image.

[0006] According to a specific embodiment of the present invention, the original image is expanded according to the characteristics of the original texture to obtain the extended image, including: expanding the original image according to the extension direction of the original texture to obtain the extended image.

[0007] According to a specific embodiment of the present invention, the original image is expanded according to the extension direction of the original texture to obtain an extended image, including: determining a first direction field of a first pixel to be filled in the outer image according to the extension direction of the original texture; determining a pixel value of the first pixel to be filled according to the first direction field; generating an outer image according to the pixel values ​​of all first pixels to be filled in the outer image, thereby obtaining an extended image.

[0008] According to a specific embodiment of the present invention, according to the extension direction of the original texture, determining the first direction field of the first pixel to be filled in the outer image includes: determining the position of the first reference pixel closest to the first pixel to be filled among the pixels on the edge of the original image; and determining the first direction field according to the second direction field of the first reference pixel. Wherein, determining the pixel value of the first pixel to be filled according to the first direction field includes: determining the position of the second reference pixel of the original image according to the position of the first pixel to be filled, the first direction field, and the first distance between the first pixel to be filled and the first reference pixel; and determining the pixel value of the first pixel to be filled according to the pixel value of the second reference pixel.

[0009] According to a specific embodiment of the present invention, the position of the second reference pixel of the original image is determined according to the position of the first pixel to be filled, the first direction field, and the first distance between the first pixel to be filled and the first reference pixel, including: determining the second distance between the second reference pixel and the first pixel to be filled in the direction of the first straight line where the first pixel to be filled and the first reference pixel are located according to the first distance; determining the angle between the direction of the first direction field and the first straight line; dividing the second distance by the tangent value of the angle to obtain the third distance between the second reference pixel and the first pixel to be filled in the direction of the second straight line perpendicular to the first straight line; determining the position of the second reference pixel according to the position of the first pixel to be filled and the second and third distances.

[0010] According to a specific embodiment of the present invention, the original image is expanded according to the characteristics of the original texture to obtain the extended image, which includes: expanding the original image according to the repetition period of the original texture to obtain the extended image.

[0011] According to a specific embodiment of the present invention, the original image is expanded according to the repetition period of the original texture to obtain an extended image, including: determining the first gradient field of the second pixel to be filled in the outer image according to the original image; judging the repetition period of the original texture according to the first gradient field; determining the pixel value of the second pixel to be filled according to the repetition period; generating the outer image according to the pixel values ​​of all the second pixels to be filled in the outer image, thereby obtaining the extended image.

[0012] According to a specific embodiment of the present invention, determining the first gradient field of the second pixel to be filled in the outer image according to the original image includes: determining the position of the third reference pixel closest to the second pixel to be filled in the pixels on the edge of the original image; determining the first gradient field according to the second gradient field of the third reference pixel. Wherein, judging the repetition period of the original texture according to the first gradient field includes: finding the fourth and fifth reference pixels whose pixel values ​​in the original image are local extreme values ​​along the direction of the first gradient field; judging the interval distance between the fourth and fifth reference pixels; and determining the repetition period according to the interval distance.

[0013] According to a specific embodiment of the present invention, the pixel value of the second pixel to be filled is determined according to the repetition period, including: starting from the position of the second pixel to be filled, along the direction of the first gradient field, finding the sixth reference pixel in the original image that is separated from the second pixel to be filled by a spacing distance; and determining the pixel value of the second pixel to be filled according to the pixel value of the sixth reference pixel.

[0014] On the other hand, the present invention provides an image recognition device, including: an acquisition module for acquiring an original image with an original texture; an expansion module for expanding the original image according to the characteristics of the original texture to obtain an extended image; and a recognition module for recognizing the extended image.

[0015] On the other hand, the present invention provides an image recognition device, comprising: a processor; a memory; an application, wherein the application is stored in the memory and configured to be executed by the processor, and the application includes instructions for executing the above-mentioned image recognition method.

[0016] In another aspect, the present invention provides a computer-readable medium storing a computer program for executing the above-mentioned image recognition method.

[0017] Expanding the image before recognizing it can improve the recognition rate and reduce the miss rate of image recognition. Expanding the boundaries of the image in accordance with the original texture features can make the expanded image consistent with the image before expansion in certain aspects of the texture (such as direction, width, pattern, etc.), which is equivalent to expanding the recognizable area of ​​the texture, making the probability of successful texture recognition higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram showing a flow chart of an image recognition method according to an embodiment of the present invention;

[0019] Figure 2 A schematic diagram showing a flow chart of an image recognition method according to an embodiment of the present invention;

[0020] Figure 3 A schematic diagram showing a flow chart of an image recognition method according to an embodiment of the present invention;

[0021] Figure 4 A schematic diagram showing an image expansion method according to an embodiment of the present invention;

[0022] Figure 5 A schematic diagram showing a flow chart of an image recognition method according to an embodiment of the present invention;

[0023] Figure 6 A schematic diagram showing a flow chart of an image recognition method according to an embodiment of the present invention;

[0024] Figure 7 A schematic diagram showing an image expansion method according to an embodiment of the present invention;

[0025] Figure 8 A schematic diagram showing the structure of an image recognition device according to an embodiment of the present invention is shown;

[0026] Fig. 9 A schematic structural diagram of an image recognition device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0027] In order to make those skilled in the art understand the concept and thought of the present invention more clearly, the present invention is described in detail below in conjunction with specific embodiment.It should be understood that the embodiment provided herein is only a part of all embodiments that the present invention may have.Those skilled in the art, after reading the specification of the application, have the ability to make improvements, transformations, or replacements to part or the whole of the following embodiments, and these improvements, transformations, or replacements are also included in the scope of the present invention.

[0028] In this article, the terms "first", "second" and other similar words are not intended to imply any order, quantity and importance, but are only used to distinguish different elements. In this article, the terms "one", "an" and other similar words are not intended to indicate that there is only one of the things described, but rather indicate that the relevant description is only for one of the things described, and the things described may have one or more. In this article, the terms "comprise", "include" and other similar words are intended to indicate logical mutual relationships, and cannot be regarded as indicating spatial structural relationships. For example, "A includes B" is intended to indicate that B belongs to A logically, but does not indicate that B is located inside A spatially. In addition, the meanings of the terms "comprise", "include" and other similar words should be regarded as open, rather than closed. For example, "A includes B" is intended to indicate that B belongs to A, but B does not necessarily constitute the whole of A, and A may also include other elements such as C, D, and E.

[0029] In this document, the terms "embodiment", "this embodiment", "one embodiment", and "an embodiment" do not mean that the relevant description is only applicable to a specific embodiment, but rather that the description may also be applicable to one or more other embodiments. Those skilled in the art should understand that in this document, any description of a certain embodiment can be replaced, combined, or combined in other ways with the relevant descriptions in one or more other embodiments, and the new embodiments generated by the replacement, combination, or combination in other ways are easily conceivable by those skilled in the art and fall within the scope of protection of the present invention.

[0030] In various embodiments of the present invention, an image may refer to an impression or perception formed in the human brain by the distribution of light reflected or transmitted by an object. According to the form of the image, the image may include static images, such as photos, pictures, etc., and also dynamic images, such as videos, animated images (such as GIF (Graphics Interchange Format) pictures), etc. According to the way the image is generated, the image may include images taken with a camera or other imaging device, images drawn or synthesized manually, and images drawn or synthesized automatically by a machine. According to the format of the image (especially a digital image), the image may include a JPEG (Joint Photographic Experts Group) image, a PNG (Portable Network Graphics) image, a BMP (Bitmap) image, a TIFF (Tagged Image File Format) image, and a DICOM (Medical Imaging and Communications Standard) image. According to the purpose of images, images include life scene images (life photos, selfies, travel photos, etc.), identity recognition images (facial images, fingerprint images, iris images, gait images, etc.), medical images (CT images, X-ray images, nuclear magnetic resonance images, B-ultrasound (B-type ultrasound) images, etc.), geological images (geological radar images, rock thin section images, etc.), industrial inspection images (such as flaw detection images), monitoring images (visible light video monitoring images, infrared video monitoring images), astronomical observation images, electron microscope images, etc.

[0031] In various embodiments of the present invention, image recognition may refer to a technology that uses a computer to process, analyze and understand an image to identify targets and objects of various different patterns. Image recognition may include fingerprint image recognition, facial image recognition, license plate image recognition, medical image recognition, geological image recognition, etc. In various embodiments of the present invention, the general steps of image recognition include image acquisition, image preprocessing, feature extraction, and image recognition.

[0032] The following combination Figure 1 An image recognition method according to an embodiment of the present invention is described.

[0033] According to this embodiment, the image recognition method 100 includes:

[0034] S110, acquiring an original image with an original texture;

[0035] S120, expanding the original image according to the characteristics of the original texture to obtain an expanded image;

[0036] S130, identifying an extended image.

[0037] According to this embodiment, the image is expanded before being recognized, which can improve the recognition rate and reduce the off-target rate of image recognition. By expanding the boundary range of the image in a manner based on the original texture features, the image after expansion can be kept consistent with the image before expansion in certain aspects of texture (such as direction, width, pattern, etc.), which is equivalent to expanding the recognizable area of ​​the texture, making the probability of successful texture recognition higher.

[0038] In one embodiment, texture may refer to patterns or lines on the surface of an object, which are linear or block-shaped patterns on an object. In one embodiment, texture may refer to a pattern with directionality and repetitiveness. In one embodiment, texture may have a texture direction. For example, for a striped texture, the extension direction of a single stripe is the direction or extension direction of the texture. In one embodiment, texture may have a repetition period. For example, for a striped texture, the distance between stripes of the same color is the repetition period of the texture. In one embodiment, texture may also have a unit area. For example, for a regularly distributed dotted texture, the size of each dot is the unit area of ​​the texture. In one embodiment, texture may also have a repeating unit. For example, the texture on the surface of a football, the pentagons and hexagons on the surface may be regarded as a repeating unit. In one embodiment, texture may refer to a biometric texture, such as a fingerprint, a palm print, a vein texture, an iris texture, etc. Texture may also have other features.

[0039] In one embodiment, an image with texture may refer to an image showing texture on the entire image, or may refer to an image showing texture on only a portion of the image and not on the other portion. In one embodiment, obtaining an original image with original texture may refer to acquiring a texture image through an image acquisition device (e.g., a camera), such as acquiring a fingerprint image through a fingerprint acquisition device; or may refer to reading a texture image stored in a memory, such as a template image pre-stored in a fingerprint recognition device.

[0040] In one embodiment, according to the characteristics of the texture, it may refer to keeping the extension direction, repetition period, image style, repetition unit size and other characteristics of the texture unchanged or substantially unchanged. In one embodiment, expanding the image may refer to any operation means to expand the area of ​​the image. In a preferred embodiment, expanding the image only refers to forming a new image boundary outside the image, thereby expanding the display area of ​​the image. In one embodiment, expanding the image according to the characteristics of the texture may refer to increasing the display area of ​​the image and reproducing the texture characteristics in the original image in the new image part, so that the image after expansion can show more texture relative to the unexpanded image. In one embodiment, expanding the original image according to the characteristics of the original texture to obtain the expanded image may refer to keeping certain aspects of the original texture unchanged, increasing the display area of ​​the original image, and reflecting certain characteristics of the original texture in the increased part, so that the image obtained in this way is used as the expanded image. In one embodiment, expanding the original image according to the characteristics of the original texture to obtain the expanded image may be a process included in the preprocessing step in the usual steps of image recognition (image acquisition, image preprocessing, feature extraction, image recognition).

[0041] In one embodiment, identifying an extended image may refer to obtaining a desired result by identifying the image obtained after expansion through a recognition device. For example, for a fingerprint image, whether the fingerprint is the same as a pre-registered fingerprint template is determined by recognition, thereby determining whether the person to whom the fingerprint belongs has a specific identity, such as whether the person is allowed to enter a specific place.

[0042] The following describes another embodiment according to the present invention. Figure 1 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0043] According to the present embodiment, the extended image includes the original image and the outer image generated outside the original image.

[0044] According to this embodiment, the extended image includes the original image and the outer image, which means that the extended image according to this embodiment is obtained by generating a new part on the basis of keeping the original image unchanged. Such an extension method can more effectively expand the area of ​​the recognizable content of the original image than the extension method such as directly stretching the original image. Adding new content to the image, rather than simply expanding the size of the image (such as stretching, scaling, etc.), can enhance the obviousness and recognizability of the image features, thereby improving the recognition rate.

[0045] In one embodiment, the outer image may refer to an image located at one side of the original image, close to or separated from the original image by a distance. The position of the outer image may be set as needed, for example, at the upper side, lower side, left side and / or right side of the original image. In one embodiment, the original image may be in other shapes other than a rectangle, such as a circle, in which case the outer image may be set at the outside of the original image in any direction, or may be set around the entire original image to form a ring-shaped outer image. In one embodiment, for an elongated original image, the outer image may be set at both sides of the width direction of the original image, thereby increasing the width of the original image to facilitate recognition.

[0046] The following describes another embodiment according to the present invention. Figure 1 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0047] According to this embodiment, S120 includes:

[0048] According to the extension direction of the original texture, the original image is expanded to obtain an extended image.

[0049] According to this embodiment, by expanding the original image in a manner according to the extension direction of the texture, the trend of the texture can be made more obvious, so that the texture features expressed by the extension and direction of the texture can be captured and recognized more accurately.

[0050] In one embodiment, the extension direction of the original texture may refer to the length direction of the elongated shape in the original texture. For example, for a striped texture, the extension direction of the texture is the length direction of the strip in the strip. If the strip is a straight line, then the direction in which the entire strip extends to the left or right is the extension direction of the texture. If the strip is a curve, then the extension direction of the texture is for each point on the strip, and the tangent direction of a point on the strip is the extension direction of the texture at that point.

[0051] In one embodiment, according to the extension direction of the original texture, it may mean that the extension direction of the original texture is kept unchanged or substantially unchanged before the next operation is performed. In one embodiment, according to the extension direction of the original texture, the original image is extended to obtain the extended image, which may mean that a new image portion is generated outside the original image (close to the original image or separated from the original image by a certain distance), and the new image portion also has a texture similar to the texture in the original image, and the extension direction of the texture in the new image portion is consistent or substantially consistent with the extension direction of the texture in the original image. For example, the texture in the new image portion is generated immediately following the boundary of the texture in the original image, thereby continuing the pattern of the original texture.

[0052] The following reference Figure 2 Describe another embodiment according to the present invention, this embodiment is Figure 1 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0053] According to this embodiment, S120 further includes:

[0054] S210, determining a first direction field of a first pixel to be filled in the outer image according to an extension direction of the original texture;

[0055] S220, determining a pixel value of a first pixel to be filled according to the first direction field;

[0056] S230, generating an outer image according to the pixel values ​​of all first pixels to be filled in the outer image, thereby obtaining an extended image.

[0057] According to this embodiment, the extension direction of the original texture is expressed by the direction field, so that the direction characteristics of the original texture can be simply and effectively determined. There are many available means for calculating the direction field. By calculating the direction and trend of the original texture according to the direction field, the content of the outer image can be determined by a relatively simple algorithm, thereby efficiently generating an outer image that can reflect and be based on the characteristics of the original texture.

[0058] In one embodiment, the direction field may refer to that for any point (x, y), the direction field of the point may be defined as the angle between the tangent direction of the ridge (or valley) position and the horizontal axis. Methods for calculating the direction field include gradient-based methods, model-based methods, filter-based methods, and convolutional neural network-based methods. In one embodiment, the direction field of a pixel may refer to the direction field at the position of the pixel.

[0059] In one embodiment, the pixels to be filled may refer to pixels in the outer image whose pixel values ​​are unknown. If all pixels in the outer image whose pixel values ​​are unknown are assigned pixel values, the outer image is generated.

[0060] In one embodiment, determining the first direction field of the first pixel to be filled in the outer image based on the extension direction of the original texture may mean determining the direction of the original texture through the extension direction of the original texture, and assuming that the direction of the original texture remains unchanged within a certain range in the outer image, thereby determining the direction field of the pixel to be filled in the outer image.

[0061] In one embodiment, determining the pixel value of the first pixel to be filled according to the first direction field may refer to determining a pixel in the original image that can be referenced (as a reference pixel) according to the direction field of the pixel to be filled. Determine the pixel value of the pixel to be filled according to the pixel value of the reference pixel.

[0062] In one embodiment, the outer image is generated according to the pixel values ​​of all the first pixels to be filled in the outer image, thereby obtaining the extended image, which may mean that after all the unknown pixels in the outer image are filled with pixel values ​​according to the above method, the entire outer image (or a part of the outer image) is generated. Once the outer image is generated, the original image is spliced ​​with the generated outer image, or the outer image is directly generated outside the boundary of the original image, so as to form the extended image.

[0063] The following reference Figure 3 Describe another embodiment according to the present invention, this embodiment is Figure 1 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0064] According to this embodiment, the image recognition method 300 includes:

[0065] S310, acquiring an original image with an original texture;

[0066] S320, determining a position of a first reference pixel closest to a first pixel to be filled in pixels on an edge of the original image, where the first pixel to be filled is in an outer image generated outside the original image;

[0067] S330, determining a first direction field of a first pixel to be filled according to the second direction field of the first reference pixel;

[0068] S340, determining the position of a second reference pixel of the original image according to the position of the first pixel to be filled, the first direction field, and a first distance between the first pixel to be filled and the first reference pixel;

[0069] S350, determining a pixel value of a first pixel to be filled according to a pixel value of a second reference pixel;

[0070] S360, generating an outer image according to the pixel values ​​of all first pixels to be filled in the outer image, thereby obtaining an extended image, where the extended image includes the original image and the outer image;

[0071] S370, identifying the extended image.

[0072] According to this embodiment, since the texture has a certain regularity, it can be assumed that the reference pixel on the edge of the original image has the same direction field as the pixel to be filled in the outer image. After determining the direction field of the pixel to be filled, the target pixel point is searched in the original image along the direction of the direction field, and then the pixel value of the target pixel point is copied to the pixel to be filled. Such a method does not require a large computational overhead, and can largely maintain the texture direction of the original image in the outer image, so that the texture in the outer image is formed according to the extension direction of the texture of the original image, thereby improving the saliency of the texture of the original image.

[0073] In one embodiment, determining the position of the first reference pixel closest to the first pixel to be filled among the pixels on the edge of the original image may mean that after determining the position of the pixel to be filled, searching for the pixel closest to the pixel to be filled on the edge of the original image. For example, for a pixel to be filled near a vertical edge of the image (e.g., the left edge), the edge pixel closest to the pixel to be filled is the pixel on the same horizontal line as the pixel to be filled; for a pixel to be filled near a horizontal edge of the image (e.g., the top edge), the edge pixel closest to the pixel to be filled is the pixel on the same vertical line as the pixel to be filled; for a pixel to be filled near an arc edge of the image (e.g., the edge of a circular image), the edge pixel closest to the pixel to be filled is the pixel on the same radial line as the pixel to be filled.

[0074] In one embodiment, determining the first direction field based on the second direction field of the first reference pixel may mean directly using the direction field of the first reference pixel as the direction field of the pixel to be filled; or may mean performing calculation or transformation based on the direction field of the first reference pixel and obtaining the result as the direction field of the pixel to be filled.

[0075] In one embodiment, the first distance is the straight-line distance between the first pixel to be filled and the first reference pixel. In one embodiment, determining the position of the second reference pixel of the original image according to the position of the first pixel to be filled, the first direction field, and the first distance between the first pixel to be filled and the first reference pixel may refer to obtaining the position of the second reference pixel according to a geometric calculation method according to the position of the pixel to be filled, the direction field, and the straight-line distance between the pixel to be filled and the first reference pixel. The second reference pixel is a pixel used to determine the pixel value of the pixel to be filled.

[0076] In one embodiment, determining the pixel value of the first pixel to be filled based on the pixel value of the second reference pixel may mean directly using the pixel value of the second reference pixel as the pixel value of the first pixel to be filled, that is, copying the pixel value of the second reference pixel to the first pixel to be filled; or it may mean using the pixel value of the second reference pixel as a reference or basis, and performing further calculation or processing, and the pixel value thus obtained is used as the pixel value of the first pixel to be filled.

[0077] The following describes another embodiment according to the present invention. Figure 3 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0078] According to this embodiment, S340 includes:

[0079] Determine, according to the first distance, a second distance between the second reference pixel and the first pixel to be filled, in a direction of a first straight line where the first pixel to be filled and the first reference pixel are located;

[0080] Determine the angle between the direction of the first direction field and the first straight line;

[0081] Dividing the second distance by the tangent value of the angle to obtain a third distance between the second reference pixel and the first pixel to be filled in the direction of a second straight line perpendicular to the first straight line;

[0082] The position of the second reference pixel is determined according to the position of the first pixel to be filled and the second and third distances.

[0083] This embodiment determines the pixel value of the pixel to be filled in the outer image by the pixel value of the second reference pixel in the original image, and involves a method for determining the position of the second reference pixel value. According to this embodiment, the distance of the second reference pixel relative to the pixel to be filled in two mutually perpendicular directions (such as the horizontal direction and the vertical direction) can be obtained by simple function calculation (such as the tangent function), and then the position of the second reference pixel relative to the pixel to be filled is determined, achieving simple, accurate and efficient calculation.

[0084] In one embodiment, the second reference pixel may refer to a pixel on the edge of the original image, whose pixel value may be assigned to an unknown pixel to be filled. In one embodiment, determining the second distance between the second reference pixel and the first pixel to be filled in the direction of the first straight line where the first pixel to be filled and the first reference pixel are located together according to the first distance may refer to: taking the straight-line distance between the first pixel to be filled and the first reference pixel (i.e., the first distance) as a reference, determining the distance between the first pixel to be filled and the second reference pixel on the straight line where the first distance is located (i.e., the straight line where the first pixel to be filled and the first reference pixel are located together). When the pixel to be filled is near the straight edge of the original image (e.g., a vertical edge), the first distance is equal to the second distance (both are horizontal distances between the pixel to be filled and the vertical edge). When the pixel to be filled is near the convex edge of the original image, the first distance is less than the second distance. When the pixel to be filled is near the concave edge of the original image, the first distance is greater than the second distance.

[0085] In one embodiment, determining the angle between the direction of the first direction field and the first straight line may refer to determining the angle between the direction represented by the direction field of the pixel to be filled (for example, represented by the angle between the direction and the horizontal line) and the straight line (i.e., the first straight line) on which the pixel to be filled and the first reference pixel are located. For example, when the first pixel to be filled and the first reference pixel are on the same horizontal line (at this time, the edge of the original image is a vertical edge), the angle between the direction of the first direction field and the first straight line is the angle between the direction of the first direction field and the horizontal line.

[0086] In one embodiment, the second distance is divided by the tangent value of the angle to obtain a third distance between the second reference pixel and the first pixel to be filled in the direction of the second straight line perpendicular to the first straight line, which may mean: assuming that the first distance is equal to the second distance (at this time, the edge of the original image is a straight line edge), the first pixel to be filled, the first reference pixel, and the second reference pixel form a right triangle, wherein the point where the first reference pixel is located is the vertex of the right angle, the distance between the first pixel to be filled and the first reference pixel (i.e., the first or second distance) is the right side, the distance between the first pixel to be filled and the second reference pixel is the hypotenuse, and the distance between the first reference pixel and the second reference pixel (i.e., the third distance) is the other right side; the tangent value of the angle between the first direction field and the first straight line is the ratio of the third distance to the second distance; the third distance can be obtained by dividing the second distance by the tangent value of the angle.

[0087] Determining the position of the second reference pixel based on the position of the first pixel to be filled and the second and third distances may mean that the distance between the second reference pixel and the first pixel to be filled on the first straight line (i.e., the second distance) is known. If the distance between the second reference pixel and the first pixel to be filled on the second straight line (i.e., the straight line perpendicular to the first straight line) is also known (i.e., the third distance), the position of the second reference pixel relative to the first pixel to be filled can be accurately known.

[0088] The following reference Figure 4 Describe another embodiment according to the present invention, this embodiment is Figure 3 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0089] like Figure 4 As shown, the original image 401 is a rectangle, and the left side thereof is the outer image 402. The original image 401 and the outer image 402 together constitute an extended image. P0 is the first pixel to be filled, P1 is the first reference pixel, and P2 is the second reference pixel. On the edge of the original image 401, the pixel closest to P0 is P1, so P1 is the first reference pixel. Assuming that the direction field of P1 is consistent with the direction field of P0 (for a regular texture image, the direction field will not change within a small range), the direction field of P0 can be obtained by the direction field of P1. The straight line where P0 and P1 are located together is a horizontal line, and the distance between P0 and P1 (i.e., the first distance) is dx. The distance between P2 and P0 on the straight line where P0 and P1 are located together (i.e., the first straight line, which is a horizontal line in the figure) (i.e., the second distance) is also dx. Therefore, the first distance is equal to the second distance. As can be seen from the figure, the tangent value of θ (i.e., tanθ) is the ratio of dy to dx, i.e., tanθ=dy / dx. Therefore, dy=dx / tanθ. According to this formula, the distance between P2 and P0 in the direction of the second straight line (vertical line) perpendicular to the first straight line (horizontal line) (i.e., the third distance), i.e., dy, can be calculated. According to the position of P0, and the values ​​of dx and dy, the position of the second reference pixel P2 can be determined. The pixel value of P2 is copied to P0, and the filling of the unknown pixel P0 is completed. The above operation is performed for all pixels in the outer image 402 to fill the entire outer image (or a part thereof, and the other parts are filled in other ways).

[0090] The following describes another embodiment according to the present invention. Figure 1 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0091] According to this embodiment, S120 includes:

[0092] According to the repetition period of the original texture, the original image is expanded to obtain an extended image.

[0093] According to this embodiment, by expanding the original image according to the repetition period of the texture, the periodic characteristics of the texture can be more significantly highlighted, so that the texture features expressed by the periodic repetition of the texture in the original image can be more clearly captured and recognized, thereby improving the recognition success rate of the original image.

[0094] In one embodiment, the repetition period of the original texture may refer to the distance between the units that appear repeatedly in the original texture. For example, for a striped texture, the repetition period of the texture may be the distance between the stripes of the same color in the stripes. For a block texture, such as the texture on the surface of a football, the repetition period of the texture may be the distance between two adjacent pentagons, or the distance between two adjacent hexagons.

[0095] In one embodiment, according to the repetition period of the original texture, it may mean that the repetition period of the original texture is kept unchanged or substantially unchanged before the next operation is performed. In one embodiment, according to the repetition period of the original texture, the original image is extended to obtain the extended image, which may mean that the texture of the newly added part of the extended image relative to the original image is also repeatable, and the distance between the repeating units is consistent or substantially consistent with the distance between the repeating units in the original image.

[0096] The following reference Figure 5 Describe another embodiment according to the present invention, this embodiment is Figure 1 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0097] According to this embodiment, S120 further includes:

[0098] S510, determining a first gradient field of a second pixel to be filled in the outer image according to the original image;

[0099] S520, determining a repetition period of the original texture according to the first gradient field;

[0100] S530, determining a pixel value of a second pixel to be filled according to the repetition period;

[0101] S540: Generate an outer image according to the pixel values ​​of all second pixels to be filled in the outer image, so as to obtain an extended image.

[0102] According to this example, the repetition period is determined by the gradient field, and the extension direction of the repetitive feature of the texture can be determined in a simple and effective way. The gradient field can indicate the direction in which the pixel value in the image changes the fastest, which is usually the direction perpendicular to the tangent of the texture. Therefore, according to the gradient field, it can be determined how large the repetition period of the texture is in the direction perpendicular to the tangent of the texture. There are many mature algorithms for calculating the gradient field. This calculation method is not complicated and is suitable for quickly and effectively determining the repetition period of the texture image, and then determining the repetition period of the texture in the outer image.

[0103] In one embodiment, the gradient field may refer to the rate of change of a certain pixel of an image in the x and y directions (compared with adjacent pixels), which is a two-dimensional vector. The classic image gradient algorithm considers the grayscale change in a certain neighborhood of each pixel of the image, and uses the first-order or second-order derivative change law of the edge to set a gradient operator for a certain neighborhood of the pixel in the original image. Usually, we use a small area template for convolution to calculate, including Sobel operator, Robinson operator, Laplace operator, etc.

[0104] In one embodiment, determining the first gradient field of the second pixel to be filled in the outer image based on the original image may mean assuming that the gradient field of a pixel to be filled in the outer image is the same as that of a pixel in the original image, and the gradient field with the filled pixel can be obtained by solving the gradient field of the pixel in the original image.

[0105] In one embodiment, judging the repetition period of the original texture according to the first gradient field may refer to judging the repetition period of the partial texture associated with the pixel to be filled in the original image based on the information displayed by the gradient field of the pixel to be filled as a guide.

[0106] In one embodiment, determining the pixel value of the second pixel to be filled according to the repetition period may mean that after obtaining the repetition period of the partial texture associated with the pixel to be filled in the original image, the repetition period of the texture around the pixel to be filled can be known. According to the repetition period of the texture around the pixel to be filled, the texture variation law around the second pixel to be filled can be known, thereby obtaining the pixel value of the second pixel to be filled.

[0107] In one embodiment, an outer image is generated according to the pixel values ​​of all second pixels to be filled in the outer image, thereby obtaining an extended image. This may mean that according to the above method, after solving all pixel points in the outer image that are suitable for solving by the above method, a complete outer image (or a part of the outer image) is generated, thereby obtaining an extended image.

[0108] The following reference Figure 6 Describe another embodiment according to the present invention, this embodiment is Figure 5 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0109] According to this embodiment, the image recognition method 600 includes:

[0110] S610, acquiring an original image with an original texture;

[0111] S620, determining a position of a third reference pixel closest to a second pixel to be filled among pixels on an edge of the original image, where the second pixel to be filled is in an outer image generated outside the original image;

[0112] S630, determining a first gradient field of a second pixel to be filled according to a second gradient field of a third reference pixel;

[0113] S640, finding the fourth and fifth reference pixels whose pixel values ​​in the original image are local extreme values ​​along the direction of the first gradient field;

[0114] S650, determining the interval distance between the fourth and fifth reference pixels;

[0115] S660, determining a repetition period according to the interval distance;

[0116] S670, starting from the position of the second pixel to be filled, along the direction of the first gradient field, find a sixth reference pixel in the original image that is separated from the second pixel to be filled by a spacing distance;

[0117] S680, determining a pixel value of a second pixel to be filled according to the pixel value of the sixth reference pixel;

[0118] S690, generating an outer image according to the pixel values ​​of all second pixels to be filled in the outer image, thereby obtaining an extended image, where the extended image includes the original image and the outer image;

[0119] S691, identifying an extended image.

[0120] According to this embodiment, the repetition direction of the texture repetition period is determined by the gradient field, and the size of the repetition period (how many pixels are repeated once) is determined by the local extreme value. In this way, the repetitive characteristics of the texture are expressed by a simple and mature algorithm, so that the repetitive characteristics can be reproduced in the newly generated outer image in the extended image based on the repetitive characteristics.

[0121] In one embodiment, determining the first gradient field based on the second gradient field of the third reference pixel may mean that, assuming that the gradient field does not change within a certain range, the gradient field of the third reference pixel closest to the second pixel to be filled may be directly used as the gradient field of the second pixel to be filled. In one embodiment, determining the first gradient field based on the second gradient field of the third reference pixel may also mean that, after further calculation or transformation based on the second gradient field, the result obtained is used as the first gradient field of the pixel to be filled.

[0122] In one embodiment, the fourth and fifth reference pixels whose pixel values ​​in the original image are local extreme values ​​are found along the direction of the first gradient field. This may mean that the direction of the first gradient field is the cross-sectional direction of the texture, and the pixels whose pixel values ​​are local maximum values ​​or local minimum values ​​are found in the original image along the direction of the first gradient field, that is, two peaks (or ridges) or troughs (or valley lines) in the original image can be found. The process of finding local extreme values ​​may be to find a pixel whose pixel value is greater than both left and right pixel values ​​as a local maximum value, or to find a pixel whose pixel value is smaller than both left and right pixel values ​​as a local minimum value. Other similar methods are also conceivable.

[0123] In one embodiment, determining the distance between the fourth and fifth reference pixels may refer to determining the distance between the repeating units in the original image. Since the fourth and fifth pixels are both local extreme values, it can be determined that the two pixels are located at similar positions in a certain repeating unit, for example, both are located on the ridge line of the fingerprint. By calculating the distance between the two pixels, the repetition period of the original texture can be obtained.

[0124] In one embodiment, determining the repetition period according to the spacing distance may mean directly using the obtained spacing distance as the repetition period; or may mean performing further calculation or processing based on the spacing distance and obtaining the result as the repetition period of the texture.

[0125] In one embodiment, starting from the position of the second pixel to be filled, along the direction of the first gradient field, finding the sixth reference pixel in the original image that is separated from the second pixel to be filled by the spacing distance may refer to drawing a straight line along the direction of the first gradient field with the second pixel to be filled as the starting point, and the straight line passes through the original image. Among the pixel points on the straight line of the original image, the point that is separated from the second pixel to be filled by the spacing distance obtained by the above method can be used as the sixth reference pixel.

[0126] In one embodiment, determining the pixel value of the second pixel to be filled based on the pixel value of the sixth reference pixel may mean directly using the pixel value of the sixth reference pixel as the pixel value of the pixel to be filled; or it may mean that after further calculation or processing based on the pixel value of the sixth reference pixel, the result obtained is used as the pixel value of the second pixel to be filled.

[0127] The following reference Figure 7 Describe another embodiment according to the present invention, this embodiment is Figure 6 A specific instance of the embodiment may include one or more features of one or more of all the above embodiments.

[0128] like Figure 7 As shown, the original image 701 is a rectangle, and the elongated rectangle on the left is the outer image 702. The original image 701 and the outer image 702 together constitute the extended image. The direction of the direction field of P3 is at a large angle with the horizontal line (for example, greater than 80°, greater than 85°, or equal to 90°), so Figure 4 The method shown is no longer applicable. In this embodiment, P0 is an unknown pixel to be filled (i.e., the second pixel to be filled). The pixel point on the edge of the original image closest to P0 is P3 (i.e., a point on the same horizontal line as P0). Because of the regularity of the texture of the original image, it is assumed that the gradient field of P3 (as shown by the arrow, i.e., the second gradient field) is the same as the gradient field of P0, thereby obtaining the first gradient field of P0. Starting from P0, along the direction of the first gradient field (i.e., the direction of the long dashed line in the figure), two pixel points of local maximum values ​​are found in the original image, i.e., P4 (the fourth reference pixel point) and P5 (the fifth reference pixel point). According to the straight-line distance T between P4 and P5, the repetition period of the original texture of the original image is obtained. According to the distance T, starting from P0, search in the original image along the direction of the first gradient field to find the pixel point P6 (i.e., the sixth reference pixel point) separated by T from P0, and use the pixel value of P6 as the pixel value of P0 to fill P0. By performing the above-mentioned operation on the entire outer image 702, the pixel value of the entire outer image (or a part of the outer image) can be obtained, that is, the outer image is generated. Once the outer image is generated, the extended image is obtained.

[0129] The following combination Figure 8 An image recognition apparatus 800 according to an embodiment of the present invention is described.

[0130] According to this embodiment, the image recognition device 800 includes:

[0131] An acquisition module 810 is used to acquire an original image with an original texture;

[0132] An expansion module 820, used to expand the original image according to the characteristics of the original texture to obtain an expanded image;

[0133] The identification module 830 is used to identify the extended image.

[0134] For details on acquisition modules, extension modules, and identification modules, see the above section on Figure 1 Description of embodiments.

[0135] In one embodiment, the expansion module is further configured to:

[0136] According to the extension direction of the original texture, the original image is expanded to obtain an extended image.

[0137] In one embodiment, the expansion module includes:

[0138] A first determining unit, configured to determine a first direction field of a first pixel to be filled in the outer image according to an extension direction of the original texture;

[0139] A second determining unit, used to determine a pixel value of a first pixel to be filled according to the first direction field;

[0140] The first generating unit is used to generate the outer image according to the pixel values ​​of all the first pixels to be filled in the outer image, so as to obtain the extended image.

[0141] In one embodiment, the first generating unit is further configured to:

[0142] Determine a position of a first reference pixel closest to the first pixel to be filled among pixels on the edge of the original image;

[0143] Determining a first direction field according to the second direction field of the first reference pixel;

[0144] Wherein, the second determining unit is further configured to:

[0145] Determine the position of a second reference pixel of the original image according to the position of the first pixel to be filled, the first direction field, and a first distance between the first pixel to be filled and the first reference pixel;

[0146] The pixel value of the first pixel to be filled is determined according to the pixel value of the second reference pixel.

[0147] In one embodiment, the second determining unit is further configured to:

[0148] Determine, according to the first distance, a second distance between the second reference pixel and the first pixel to be filled, in a direction of a first straight line where the first pixel to be filled and the first reference pixel are located;

[0149] Determine the angle between the direction of the first direction field and the first straight line;

[0150] Dividing the second distance by the tangent value of the angle to obtain a third distance between the second reference pixel and the first pixel to be filled in the direction of a second straight line perpendicular to the first straight line;

[0151] The position of the second reference pixel is determined according to the position of the first pixel to be filled and the second and third distances.

[0152] In one embodiment, the expansion module is further configured to:

[0153] According to the repetition period of the original texture, the original image is expanded to obtain an extended image.

[0154] In one embodiment, the expansion module further includes:

[0155] A third determining unit, configured to determine, according to the original image, a first gradient field of a second pixel to be filled in the outer image;

[0156] A judging unit, used for judging a repetition period of the original texture according to the first gradient field;

[0157] A fourth determining unit, configured to determine a pixel value of a second pixel to be filled according to the repetition period;

[0158] The second generating unit is used to generate the outer image according to the pixel values ​​of all the second pixels to be filled in the outer image, so as to obtain the extended image.

[0159] In one embodiment, the third determining unit is further configured to:

[0160] Determine a position of a third reference pixel closest to the second pixel to be filled among pixels on the edge of the original image;

[0161] Determining a first gradient field according to a second gradient field of a third reference pixel;

[0162] Wherein, the judging unit is further configured to:

[0163] Find the fourth and fifth reference pixels whose pixel values ​​in the original image are local extreme values ​​along the direction of the first gradient field; determine the interval distance between the fourth and fifth reference pixels;

[0164] Determine the repetition period based on the interval distance.

[0165] In one embodiment, the fourth determining unit is further configured to:

[0166] Starting from the position of the second pixel to be filled, along the direction of the first gradient field, find a sixth reference pixel in the original image that is separated from the second pixel to be filled by a spacing distance;

[0167] The pixel value of the second pixel to be filled is determined according to the pixel value of the sixth reference pixel.

[0168] The following combination Fig. 9 An image recognition apparatus according to an embodiment of the present invention is described.

[0169] like Fig. 9 As shown, the image recognition device 900 includes one or more processors 910 and a memory 920 .

[0170] The processor 910 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the image recognition device 900 to perform desired functions.

[0171] The memory 920 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 910 may execute the program instructions to implement the parking method of each embodiment of the present application described above and / or other desired functions.

[0172] In one example, the image recognition device 900 may further include: an input device 930 and an output device 940 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0173] For example, the input device 930 may be a microphone or a microphone array for capturing voice input signals; it may be a communication network connector for receiving collected input signals from the cloud or other devices; it may also include, for example, a keyboard, a mouse, and the like.

[0174] The output device 940 can output various information to the outside, including the determined distance information, direction information, etc. The output device 940 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0175] Of course, to simplify, Fig. 9 Only some of the components related to the present application in the image recognition device 900 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the image recognition device 900 may also include any other appropriate components.

[0176] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the display control method according to various embodiments of the present application described above in this specification.

[0177] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0178] The above describes in detail the concepts, principles and ideas of the present invention in conjunction with specific implementation methods (including embodiments and examples). Those skilled in the art should understand that the implementation methods of the present invention are not limited to the several forms given above. After reading this application document, those skilled in the art can make any possible improvements, substitutions and equivalent forms to the steps, methods, devices and components in the above implementation methods, and these improvements, substitutions and equivalent forms should be deemed to fall within the scope of the present invention. The scope of protection of the present invention shall be subject only to the claims.

Claims

1. An image recognition method, comprising: Get the original image with the original texture; Expanding the original image according to the characteristics of the original texture to obtain an expanded image; identifying the extended image; The extended image includes the original image and an outer image generated outside the original image; The step of expanding the original image according to the feature of the original texture to obtain the expanded image comprises: Expanding the original image according to the extension direction of the original texture to obtain the expanded image; The step of expanding the original image according to the extension direction of the original texture to obtain the expanded image includes: Determining a first direction field of a first pixel to be filled in the outer image according to an extension direction of the original texture; Determining a pixel value of the first pixel to be filled according to the first direction field; Generate the outer image according to the pixel values ​​of all the first pixels to be filled in the outer image, so as to obtain the extended image; The step of determining a first direction field of a first pixel to be filled in the outer image according to an extension direction of the original texture includes: Determine a position of a first reference pixel closest to the first pixel to be filled among pixels on the edge of the original image; determining the first direction field according to the second direction field of the first reference pixel; The step of determining the pixel value of the first pixel to be filled according to the first direction field includes: Determine a position of a second reference pixel of the original image according to the position of the first pixel to be filled, the first direction field, and a first distance between the first pixel to be filled and the first reference pixel; Determining a pixel value of the first pixel to be filled according to the pixel value of the second reference pixel; The determining the position of the second reference pixel of the original image according to the position of the first pixel to be filled, the first direction field, and the first distance between the first pixel to be filled and the first reference pixel includes: Determine, according to the first distance, a second distance between the second reference pixel and the first pixel to be filled, in a direction of a first straight line on which the first pixel to be filled and the first reference pixel are located; Determining an angle between the direction of the first direction field and the first straight line; Dividing the second distance by the tangent value of the angle to obtain a third distance between the second reference pixel and the first pixel to be filled in the direction of a second straight line perpendicular to the first straight line; The position of the second reference pixel is determined according to the position of the first pixel to be filled and the second and third distances.

2. An image recognition method, comprising: Get the original image with the original texture; Expanding the original image according to the characteristics of the original texture to obtain an expanded image; identifying the extended image; The extended image includes the original image and an outer image generated outside the original image; Wherein, the step of expanding the original image according to the feature of the original texture to obtain the expanded image includes: Expanding the original image according to the repetition period of the original texture to obtain the expanded image; The step of extending the original image according to the repetition period of the original texture to obtain the extended image comprises: Determine, according to the original image, a first gradient field of a second pixel to be filled in the outer image; determining a repetition period of the original texture according to the first gradient field; Determining a pixel value of the second pixel to be filled according to the repetition period; Generate the outer image according to the pixel values ​​of all the second pixels to be filled in the outer image, so as to obtain the extended image; The step of determining, according to the original image, a first gradient field of a second pixel to be filled in the outer image comprises: Determine a position of a third reference pixel closest to the second pixel to be filled among pixels on the edge of the original image; determining the first gradient field according to the second gradient field of the third reference pixel; The step of determining the repetition period of the original texture according to the first gradient field includes: Finding fourth and fifth reference pixels whose pixel values ​​in the original image are local extreme values ​​along the direction of the first gradient field; Determining a spacing distance between the fourth and fifth reference pixels; Determining the repetition period according to the interval distance; The step of determining the pixel value of the second pixel to be filled according to the repetition period includes: Starting from the position of the second pixel to be filled, along the direction of the first gradient field, find a sixth reference pixel in the original image that is separated from the second pixel to be filled by the spacing distance; The pixel value of the second pixel to be filled is determined according to the pixel value of the sixth reference pixel.

3. An image recognition device, comprising: An acquisition module, used for acquiring an original image with an original texture; An expansion module, used for expanding the original image according to the characteristics of the original texture to obtain an expanded image; A recognition module, used for recognizing the extended image; The extended image includes the original image and an outer image generated outside the original image; The step of expanding the original image according to the feature of the original texture to obtain the expanded image comprises: Expanding the original image according to the extension direction of the original texture to obtain the expanded image; The step of expanding the original image according to the extension direction of the original texture to obtain the expanded image includes: Determining a first direction field of a first pixel to be filled in the outer image according to an extension direction of the original texture; Determining a pixel value of the first pixel to be filled according to the first direction field; Generate the outer image according to the pixel values ​​of all the first pixels to be filled in the outer image, so as to obtain the extended image; The step of determining a first direction field of a first pixel to be filled in the outer image according to an extension direction of the original texture includes: Determine a position of a first reference pixel closest to the first pixel to be filled among pixels on the edge of the original image; determining the first direction field according to the second direction field of the first reference pixel; The step of determining the pixel value of the first pixel to be filled according to the first direction field includes: Determine a position of a second reference pixel of the original image according to the position of the first pixel to be filled, the first direction field, and a first distance between the first pixel to be filled and the first reference pixel; Determining a pixel value of the first pixel to be filled according to the pixel value of the second reference pixel; The determining the position of the second reference pixel of the original image according to the position of the first pixel to be filled, the first direction field, and the first distance between the first pixel to be filled and the first reference pixel includes: Determine, according to the first distance, a second distance between the second reference pixel and the first pixel to be filled, in a direction of a first straight line on which the first pixel to be filled and the first reference pixel are located; Determining an angle between the direction of the first direction field and the first straight line; Dividing the second distance by the tangent value of the angle to obtain a third distance between the second reference pixel and the first pixel to be filled in the direction of a second straight line perpendicular to the first straight line; The position of the second reference pixel is determined according to the position of the first pixel to be filled and the second and third distances.

4. An image recognition device, comprising: processor; Memory; An application program, which is stored in the memory and configured to be executed by the processor, wherein the application program includes instructions for executing the image recognition method according to any one of claims 1-2.

5. A computer-readable medium storing a computer program for executing the image recognition method according to any one of claims 1 to 2.