An AR interactive method for children's toys
By calculating the gradient value and gradient direction of the toy surface image in children's toy AR interaction, separating and enhancing the gradient value of weak edge pixel points, the problem of traditional edge detection accurately identifying toy edges in uncertain lighting environments is solved, and the problem of improving the Identify accuracy.
Patent Information
- Application Number
- CN202411215025.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-02
AI Technical Summary
During the traditional extraction process of children's toy edges through Canny edge detection operator, due to the uncertainty of the external lighting environment, the edge detection results are incorrect, resulting in inaccurate identification results of the physical toy module.
By obtaining the grayscale image of the toy surface image, calculating the gradient value and gradient direction of the pixel points, separating the strong edge and weak edge pixel points, calculating the true degree and importance of the edge segment, and enhancing the gradient value of the weak edge pixel points, Finally identify the toy edge.
It realizes accurate identification of toy edges in uncertain lighting environments, and improves the recognition accuracy of physical toy modules.
Smart Images

Figure CN118736453B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an AR interactive method for children's toys. Background Art
[0002] With the development of science and technology and the improvement of living standards, AR technology has brought a more immersive and participatory experience to children, which can promote the development of their creativity, imagination and learning ability. Currently, AR interaction is becoming more and more common in the field of children's toys.
[0003] AR interaction first requires the user's mobile terminal to identify the physical toy to combine the virtual element with the toy. This requires segmenting each module of the physical toy in the image. Generally, each module of the toy is extracted through edge detection. However, in the traditional process of directly extracting the edges of each toy through the Canny edge detection operator, due to the uncertainty of the external lighting environment, errors occur in the edge detection results, resulting in inaccurate recognition results of each module of the physical toy. Therefore, the present invention proposes a method for accurately identifying the edges of toys for AR interaction of children's toys. Summary of the invention
[0004] The present invention provides an AR interactive method for children's toys to solve the existing problem that due to the uncertainty of the external lighting environment, errors occur in the edge detection results, resulting in inaccurate recognition results of various modules of the physical toy.
[0005] An AR interactive method for children's toys of the present invention adopts the following technical solution:
[0006] The following steps are involved:
[0007] Get a grayscale image of the toy surface image;
[0008] Obtain the gradient value and gradient direction of the pixel points in the grayscale image according to the grayscale image; obtain the strong edge pixel points and the weak edge pixel points in the grayscale image according to the gradient value of the pixel points in the grayscale image;
[0009] Obtain strong edge segments according to strong edge pixels and calculate the true degree of the strong edge segments;
[0010] Obtain the degree of change of the surrounding pixels of each weak edge pixel according to the weak edge pixel; obtain the weak edge segment according to the weak edge pixel, and obtain the degree of change of the surrounding pixels of the weak edge segment according to the degree of change of the surrounding pixels of all the weak edge pixels on the weak edge segment; calculate the similarity of the extension degree between the weak edge segment and the strong edge segment according to the gradient direction of the weak edge pixel on the weak edge segment and the gradient direction of the strong edge pixel on the strong edge segment, and select the true degree of the strong edge segment with the greatest similarity to the extension degree of the weak edge segment as the true degree of the weak edge segment; obtain the importance of the weak edge segment according to the true degree of the weak edge segment, the slope of the weak edge pixel on the weak edge segment, the degree of change of the surrounding pixels of the weak edge segment, and the gradient value of the weak edge pixel on the weak edge segment;
[0011] According to the importance of the weak edge segment, the gradient value of the weak edge pixel point on the weak edge segment is enhanced to obtain the enhanced gradient value of the weak edge pixel point; new strong edge pixel points are obtained according to the enhanced gradient value of the weak edge pixel point; all new strong edge pixel points and strong edge pixel points are recorded as target pixel points; the toy edge is obtained according to the target pixel point; and the toy is identified according to the toy edge.
[0012] Preferably, the grayscale image of the toy surface image is obtained, including the following specific methods:
[0013] The toy surface image is captured by the built-in camera of the user's mobile terminal, and the toy surface image is grayed to obtain a toy surface grayscale image; then the toy surface grayscale image is subjected to Gaussian filtering denoising to obtain a denoised toy surface grayscale image, which is recorded as a grayscale image.
[0014] Preferably, the method of obtaining the gradient value and gradient direction of the pixel points in the grayscale image according to the grayscale image; and obtaining the strong edge pixel points and the weak edge pixel points in the grayscale image according to the gradient value of the pixel points in the grayscale image includes the following specific methods:
[0015] Use the Canny edge detection operator on the grayscale image to obtain the gradient value and gradient direction of each pixel in the grayscale image; then preset two gradient value thresholds respectively , ; The gradient value in the grayscale image is greater than or equal to Less than Pixels with gradient values greater than or equal to The pixel points are recorded as strong edge pixels, where .
[0016] Preferably, the obtaining of the strong edge segment according to the strong edge pixel points and calculating the authenticity of the strong edge segment comprises the following specific methods:
[0017] The edge line composed of connected strong edge pixels in the grayscale image is recorded as a strong edge segment, and several strong edge segments are obtained; strong edge segment, The variance of the grayscale values of all strong edge pixels on the strong edge segment is multiplied by the The variance of the gradient direction of all strong edge pixels on the strong edge segment is multiplied by the The variance of the slopes of all strong edge pixels on the strong edge segment is recorded as the first product. The real degree of a strong edge segment.
[0018] Preferably, the method of obtaining the degree of change of surrounding pixels of each weak edge pixel according to the weak edge pixel; obtaining the weak edge segment according to the weak edge pixel, and obtaining the degree of change of surrounding pixels of the weak edge segment according to the degree of change of all weak edge pixels on the weak edge segment includes the following specific methods:
[0019] Construct a Window, all pixels except the central pixel in the window are regarded as the pixels around the central pixel of the window; the degree of change of the surrounding pixels of each weak edge pixel is calculated by the gray value of each pixel in the window, and the specific calculation formula is:
[0020]
[0021] In the formula, Indicates The degree of change of the surrounding pixels of a weak edge pixel; Indicated in the The variance of the grayscale values of all pixels in a window centered on a weak edge pixel; Indicated in the The gray value of the pixel with the largest gray value in the window centered on the weak edge pixel; Indicated in the The gray value of the pixel with the smallest gray value in the window centered on the weak edge pixel; represents the linear normalization function;
[0022] Then, the edge line composed of the connected weak edge pixels in the grayscale image is recorded as a weak edge segment, and several weak edge segments are obtained; the average value of the degree of change of the surrounding pixels of all the pixels on the weak edge segment is taken as the degree of change of the surrounding pixels of the weak edge segment.
[0023] Preferably, the calculating of the similarity of the extension degree between the weak edge segment and the strong edge segment comprises the following specific methods:
[0024] For The strong edge segment and edge segments and weak edge segments, obtain the The mean of the gradient directions of all the strong edge pixels on the first strong edge segment is The first difference between the mean values of the gradient directions of all weak edge pixels on the weak edge segments is obtained according to the first difference. The strong edge segment and The similarity of the extension degree between the weak edge segments.
[0025] Preferably, the obtaining of the importance of the weak edge segment includes a specific calculation formula as follows:
[0026]
[0027] In the formula, Indicates The importance of weak edge segments; Indicates The variance of the slopes of all weak edge pixels on a weak edge segment; Indicates The true degree of a weak edge segment; Indicates The variance of the gradient values of all weak edge pixels on a weak edge segment; Indicates the degree of change of the surrounding pixels of the weak edge segment; represents the linear normalization function.
[0028] Preferably, the step of enhancing the gradient value of the weak edge pixel point on the weak edge segment according to the importance of the weak edge segment to obtain the enhanced gradient value of the weak edge pixel point includes the following specific calculation formula:
[0029]
[0030] In the formula, Indicates The first of the weak edge segments The gradient value of the weak edge pixel after enhancement; Indicates The first of the weak edge segments The gradient value of weak edge pixels; Indicates The importance of a weak edge segment.
[0031] Preferably, the method of obtaining a new strong edge pixel point according to the gradient value after the weak edge pixel point is enhanced includes the following specific methods:
[0032] By preset gradient value threshold , if the gradient value of the weak edge pixel after enhancement is greater than or equal to the gradient value threshold , then the enhanced weak edge pixel points are recorded as new strong edge pixel points; and several new strong edge pixel points are obtained.
[0033] Preferably, the method of acquiring the edge of the toy according to the target pixel point and identifying the toy according to the edge of the toy includes the following specific methods:
[0034] The edge line composed of connected target pixel points in the grayscale image is recorded as a target pixel segment, and a number of target pixel segments are obtained; then a true degree threshold is preset. , the degree of truth is greater than or equal to The target pixel segment is recorded as the toy edge pixel segment;
[0035] All toy edge pixel segments are regarded as toy edges; a structural similarity index is calculated between the toy edge and the toy edge pre-stored in the AR device to obtain a structural similarity index between the toy edge and the toy edge pre-stored in the AR device;
[0036] Finally, a similarity threshold is preset , if the structural similarity index between the toy edge and the image pre-saved in the AR device is greater than or equal to , the toy edge is displayed on the AR device.
[0037] The beneficial effect of the technical solution of the present invention is that in the traditional process of directly extracting the edges of each toy through an edge detection operator, due to the uncertainty of the external lighting environment, errors occur in the edge detection results, resulting in inaccurate subsequent recognition results of the physical toy module. The present invention enhances the pixel points with small gradients in the toy according to the influence of light on the toy boundary, and determines whether the pixel points with large gradients are toy edge pixels, thereby achieving the purpose of accurately identifying the toy edge. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 The present invention is a flowchart of the steps of an AR interactive method for children's toys. DETAILED DESCRIPTION
[0040] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the AR interactive method for children's toys proposed according to the present invention, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0041] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0042] The following is a detailed description of a specific scheme of an AR interactive method for children's toys provided by the present invention in conjunction with the accompanying drawings.
[0043] See also Figure 1 , which shows a flowchart of an AR interactive method for children's toys provided by an embodiment of the present invention, the method comprising the following steps:
[0044] Step S001: Collect the toy surface image and obtain the grayscale image.
[0045] It should be noted that this embodiment, as a toy AR interaction method, requires the user's mobile terminal to identify the physical toy and combine the virtual elements with the toy. Therefore, it is necessary to first collect the toy surface image. At the same time, in order to better combine the virtual elements with the physical toy, the toy surface image also needs to be pre-processed.
[0046] Specifically, the toy surface image is captured through the built-in camera of the user's mobile terminal, and the toy surface image is grayscaled to obtain a toy surface grayscale image; then the toy surface grayscale image is subjected to Gaussian filtering denoising to obtain a denoised toy surface grayscale image, which is recorded as a grayscale image.
[0047] At this point, a grayscale image is obtained.
[0048] Step S002: Obtain the gradient value and gradient direction of the pixel points in the grayscale image according to the grayscale image; obtain the strong edge pixel points and the weak edge pixel points in the grayscale image according to the gradient value of the pixel points in the grayscale image.
[0049] It should be noted that, since this embodiment is an AR interactive method of a toy, it is necessary to combine the physical toy with the virtual elements, so it is necessary to obtain the morphological characteristics of the toy through a grayscale image.
[0050] Specifically, the Canny edge detection operator is first used on the grayscale image to obtain the gradient value and gradient direction of each pixel in the grayscale image; then two gradient value thresholds are preset respectively. , ,in , The specific size can be set according to the actual situation. This embodiment does not make a rigid requirement. In this implementation, , Narrate, and ; The gradient value in the grayscale image is greater than or equal to Less than Pixels with gradient values greater than or equal to The pixel point is recorded as a strong edge pixel point; if the gradient value of the pixel point in the grayscale image is less than , then the pixel is not an edge pixel.
[0051] At this point, the morphological characteristics of the toy are obtained.
[0052] Step S003: obtaining a strong edge segment according to the strong edge pixel points and calculating the authenticity of the strong edge segment.
[0053] It should be noted that since this embodiment is an AR interaction method for a toy, and the user may interact with the toy in any environment, the external lighting environment of the toy surface image collected by the mobile terminal is unstable, and the lighting will affect the toy surface image collected by the mobile terminal, resulting in the inability to obtain an accurate toy edge. Therefore, it is necessary to analyze the lighting effect in the toy surface image to obtain an accurate toy edge.
[0054] Specifically, a connected domain composed of adjacent strong edge pixels in a grayscale image is recorded as a strong edge segment, and a plurality of strong edge segments are obtained.
[0055] It should be noted that, since the pixels are classified only by the gradient value of the pixels in the grayscale image in step S002, the obtained strong edge pixels are not necessarily on the edge of the toy. Therefore, it is necessary to calculate the true degree of the strong edge segment composed of the strong edge pixels by the grayscale value of the strong edge pixels, the gradient direction of the strong edge pixels and the slope of the strong edge pixels.
[0056] For strong edge segment; through the The gray value, gradient direction and slope of the strong edge pixel on the strong edge segment are calculated; the true degree of the strong edge segment is calculated, and the specific calculation formula is:
[0057]
[0058] In the formula, Indicates The authenticity of a strong edge segment; Indicates The variance of the grayscale values of all strong edge pixels on a strong edge segment; Indicates The variance of the gradient direction of all strong edge pixels on a strong edge segment; Indicates The variance of the slopes of all strong edge pixels on a strong edge segment; Represents an exponential function with natural numbers as base.
[0059] It should be further explained that, since the grayscale values of the pixels at the edge of the toy are always consistent, the smaller the variance of the grayscale values of all strong edge pixels on the strong edge segment, the more likely the strong edge segment is to be at the edge of the toy; at the same time, the gradient direction of the pixels at the edge of the toy is always consistent, so the smaller the variance of the gradient direction of all strong edge pixels on the strong edge segment, the more likely the strong edge segment is to be at the edge of the toy; and the slope of the pixels at the edge of the toy is always consistent; therefore, the smaller the variance of the slope of all strong edge pixels on the strong edge segment, the more likely the strong edge segment is to be at the edge of the toy; therefore, the greater the degree of authenticity of the strong edge segment obtained in the end, the more likely the strong edge segment is to be at the edge of the toy.
[0060] At this point, the true extent of the strong edge segment is obtained.
[0061] Step S004: Obtain the importance of the weak edge segment according to the authenticity of the weak edge pixel point and the strong edge segment.
[0062] It should be noted that, under normal circumstances, the gradient direction of pixels on the edge of the toy tends to be consistent. However, since light will affect the toy surface image collected by the mobile terminal, the gradient value of the pixel points in the toy surface image will change. Specifically, some of the strong edge pixels in the grayscale image that were originally strong edge pixels become weak edge pixels. If the weak edge pixels that were originally strong edge pixels are important, the importance of the weak edge segment composed of the weak edge pixels can be calculated, and the gradient of the weak edge pixels in the weak edge segment can be enhanced according to the importance of the weak edge segment.
[0063] Specifically, a window, is the default window size, The specific size can be set according to the actual situation. This embodiment does not make a rigid requirement. To further describe, all pixels in the window except the central pixel are regarded as the pixels around the central pixel of the window; the degree of change of the surrounding pixels of each weak edge pixel is calculated by the gray value of each pixel in the window, and the specific calculation formula is:
[0064]
[0065] In the formula, Indicates The degree of change of the surrounding pixels of a weak edge pixel; Indicated in the The variance of the grayscale values of all pixels in a window centered on a weak edge pixel; Indicated in the The gray value of the pixel with the largest gray value in the window centered on the weak edge pixel; Indicated in the The gray value of the pixel with the smallest gray value in the window centered on the weak edge pixel; represents the linear normalization function.
[0066] It should be noted that the greater the variance of the grayscale values of the surrounding pixels of the weak edge pixel, the stronger the influence of light on the weak edge pixel; among the surrounding pixels of the weak edge pixel, the greater the difference between the grayscale value of the pixel with the largest grayscale value and the grayscale value of the pixel with the smallest grayscale value, the stronger the influence of light on the weak edge pixel; therefore, the greater the degree of change of the surrounding pixels of the weak edge pixel, the stronger the influence of light on the weak edge pixel.
[0067] Then, the connected domain composed of adjacent weak edge pixels in the grayscale image is recorded as a weak edge segment, and several weak edge segments are obtained; the average value of the degree of change of the surrounding pixels of all pixels on the weak edge segment is taken as the degree of change of the surrounding pixels of the weak edge segment.
[0068] It should be noted that if the weak edge pixel should originally be a strong edge pixel, the extension trend of the weak edge segment where the weak edge pixel is located is similar to the extension trend of the original strong edge segment; therefore, the similarity of the extension degree between each weak edge segment and each strong edge segment in the grayscale image can be calculated to obtain each strong edge segment that is most similar to the weak edge segment.
[0069] Furthermore, the calculation formula for calculating the similarity of the extension degree between the weak edge segment and the strong edge segment is as follows:
[0070]
[0071] In the formula, Indicates The mean value of the gradient direction of all strong edge pixels on a strong edge segment; Indicates The mean value of the gradient direction of all weak edge pixels on a weak edge segment; Indicates The strong edge segment and The similarity of the extension between the weak edge segments; represents an exponential function with a natural constant as base; Represents absolute value operation.
[0072] It should be noted that The larger the value of The strong edge segment and The more similar the extensions between the weak edge segments are; The smaller the value of The strong edge segment and The more dissimilar the extensions between the weak edge segments are.
[0073] Furthermore, the true degree of the strong edge segment that is most similar to the extension degree of the weak edge segment is selected as the true degree of the weak edge segment.
[0074] It should be further explained that the greater the authenticity of the weak edge segment, the greater the variance of the slopes of all weak edge pixels on the weak edge segment, the more concentrated the gradient values of the weak edge pixels on the weak edge segment, and the greater the degree of change of the surrounding pixels of the weak edge segment, the more important the weak edge pixel segment is, thereby obtaining the importance of the weak edge pixel segment.
[0075] Furthermore, the importance of the weak edge pixel segment is finally obtained through the true degree of the weak edge segment, the variance of the slopes of all weak edge pixels on the weak edge segment, the gradient value of the weak edge pixel on the weak edge segment, and the degree of change of the surrounding pixels of the weak edge segment. The specific calculation formula is:
[0076]
[0077] In the formula, Indicates The importance of weak edge segments; Indicates The variance of the slopes of all weak edge pixels on a weak edge segment; Indicates The true degree of a weak edge segment; Indicates The variance of the gradient values of all weak edge pixels on a weak edge segment; Indicates the degree of change of the surrounding pixels of the weak edge segment; represents the linear normalization function.
[0078] It should be further explained that the smaller the variance of the slopes of all weak edge pixels on the weak edge segment, the more stable the edge segment is, and the more important the weak edge segment is; the greater the authenticity of the weak edge segment, the more likely the weak edge segment is on the edge of the toy, and the greater the possibility that the weak edge segment is on the edge of the toy, the more important the weak edge segment is; since the gradient on the edge of the toy tends to be consistent, the smaller the variance of the gradient value of the weak edge pixel, the more important the weak edge segment is; the greater the degree of change of the surrounding pixels of the weak edge segment, the greater the influence of light on the weak edge segment, and the greater the influence of light on the weak edge segment, the more likely the weak edge segment is to be a strong edge segment, that is, the more important the weak edge segment is; finally, the importance of the weak edge pixel segment is obtained through the authenticity of the weak edge segment, the variance of the slopes of all weak edge pixels on the weak edge segment, the gradient value of the weak edge pixels on the weak edge segment, and the degree of change of the surrounding pixels of the weak edge segment.
[0079] At this point, the importance of the weak edge pixel segment is obtained.
[0080] Step S005: obtaining a target pixel point according to the importance of the weak edge segment; obtaining a toy edge according to the target pixel point; and identifying the toy according to the toy edge.
[0081] It should be noted that due to the influence of lighting, some of the strong edge pixels in the grayscale image become weak edge pixels. Therefore, it is necessary to enhance the gradient values of the weak edge pixels on the weak edge segments according to the importance of the weak edge segments. The greater the importance of the weak edge segments, the more it is necessary to enhance the gradient values of the weak edge pixels on the weak edge segments.
[0082] The specific calculation formula for obtaining the gradient value of the weak edge pixel after enhancement is as follows:
[0083]
[0084] In the formula, Indicates The first of the weak edge segments The gradient value of the weak edge pixel after enhancement; Indicates The first of the weak edge segments The gradient value of weak edge pixels; Indicates The importance of a weak edge segment.
[0085] At this point, the enhancement of the gradient value of the weak edge pixel is completed.
[0086] Then, through the preset gradient value threshold , if the gradient value of the weak edge pixel after enhancement is greater than or equal to the gradient value threshold , then the enhanced weak edge pixel is recorded as a new strong edge pixel; if the gradient value of the weak edge pixel after enhancement is less than the gradient value threshold , the enhanced weak edge pixel points are not recorded as new strong edge pixel points; and several new strong edge pixel points are obtained.
[0087] All new strong edge pixels and strong edge pixels are recorded as target pixels; the connected domain composed of adjacent target pixels in the grayscale image is recorded as a target pixel segment to obtain a number of target pixel segments; the authenticity of each target pixel segment is calculated according to step S003, and then a authenticity threshold is preset. ,in The specific value of can be set according to the actual situation. This embodiment does not make a hard requirement. Into the narrative, the degree of truth is greater than or equal to The target pixel segment is recorded as the toy edge pixel segment, and the real pixel segment is less than The target pixel segment is not recorded as the toy edge pixel segment.
[0088] All toy edge pixel segments are taken as toy edges to obtain a toy edge, which is recorded as a first edge; the toy edge pre-saved in the AR device is obtained, which is recorded as a second edge; the structural similarity index of the first edge and the second edge is calculated to obtain the structural similarity index of the first edge and the second edge, wherein the calculation of the structural similarity index is a well-known technology, so it will not be repeated in this embodiment.
[0089] Finally, a similarity threshold is preset ,in The specific value of can be set according to the actual situation. This embodiment does not make a hard requirement. Further description, if the structural similarity index between the toy edge and the image pre-saved in the AR device is greater than or equal to , the toy edge is displayed on the AR device.
[0090] At this point, this embodiment is completed.
[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An AR interactive method for children's toys, characterized in that: The method comprises the following steps: Get a grayscale image of the toy surface image; Obtain the gradient value and gradient direction of the pixel points in the grayscale image according to the grayscale image; obtain the strong edge pixel points and the weak edge pixel points in the grayscale image according to the gradient value of the pixel points in the grayscale image; Obtain strong edge segments according to strong edge pixels and calculate the true degree of the strong edge segments; Obtain the degree of change of the surrounding pixels of each weak edge pixel according to the weak edge pixel; obtain the weak edge segment according to the weak edge pixel, and obtain the degree of change of the surrounding pixels of the weak edge segment according to the degree of change of the surrounding pixels of all the weak edge pixels on the weak edge segment; calculate the similarity of the extension degree between the weak edge segment and the strong edge segment according to the gradient direction of the weak edge pixel on the weak edge segment and the gradient direction of the strong edge pixel on the strong edge segment, and select the true degree of the strong edge segment with the greatest similarity to the extension degree of the weak edge segment as the true degree of the weak edge segment; obtain the importance of the weak edge segment according to the true degree of the weak edge segment, the slope of the weak edge pixel on the weak edge segment, the degree of change of the surrounding pixels of the weak edge segment, and the gradient value of the weak edge pixel on the weak edge segment; According to the importance of the weak edge segment, the gradient value of the weak edge pixel point on the weak edge segment is enhanced to obtain the gradient value of the weak edge pixel point after enhancement; new strong edge pixel points are obtained according to the gradient value of the weak edge pixel point after enhancement; all new strong edge pixel points and strong edge pixel points are recorded as target pixel points; the toy edge is obtained according to the target pixel point; and the toy is identified according to the toy edge; The specific method of calculating the similarity of the extension degree between the weak edge segment and the strong edge segment is as follows: For The strong edge segment and edge segments and weak edge segments, obtain the The mean of the gradient directions of all the strong edge pixels on the first strong edge segment is The first difference between the mean values of the gradient directions of all weak edge pixels on the weak edge segments is obtained according to the first difference. The strong edge segment and The similarity of extension degree between weak edge segments; The specific calculation formula for obtaining the importance of the weak edge segment is as follows: In the formula, Indicates The importance of weak edge segments; Indicates The variance of the slopes of all weak edge pixels on a weak edge segment; Indicates The true degree of a weak edge segment; Indicates The variance of the gradient values of all weak edge pixels on a weak edge segment; Indicates the degree of change of the surrounding pixels of the weak edge segment; represents the linear normalization function.
2. An AR interactive method for children's toys according to claim 1, characterized in that: The specific method of obtaining the grayscale image of the toy surface image includes: The toy surface image is captured by the built-in camera of the user's mobile terminal, and the toy surface image is grayed to obtain a toy surface grayscale image; then the toy surface grayscale image is subjected to Gaussian filtering denoising to obtain a denoised toy surface grayscale image, which is recorded as a grayscale image.
3. The AR interactive method for children's toys according to claim 1, characterized in that: The method of obtaining the gradient value and gradient direction of the pixel points in the grayscale image according to the grayscale image; and obtaining the strong edge pixel points and the weak edge pixel points in the grayscale image according to the gradient value of the pixel points in the grayscale image includes the following specific methods: Use the Canny edge detection operator on the grayscale image to obtain the gradient value and gradient direction of each pixel in the grayscale image; then preset two gradient value thresholds respectively , ; The gradient value in the grayscale image is greater than or equal to Less than Pixels with gradient values greater than or equal to The pixel points are recorded as strong edge pixels, where .
4. The AR interactive method for children's toys according to claim 1, characterized in that: The specific method of obtaining the strong edge segment according to the strong edge pixel point and calculating the true degree of the strong edge segment includes: The edge line composed of connected strong edge pixels in the grayscale image is recorded as a strong edge segment, and several strong edge segments are obtained; strong edge segment, The variance of the grayscale values of all strong edge pixels on the strong edge segment is multiplied by the The variance of the gradient direction of all strong edge pixels on the strong edge segment is multiplied by the The variance of the slopes of all strong edge pixels on the strong edge segment is recorded as the first product. The real degree of a strong edge segment.
5. The AR interactive method for children's toys according to claim 1, characterized in that: The method of obtaining the degree of change of the surrounding pixels of each weak edge pixel according to the weak edge pixel; obtaining the weak edge segment according to the weak edge pixel, and obtaining the degree of change of the surrounding pixels of the weak edge segment according to the degree of change of all the weak edge pixels on the weak edge segment includes the following specific methods: Construct a Window, all pixels except the central pixel in the window are regarded as the pixels around the central pixel of the window; the degree of change of the surrounding pixels of each weak edge pixel is calculated by the gray value of each pixel in the window, and the specific calculation formula is: In the formula, Indicates The degree of change of the surrounding pixels of a weak edge pixel; Indicated in the The variance of the grayscale values of all pixels in a window centered on a weak edge pixel; Indicated in the The gray value of the pixel with the largest gray value in the window centered on the weak edge pixel; Indicated in the The gray value of the pixel with the smallest gray value in the window centered on the weak edge pixel; represents the linear normalization function; Then, the edge line composed of the connected weak edge pixels in the grayscale image is recorded as a weak edge segment, and several weak edge segments are obtained; the average value of the degree of change of the surrounding pixels of all the pixels on the weak edge segment is taken as the degree of change of the surrounding pixels of the weak edge segment.
6. The AR interactive method for children's toys according to claim 1, characterized in that: The gradient value of the weak edge pixel point on the weak edge segment is enhanced according to the importance of the weak edge segment to obtain the gradient value of the weak edge pixel point after enhancement, and the specific calculation formula included is: In the formula, Indicates The first of the weak edge segments The gradient value of the weak edge pixel after enhancement; Indicates The first of the weak edge segments The gradient value of weak edge pixels; Indicates The importance of a weak edge segment.
7. The AR interactive method for children's toys according to claim 1, characterized in that: The specific method of obtaining a new strong edge pixel point according to the gradient value of the weak edge pixel point after enhancement is as follows: By preset gradient value threshold , if the gradient value of the weak edge pixel after enhancement is greater than or equal to the gradient value threshold , then the enhanced weak edge pixel points are recorded as new strong edge pixel points; and several new strong edge pixel points are obtained.
8. The AR interactive method for children's toys according to claim 4, characterized in that: The method of obtaining the edge of the toy according to the target pixel point and identifying the toy according to the edge of the toy includes the following specific methods: The edge line composed of connected target pixel points in the grayscale image is recorded as a target pixel segment, and a number of target pixel segments are obtained; then a true degree threshold is preset. , the degree of truth is greater than or equal to The target pixel segment is recorded as the toy edge pixel segment; All toy edge pixel segments are regarded as toy edges; a structural similarity index is calculated between the toy edge and the toy edge pre-stored in the AR device to obtain a structural similarity index between the toy edge and the toy edge pre-stored in the AR device; Finally, a similarity threshold is preset , if the structural similarity index between the toy edge and the image pre-saved in the AR device is greater than or equal to , the toy edge is displayed on the AR device.
Citation Information
Patent Citations
Online intelligent monitoring method and system for slag-iron ratio of blast furnace
CN112862769A
Computer image edge detection method
CN114170228A
Visual inspection method for quality of watch shell
CN117011291A
Vision-assisted display screen defect detection method
CN117764989A
Wrinkle detection apparatus and wrinkle detection method
JP2016009203A
