Image Processing Method, Apparatus, Electronic Device, and Computer-Readable Storage Medium

By acquiring and processing the angle difference information in the image, and combining the reference points of the object to be identified, the problem of inaccurate image recognition in the prior art is solved, and high accuracy recognition of the object to be identified in the noisy image is achieved.

CN113962306BActive Publication Date: 2025-05-30HANGZHOU RUISHENG SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111235044.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2025-05-30
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

When existing image recognition techniques process images containing noise, it is difficult to accurately identify objects to be identified, such as the annual rings of trees.

Method used

By obtaining the angle difference information of the to-process area in the input image, combining the reference point of the object to be identified, image processing is performed to generate the angle difference image, and the angle difference information and the input image are recognized to improve the accuracy of the recognition result.

Benefits of technology

This method can effectively eliminate noise in the image and improve the recognition accuracy of the object to be recognized, especially when processing images containing complex patterns such as annual rings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113962306B_ABST
    Figure CN113962306B_ABST
Patent Text Reader

Abstract

An image processing method, an image processing device, an electronic device, and a computer-readable storage medium. The image processing method includes: obtaining an input image, where the input image includes an object to be recognized and a region to be processed, the region to be processed includes a plurality of first pixel points, and at least part of the object to be recognized is located in the region to be processed; performing first image processing on the input image to determine feature information of the object to be recognized, where the feature information includes a reference point of the object to be recognized; obtaining angular difference information of the region to be processed, where the angular difference information indicates the angular differences of the plurality of first pixel points, and the angular difference of each first pixel point is the angular difference value between the pixel direction between each first pixel point and the reference point and the gradient direction of each first pixel point; and performing recognition on the angular difference information and the input image to obtain a recognition result corresponding to the object to be recognized. This method can improve the accuracy of recognizing the object to be recognized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to an image processing method, an image processing apparatus, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of science and technology and economy, image processing technology has penetrated into all aspects of our lives and plays an indispensable role in modern life. For example, video playback, data and information extraction from images, etc. can be achieved by using image processing technology. Image recognition technology is one of the important applications in image processing technology. Image recognition technology can achieve face recognition, recognition of target features, etc. Summary of the Invention

[0003] At least one embodiment of the present disclosure provides an image processing method, including: obtaining an input image, where the input image includes an object to be recognized and a region to be processed, the region to be processed includes a plurality of first pixel points, and at least part of the object to be recognized is located in the region to be processed; performing first image processing on the input image to determine feature information of the object to be recognized, where the feature information includes a reference point of the object to be recognized; obtaining angular difference information of the region to be processed, where the angular difference information indicates the angular difference of the plurality of first pixel points, and the angular difference of each first pixel point is the angular difference value between the pixel direction between each first pixel point and the reference point and the gradient direction of each first pixel point; and performing recognition on the angular difference information and the input image to obtain a recognition result corresponding to the object to be recognized.

[0004] For example, in the image processing method provided in an embodiment of the present disclosure, the angular difference information includes an angular difference image, the angular difference image includes a plurality of second pixel points, and the plurality of second pixel points correspond to the plurality of first pixel points one by one. Obtaining the angular difference information of the region to be processed includes: obtaining the angular difference of the plurality of first pixel points; determining the gray values of the plurality of second pixel points according to the angular difference of the plurality of first pixel points, where the gray value of each second pixel point is determined according to the angular difference of the first pixel point corresponding to each second pixel point; and generating an angular difference image according to the gray values of the plurality of second pixel points.

[0005] For example, in the image processing method provided in an embodiment of the present disclosure, the gray value of each second pixel point is inversely correlated with the angular difference of the first pixel point corresponding to each second pixel point.

[0006] For example, in the image processing method provided in an embodiment of the present disclosure, obtaining the angular differences of a plurality of first pixel points includes: determining the gradient direction of each first pixel point; taking the direction of the vector formed by each first pixel point and a reference point as the pixel direction of each first pixel point, where the starting point of the vector is each first pixel point; and calculating the angular difference between the gradient direction of each first pixel point and the pixel direction of each first pixel point, and taking the angular difference as the angular difference of each first pixel point.

[0007] For example, in the image processing method provided in an embodiment of the present disclosure, determining the gradient direction of each first pixel point includes: respectively obtaining the gradient value of each first pixel point in a first direction and the gradient value in a second direction; and determining the gradient direction of each first pixel point according to the gradient value of each first pixel point in the first direction and the gradient value in the second direction.

[0008] For example, in the image processing method provided in an embodiment of the present disclosure, identifying the angular difference information and the input image to obtain the recognition result corresponding to the object to be recognized includes: performing edge detection on the input image to obtain the edge line graph corresponding to the input image; performing convolution calculation on the angular difference information and the edge line graph to obtain a projection graph; and recognizing the projection graph to obtain the recognition result corresponding to the object to be recognized.

[0009] For example, in the image processing method provided in an embodiment of the present disclosure, the feature information further includes the outer contour of the object to be recognized. Recognizing the projection graph to obtain the recognition result corresponding to the object to be recognized includes: performing second image processing on the projection graph according to the outer contour to obtain an image region, where the image region is the region where the object to be recognized is located, and the region to be processed includes the image region; and analyzing and processing the image region to obtain the recognition result corresponding to the object to be recognized.

[0010] For example, in the image processing method provided in an embodiment of the present disclosure, performing second image processing on the projection graph according to the outer contour to obtain an image region includes: performing cutting processing on the projection graph according to the outer contour to cut out the image region from the projection graph.

[0011] For example, in the image processing method provided in an embodiment of the present disclosure, performing second image processing on the projection graph according to the outer contour to obtain an image region includes: setting the gray value of each pixel point in other regions outside the outer contour in the projection graph to a fixed value to obtain the image region, where the size of the image region is the same as the size of the projection graph.

[0012] For example, in the image processing method provided in an embodiment of the present disclosure, analyzing and processing an image region to obtain an identification result corresponding to an object to be identified includes: normalizing the gray values of all pixel points in the image region to obtain a normalized image, where the gray value of each pixel point in the normalized image is within the range of [0, 255]; and analyzing the normalized image to obtain an identification result corresponding to the object to be identified.

[0013] For example, in the image processing method provided in an embodiment of the present disclosure, the object to be identified includes at least one stripe to be identified. Analyzing the normalized image to obtain an identification result corresponding to the object to be identified includes: analyzing and processing the normalized image to obtain the number of at least one stripe to be identified, where the identification result includes the number of at least one stripe to be identified.

[0014] For example, in the image processing method provided in an embodiment of the present disclosure, the normalized image includes at least one curved stripe with a first gray value and at least one curved stripe with a second gray value, and the at least one curved stripe with the first gray value and the at least one curved stripe with the second gray value are arranged alternately, and the second gray value is less than the first gray value. Analyzing and processing the normalized image to obtain the number of at least one stripe to be identified includes: taking a reference point as a vertex and drawing at least one ray from the reference point, where each ray intersects with at least one curved stripe with the first gray value and / or at least one curved stripe with the second gray value; for each ray, counting the number of times the gray value of the pixel points on the ray changes from the first gray value to the second gray value in the direction of the ray; and determining the number of at least one stripe to be identified based on the number of changes corresponding to each ray.

[0015] For example, in the image processing method provided in an embodiment of the present disclosure, at least one ray is multiple rays. Determining the number of at least one stripe to be identified based on the number of changes corresponding to each ray includes: calculating the average value of the multiple numbers of changes corresponding to the multiple rays, and taking the average value as the number of at least one stripe to be identified.

[0016] For example, in the image processing method provided in an embodiment of the present disclosure, performing a first image processing on an input image to determine the feature information of an object to be identified includes: performing a blurring process on the input image to obtain a blurred image; performing an edge detection on the blurred image to obtain a detection contour of the object to be identified; and fitting the detection contour to obtain an outer contour of the object to be identified and the center of the outer contour, where the center of the outer contour is the reference point.

[0017] For example, in the image processing method provided by an embodiment of the present disclosure, a first image processing is performed on an input image to determine the feature information of an object to be recognized, including: inputting the input image into a recognition model to recognize the feature information of the object to be recognized through the recognition model.

[0018] For example, in the image processing method provided by an embodiment of the present disclosure, the object to be recognized includes the cross-section of a tree, the cross-section of the tree includes the tree rings of the tree, and the recognition result includes the tree rings of the tree or the number of the tree rings of the tree.

[0019] At least one embodiment of the present disclosure provides an image processing apparatus, including: an image acquisition unit configured to acquire an input image, the input image including an object to be recognized and a region to be processed, the region to be processed including a plurality of first pixel points, and at least part of the object to be recognized being located in the region to be processed; a processing unit configured to perform a first image processing on the input image to determine the feature information of the object to be recognized, the feature information including a reference point of the object to be recognized; an angle difference acquisition unit configured to acquire angle difference information of the region to be processed, the angle difference information indicating the angle difference of the plurality of first pixel points, and the angle difference of each first pixel point being the angle difference between the pixel direction between each first pixel point and the reference point and the gradient direction of each first pixel point; and a recognition unit configured to perform recognition on the angle difference information and the input image to obtain a recognition result corresponding to the object to be recognized.

[0020] At least one embodiment of the present disclosure provides an electronic device, including a processor; a memory including one or more computer program modules; wherein, the one or more computer program modules are stored in the memory and configured to be executed by the processor, and the one or more computer program modules include those for implementing the image processing method provided by any embodiment of the present disclosure.

[0021] At least one embodiment of the present disclosure provides a computer-readable storage medium for non-temporarily storing computer-readable instructions, which can implement the image processing method provided by any embodiment of the present disclosure when executed by a computer. Description of the Drawings

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings described below only relate to some embodiments of the present disclosure and do not limit the present disclosure.

[0023] Figure 1A Shows a flowchart of an image processing method provided by at least one embodiment of the present disclosure;

[0024] Figure 1B Shows a schematic diagram of an input image provided by at least one embodiment of the present disclosure;

[0025] Figure 1C Schematic diagram showing the pixel direction and gradient direction of the exemplary pixel point P provided by at least one embodiment of the present disclosure;

[0026] Figure 1D Schematically shows Figure 1B the angular difference image of the input image shown;

[0027] Figure 2A Shows a method flow chart of step S20 provided by at least one embodiment of the present disclosure Figure 1A in;

[0028] Figure 2B Schematic diagram showing the blurred image obtained by at least one embodiment of the present disclosure executing step S21;

[0029] Figure 2C Schematic diagram showing the detected contour obtained by at least one embodiment of the present disclosure executing step S22;

[0030] Figure 2D Shows the outer contour of the object to be recognized and the center of the outer contour obtained by at least one embodiment of the present disclosure executing step S23;

[0031] Figure 2E Schematic diagram showing the area where the object to be recognized is located and the outer contour of the object to be recognized provided by at least one embodiment of the present disclosure;

[0032] Figure 3A Shows a method flow chart of step S30 provided by at least one embodiment of the present disclosure Figure 1A in;

[0033] Figure 3B Schematic diagram showing the effect diagram generated according to the gradient of pixels along the first direction provided by at least one embodiment of the present disclosure;

[0034] Figure 3C Schematic diagram showing the effect diagram generated according to the gradient of pixels along the second direction provided by at least one embodiment of the present disclosure;

[0035] Figure 3D Schematic diagram showing the effect diagram generated according to the gradient direction of each first pixel point provided by at least one embodiment of the present disclosure;

[0036] Figure 3E Schematic diagram showing the correspondence between the pixel direction and the gray scale of the pixel points provided by at least one embodiment of the present disclosure and the effect diagram generated according to the pixel direction of the pixels;

[0037] Figure 3F Schematic diagram showing the angular difference between two exemplary pixel points P and Q provided by at least one embodiment of the present disclosure;

[0038] Figure 4A shows the Figure 1A method flowchart of step S40 provided by at least one embodiment of the present disclosure;

[0039] Figure 4B schematically shows the Figure 1B edge line graph obtained by performing edge detection on the input image shown;

[0040] Figure 4C shows the projection graph obtained in step S42 provided by at least one embodiment of the present disclosure;

[0041] Figure 4D shows the Figure 4A method flowchart of step S43 provided by at least one embodiment of the present disclosure;

[0042] Figure 4E shows the image region obtained by performing cutting processing on the projection graph provided by at least one embodiment of the present disclosure;

[0043] Figure 4F shows the schematic diagram of the normalization processing provided by at least one embodiment of the present disclosure;

[0044] Figure 4G shows the normalized image obtained by normalizing the gray values of all pixel points in the image provided by at least one embodiment of the present disclosure;

[0045] Figure 5A shows the method flowchart of obtaining the number of at least one stripe to be recognized by performing analysis processing on the normalized image provided by at least one embodiment of the present disclosure;

[0046] Figure 5B shows the Figure 5A schematic diagram of the method shown;

[0047] Figure 6 shows the schematic block diagram of an image processing apparatus provided by at least one embodiment of the present disclosure;

[0048] Figure 7 shows the schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure;

[0049] Figure 8 shows the schematic block diagram of another electronic device provided by at least one embodiment of the present disclosure; and

[0050] Figure 9 shows the schematic diagram of a computer-readable storage medium provided by at least one embodiment of the present disclosure. Detailed implementation manners

[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present disclosure. Obviously, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.

[0052] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure shall have the ordinary meanings as understood by those of ordinary skill in the art to which the present disclosure pertains. The terms "first", "second", and similar terms used in the present disclosure do not denote any order, quantity, or importance, but are only used to distinguish different components. Similarly, terms such as "a", "an", or "the" do not denote a quantity limitation, but mean that there is at least one. Terms such as "comprising" or "including" mean that the elements or items appearing before the term cover the elements or items listed after the term and their equivalents, without excluding other elements or items. Terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Terms such as "upper", "lower", "left", "right", etc. are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0053] Image recognition technology has been widely applied, providing a great deal of assistance to our life and technological progress. For example, tree rings are an important basis for studying the growth laws of trees, calculating forest productivity, and climate change, and are of great significance for monitoring the growth status of forest trees. Traditional methods for tree ring recognition mainly involve manual measurement by professionals, which have many drawbacks such as large workload, low efficiency, high cost, and easy errors. With the development of image recognition technology, image recognition technology has been applied to the recognition of tree rings. However, due to some environmental factors, existing image recognition technology cannot accurately recognize the object to be recognized (e.g., tree rings). For example, due to scars generated during the growth of trees, burrs generated during the felling process, and noise points generated during the collection process, existing image recognition methods cannot accurately recognize tree rings.

[0054] At least one embodiment of the present disclosure provides an image processing method, an image processing apparatus, an electronic device, and a computer-readable storage medium. The image processing method includes: obtaining an input image, where the input image includes an object to be recognized and a region to be processed, the region to be processed includes a plurality of first pixel points, and at least part of the object to be recognized is located in the region to be processed; performing first image processing on the input image to determine feature information of the object to be recognized, where the feature information includes a reference point of the object to be recognized; obtaining angular difference information of the region to be processed, where the angular difference information indicates the angular differences of the plurality of first pixel points, and the angular difference of each first pixel point is the angular difference value between the pixel direction between each first pixel point and the reference point and the gradient direction of each first pixel point; and performing recognition on the angular difference information and the input image to obtain a recognition result corresponding to the object to be recognized.

[0055] The image processing method can recognize the object to be recognized in the input image according to the angular difference information between the pixel direction between the pixel points in the region to be processed in the input image and the reference point of the object to be recognized and the gradient method of the pixel points in the region to be processed, so as to eliminate the noise in the input image and improve the accuracy of recognizing the object to be recognized.

[0056] Figure 1A The flowchart of an image processing method provided by at least one embodiment of the present disclosure is shown.

[0057] As Figure 1A shown, the image processing method may include steps S10 to S40.

[0058] Step S10: Obtain an input image, where the input image includes an object to be recognized and a region to be processed, the region to be processed includes a plurality of first pixel points, and at least part of the object to be recognized is located in the region to be processed.

[0059] Step S20: Perform first image processing on the input image to determine feature information of the object to be recognized, where the feature information includes a reference point of the object to be recognized.

[0060] Step S30: Obtain angular difference information of the region to be processed, where the angular difference information indicates the angular differences of the plurality of first pixel points.

[0061] Step S40: Perform recognition on the angular difference information and the input image to obtain a recognition result corresponding to the object to be recognized.

[0062] For step S10, the input image can be a two-dimensional image or a three-dimensional image. For example, the input image can be a two-dimensional image or a three-dimensional stereoscopic image obtained by image acquisition device (such as digital camera, mobile phone or scanner, etc.) for image acquisition of the object to be recognized. For another example, the input image can be, for example, a two-dimensional image or a stereoscopic image of the object to be recognized constructed by design software or modeling software. For example, the input image can be a grayscale image or a color image. For example, the shape of the input image can be a regular shape such as rectangle or square, or an irregular shape, and the shape, size, etc. of the input image can be set by the user according to the actual situation. For example, the input image can be the original image directly acquired by the image acquisition device. In addition, in order to avoid the influence of the data quality, data imbalance, etc. of the original image on the recognition of the input image, the image processing method provided by the embodiments of the present disclosure can also include an operation of preprocessing the original image, that is, the input image can also be the image obtained after preprocessing the original image. For example, preprocessing can eliminate the irrelevant information or noise information in the original image to facilitate better processing of the original image. Preprocessing can include, for example, operations such as bending correction, scaling, cropping, Gamma correction, image enhancement or noise reduction filtering on the original image, so as to improve the accuracy and reliability of various operations in subsequent steps.

[0063] In some embodiments of the present disclosure, the object to be recognized includes the cross-section of a tree, and the cross-section of the tree includes the tree rings. For example, the input image is obtained by image acquisition device for image acquisition of the cross-section of a tree stump. In this input image, the cross-section of the tree stump is the object to be recognized.

[0064] In some embodiments of the present disclosure, the area to be processed of the input image can be the area containing the object to be recognized, or the area containing at least part of the object to be recognized. For example, the entire input image is the area to be processed, or, a part of the input image is the area to be processed. For example, the area where the object to be recognized in the input image is the area to be processed. Or, the area where part of the object to be recognized is located and part of the area other than the area where the object to be recognized is located in the input image are used as the area to be processed.

[0065] Figure 1B The schematic diagram of the input image provided by at least one embodiment of the present disclosure is shown.

[0066] As Figure 1B shown, the input image 100 can be obtained by image acquisition of a tree stump. The object to be recognized can be, for example, the cross-section 101 of the tree stump.

[0067] The area to be processed can be, for example, the entire input image 100, or the area where the cross-section 101 of the tree stump is located.

[0068] For step S20, for example, the feature information of the object to be recognized may be information describing the features of the object to be recognized, and the feature information includes the reference point of the object to be recognized. For example, the feature information may further include the outer contour of the object to be recognized.

[0069] In some embodiments of the present disclosure, the reference point may be, for example, the center of the outer contour, the center of gravity, etc.

[0070] For example, if the object to be recognized is a circular pattern or an elliptical pattern, the reference point of the object to be recognized may include the center of the circular pattern or the center of the elliptical pattern.

[0071] In some embodiments of the present disclosure, the object to be recognized may be an irregular pattern. For example, a tree stump is an irregular pattern similar to a circle or an ellipse. For an irregular pattern, for example, image processing may be performed on the input image to process the irregular pattern into the regular pattern closest to the irregular pattern, and then the feature information of the regular pattern may be used as the feature information of the object to be recognized. For example, for the cross-section of a tree stump, edge detection is performed on the tree stump to obtain the annual ring area where the annual rings of the tree stump are located, and then curve fitting is performed on the largest annual ring in the annual ring area to obtain the regular pattern closest to the largest annual ring, and this regular pattern is used as the outer contour of the annual ring area. For example, if the outer contour is a circle, the center of the circle and the radius of the circle may also be used as the feature information of the cross-section of the tree stump.

[0072] In some embodiments of the present disclosure, for example, the input image is input into the recognition model to recognize the feature information of the object to be recognized through the recognition model. The recognition model is obtained, for example, by training a neural network with multiple samples and the respective sample feature information of the multiple samples. For example, the recognition model may be implemented using machine learning techniques and may run on a general computing device or a dedicated computing device. The recognition models are all pre-trained neural network models. For example, the recognition model may be implemented using a neural network such as a deep convolutional neural network (DEEP-CNN).

[0073] In some other embodiments of the present disclosure, for example, first, preprocessing such as grayscale conversion, filtering and noise reduction (implemented based on, for example, a bilateral filter), and image segmentation (implemented based on, for example, an adaptive threshold segmentation algorithm, etc.) is performed on the input image, and then an edge detection operator (such as the canny operator or the soble operator in opencv, etc.) is used to extract the edges of the preprocessed input image to obtain the outer contour of the object to be recognized. Next, the Hough transform of gradient transformation is used to obtain several suspected centers of the outer contour, and finally, the K-medoids clustering algorithm is used to cluster the suspected centers to obtain the reference point.

[0074] Figure 2A shows a method flowchart of step S20 provided by at least one embodiment of the present disclosure. Figure 1A

[0075] In some other embodiments of the present disclosure, as Figure 2A shown, step S20 may include steps S21 to S23.

[0076] Step S21: Blur the input image to obtain a blurred image.

[0077] Step S22: Perform edge detection on the blurred image to obtain a detection contour of the object to be recognized.

[0078] Step S23: Fit the detection contour to obtain the outer contour of the object to be recognized and the center of the outer contour, and the center of the outer contour is used as a reference point.

[0079] For example, in the Figure 2A shown example, the first image processing includes blur processing, edge detection processing, and fitting processing.

[0080] The following will be described in conjunction with Figure 2B - 2D to illustrate the Figure 2A embodiment.

[0081] Figure 2B shows a schematic diagram of the blurred image obtained by at least one embodiment of the present disclosure when performing step S21.

[0082] For step S21, Figure 2B the image shown is the blurred image obtained by blurring the Figure 1B shown input image 100. For example, the input image 100 is blurred by Gaussian blur, mean filtering, etc. to obtain a blurred image.

[0083] Figure 2C shows a schematic diagram of the detection contour obtained by at least one embodiment of the present disclosure when performing step S22.

[0084] For step S22, for example Figure 2C the image shown is the detection contour of the object to be recognized obtained by performing edge detection on the Figure 2B shown blurred image using an edge detection operator. For example, in Figure 2C , the white line is the detection contour. The edge detection operator can be any one of the Canny operator, Sobel operator, Laplace operator, etc. in opencv.

[0085] Figure 2DShows the outer contour of the object to be recognized obtained by performing step S23 in at least one embodiment of the present disclosure and the center of the outer contour.

[0086] For step S23, for example, in some embodiments, Figure 2C The outer contour of the object to be recognized and the center of the outer contour are obtained by curve fitting the detected contour shown, as Figure 2D shown, the outer contour of the object to be recognized is outer contour 201, and outer contour 201 is a circular contour. The center of the circular outer contour is the center of the circle O. The center of the circle O is used as a reference point. For example, the least squares method can be used to perform curve fitting to obtain the outer contour of the object to be recognized, and then the center of the outer contour is determined according to the outer contour.

[0087] It should be noted that the outer contour of the object to be recognized can also be in a shape such as a roughly oval shape, and the present disclosure does not make specific limitations on the shape of the outer contour of the object to be recognized. The area surrounded by the outer contour of the object to be recognized and the area where the object to be recognized is located do not necessarily completely overlap, and the outer contour of the object to be recognized only needs to roughly surround the object to be recognized.

[0088] Figure 2E Shows a schematic diagram of the area where the object to be recognized is located and the outer contour of the object to be recognized provided by at least one embodiment of the present disclosure.

[0089] Figure 2E For example, it is to project the outer contour of the object to be recognized obtained by fitting onto the blurred image to obtain a schematic diagram.

[0090] As Figure 2E shown, the area 202 where the object to be recognized (i.e., the cross-section of the stump) is located and the area surrounded by the outer contour 201 of the object to be recognized do not completely overlap. The area of the area 202 where the object to be recognized (i.e., the cross-section of the stump) is located is slightly larger than the area surrounded by the outer contour 201 of the object to be recognized.

[0091] For step S30, the angular difference of each first pixel point is the angular difference between the pixel direction between each first pixel point and the reference point and the gradient direction of each first pixel point.

[0092] In some embodiments of the present disclosure, the direction of the vector formed by each first pixel point and the reference point is used as the pixel direction of each first pixel point, and the starting point of the vector is each first pixel point.

[0093] In some embodiments of the present disclosure, the gradient direction of each first pixel point is the direction of the gradient of each first pixel point.

[0094] In some embodiments of the present disclosure, the angular difference information includes an angular difference image. Figure 1C Exemplarily shows Figure 1BThe angular difference image of the area to be processed. The following will describe the pixel direction and gradient direction of the pixel points in conjunction with Figure 1C to illustrate.

[0095] Figure 1C The schematic diagram shows the pixel direction and gradient direction of the exemplary pixel point P provided by at least one embodiment of the present disclosure.

[0096] As Figure 1C shown, the pixel point P is an example of the first pixel point of the present disclosure. The pixel direction of the pixel point P is the direction of the vector formed by the pixel point P and the reference point O, and the starting point of the vector is the pixel point P.

[0097] As Figure 1C shown, the gradient direction of the pixel point P is the direction of the gradient of the pixel point P.

[0098] The angular difference of the pixel point P is the difference between the direction of the vector and the direction of the gradient of the pixel point P.

[0099] For example, the angle of the direction of the vector relative to the reference direction (the direction shown by the dashed line with an arrow in Figure 1C ) is α, and the angle of the direction of the gradient relative to the reference direction is β. Then, the difference between the direction of the gradient of the pixel point P and the direction of the vector is the difference β - α between the angle β and the angle α. That is, the angular difference of the pixel point P is the difference β - α between the angle β and the angle α. The reference direction can be, for example, the width direction of the input image, that is, the Figure 1C X direction in.

[0100] In some embodiments of the present disclosure, for example, the range of the angular difference of the pixel points is [-90°, 90°].

[0101] In some embodiments of the present disclosure, the angular difference information can be, for example, an angular difference image, and the angular difference image includes a plurality of second pixel points, and the plurality of second pixel points correspond to the plurality of first pixel points one by one.

[0102] In step S30, for example, an angular difference image of the area to be processed is obtained, and the gray value of each second pixel point in the angular difference image is inversely correlated with the angular difference of the first pixel point corresponding to each second pixel point. That is, the greater the angular difference of the pixel points in the area to be processed, the smaller the gray value of the pixel point corresponding to the pixel point in the angular difference image.

[0103] For example, a grayscale value of 255 (i.e., a white pixel) indicates that the angular difference is very small or zero, and a grayscale value of 0 (i.e., a black pixel) indicates that the angular difference is very large. For example, in a scenario where the object to be recognized is the cross-section of a tree, the smaller the angular difference of the pixel points in the area to be processed, the higher the probability that the pixel point is a tree ring. That is, in the cross-section of a tree, the angular difference of the pixel points corresponding to the tree rings is smaller. Therefore, the approximate line contour of the tree rings can be displayed through the angular difference image.

[0104] Figure 1D Schematically shows Figure 1B the angular difference image of the input image shown.

[0105] As Figure 1D shown, the angular difference image shows the approximate line contour of the tree rings.

[0106] In Figure 1D it, the line contour formed by the pixel points with higher grayscale values is the approximate line contour of the tree rings.

[0107] As Figure 1D shown, pixel points such as pixel point 101, pixel point 102, and pixel point 103 have higher grayscale values, and pixel points such as pixel point 101, pixel point 102, and pixel point 103 form the approximate line contour of the tree rings.

[0108] It should be understood that pixel point 101, pixel point 102, and pixel point 103 are only examples for facilitating the description of the approximate line contour of the tree rings. The approximate line contour of the tree rings is actually formed by a relatively large number of pixel points, rather than only three pixel points.

[0109] Figure 3A Shows a Figure 1A method flowchart of step S30 provided by at least one embodiment of the present disclosure.

[0110] As Figure 3A shown, step S30 may include step S31 to step S33.

[0111] Step S31: Obtain the angular differences of a plurality of first pixel points.

[0112] Step S32: Determine the grayscale values of a plurality of second pixel points according to the angular differences of the plurality of first pixel points, and the grayscale value of each second pixel point is determined according to the angular difference of the first pixel point corresponding to each second pixel point.

[0113] Step S33: Generate an angular difference image according to the grayscale values of the plurality of second pixel points.

[0114] In this embodiment, representing the angular differences of a plurality of first pixel points by an angular difference image facilitates the execution of step S40, and when the angular difference image is output, the angular differences of the plurality of first pixel points can be visually displayed.

[0115] For step S31, for example, determining the gradient direction of each first pixel point, taking the direction of the vector formed by each first pixel point and a reference point as the pixel direction of each first pixel point, with the starting point of the vector being each first pixel point, and calculating the angular difference between the gradient direction of each first pixel point and the pixel direction of each first pixel point, and this angular difference is the angular difference of the first pixel point.

[0116] For example, according to Figure 1C the method schematically described to determine the pixel direction and gradient direction of each first pixel point, and then calculate the angular difference between the gradient direction of each first pixel and the pixel direction of each first pixel point.

[0117] In some embodiments of the present disclosure, determining the gradient direction of each first pixel point includes: respectively obtaining the gradient value of each first pixel point in a first direction and the gradient value in a second direction, and determining the gradient direction of each first pixel point according to the gradient value of each first pixel point in the first direction and the gradient value in the second direction.

[0118] For example, performing grayscale processing on the input image to obtain a grayscale image, and then based on the grayscale image, respectively calculating the gradient value of the pixel points in the region corresponding to the region to be processed in the first direction and the gradient value in the second direction. The gradient values of each pixel point in the region corresponding to the region to be processed in the first direction and the second direction in the grayscale image are the gradient values of the corresponding first pixel points in the first direction and the second direction in the region to be processed.

[0119] In some embodiments of the present disclosure, the first direction can be, for example, the width direction of the grayscale image. The width direction of the grayscale image is consistent with the width direction of the input image. For example, the first direction is consistent with Figure 1C the X direction in Figure 1C The second direction can be a direction perpendicular to the first direction. The second direction is, for example, the height direction of the grayscale image, for example, consistent with

[0120] For example, the gradient value of the pixel point (x, y) in the first direction in the above grayscale image is calculated according to the formula gx = f(x + 1, y) - f(x, y). gx represents the gradient value in the first direction, f(x, y) is the grayscale value of the pixel point (x, y) in the above grayscale image, and f(x + 1, y) is the grayscale value of the pixel point (x + 1, y) adjacent to the pixel point (x, y) in the first direction.

[0121] In another embodiment of the present disclosure, for example, the sobel operator can be used to calculate the gradient of the pixel point in the first direction. Figure 3B The figure shows a first gradient image generated by using the sobel operator to calculate the gradient of the pixel point in the first direction in the grayscale image of the input image provided by at least one embodiment of the present disclosure. As Figure 3B shown, for example, the sobel operator is used to perform convolution calculation on the grayscale image of the input image to obtain the first gradient image, and the grayscale value of the pixel point in the first gradient image indicates the gradient value of the corresponding pixel point in the grayscale image in the first direction.

[0122] Similarly, the gradient value of the pixel point (x, y) in the second direction in the above grayscale image can be calculated according to the formula gy = f(x, y + 1) - f(x, y). gy represents the gradient value in the second direction, f(x, y) is the grayscale value of the pixel point (x, y) in the above grayscale image, and f(x, y + 1) is the grayscale value of the pixel point (x, y + 1) adjacent to the pixel point (x, y) in the second direction. Figure 3C The figure shows a second gradient image generated by using the sobel operator to calculate the gradient of the pixel point in the second direction in the grayscale image of the input image provided by at least one embodiment of the present disclosure. As Figure 3C shown, for example, the sobel operator is used to perform convolution calculation on the grayscale image of the input image to obtain the second gradient image, and the grayscale value pixel point in the second gradient image indicates the gradient value of the corresponding pixel point in the grayscale image in the second direction.

[0123] In some embodiments of the present disclosure, for example, if the gradient value of the pixel point in the first direction is gx and the gradient value in the second direction is gy, then the gradient direction of the pixel point can be represented by the arctangent of gy / gx, that is, the angle between the gradient direction and the reference direction is equal to arctan2(gy, gx).

[0124] Figure 3D The figure shows an effect diagram generated according to the gradient direction of each pixel point provided by at least one embodiment of the present disclosure.

[0125] For example, in Figure 3D , the grayscale value of each pixel point represents the gradient direction of the pixel point.

[0126] Figure 3E Shows the correspondence diagram between the pixel direction and the gray level of the pixel points provided by at least one embodiment of the present disclosure and the effect diagram generated according to the pixel direction of the pixel points.

[0127] Figure 3E The left diagram shows the correspondence between the pixel direction of the pixel point and the position of the pixel point in the effect diagram generated according to the pixel direction of the pixel point.

[0128] Figure 3E The right diagram shows an exemplary effect diagram generated according to the pixel directions of multiple pixel points.

[0129] In Figure 3E The gray level diagram in the right diagram is an exemplary effect diagram obtained by normalizing the pixel directions of multiple pixel points. For example, if the maximum value of the angle between the pixel directions of multiple pixel points in the input image and the reference direction is max, and the minimum value of the angle between the pixel directions of multiple pixel points in the input image and the reference direction is min, then the pixel direction can be normalized according to (A(x,y) – min) / (max - min), where A(x,y) is the angle between the pixel direction of the pixel point (x,y) and the reference direction.

[0130] In some embodiments of the present disclosure, the greater the angle difference between the direction of the vector formed by the pixel point and the reference point (i.e., the pixel direction) and the reference direction, the greater the gray level value of the pixel point.

[0131] As Figure 3E Shown in the left diagram, the angle range between the pixel direction of the pixel point and the reference direction is [-180°, 180°]. The smaller the angle between the pixel direction of the pixel point and the reference direction, the smaller the gray level value of the pixel point in the effect diagram. That is, the smaller the angle between the pixel direction of the pixel point and the reference direction, the darker the color of the pixel point in the effect diagram.

[0132] Figure 3F Shows a schematic diagram of the angle difference between two pixel points P and Q provided by an example shown in at least one embodiment of the present disclosure.

[0133] Pixel point P and two pixel points Q are examples of the first pixel point of the present disclosure. As Figure 3F Shown, the angle difference of pixel point P is the difference between the direction of the gradient of pixel point P and the direction of the vector That is, the difference between angle β and angle α, β - α.

[0134] The angle difference of pixel point Q is the difference between the direction μ of the gradient of pixel point Q and the direction of the vector of the direction The difference between, that is, the angle difference between angle μ and angle is small

[0135] As Figure 3F shown, the angle difference between the gradient direction of pixel point P and the pixel direction (i.e., the direction of the gradient is small compared to the direction of vector ), while the angle difference between the gradient direction of pixel point Q and the pixel direction (i.e., the direction μ of the gradient and the direction of vector is large ). In the scenario where the object to be recognized is the cross-section of a tree, the smaller the angle difference of the pixel point, the higher the probability that this pixel point represents an annual ring. Thus, it can be known that the probability that pixel point P is the pixel point corresponding to the annual ring is higher than the probability that pixel point Q is the pixel point corresponding to the annual ring.

[0136] For step S32, the gray values of multiple second pixel points are determined according to the angle differences of the first pixel points corresponding to each second pixel point. For example, according to the mapping relationship between the angle difference and the gray value of the first pixel point, the gray value of each second pixel point is determined. The mapping relationship can be set by the user according to the actual situation. For example, when the angle difference of the first pixel point is within the first angle difference range, the gray value of this first pixel point can be gray value A, and when the angle difference of the first pixel point is within the second angle difference range, the gray value of this first pixel point can be gray value B, and so on. The first angle difference range, the second angle difference range, gray value A, and gray value B can be preset by the user and stored in the form of a table.

[0137] In some other embodiments of the present disclosure, the angle difference information can also be an angle difference matrix formed by the angle differences of each pixel point in each region to be processed.

[0138] For step S40, for example, the object to be recognized includes at least one stripe to be recognized. The angle difference information of the pixel points in the image region where at least one stripe to be recognized is located and the input image are recognized to obtain at least one stripe to be recognized or the number of at least one stripe to be recognized. At this time, the recognition result corresponding to the object to be recognized is the shape, number, position (the position of at least one stripe to be recognized in the input image), etc. of at least one stripe to be recognized.

[0139] For example, in Figure 1B the shown input image, the object to be recognized includes the cross-section of a tree, and the cross-section of the tree includes the annual rings of the tree. Then the recognition result includes the annual rings of the tree or the number, shape, position (the position of the annual rings in the input image), etc. of the annual rings of the tree. The angle difference information of each pixel point in the cross-section and the input image are recognized to obtain the annual rings of the tree or the number of the annual rings of the tree.

[0140] It should be understood that although the cross-section or stripes of a tree are used as examples of the object to be recognized in this text to illustrate the embodiments of the present disclosure, the image processing method provided by the present disclosure is not limited to recognizing the cross-section or stripes of a tree. The stripes may include or be some concentric stripes, for example, interference stripes such as Newton's rings.

[0141] Figure 4A The method flowchart of step S40 provided by at least one embodiment of the present disclosure is shown. Figure 1A in

[0142] As Figure 4A shown, step S40 includes steps S41 to S43.

[0143] Step S41: Perform edge detection on the input image to obtain an edge line graph corresponding to the input image.

[0144] Step S42: Perform convolution calculation on the angle difference information and the edge line graph to obtain a projection graph.

[0145] Step S43: Recognize the projection graph to obtain a recognition result corresponding to the object to be recognized.

[0146] In this embodiment, by performing convolution calculation on the angle difference information and the edge line graph, the angle difference information and the edge line graph can be fused, thereby reducing the influence of noise, and further improving the recognition accuracy.

[0147] For step S41, for example, any one of the Canny operator, Sobel operator, Laplace operator, etc. is used to perform edge detection on the input image to obtain an edge line graph.

[0148] Figure 4B Schematically shows the Figure 1B edge line graph obtained by performing edge detection on the shown input image.

[0149] For step S42, the angle difference information may be, for example, an angle difference image, and convolution calculation (for example, convolution multiplication calculation) is performed on the angle difference image and the edge line graph to obtain a projection graph.

[0150] Figure 4C The projection graph obtained in step S42 provided by at least one embodiment of the present disclosure is shown.

[0151] For step S43, for example, the lines in the projection graph are recognized to obtain a recognition result.

[0152] Figure 4D The method flowchart of step S43 provided by at least one embodiment of the present disclosure is shown. Figure 4A in

[0153] As Figure 4D shown, step S43 may include step S431 and step S432.

[0154] In this embodiment, the feature information further includes the outer contour of the object to be recognized.

[0155] Step S431: According to the outer contour, perform a second image processing on the projection image to obtain an image region, where the image region is the region where the object to be recognized is located, and the region to be processed includes the image region.

[0156] In some embodiments of the present disclosure, the projection image is cut according to the outer contour to cut out the image region from the projection image.

[0157] For example, the regions outside the region surrounded by the outer contour in the projection image are removed, so as to cut out the image region from the projection image.

[0158] Figure 4E Shows the image region obtained by cutting the projection image provided by at least one embodiment of the present disclosure.

[0159] As Figure 4E shown, the area of this image region is close to or slightly larger than the area surrounded by the outer contour.

[0160] In some other embodiments of the present disclosure, the gray value of each pixel point in the region outside the region surrounded by the outer contour in the projection image is set to a fixed value to obtain an image region, and the size of the image region is the same as the size of the projection image. This method is simple and easy to implement.

[0161] For example, in some embodiments, the gray value of each pixel point in the region outside the region surrounded by the outer contour in the projection image is set to 127.

[0162] Step S432: Analyze and process the image region to obtain the recognition result corresponding to the object to be recognized.

[0163] In some embodiments of the present disclosure, step S432 includes: normalizing the gray values of all pixel points in the image region to obtain a normalized image; analyzing the normalized image to obtain the recognition result corresponding to the object to be recognized. For example, the gray value of each pixel point in the normalized image is in the range of [0, 255].

[0164] In some embodiments of the present disclosure, for example, the normalization process can be performed according to the following formula.

[0165] maxval, minval = np.max(projection), np.min(projection)

[0166] P = ((projection - minval) / (maxval - minval) * 255).astype(np.uint8)

[0167] maxval, minval = np.max(projection), np.min(projection) respectively calculate the maximum and minimum grayscale values in the projection image. maxval represents the maximum grayscale value, and minval represents the minimum grayscale value. projection represents the grayscale value of the pixel points in the projection image, and P represents the normalized grayscale value of the pixel points in the projection image. astype represents the variable type conversion function in the Python language.

[0168] Figure 4F The schematic diagram of the normalization process provided by at least one embodiment of the present disclosure is shown.

[0169] As Figure 4F shown, before normalization, the distribution of the grayscale values of multiple pixel points in the image area of the projection image is as shown by curve 401. At this time, the value range of the grayscale values is [-256, 256]. After normalization, the distribution of the grayscale values of multiple pixel points in the normalized image is as shown by curve 402. Figure 4F In the coordinate system shown, the abscissa represents the grayscale value, and the ordinate represents the number of pixel points.

[0170] In the embodiments of the present disclosure, since the projection image is obtained by performing convolution calculation on the angular difference information and the edge line drawing, therefore, in the matrix corresponding to the image area of the projection image, as shown by curve 401, there are elements with negative values. The elements with negative values are displayed as black in the projection image. However, the grayscale value of a pixel in the image is an integer in the range of [0, 255]. Therefore, in order to better identify the image area, it is necessary to normalize the grayscale values in the image area of the projection image. After the normalization process, the value range of the elements in the projection image becomes [0, 255]. The normalization process can be roughly understood as compressing curve 401 into curve 402, and the overall distribution shape of the grayscale values of multiple pixel points remains unchanged. As Figure 4F shown, the black pixel points in the image area of the projection image, that is, the pixel points with a grayscale value of 0, have a grayscale value of 127 in the normalized image.

[0171] Figure 4G The normalized image obtained by normalizing the grayscale values of all pixel points in the image area provided by at least one embodiment of the present disclosure is shown.

[0172] In Figure 4GIn the illustrated embodiment, the image region is obtained by setting the grayscale value of each pixel point in the region outside the region enclosed by the outer contour in the projection image to 127. At this time, the size of the image region is the same as that of the projection image, and the image region includes the region enclosed by the outer contour and the region outside the region enclosed by the outer contour.

[0173] By uniformly setting the grayscale value of each pixel point in the region outside the region enclosed by the outer contour in the projection image and the grayscale value of the black pixel points in the region enclosed by the outer contour in the projection image to 127, it is convenient to calculate the number of annual rings / stripes in the subsequent steps.

[0174] In some embodiments of the present disclosure, the object to be recognized includes at least one stripe to be recognized. Analyzing the normalized image to obtain the recognition result of the object to be recognized includes: analyzing and processing the normalized image to obtain the number of at least one stripe to be recognized, and the recognition result includes the number of at least one stripe to be recognized.

[0175] For example, according to the characteristics of the stripe to be recognized, the normalized image is recognized to determine the number of stripes having the characteristics of the stripe to be recognized in the normalized image. The characteristics of the stripe to be recognized may include, for example, the grayscale value of the stripe, the shape of the stripe, etc.

[0176] In some embodiments of the present disclosure, the normalized image includes at least one curved stripe having a first grayscale value and at least one curved stripe having a second grayscale value. The at least one curved stripe having a first grayscale value and the at least one curved stripe having a second grayscale value are arranged alternately, and the second grayscale value is less than the first grayscale value.

[0177] Figure 5A The flowchart shows a method for analyzing and processing a normalized image to obtain the number of at least one stripe to be recognized provided by at least one embodiment of the present disclosure.

[0178] As Figure 5A shown, analyzing and processing the normalized image to obtain the number of at least one stripe to be recognized may include step S510 to step S530.

[0179] Step S510: Taking the reference point as the vertex, at least one ray is drawn from the reference point, where each ray intersects at least one curved stripe having a first grayscale value and / or at least one curved stripe having a second grayscale value.

[0180] Step S520: For each ray, count the number of times the grayscale value of the pixel points on the ray changes from the first grayscale value to the second grayscale value in the direction of the ray.

[0181] Step S530: Determine the number of at least one stripe to be recognized based on the number of changes corresponding to each ray.

[0182] This embodiment determines the number of stripes to be recognized based on the number of changes in the gray - scale values of the pixel points on the ray, thereby improving the accuracy of determining the number of stripes to be recognized.

[0183] Figure 5B Illustrates at least one embodiment provided by the present disclosure Figure 5A Schematic diagram of the method shown. The following is combined with Figure 5B to illustrate Figure 5A the method. As Figure 5B shown, taking the cross - section of a tree as an example of the object to be recognized for illustration.

[0184] As Figure 5B shown, the normalized image includes at least one curved stripe 1 with a first gray - scale value and at least one curved stripe 2 with a second gray - scale value, and at least one curved stripe 1 with a first gray - scale value and at least one curved stripe 2 with a second gray - scale value are arranged alternately. As Figure 5B shown, the gray - scale value of the curved stripe 1 can be 127. The gray - scale value of the curved stripe 2 is 0.

[0185] For step S510, as Figure 5B shown, with the reference point O as the vertex, a plurality of rays R1 - R5 are drawn from the reference point O, and each ray in the plurality of rays R1 - R5 intersects at least one curved stripe 1 with a first gray - scale value and at least one curved stripe 2 with a second gray - scale value.

[0186] For step S520, for example, when the gray - scale value of the pixel point on the ray changes from non - zero to zero, that is, when the pixel point becomes black, it is considered that an annual ring appears, and the number of changes in the gray - scale value of the pixel point on the ray from the first gray - scale value to 0 is the number of annual rings.

[0187] As Figure 5B shown, for each ray, the direction of the ray is from the reference point O towards the outer contour. In the direction of the ray, the number of changes in the gray - scale value of the pixel points on the ray from the first gray - scale value to the second gray - scale value is counted.

[0188] As Figure 5B shown, for ray R1, in the direction of ray R1, the number of changes in the gray - scale value of the pixel points on ray R1 is 11 times. For ray R4, along the direction of ray R4 from the reference point O, the number of changes in the gray - scale value of the pixel points on ray R4 is 12 times.

[0189] In some embodiments of the present disclosure, at least one ray is a plurality of rays, the average value of the plurality of change times corresponding to the plurality of rays is calculated, and the average value is used as the number of at least one stripe to be recognized.

[0190] By calculating the average value of the change times of the plurality of rays, the influence of noise can be reduced, thereby further improving the accuracy of the recognition result.

[0191] For example, the plurality of rays have different angles relative to the reference direction. For example, an angle range of 0-90 degrees is selected, 90 rays are selected, the angles corresponding to the 90 rays are within the above angle range, and the change times corresponding to the 90 rays are averaged. Of course, 45 rays can also be selected, etc. Again, for example, the angle range can also be 0-270 degrees. It should be noted that in the embodiments of the present disclosure, the angle of each ray relative to the reference direction means: the angle determined by rotating from the reference direction in the counterclockwise direction (or clockwise direction) to the ray.

[0192] Figure 6 FIG. 600 shows a schematic block diagram of an image processing apparatus 600 provided by at least one embodiment of the present disclosure.

[0193] For example, as Figure 6 shown, the image processing apparatus 600 includes an image acquisition unit 610, a processing unit 620, an angle difference acquisition unit 630, and an identification unit 640.

[0194] The image acquisition unit 610 is configured to acquire an input image, the input image includes an object to be recognized and a region to be processed, the region to be processed includes a plurality of first pixel points, and at least part of the object to be recognized is located in the region to be processed.

[0195] The image acquisition unit 610 can, for example, execute Figure 1A the steps S10 described.

[0196] The processing unit 620 is configured to perform first image processing on the input image to determine the feature information of the object to be recognized, and the feature information includes the reference point of the object to be recognized.

[0197] The processing unit 620 can, for example, execute Figure 1A the steps S20 described.

[0198] The angle difference acquisition unit 630 is configured to acquire the angle difference information of the region to be processed, and the angle difference information indicates the angle difference of the plurality of first pixel points. The angle difference of each first pixel point is the angle difference between the pixel direction between each first pixel point and the reference point and the gradient direction of each first pixel point.

[0199] The angle difference acquisition unit 630 can, for example, execute Figure 1A the steps S30 described.

[0200] The recognition unit 640 is configured to recognize the angular difference information and the input image to obtain a recognition result corresponding to the object to be recognized.

[0201] The recognition unit 640 may, for example, execute Figure 1A the steps S40 described above.

[0202] For example, the image acquisition unit 610, the processing unit 620, the angular difference acquisition unit 630, and the recognition unit 640 may be hardware, software, firmware, and any feasible combination thereof. For example, the image acquisition unit 610, the processing unit 620, the angular difference acquisition unit 630, and the recognition unit 640 may be dedicated or general-purpose circuits, chips, or devices, etc., or may be a combination of a processor and a memory. Regarding the specific implementation forms of the above-mentioned respective units, the embodiments of the present disclosure do not limit this.

[0203] It should be noted that in the embodiments of the present disclosure, each unit of the image processing apparatus 600 corresponds to each step of the foregoing image processing method. For the specific functions of the image processing apparatus 600, reference may be made to the relevant descriptions of the image processing method, which will not be elaborated herein. Figure 6 The components and structures of the illustrated image processing apparatus 600 are merely exemplary and not restrictive. According to needs, the image processing apparatus 600 may further include other components and structures.

[0204] At least one embodiment of the present disclosure further provides an electronic device, which includes a processor and a memory. The memory includes one or more computer program modules. One or more computer program modules are stored in the memory and are configured to be executed by the processor. One or more computer program modules include instructions for implementing the above-mentioned image processing method. This electronic device can improve the accuracy of recognizing the object to be recognized.

[0205] Figure 7 It is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure. As Figure 7 shown, the electronic device 700 includes a processor 710 and a memory 720. The memory 720 is used for non-temporarily storing computer-readable instructions (such as one or more computer program modules). The processor 710 is used for running the computer-readable instructions. When the computer-readable instructions are run by the processor 710, one or more steps in the above-mentioned image processing method can be executed. The memory 720 and the processor 710 may be interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0206] For example, the processor 710 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units with data processing capabilities and / or program execution capabilities. For example, the central processing unit (CPU) may be of the X86 or ARM architecture, etc. The processor 710 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 700 to perform desired functions.

[0207] For example, the memory 720 may include any combination of 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. Volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage media, and the processor 710 may run one or more computer program modules to implement various functions of the electronic device 700. Various application programs and various data, as well as various data used and / or generated by the application programs, etc. may also be stored in the computer-readable storage media.

[0208] It should be noted that in the embodiments of the present disclosure, the specific functions and technical effects of the electronic device 700 may refer to the description of the image processing method in the foregoing text, and will not be elaborated herein.

[0209] Figure 8 A schematic block diagram of another electronic device provided for some embodiments of the present disclosure. The electronic device 900 is, for example, suitable for implementing the image processing method provided by the embodiments of the present disclosure. The electronic device 900 may be a terminal device, etc. It should be noted that Figure 8 The illustrated electronic device 900 is merely an example, and it will not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0210] As Figure 8 shown, the electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 910, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 920 or the program loaded from the storage device 980 into the random access memory (RAM) 930. In the RAM 930, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 910, the ROM 920, and the RAM 930 are connected to each other through a bus 940. The input / output (I / O) interface 950 is also connected to the bus 940.

[0211] Typically, the following devices can be connected to the I / O interface 950: input devices 960 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 970 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 980 including, for example, magnetic tapes, hard disks, etc.; and communication devices 990. The communication device 990 can allow the electronic device 900 to communicate with other electronic devices wirelessly or wiredly to exchange data. Although Figure 8 the electronic device 900 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices, and the electronic device 900 can alternatively implement or have more or fewer devices.

[0212] For example, according to an embodiment of the present disclosure, the above image processing method can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for executing the above image processing method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device 990, or installed from the storage device 980, or installed from the ROM 920. When the computer program is executed by the processing device 910, the functions defined in the image processing method provided by the embodiments of the present disclosure can be implemented.

[0213] At least one embodiment of the present disclosure also provides a computer-readable storage medium, which is used to non-temporarily store computer-readable instructions, and when the computer-readable instructions are executed by a computer, the above image processing method can be implemented. By using this computer-readable storage medium, the accuracy of recognizing an object to be recognized can be improved.

[0214] Figure 9 Schematic diagram of a storage medium provided for some embodiments of the present disclosure. As Figure 9 shown, the storage medium 1000 is used to non-temporarily store computer-readable instructions 1010. For example, the storage medium 1000 can be a non-transient storage medium. For example, when the computer-readable instructions 1010 are executed by a computer, one or more steps in the image processing method described above can be executed.

[0215] For example, the storage medium 1000 can be applied to the above electronic device 700. For example, the storage medium 1000 can be Figure 7 the memory 720 in the electronic device 700 shown. For example, the relevant description about the storage medium 1000 can refer to Figure 7 the corresponding description of the memory 720 in the electronic device 700 shown, and details are not described herein again.

[0216] The following points need to be explained:

[0217] (1) The accompanying drawings of the embodiments of the present disclosure only relate to the structures involved in the embodiments of the present disclosure, and other structures can refer to the general design.

[0218] (2) Without conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other to obtain new embodiments.

[0219] As mentioned above, it is only the specific implementation manner of the present disclosure, but the protection scope of the present disclosure is not limited thereto. The protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims

1. An image processing method, comprising: obtaining an input image, wherein the input image includes an object to be recognized and a region to be processed, the region to be processed includes a plurality of first pixel points, and at least part of the object to be recognized is located in the region to be processed; performing a first image processing on the input image to determine feature information of the object to be recognized, wherein the feature information includes a reference point of the object to be recognized; obtaining angular difference information of the region to be processed, wherein the angular difference information indicates an angular difference of the plurality of first pixel points, and the angular difference of each first pixel point is an angular difference value between a pixel direction between each first pixel point and the reference point and a gradient direction of each first pixel point; and recognizing the angular difference information and the input image to obtain a recognition result corresponding to the object to be recognized, wherein the angular difference information includes an angular difference image, the angular difference image includes a plurality of second pixel points, and the plurality of second pixel points correspond to the plurality of first pixel points one by one, obtaining the angular difference information of the region to be processed includes: obtaining the angular difference of the plurality of first pixel points; determining gray values of the plurality of second pixel points according to the angular difference of the plurality of first pixel points, wherein the gray value of each second pixel point is determined according to the angular difference of the first pixel point corresponding to each second pixel point; and generating the angular difference image according to the gray values of the plurality of second pixel points.

2. The method according to claim 1, wherein, the gray value of each second pixel point is inversely correlated with the angular difference of the first pixel point corresponding to each second pixel point.

3. The method according to claim 1, wherein, obtaining the angular difference of the plurality of first pixel points includes: determining the gradient direction of each first pixel point; taking the direction of the vector formed by each first pixel point and the reference point as the pixel direction of each first pixel point, wherein the starting point of the vector is each first pixel point; and calculating an angular difference value between the gradient direction of each first pixel point and the pixel direction of each first pixel point, and taking the angular difference value as the angular difference of each first pixel point.

4. The method according to claim 3, wherein, determining the gradient direction of each first pixel point includes: respectively obtaining a gradient value of each first pixel point in a first direction and a gradient value of each first pixel point in a second direction; and determining the gradient direction of each first pixel point according to the gradient value of each first pixel point in the first direction and the gradient value of each first pixel point in the second direction.

5. The method according to claim 1, wherein, recognizing the angular difference information and the input image to obtain a recognition result corresponding to the object to be recognized includes: performing edge detection on the input image to obtain an edge line graph corresponding to the input image; performing convolution calculation on the angular difference information and the edge line graph to obtain a projection graph; and recognizing the projection graph to obtain a recognition result corresponding to the object to be recognized.

6. The method according to claim 5, wherein, the feature information further includes the outer contour of the object to be recognized, recognizing the projection image to obtain the recognition result corresponding to the object to be recognized includes: performing second image processing on the projection image according to the outer contour to obtain an image area, wherein the image area is the area where the object to be recognized is located, and the area to be processed includes the image area; and analyzing and processing the image area to obtain the recognition result corresponding to the object to be recognized.

7. The method according to claim 6, wherein, performing second image processing on the projection image according to the outer contour to obtain the image area includes: performing cutting processing on the projection image according to the outer contour to cut out the image area from the projection image.

8. The method according to claim 6, wherein, performing second image processing on the projection image according to the outer contour to obtain the image area includes: setting the gray value of each pixel point in other areas outside the outer contour in the projection image to a fixed value to obtain the image area, wherein the size of the image area is the same as the size of the projection image.

9. The method according to claim 6, wherein, analyzing and processing the image area to obtain the recognition result corresponding to the object to be recognized includes: performing normalization processing on the gray values of all pixel points in the image area to obtain a normalized image, wherein the gray value of each pixel point in the normalized image is within the range of [0, 255]; and analyzing the normalized image to obtain the recognition result corresponding to the object to be recognized.

10. The method according to claim 9, wherein, the object to be recognized includes at least one stripe to be recognized, and analyzing the normalized image to obtain the recognition result of the object to be recognized includes: analyzing and processing the normalized image to obtain the number of the at least one stripe to be recognized, wherein the recognition result includes the number of the at least one stripe to be recognized.

11. The method according to claim 10, wherein, the normalized image includes at least one curvilinear stripe with a first gray value and at least one curvilinear stripe with a second gray value, and the at least one curvilinear stripe with the first gray value and the at least one curvilinear stripe with the second gray value are arranged alternately, and the second gray value is less than the first gray value, analyzing and processing the normalized image to obtain the number of the at least one stripe to be recognized includes: taking the reference point as the vertex and drawing at least one ray from the reference point, wherein each ray intersects with the at least one curvilinear stripe with the first gray value and / or the at least one curvilinear stripe with the second gray value; for each ray, counting the number of times the gray value of the pixel points on the ray changes from the first gray value to the second gray value in the direction of the ray; and determining the number of the at least one stripe to be recognized based on the number of times of change corresponding to each ray.

12. The method according to claim 11, wherein, the at least one ray is a plurality of rays, determining the number of the at least one stripe to be recognized based on the number of changes corresponding to each ray includes: calculating an average value of the numbers of changes corresponding to the plurality of rays, and using the average value as the number of the at least one stripe to be recognized.

13. The method according to claim 1, wherein, performing first image processing on the input image to determine feature information of the object to be recognized includes: performing blurring processing on the input image to obtain a blurred image; performing edge detection on the blurred image to obtain a detection contour of the object to be recognized; and performing fitting on the detection contour to obtain an outer contour of the object to be recognized and a center of the outer contour, wherein the center of the outer contour is the reference point.

14. The method according to claim 1, wherein, performing first image processing on the input image to determine feature information of the object to be recognized includes: inputting the input image into a recognition model to recognize the feature information of the object to be recognized through the recognition model.

15. The method according to any one of claims 1 to 14, wherein, the object to be recognized includes a cross-section of a tree, the cross-section of the tree includes tree rings of the tree, and the recognition result includes the tree rings or the number of the tree rings of the tree.

16. An image processing apparatus, comprising: an image acquisition unit configured to acquire an input image, wherein the input image includes an object to be recognized and a region to be processed, the region to be processed includes a plurality of first pixel points, and at least part of the object to be recognized is located in the region to be processed; a processing unit configured to perform first image processing on the input image to determine feature information of the object to be recognized, wherein the feature information includes a reference point of the object to be recognized; an angle difference acquisition unit configured to acquire angle difference information of the region to be processed, wherein the angle difference information indicates an angle difference of the plurality of first pixel points, and an angle difference of each first pixel point is an angle difference between a pixel direction between each first pixel point and the reference point and a gradient direction of each first pixel point; and a recognition unit configured to perform recognition on the angle difference information and the input image to obtain a recognition result corresponding to the object to be recognized, wherein the angle difference information includes an angle difference image, the angle difference image includes a plurality of second pixel points, the plurality of second pixel points correspond to the plurality of first pixel points one by one, and the angle difference acquisition unit is configured to: acquire the angle differences of the plurality of first pixel points; determine gray values of the plurality of second pixel points according to the angle differences of the plurality of first pixel points, wherein a gray value of each second pixel point is determined according to the angle difference of the first pixel point corresponding to each second pixel point; and generate the angle difference image according to the gray values of the plurality of second pixel points.

17. An electronic device, comprising: a processor; a memory including one or more computer program instructions; Among them, the one or more computer program instructions are stored in the memory and, when executed by the processor, implement the image processing method according to any one of claims 1-15.

18. A computer-readable storage medium storing non-temporary computer-readable instructions, wherein, when the computer-readable instructions are executed by a processor, the image processing method according to any one of claims 1-15 is implemented.

Citation Information

Patent Citations

  • Polar coordinate Fourier transform based rotation invariance image characteristic extraction method

    CN103646239A