A method, system, device, and storage medium for identifying virtual characters.

By extracting shadow contours from video frames and analyzing pixel and edge features, combined with a deep learning model, the problem of inaccurate recognition of simulation-type virtual characters in virtual character recognition technology is solved, achieving higher recognition accuracy.

CN118942120BActive Publication Date: 2025-12-02HAINAN JIKE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411084837.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2025-12-02
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

Existing virtual character recognition technologies struggle to accurately identify simulated virtual characters, especially with advancements in beautification and skin smoothing techniques, which have increased the similarity between real and virtual facial features, leading to inaccurate recognition results.

Method used

By capturing video frames and taking screenshots, the outline of the person's shadow is extracted, and the pixel and edge features of the shadow outline are analyzed. A deep learning model is then used to determine whether the person in the video is a virtual character.

Benefits of technology

It improves the accuracy and effectiveness of virtual character recognition by analyzing shadow and edge features to distinguish virtual characters from real characters, overcoming the recognition difficulties brought about by beautification technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118942120B_ABST
    Figure CN118942120B_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, device, and storage medium for identifying virtual characters, relating to the field of virtual character recognition technology. The method includes the following steps: capturing video frames containing a character's shadow within a playing video and taking screenshots to obtain video screenshots; extracting the outline of the character's shadow in the video screenshots to obtain shadow outlines; analyzing the shadow features of the character's shadow based on the shadow outlines; and determining whether the character in the playing video is a virtual character based on the shadow features. This invention addresses the problem that existing virtual character recognition technologies still have difficulty identifying simulated virtual characters, leading to inaccurate identification results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtual character recognition technology, specifically to a method, system, device, and storage medium for identifying virtual characters. Background Technology

[0002] Virtual character recognition technology refers to the process of accurately identifying and locating virtual characters from image or video data by analyzing and recognizing their features using computer vision and image processing techniques. This technology typically involves using various algorithms and models to detect, recognize, and track virtual characters to meet the needs of different application areas.

[0003] Existing virtual character recognition technologies typically classify virtual characters based on the premise that the characters in a video are virtual, or identify obviously virtual cartoon characters. Identifying realistic virtual characters is more difficult. Current technologies usually rely on facial features for identification because virtual characters have smoother, more perfect facial features compared to real people. However, with advancements in technology, such as beautification and skin smoothing techniques, even real people's faces in videos can become smoother and more perfect, making virtual character identification even more challenging. For example, patent application CN109241980A discloses a method and apparatus for virtual character identification, which classifies virtual characters based on the premise that the characters in a video are virtual. However, virtual character recognition technology primarily identifies whether a character in a video is virtual, rather than classifying them. Furthermore, existing virtual character recognition technologies struggle with realistic virtual characters, leading to inaccurate identification results. Summary of the Invention

[0004] This invention aims to at least partially solve one of the technical problems in the prior art. By capturing video frames containing human shadows within a playing video and taking screenshots, a video screenshot is obtained. The outline of the human shadow in the video screenshot is extracted to obtain the shadow outline. Then, based on the shadow outline, a detection starting point is found in the video screenshot. Next, the pixel features and edge features of the human shadow are analyzed based on the detection starting point. Finally, the base pixel features and edge features are used to determine whether the human in the playing video is a virtual human. This solves the problem that existing virtual human recognition technologies still have difficulty recognizing simulated virtual human characters, leading to inaccurate recognition results.

[0005] To achieve the above objectives, in a first aspect, this application provides a method for identifying virtual characters, comprising the following steps:

[0006] Capture video frames containing human shadows within the playing video and take screenshots to obtain video screenshots. Extract the outline of the human shadows in the video screenshots to obtain the shadow outlines.

[0007] The shadow characteristics of a person's shadow are analyzed based on the shadow contour.

[0008] Determine whether the characters in the video being played are virtual characters based on shadow features.

[0009] Furthermore, video frames containing the shadows of people within the playing video are captured and screenshots are taken to obtain video screenshots. The outline of the shadows in the video screenshots is extracted to obtain the shadow outline, which includes the following sub-steps:

[0010] When a user watches a video, the video frame of the video is obtained, and the video frame is the video screen at any frame of the video.

[0011] The video frame is analyzed by shadow detection to determine whether there is a person's shadow in the video frame. If there is, the video frame is marked as a video screenshot; if not, the next video frame is analyzed.

[0012] Obtain the first number of video screenshots, convert the video screenshots to grayscale images, and obtain grayscale screenshots.

[0013] The contours of the shadows of people in the grayscale screenshot are extracted using contour extraction technology to obtain the first number of shadow contours.

[0014] Furthermore, the analysis of the edge features of a person's shadow based on its contour includes the following sub-steps:

[0015] Find the detection start point in the video screenshot based on the shadow contour;

[0016] Analyze the pixel features of the figure's shadow based on the detection starting point;

[0017] Analyze the edge features of a person's shadow based on the detection starting point.

[0018] Furthermore, finding the detection starting point in the video screenshot based on the shadow contour includes the following sub-steps:

[0019] Get the side length of a pixel and name it "pixel side length";

[0020] Establish a Cartesian coordinate system with the pixel side length as the X and Y axes, and name it the contour image coordinate system. Place the shadow contour into the contour image coordinate system, where the shadow contour is entirely in the first quadrant and intersects the X and Y axes.

[0021] Get the maximum value of the X-axis in the shadow outline and mark it as the maximum X value; get the maximum value of the Y-axis in the shadow outline and mark it as the maximum Y value.

[0022] Name the point with the maximum X value and the maximum Y value as the top right point; name the point with the maximum X value and zero Y value as the bottom right point; name the point with zero X value and the maximum Y value as the top left point.

[0023] Connect the top right coordinate point to the origin, and connect the top left coordinate point to the bottom right coordinate point. Mark the pixel at the intersection of the two lines as the detection start point.

[0024] Furthermore, analyzing the pixel features of a person's shadow based on the detection starting point includes the following sub-steps:

[0025] Based on the detection starting point, pixels are searched to the left, down, right and up until the shadow outline is reached, and then the search stops. Several pixels are obtained and are jointly marked as the pixel group to be analyzed, together with the detection starting point. Each individual pixel in the group is named the pixel to be analyzed.

[0026] Obtain the grayscale value of the pixel to be analyzed, name it the grayscale value to be analyzed, sort and number the grayscale values ​​in the pixel group to be analyzed in ascending order, and use the symbol F. n Let F be an integer, where n is the index of F and n is a positive integer.

[0027] With F n Establish a Cartesian coordinate system with the X-axis as the x-axis and the grayscale values ​​to be analyzed as the Y-axis, and name it "Pixel Fluctuation Scatter Plot"; [The text then abruptly shifts to a different topic:] F n And the corresponding grayscale values ​​to be analyzed are entered into the pixel fluctuation scatter plot;

[0028] Linear regression is performed on the pixel fluctuation scatter plot to obtain the pixel fluctuation regression function. The format of the pixel fluctuation regression function is Y = a × X + b, where Y is the gray value to be analyzed, and X is the F-value. n In this context, n, a represent the fluctuation slope, and b represents the intrinsic constant of the regression function.

[0029] The fluctuation slope is the pixel feature of the figure's shadow. The first number of figure shadows obtained are analyzed to obtain the first number of pixel features.

[0030] Furthermore, analyzing the edge features of a person's shadow based on the detection starting point includes the following sub-steps:

[0031] Mark the pixels on the shadow outline as outline pixels, and mark the outline pixels adjacent to the pixel to be analyzed as outline starting points.

[0032] Pixels in the opposite direction from the contour starting point to the pixel being analyzed are marked as edge pixels. A second number of edge pixels are found and marked as blurred pixels. The blurred pixels are then sorted and numbered according to their distance from the contour starting point in ascending order, using the symbol P. m This indicates that m is the index of P and m is a positive integer;

[0033] Obtain the grayscale value of the blurred pixel, name it the blurred grayscale value, and use the symbol R. m P represents m The blurred grayscale value;

[0034] Calculate the value of R2-R1, and mark it as the fuzzy reference value. Starting with m=2, calculate R. m+1 -R m The calculation result is labeled as L. m Determine L m If the sign of the value is the same as the sign of the blurring reference value, and they are not the same, a blurring cutoff signal is output; if they are the same, a blurring continuation signal is output.

[0035] If the output blurring continues, then m+1 and L will be reanalyzed. m If the output is a virtual cutoff signal, then mark the value of m-1 at this time as G, and let 1≤m≤G;

[0036] With P m L is the horizontal axis. m Establish a Cartesian coordinate system for the vertical axis, named "Pixel Blur Scatter Plot", and set P m With the corresponding L m Input a pixel-blurred scatter plot;

[0037] Linear regression is performed on the pixel bokeh scatter plot to obtain the pixel bokeh regression function. The slope of the pixel bokeh regression function is marked as the edge feature of the character's shadow. The first number of character shadows obtained are analyzed to obtain the first number of edge features.

[0038] Furthermore, determining whether a character in a video is virtual based on shadow features includes the following sub-steps:

[0039] Establish a deep learning model for virtual character recognition;

[0040] The deep learning model for virtual character recognition is trained by using a training image set, which includes a third number of virtual character images and a third number of real character images.

[0041] The shadow features of virtual character images and real character images are analyzed and labeled as virtual shadow features and real shadow features, respectively. The virtual shadow features include virtual pixel features and virtual edge features, and the real shadow features include real pixel features and real edge features.

[0042] Obtain the maximum value of the virtual pixel feature and the minimum value of the real pixel feature, and mark them as the virtual maximum pixel feature and the real minimum pixel feature, respectively. Calculate the average value of the virtual maximum pixel feature and the real minimum pixel feature, and mark it as the pixel feature judgment value.

[0043] Obtain the minimum value of the virtual edge feature and the maximum value of the real edge feature, and mark them as the virtual minimum edge feature and the real maximum edge feature, respectively. Calculate the average value of the virtual minimum edge feature and the real maximum edge feature, and mark it as the edge feature judgment value.

[0044] The pixel feature is compared with the pixel feature judgment value. If the pixel feature is less than or equal to the pixel feature judgment value, the virtual character signal is output; if the pixel feature is greater than the pixel feature judgment value, the real character signal is output.

[0045] The edge features are compared with the edge feature judgment value. If the edge feature is greater than the edge feature judgment value, a virtual character signal is output; if the edge feature is less than or equal to the edge feature judgment value, a real character signal is output.

[0046] The number of virtual character signals output after judging the shadow features of the first number is counted and marked as the virtual signal number. The number of real character signals output is counted and marked as the real signal number. The virtual signal number is compared with the real signal number. If the virtual signal number is greater than or equal to the real signal number, the character in the video is determined to be a virtual character. If the virtual signal number is less than the real signal number, the character in the video is determined to be a real character.

[0047] Secondly, this application provides a virtual character recognition system, including a contour extraction module, a feature analysis module, and a virtual determination module; the contour extraction module and the virtual determination module are respectively connected to the feature analysis module for data processing.

[0048] The outline extraction module is used to capture video frames containing human shadows in the playing video and take screenshots to obtain video screenshots. The outline of the human shadow in the video screenshots is extracted to obtain the shadow outline.

[0049] The feature analysis module is used to analyze the shadow features of a person's shadow based on the shadow outline;

[0050] The virtual determination module is used to determine whether a person in the video being played is a virtual person based on shadow features.

[0051] Thirdly, this application provides an electronic device including a processor and a memory, the memory storing computer-readable instructions, which, when executed by the processor, perform the steps of the method described above.

[0052] Fourthly, this application provides a storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method described above.

[0053] The beneficial effects of this invention are as follows: This invention captures and screenshots video frames containing human shadows within a playing video, obtaining video screenshots. The outline of the human shadow in the video screenshot is then extracted to obtain the shadow outline. The advantage lies in the fact that, due to advancements in beautification technology, faces in videos can achieve a simulated virtual human facial effect, making it more difficult to identify virtual characters using facial recognition. However, for the shadows of virtual characters, the lighting in videos is usually point light sources, while real-world lighting is usually multi-directional. This results in a more scattered and varied color value distribution in the shadows of real people due to different multi-directional lighting effects, and the edges of the shadows also exhibit a blurring effect. In contrast, the color values ​​of the shadows of virtual characters are usually fixed values, and the outlines of the shadows are very clear. Therefore, analyzing human shadows can improve the accuracy and effectiveness of virtual character recognition.

[0054] This invention finds the detection starting point in a video screenshot based on the shadow contour, then analyzes the pixel and edge features of the shadow based on the detection starting point, and finally determines whether the person in the video is a virtual character based on the pixel and edge features. The advantage is that the pixel features reflect the fluctuation trend of the color value of the shadow, while the edge features reflect whether there is a blurring effect at the edge of the shadow. Generally, the color value fluctuation of the shadow of a virtual character is smaller, while the color value change of the contour edge is greater, making the contour clearer and more visible, thus improving the accuracy and rationality of virtual character recognition. Attached Figure Description

[0055] Figure 1 This is a schematic diagram of the system of the present invention;

[0056] Figure 2 This is a schematic diagram showing the position of the shadow contour in the contour image coordinate system according to the present invention;

[0057] Figure 3 This is a schematic diagram of the detection starting point of the present invention;

[0058] Figure 4 This is a schematic diagram showing the position of the pixel group to be analyzed in this invention;

[0059] Figure 5This is a scatter plot of pixel fluctuations from the present invention.

[0060] Figure 6 This is a schematic diagram of the edge pixels of the present invention;

[0061] Figure 7 This is a pixel bokeh scatter plot of the present invention;

[0062] Figure 8 This is a flowchart of the steps of the method of the present invention. Detailed Implementation

[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] Example 1, please refer to Figure 1 As shown, this application provides a virtual character recognition system, including a contour extraction module, a feature analysis module, and a virtual determination module; the contour extraction module and the virtual determination module are respectively connected to the feature analysis module for data processing.

[0065] The outline extraction module is used to capture video frames containing human shadows within the playing video and take screenshots to obtain video screenshots. The outline of the human shadow in the video screenshot is then extracted to obtain the shadow outline.

[0066] The contour trimming module is configured with contour trimming strategies, which include:

[0067] When a user is watching a video, the video frame is obtained. The video frame is the video image at any frame of the video.

[0068] The video frame is analyzed by shadow detection to determine whether there is a person's shadow in the video frame. If there is, the video frame is marked as a video screenshot; if not, the next video frame is analyzed.

[0069] Obtain the first number of video screenshots, convert the video screenshots to grayscale images, and obtain grayscale screenshots.

[0070] The contours of the shadows of people in the grayscale screenshot are extracted using contour extraction technology to obtain the first number of shadow contours.

[0071] In practical applications, the shadow detection technology adopts the existing Attention Res-Unet shadow detection technology, and the contour extraction technology adopts the existing OpenCV algorithm. To reduce the amount of computation, the video frame acquisition is set to randomly extract one frame every 3 seconds for analysis. The first number is set to prevent the recognition result of the virtual character from being incorrect due to randomness. The value range of the first number is usually 3 to 10. In this embodiment, the first number is set to 3. That is, three video screenshots with the character's shadow are obtained, converted into grayscale images to obtain three grayscale screenshots, and then the character's shadow in the grayscale screenshots is extracted by the OpenCV algorithm to obtain three shadow contours.

[0072] The feature analysis module is used to analyze the shadow features of a person's shadow based on the shadow contour; the feature analysis module includes a detection start analysis unit, a pixel feature analysis unit, and an edge feature analysis unit;

[0073] The detection start analysis unit is used to find the detection start point in the video screenshot based on the shadow contour.

[0074] The detection initiation analysis unit is configured with a detection initiation analysis strategy, which includes:

[0075] Get the side length of a pixel and name it "pixel side length";

[0076] Please see Figures 2 to 3 As shown, a Cartesian coordinate system is established with the pixel side length as the X-axis and Y-axis, named the contour image coordinate system. The shadow contour is placed in the contour image coordinate system, where the shadow contour is entirely in the first quadrant and intersects the X-axis and Y-axis.

[0077] Get the maximum value of the X-axis in the shadow outline and mark it as the maximum X value; get the maximum value of the Y-axis in the shadow outline and mark it as the maximum Y value.

[0078] Name the point with the maximum X value and the maximum Y value as the top right point; name the point with the maximum X value and zero Y value as the bottom right point; name the point with zero X value and the maximum Y value as the top left point.

[0079] Connect the top right coordinate point to the origin, and connect the top left coordinate point to the bottom right coordinate point. Mark the pixel at the intersection of the two lines as the detection start point.

[0080] In practical applications, the placement of the shadow contour in the contour image coordinate system is as follows: Figure 2 As shown, the detection starting point was obtained through analysis. Figure 3 As shown, Figure 3 The darkest black dot indicated by the black arrow is the detection starting point.

[0081] The pixel feature analysis unit is used to analyze the pixel features of the person's shadow based on the detection starting point;

[0082] The pixel feature analysis unit is configured with a pixel feature analysis strategy, which includes:

[0083] Please see Figure 4 As shown, based on the detection starting point, pixels are searched to the left, down, right and up respectively until the shadow outline is reached and the search stops. Several pixels are obtained and are jointly marked as the pixel group to be analyzed together with the detection starting point. Individual pixels in the group are named as the pixel to be analyzed.

[0084] In practical applications, the shadow contour is the outermost pixel in the shadow contour image. Since the shadow contour of the actual contour image is far from the starting point to be analyzed, this embodiment uses... Figure 4 A brief explanation of the positions of the pixel group to be analyzed; Figure 4 In the diagram, the central black pixel is the starting point for analysis, and the outer gray pixels represent the shadow outline. Figure 4 The dark gray pixel located between the starting point to be analyzed and the shadow outline, as well as the starting point to be analyzed, are the pixels to be analyzed. Together they form the pixel group to be analyzed.

[0085] Obtain the grayscale value of the pixel to be analyzed, name it the grayscale value to be analyzed, sort and number the grayscale values ​​in the pixel group to be analyzed in ascending order, and use the symbol F. n Let F be an integer, where n is the index of F and n is a positive integer.

[0086] Please see Figure 5 As shown, with F n Establish a Cartesian coordinate system with the X-axis as the x-axis and the grayscale values ​​to be analyzed as the Y-axis, and name it "Pixel Fluctuation Scatter Plot"; [The text then abruptly shifts to a different topic:] F n And the corresponding grayscale values ​​to be analyzed are entered into the pixel fluctuation scatter plot;

[0087] Linear regression was performed on the pixel fluctuation scatter plot to obtain the pixel fluctuation regression function. The format of the pixel fluctuation regression function is Y = a × X + b, where Y is the gray value to be analyzed, and X is the F-value. n In this context, n, a represent the fluctuation slope, and b represents the intrinsic constant of the regression function.

[0088] The fluctuation slope is the pixel feature of the figure's shadow. The first number of figure shadows obtained are analyzed to obtain the first number of pixel features.

[0089] In practical applications, the pixel fluctuation scatter plot is constructed as follows: Figure 5As shown, the pixel fluctuation regression function obtained through linear regression is Y = 0.0591 × X + 37.114, where a = 0.0591 and b = 37.114. The fluctuation slope reflects the fluctuation range of the gray value of the person's shadow. The pixel feature of the person's shadow in the video screenshot analyzed in this embodiment is 0.0591. The three obtained person shadows are analyzed to obtain three pixel features.

[0090] The edge feature analysis unit is used to analyze the edge features of a person's shadow based on the detection starting point;

[0091] The edge feature analysis unit is configured with an edge feature analysis strategy, which includes:

[0092] Mark the pixels on the shadow outline as outline pixels, and mark the outline pixels adjacent to the pixel to be analyzed as outline starting points.

[0093] Please see Figure 6 As shown, pixels in the opposite direction from the starting point of the contour to the pixel to be analyzed are marked as edge pixels. A second number of edge pixels are found and marked as blurred pixels. The blurred pixels are then sorted and numbered according to their distance from the starting point of the contour, from smallest to largest, and identified by the symbol P. m This indicates that m is the index of P and m is a positive integer;

[0094] Obtain the grayscale value of the blurred pixel, name it the blurred grayscale value, and use the symbol R. m P represents m The blurred grayscale value;

[0095] In practical applications, Figure 6 Gray pixels outside the shadow outline are considered edge pixels. Typically, the blurring effect at image edges doesn't exceed 10 pixels, so the second quantity is set to 10. Ten edge pixels are found in one direction and marked as blurred pixels. There are four directions, resulting in a total of 40 blurred pixels. For blurred pixels in any direction, the closer they are to the starting point of the analysis, the smaller m is. These are numbered from P1 to P... 10 The blurred pixels, and for any direction there are P1 to P 10 The blurred pixels, taking the blurred pixels above as an example in this embodiment, obtain the blurred grayscale values ​​R1 to R... 10 The numbers are 67, 75, 86, 96, 110, 127, 144, 160, 175, and 169, respectively.

[0096] Calculate the value of R2-R1, and mark it as the fuzzy reference value. Starting with m=2, calculate R. m+1 -R m The calculation result is labeled as L.m Determine L m If the sign of the value is the same as the sign of the blurring reference value, and they are not the same, a blurring cutoff signal is output; if they are the same, a blurring continuation signal is output.

[0097] If the output blurring continues, then m+1 and L will be reanalyzed. m If the output is a virtual cutoff signal, then mark the value of m-1 at this time as G, and let 1≤m≤G;

[0098] In practical applications, the calculated blurring reference value is 75-67=8, which is a positive number. Then, L is analyzed sequentially. m The analysis results show that when m takes values ​​from 2 to 8, the obtained L m The positive and negative values ​​are the same as the blurring reference value, therefore the blurring continuation signal is output. When m=9, the calculated L m The value is -6, which is opposite to the bokeh reference value. Therefore, the bokeh cutoff signal is output, and m-1 at this time is marked as G, that is, G=8, so 1≤m≤8;

[0099] Please see Figure 7 As shown, with P m L is the horizontal axis. m Establish a Cartesian coordinate system for the vertical axis, named "Pixel Blur Scatter Plot", and set P m With the corresponding L m Input a pixel-blurred scatter plot;

[0100] Linear regression is performed on the pixel bokeh scatter plot to obtain the pixel bokeh regression function. The slope of the pixel bokeh regression function is marked as the edge feature of the character's shadow. The first number of character shadows obtained are analyzed to obtain the first number of edge features.

[0101] In practical applications, the constructed pixel-blurred scatter plot is as follows: Figure 7 As shown, the pixel blur regression function obtained through linear regression is L = 1.4333 × P + 7.9, where L is L m P is P m In the image, m represents the edge feature value of 1.4333; by analyzing the three obtained shadow images of the figures, three edge features are obtained.

[0102] The virtual character determination module is used to determine whether a person in a video is a virtual person based on shadow features.

[0103] The virtual decision module is configured with virtual decision strategies, which include:

[0104] Establish a deep learning model for virtual character recognition;

[0105] The deep learning model for virtual character recognition is trained using a training image set, which includes a third number of virtual character images and a third number of real character images.

[0106] The shadow features of virtual character images and real character images are analyzed and labeled as virtual shadow features and real shadow features, respectively. Virtual shadow features include virtual pixel features and virtual edge features, while real shadow features include real pixel features and real edge features.

[0107] In practical applications, the virtual character recognition deep learning model is implemented using existing convolutional neural network technology; the training image set is obtained by filtering images from big data; the third quantity is set to ensure that the virtual character recognition deep learning model has a more reliable data foundation and sufficient basic data. In this embodiment, the third quantity is set to 1000; 1000 virtual shadow features and 1000 real shadow features are obtained through analysis.

[0108] Obtain the maximum value of the virtual pixel feature and the minimum value of the real pixel feature, and mark them as the virtual maximum pixel feature and the real minimum pixel feature, respectively. Calculate the average value of the virtual maximum pixel feature and the real minimum pixel feature, and mark it as the pixel feature judgment value.

[0109] In practical applications, due to the complex lighting conditions in display scenarios, the pixel features of the shadows of real people usually fluctuate significantly, while the pixel features of the shadows of virtual people usually fluctuate less. Therefore, we obtained the maximum virtual pixel feature and the minimum real pixel feature for analysis. In 1000 virtual shadow features and 1000 real shadow features, the maximum virtual pixel feature and the minimum real pixel feature were found to be 0.125 and 0.349, respectively. The edge feature judgment value was calculated to be (0.125+0.349) / 2=0.237.

[0110] Obtain the minimum value of the virtual edge feature and the maximum value of the real edge feature, and mark them as the virtual minimum edge feature and the real maximum edge feature, respectively. Calculate the average value of the virtual minimum edge feature and the real maximum edge feature, and mark it as the edge feature judgment value.

[0111] In practical applications, regarding the edges of a person's shadow, due to the complex lighting conditions in real scenes, the pixel values ​​of the shadow edges of a real person usually have a slow transition with the pixel values ​​of the environment. However, the pixel values ​​of the shadow edges of a virtual person usually change drastically. This results in the virtual edge features being much larger than the real edge features. Therefore, we obtain the minimum virtual edge features and the maximum real edge features for analysis. The minimum virtual edge features and the maximum real edge features are found to be 1.645 and 0.796, respectively. The calculated edge feature judgment value is (1.645 + 0.796) = 1.2205.

[0112] The pixel feature is compared with the pixel feature judgment value. If the pixel feature is less than or equal to the pixel feature judgment value, the virtual character signal is output; if the pixel feature is greater than the pixel feature judgment value, the real character signal is output.

[0113] The edge features are compared with the edge feature judgment value. If the edge feature is greater than the edge feature judgment value, a virtual character signal is output; if the edge feature is less than or equal to the edge feature judgment value, a real character signal is output.

[0114] The number of virtual character signals output after judging the first number of shadow features is counted and marked as the virtual signal count. The number of real character signals output is counted and marked as the real signal count. The virtual signal count is compared with the real signal count. If the virtual signal count is greater than or equal to the real signal count, the character in the video is determined to be a virtual character. If the virtual signal count is less than the real signal count, the character in the video is determined to be a real character.

[0115] In practical applications, the pixel feature obtained from the analysis in this embodiment is 0.0591, and the edge feature is 1.433. By comparison, it is found that the pixel feature is less than the pixel feature judgment value, and the edge feature is greater than the edge feature judgment value. Therefore, two virtual character signals are output. There are a total of three pixel features and edge features. Through analysis by the virtual character recognition deep learning model, the number of virtual signals is finally obtained as 5, and the number of real signals is 1. By comparison, it is found that the number of virtual signals is greater than the number of real signals, so the character in the video is determined to be a virtual character.

[0116] Example 2, please refer to Figure 8 As shown, this application provides a method for identifying virtual characters, including the following steps:

[0117] Step S1 involves capturing video frames containing a person's shadow within the playing video and taking screenshots to obtain video screenshots. The outline of the person's shadow in the video screenshots is then extracted to obtain the shadow outline. Step S1 includes the following sub-steps:

[0118] Step S101: When the user is watching the video, the video frame of the video is obtained. The video frame is the video picture at any frame of the video.

[0119] Step S102: Detect the video frame by shadow detection to determine whether there is a person's shadow in the video frame. If there is, mark the video frame as a video screenshot; if not, continue to analyze the next video frame.

[0120] Step S103: Obtain a first number of video screenshots, convert the video screenshots into grayscale images, and obtain grayscale screenshots;

[0121] Step S104: Extract the outline of the figure's shadow in the grayscale screenshot using outline extraction technology to obtain the first number of shadow outlines.

[0122] Step S2 involves analyzing the shadow features of a person's shadow based on its outline. Step S2 includes the following sub-steps:

[0123] Step S201: Find the detection starting point in the video screenshot based on the shadow contour;

[0124] Step S201 includes the following sub-steps:

[0125] Step S201.1: Obtain the side length of the pixel and name it "pixel side length";

[0126] Step S201.2: Establish a Cartesian coordinate system with the pixel side length as the X-axis and Y-axis, named the contour image coordinate system, and put the shadow contour into the contour image coordinate system, wherein the shadow contour is entirely in the first quadrant and the shadow contour intersects with the X-axis and Y-axis.

[0127] Step S201.3: Obtain the maximum value of the X-axis in the shadow contour and mark it as the maximum X value; obtain the maximum value of the Y-axis in the shadow contour and mark it as the maximum Y value.

[0128] Step S201.4: Name the point with the maximum X value and the maximum Y value as the upper right coordinate point; name the point with the maximum X value and zero Y value as the lower right coordinate point; name the point with zero X value and the maximum Y value as the upper left coordinate point.

[0129] Step S201.5: Connect the upper right coordinate point to the origin, connect the upper left coordinate point to the lower right coordinate point, and mark the pixel at the intersection of the two lines as the detection start point.

[0130] Step S202: Analyze the pixel features of the person's shadow based on the detection starting point;

[0131] Step S202 includes the following sub-steps:

[0132] Step S202.1: Based on the detection starting point, search for pixels to the left, down, right and up respectively until the shadow outline is reached and the search stops. A number of pixels are obtained and are jointly marked as the pixel group to be analyzed together with the detection starting point. Each individual pixel in the group is named the pixel to be analyzed.

[0133] Step S202.2: Obtain the grayscale value of the pixel to be analyzed, name it the grayscale value to be analyzed, sort and number the grayscale values ​​in the pixel group to be analyzed in ascending order, and use the symbol F. n Let F be an integer, where n is the index of F and n is a positive integer.

[0134] Step S202.3, with F n Establish a Cartesian coordinate system with the X-axis as the x-axis and the grayscale values ​​to be analyzed as the Y-axis, and name it "Pixel Fluctuation Scatter Plot"; [The text then abruptly shifts to a different topic:] F n And the corresponding grayscale values ​​to be analyzed are entered into the pixel fluctuation scatter plot;

[0135] Step S202.4: Perform linear regression on the pixel fluctuation scatter plot to obtain the pixel fluctuation regression function. The format of the pixel fluctuation regression function is Y = a × X + b, where Y is the gray value to be analyzed, and X is the F-value. n In this context, n, a represent the fluctuation slope, and b represents the intrinsic constant of the regression function.

[0136] Step S202.5: The fluctuation slope is the pixel feature of the character's shadow. Analyze the first number of character shadows obtained to obtain the first number of pixel features.

[0137] Step S203: Analyze the edge features of the figure's shadow based on the detection starting point;

[0138] Step S203 includes the following sub-steps:

[0139] Step S203.1: Mark the pixels on the shadow contour as contour pixels, and mark the contour pixels adjacent to the pixel to be analyzed as contour starting points;

[0140] Step S203.2: Mark the pixels in the opposite direction from the contour starting point to the pixel to be analyzed as edge pixels. Find the second number of edge pixels and mark them as blurred pixels. Sort and number the blurred pixels according to their distance from the contour starting point from smallest to largest, and use the symbol P. m This indicates that m is the index of P and m is a positive integer;

[0141] Step S203.3: Obtain the grayscale value of the blurred pixel, name it the blurred grayscale value, and use the symbol R. m P represents m The blurred grayscale value;

[0142] Step S203.4: Calculate the value of R2-R1, mark it as the fuzzy reference value, and calculate R starting from m=2. m+1 -R m The calculation result is labeled as L. m Determine L m If the sign of the value is the same as the sign of the blurring reference value, and they are not the same, a blurring cutoff signal is output; if they are the same, a blurring continuation signal is output.

[0143] Step S203.5: If the output blurring continues signal, then increase m+1 and reanalyze L. m If the output is a virtual cutoff signal, then mark the value of m-1 at this time as G, and let 1≤m≤G;

[0144] Step S203.6, with P m L is the horizontal axis. m Establish a Cartesian coordinate system for the vertical axis, named "Pixel Blur Scatter Plot", and set P m With the corresponding L m Input a pixel-blurred scatter plot;

[0145] Step S203.7: Perform linear regression on the pixel bokeh scatter plot to obtain the pixel bokeh regression function. Mark the slope of the pixel bokeh regression function as the edge feature of the character's shadow. Analyze the first number of character shadows obtained to obtain the first number of edge features.

[0146] Step S3: Determine whether the person in the video is a virtual person based on the shadow features; Step S3 includes the following sub-steps:

[0147] Step S301: Establish a deep learning model for virtual character recognition;

[0148] Step S302: Train the deep learning model for virtual character recognition using a training image set, which includes a third number of virtual character images and a third number of real character images.

[0149] Step S303: Analyze the shadow features of the virtual character image and the shadow features of the real character image, and label them as virtual shadow features and real shadow features respectively. Virtual shadow features include virtual pixel features and virtual edge features, and real shadow features include real pixel features and real edge features.

[0150] Step S304: Obtain the maximum value of the virtual pixel feature and the minimum value of the real pixel feature, and mark them as the virtual maximum pixel feature and the real minimum pixel feature, respectively. Calculate the average value of the virtual maximum pixel feature and the real minimum pixel feature, and mark it as the pixel feature judgment value.

[0151] Step S305: Obtain the minimum value of the virtual edge feature and the maximum value of the real edge feature, and mark them as the virtual minimum edge feature and the real maximum edge feature, respectively. Calculate the average value of the virtual minimum edge feature and the real maximum edge feature, and mark it as the edge feature judgment value.

[0152] Step S306: Compare the pixel feature with the pixel feature judgment value. If the pixel feature is less than or equal to the pixel feature judgment value, output the virtual character signal; if the pixel feature is greater than the pixel feature judgment value, output the real character signal.

[0153] Step S307: Compare the edge features with the edge feature judgment value. If the edge features are greater than the edge feature judgment value, output the virtual character signal; if the edge features are less than or equal to the edge feature judgment value, output the real character signal.

[0154] Step S308: Count the number of virtual character signals output after judging the first number of shadow features, and mark them as virtual signal count; count the number of real character signals output, and mark them as real signal count; compare the virtual signal count with the real signal count. If the virtual signal count is greater than or equal to the real signal count, the character in the video is determined to be a virtual character; if the virtual signal count is less than the real signal count, the character in the video is determined to be a real character.

[0155] Example 3: This application provides an electronic device, which may include a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores computer-readable instructions. The processor can call the instructions in the memory. When the computer-readable instructions are executed by the processor, steps such as those in a virtual character recognition method are performed to achieve the following functions: capturing video frames containing a person's shadow within a playing video and taking screenshots to obtain video screenshots; extracting the outline of the person's shadow in the video screenshots to obtain shadow outlines; analyzing the shadow features of the person's shadow based on the shadow outlines; and determining whether the person in the playing video is a virtual character based on the shadow features.

[0156] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0157] Example 4: This application also provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute a virtual character recognition method provided by the above methods. The method includes: capturing video frames containing a person's shadow in a playing video and taking screenshots to obtain video screenshots; extracting the outline of the person's shadow in the video screenshots to obtain shadow outlines; analyzing the shadow features of the person's shadow based on the shadow outlines; and determining whether the person in the playing video is a virtual character based on the shadow features.

[0158] Example 5: This application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it performs the steps of the above-mentioned method for identifying virtual characters to achieve the following functions: capturing video frames containing shadows of characters in a playing video and taking screenshots to obtain video screenshots; extracting the outline of the shadows of characters in the video screenshots to obtain shadow outlines; analyzing the shadow features of the shadows of characters based on the shadow outlines; and determining whether the characters in the playing video are virtual characters based on the shadow features.

[0159] Based on the above description of the embodiments, the embodiments of the present invention can be provided as methods, systems, or computer program products. Based on this understanding, the technical solutions described above, or the parts that contribute to the prior art, can be embodied in the form of software products. These computer software products can be stored in computer-readable storage media, such as ROM / RAM, magnetic disks, optical disks, etc., and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or certain parts of the embodiments.

[0160] In the embodiments provided in this application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces. The indirect coupling or communication connection between systems, modules, and units may be electrical, mechanical, or other forms.

[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for identifying virtual characters, characterized in that, Includes the following steps: Capture video frames containing human shadows within the playing video and take screenshots to obtain video screenshots. Extract the outline of the human shadows in the video screenshots to obtain the shadow outlines. The shadow characteristics of a person's shadow are analyzed based on the shadow contour. Determine whether the characters in the video being played are virtual characters based on shadow features; Analyzing the edge features of a person's shadow based on its contour includes the following sub-steps: Find the detection start point in the video screenshot based on the shadow contour; Analyze the pixel features of the figure's shadow based on the detection starting point; Analyze the edge features of the figure's shadow based on the detection starting point; Finding the detection start point in a video screenshot based on shadow contours includes the following sub-steps: Get the side length of a pixel and name it "pixel side length"; Establish a Cartesian coordinate system with the pixel side length as the X and Y axes, and name it the contour image coordinate system. Place the shadow contour into the contour image coordinate system, where the shadow contour is entirely in the first quadrant and intersects the X and Y axes. Get the maximum value of the X-axis in the shadow outline and mark it as the maximum X value; get the maximum value of the Y-axis in the shadow outline and mark it as the maximum Y value. Name the point with the maximum X value and the maximum Y value as the top right point; name the point with the maximum X value and zero Y value as the bottom right point; name the point with zero X value and the maximum Y value as the top left point. Connect the top right coordinate point to the origin, and connect the top left coordinate point to the bottom right coordinate point. Mark the pixel at the intersection of the two lines as the detection start point.

2. The method for identifying virtual characters according to claim 1, characterized in that, Capture video frames containing human shadows within the playing video and take screenshots to obtain video screenshots. Extract the outline of the human shadows from the video screenshots. Obtaining the shadow outline includes the following sub-steps: When a user watches a video, the video frame of the video is obtained, and the video frame is the video screen at any frame of the video. The video frame is analyzed by shadow detection to determine whether there is a person's shadow in the video frame. If there is, the video frame is marked as a video screenshot; if not, the next video frame is analyzed. Obtain the first number of video screenshots, convert the video screenshots to grayscale images, and obtain grayscale screenshots. The contours of the shadows of people in the grayscale screenshot are extracted using contour extraction technology to obtain the first number of shadow contours.

3. The method for identifying virtual characters according to claim 2, characterized in that, Analyzing the pixel features of a person's shadow based on the detection starting point includes the following sub-steps: Based on the detection starting point, pixels are searched to the left, down, right and up until the shadow outline is reached, and then the search stops. Several pixels are obtained and are jointly marked as the pixel group to be analyzed, together with the detection starting point. Each individual pixel in the group is named the pixel to be analyzed. Obtain the grayscale value of the pixel to be analyzed, name it the grayscale value to be analyzed, sort and number the grayscale values ​​in the pixel group to be analyzed in ascending order, and use the symbol F. n Let F be an integer, where n is the index of F and n is a positive integer. With F n Establish a Cartesian coordinate system with the X-axis as the x-axis and the grayscale values ​​to be analyzed as the Y-axis, and name it "Pixel Fluctuation Scatter Plot"; [The text then abruptly shifts to a different topic:] F n And the corresponding grayscale values ​​to be analyzed are entered into the pixel fluctuation scatter plot; Linear regression is performed on the pixel fluctuation scatter plot to obtain the pixel fluctuation regression function. The format of the pixel fluctuation regression function is Y=a×X+b, where Y is the gray value to be analyzed, and X is the F-value. n In this context, n, a represent the fluctuation slope, and b represents the intrinsic constant of the regression function. The fluctuation slope is the pixel feature of the figure's shadow. The first number of figure shadows obtained are analyzed to obtain the first number of pixel features.

4. The method for identifying virtual characters according to claim 3, characterized in that, Analyzing the edge features of a person's shadow based on the detection starting point includes the following sub-steps: Mark the pixels on the shadow outline as outline pixels, and mark the outline pixels adjacent to the pixel to be analyzed as outline starting points. Pixels in the opposite direction from the contour starting point to the pixel being analyzed are marked as edge pixels. A second number of edge pixels are found and marked as blurred pixels. The blurred pixels are then sorted and numbered according to their distance from the contour starting point in ascending order, using the symbol P. m This indicates that m is the index of P and m is a positive integer; Obtain the grayscale value of the blurred pixel, name it the blurred grayscale value, and use the symbol R. m P represents m The blurred grayscale value; Calculate the value of R2-R1, and mark it as the fuzzy reference value. Starting with m=2, calculate R. m+1 -R m The calculation result is labeled as L. m Determine L m If the sign of the value is the same as the sign of the blurring reference value, and they are not the same, a blurring cutoff signal is output; if they are the same, a blurring continuation signal is output. If the output blurring continues, then m+1 and L will be reanalyzed. m If the output is a virtual cutoff signal, then mark the value of m-1 at this time as G, and let 1≤m≤G; With P m L is the horizontal axis. m Establish a Cartesian coordinate system for the vertical axis, named "Pixel Blur Scatter Plot", and set P m With the corresponding L m Input a pixel-blurred scatter plot; Linear regression is performed on the pixel bokeh scatter plot to obtain the pixel bokeh regression function. The slope of the pixel bokeh regression function is marked as the edge feature of the character's shadow. The first number of character shadows obtained are analyzed to obtain the first number of edge features.

5. The method for identifying virtual characters according to claim 4, characterized in that, Determining whether a character in a video is virtual based on shadow features includes the following sub-steps: Establish a deep learning model for virtual character recognition; The deep learning model for virtual character recognition is trained by using a training image set, which includes a third number of virtual character images and a third number of real character images. The shadow features of virtual character images and real character images are analyzed and labeled as virtual shadow features and real shadow features, respectively. The virtual shadow features include virtual pixel features and virtual edge features, and the real shadow features include real pixel features and real edge features. Obtain the maximum value of the virtual pixel feature and the minimum value of the real pixel feature, and mark them as the virtual maximum pixel feature and the real minimum pixel feature, respectively. Calculate the average value of the virtual maximum pixel feature and the real minimum pixel feature, and mark it as the pixel feature judgment value. Obtain the minimum value of the virtual edge feature and the maximum value of the real edge feature, and mark them as the virtual minimum edge feature and the real maximum edge feature, respectively. Calculate the average value of the virtual minimum edge feature and the real maximum edge feature, and mark it as the edge feature judgment value. The pixel feature is compared with the pixel feature judgment value. If the pixel feature is less than or equal to the pixel feature judgment value, the virtual character signal is output; if the pixel feature is greater than the pixel feature judgment value, the real character signal is output. The edge features are compared with the edge feature judgment value. If the edge feature is greater than the edge feature judgment value, a virtual character signal is output; if the edge feature is less than or equal to the edge feature judgment value, a real character signal is output. The number of virtual character signals output after judging the shadow features of the first number is counted and marked as the virtual signal number. The number of real character signals output is counted and marked as the real signal number. The virtual signal number is compared with the real signal number. If the virtual signal number is greater than or equal to the real signal number, the character in the video is determined to be a virtual character. If the virtual signal number is less than the real signal number, the character in the video is determined to be a real character.

6. A virtual character recognition system, used to implement the virtual character recognition method according to any one of claims 1-5, characterized in that, It includes a contour extraction module, a feature analysis module, and a virtual determination module; the contour extraction module and the virtual determination module are respectively connected to the feature analysis module for data processing. The outline extraction module is used to capture video frames containing human shadows in the playing video and take screenshots to obtain video screenshots. The outline of the human shadow in the video screenshots is extracted to obtain the shadow outline. The feature analysis module is used to analyze the shadow features of a person's shadow based on the shadow outline; The virtual determination module is used to determine whether a person in the video being played is a virtual person based on shadow features.

7. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the steps of the method as described in any one of claims 1-5.

8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the steps of the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • A method and apparatus for identifying a virtual person

    CN109241980A

  • Face living body detection method and system

    CN114612984A

  • Image generation method and device, electronic equipment and storage medium

    CN116416361A