A method and system for identifying short video content based on computer vision recognition
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2026-08-11
AI Technical Summary
具体而言,本申请提出一种基于计算机视觉识别处理短剧内容的识别方法,利用九宫格分割方式进行对应的区域以解决文字准确性低和识别速度慢的问题
[0059]分析本发明提供的上述一种基于计算机视觉识别处理短剧内容的识别方法可知,在具体应用时通过待检测文字图像进行初步的扫描,能够得到与待检测文字图像近似的多个相似特征文字图像,减少了大范围检查文字的速度;
Smart Images

Figure CN118506348B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video frame recognition, and in particular to a recognition method and system for processing short drama content based on computer vision recognition. Background Art
[0002] Video editing is the non-linear editing of a video source, remixing the added picture, background music, special effects, scenes and other materials with the video, or extracting part of the content of the video source, or cutting and combining the video source, and generating a new video with different expressiveness through secondary encoding.
[0003] In the process of video editing (especially there are also a large number of text monologues in short drama videos), it involves the extraction of text in the video picture or video frame. In the process of using the software system for video editing, the normal operation is to open the software system → click "Start Creation" → import the video → click "Text" below → click "Recognize keywords in the background picture of the video frame"; or click "Recognize keywords in the subtitles of the video frame", and then the software system is set according to the needs of the user, click "Start Matching", and then it can automatically recognize the subtitle keywords or the keywords in the background picture. Subtitle keywords include, for example, names of people, tone words, etc., and background picture keywords include text-based keywords such as billboards, signs, and mobile phone editing content pictures in the background picture;
[0004] It is found through research that since there are nearly one hundred thousand Chinese characters, and only a few thousand Chinese characters are used daily, which are an essential part of our daily life, but some Chinese characters are basically very similar, such as "field", "armor", "from", these characters are very similar, and when performing machine recognition, it will cause a large recognition error.
[0005] For the commonly used semantic recognition models and other methods based on video frame image processing, although they can find related words for text for semantic recognition, there will also be cases of recognition errors, so the semantic recognition model of the displayed text on the image in the prior art is more difficult to recognize than the simple text semantic recognition model; especially in the face of similar characters, especially the similar handwritten characters (or texts) on the image, the recognition difficulty is even greater; in addition, because the number of Chinese characters is too large, in the recognition system for processing short drama content based on approximate computer vision recognition in the image, it will cause the speed of related word recognition to be slow, thus affecting the detection speed. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for recognizing short drama content based on computer vision recognition, thereby solving the aforementioned technical problems pointed out in the prior art. Specifically, this application proposes a method for recognizing short drama content based on computer vision recognition, which utilizes a nine-square grid segmentation method to divide corresponding regions to solve the problems of low text accuracy and slow recognition speed.
[0007] This invention provides a method for identifying short drama content based on computer vision recognition, comprising the following steps:
[0008] A text image to be detected is acquired, and a preliminary scan is performed on the text image to be detected to obtain multiple text images with similar features;
[0009] The multiple similar feature text images and the text image to be detected are divided into grid images to obtain multiple similar feature grid images and the grid image to be detected; the corresponding grids of the multiple similar feature grid images and the grid image to be detected are compared to obtain the target text of the text image to be detected.
[0010] The target text is determined as the final text in the text image to be detected.
[0011] Preferably, the plurality of similar feature text images and the text image to be detected are divided into grid images to obtain a plurality of similar feature grid images and a grid image to be detected; the corresponding grids of the plurality of similar feature grid images and the grid image to be detected are compared to obtain the target text of the text image to be detected. The specific operation steps are as follows:
[0012] The text image to be detected is divided into a grid image: the grid image to be detected is divided into 3*3 sub-regions to be detected, and then each sub-region to be detected is further divided into grids to obtain several grids. The current sub-region to be detected after the above-mentioned further division is recorded as the growth region to be detected.
[0013] The region to be detected is traversed and the region growth algorithm is used to grow the text lines; the gray value of each pixel in the region to be detected is calculated, and the gray value difference between the maximum and minimum gray values of pixels in two grids in the region to be detected is calculated.
[0014] The grayscale value of each pixel in the grid is compared with the grayscale difference to find the pixel closest to the grayscale difference. A preset comparison threshold e is set to determine whether the grayscale value of the pixel closest to the grayscale difference is greater than the comparison threshold e. If not, it is initially determined that there are no text lines in the sub-region to be detected. If so, it is determined that there are text lines in the sub-region to be detected, and the pixel closest to the grayscale difference is used as the seed point to be detected.
[0015] If there are multiple pixels that are closest to the grayscale difference, and the grayscale value of multiple pixels that are closest to the grayscale difference is found to be greater than the comparison threshold e, then all of the multiple pixels that are closest to the grayscale difference are used as seed points to be detected.
[0016] The neighboring region of the seed point to be detected is grown, and it is determined whether the gray value of the seed point to be detected is greater than or equal to the gray value of the neighboring pixels; if not, the growth of the seed point to be detected is stopped, and it is determined that the sub-region to be detected in the growth area to be detected ultimately does not contain text lines.
[0017] If so, the seed point to be detected is grown. When the seed point to be detected grows to the edge of the growth area to be detected, the seed point to be detected stops growing and forms text lines.
[0018] If all the seed points to be tested have completed their growth, multiple text lines will be formed;
[0019] The similar feature grid image is composed of 3*3 similar sub-regions. Each similar sub-region is further divided into grids to obtain similar growth regions.
[0020] The similar growth regions of each similar feature text image are traversed, and the text lines are grown using a region growing algorithm; the gray value of each pixel in the similar growth region is calculated, and the average gray value of the pixels is calculated; the pixels in the grid with the average gray value are selected as similarity seed points.
[0021] Determine whether the gray value of a neighboring pixel is greater than or equal to the gray value of a similar seed point; if so, determine whether to grow the similar seed point. When the similar seed point grows to the edge of the similar growth region, the similar seed point stops growing and generates a text line; if not, the similar seed point stops growing and it is determined that there is no text line in the similar sub-region.
[0022] If there are multiple pixels with gray values equal to the average gray value, then all of them are used as similar seed points to complete the growth and obtain multiple text lines.
[0023] By comparing each sub-region of the grid image to be detected with each similar sub-region of a plurality of similar feature text images, the text lines are judged, thereby determining the target text in the text image to be detected.
[0024] Preferably, the target text in the text image is determined by comparing each sub-region of the grid image to be detected with each similar sub-region of a plurality of similar feature text images to identify text lines. The specific operation steps are as follows:
[0025] Each sub-region to be detected is compared with each similar sub-region of the corresponding multiple similar feature text images;
[0026] Determine whether the corresponding similar sub-regions contain text lines;
[0027] If not, then remove the similar feature text images of the corresponding similar sub-regions;
[0028] If so, determine whether the number of text lines in the corresponding similar sub-regions is the same;
[0029] If not, similar feature text images of similar sub-regions that do not conform to the number of text lines will be removed;
[0030] If so, then check whether the positions of the text lines inside the sub-region to be detected and the similar sub-region correspond to each other;
[0031] If not, similar feature text images of similar sub-regions whose text lines do not correspond to each other in the sub-region to be detected are removed;
[0032] If so, the sub-regions to be detected are re-merged into a grid image to be detected, and the text lines are connected to each other to form strokes to be detected;
[0033] Multiple similar sub-regions are merged back into a similar feature grid image, and the text lines are connected to each other to form similar strokes;
[0034] The stroke to be detected is compared with the similar strokes, and the character image with the highest contrast between the stroke to be detected and the similar strokes is determined as the target character of the character image to be detected.
[0035] Preferably, the specific steps for determining whether the positions of the text lines within the sub-region to be detected and the similar sub-region correspond to each other are as follows:
[0036] A projection process is performed on the sub-region to be detected to generate a histogram of the projection to be detected;
[0037] The distribution of pixel brightness in the histogram of the current projection to be detected is obtained through the histogram of the projection to be detected. The peak to be detected in the histogram of the projection to be detected is obtained through the distribution of pixel brightness. The highest peak value and the lowest peak value to be detected are calculated through the peak to be detected in the histogram of the projection to be detected.
[0038] If there are multiple text lines inside the sub-region to be detected, the generated projection histogram to be detected is cut to separate the text lines, generating multiple sub-projection histograms to be detected, and the above steps are performed to obtain the highest peak value and the lowest peak value of the projection histogram to be detected.
[0039] The similar sub-regions are analyzed using the above steps to establish a similar projection histogram, and the highest and lowest similar peak values of the similar projection histogram are determined.
[0040] The difference between the similar highest peak value and the highest peak value to be detected is determined, and the position of the text lines in the sub-region to be detected is determined by the difference. The difference is used to determine whether the position of the text lines in the sub-region to be detected is close to that of the text lines in the similar sub-region. The difference between the similar highest peak value and the highest peak value to be detected is determined by a preset highest peak value threshold g.
[0041] If not, determine that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region, and remove the similar feature text images of the similar sub-region;
[0042] If so, it is determined that the text lines of the sub-region to be detected are close in position to the text lines of the similar sub-region; and a minimum peak value threshold h is preset, and it is further determined whether the difference between the minimum peak value of the similar sub-region and the minimum peak value to be detected is less than the preset minimum peak value threshold h;
[0043] If not, it is determined that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region, and the similar feature text images of the similar sub-region are removed;
[0044] If so, the text lines of the sub-region to be detected are in the same position as the text lines of the similar sub-region;
[0045] If the difference between the highest peak value of the similarity and the highest peak value to be detected, and the difference between the lowest peak value of the similarity and the lowest peak value to be detected, all meet the peak value threshold judgment, then it is determined that the text lines of the sub-region to be detected and the text lines of the similar sub-region are in the same position.
[0046] If one of them does not meet the threshold judgment, it is determined that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region.
[0047] Preferably, the formula for calculating the highest peak value to be detected is:
[0048]
[0049] In the formula, a1 is the highest peak value to be detected within the first sub-region of the grid image to be detected, and u n Let n be the nth pixel in terms of the number of pixels in the vertical direction of the y-axis of the projection histogram to be detected. Let y be the average grayscale value of the pixels at the x-axis of the projection histogram to be detected. nv Let v be the pixel brightness distribution of the projection histogram to be detected, v be the highest point of the peak to be detected in the projection histogram to be detected, Qn be the brightness threshold around the nth pixel in the projection histogram to be detected, and sigmoid{} be the histogram function.
[0050] Preferably, the formula for calculating the lowest peak value to be detected is:
[0051]
[0052] In the formula, b1 is the lowest peak value to be detected within the first sub-region of the grid image to be detected, u m Let m be the m-th pixel, representing the number of pixels in the y-axis direction of the projection histogram to be detected. Let y be the average grayscale value of the pixels at the x-axis of the projection histogram to be detected. mv Let v be the pixel brightness distribution of the projection histogram to be detected, v be the trough of the lowest point of the peak to be detected in the projection histogram to be detected, Qm be the shadow threshold around the m-th pixel in the projection histogram to be detected, and sigmoid{} be the histogram function.
[0053] Accordingly, the present invention also provides a recognition system for processing short drama content based on computer vision recognition, including: an image acquisition module, an image comparison module, and a final determination module;
[0054] The image acquisition module is used to acquire the text image to be detected, and to perform a preliminary scan on the text image to be detected to obtain multiple text images with similar features;
[0055] The image comparison module is used to divide the multiple similar feature text images and the text image to be detected into grid images to obtain multiple similar feature grid images and the grid image to be detected; and to compare the corresponding grids of the multiple similar feature grid images and the grid image to be detected to obtain the target text of the text image to be detected.
[0056] The final determination module is used to determine the target text as the final text in the text image to be detected.
[0057] Accordingly, this application also relates to a storage medium storing a computer program, which, when executed by a processor, implements a method for recognizing short drama content based on computer vision recognition.
[0058] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:
[0059] Analysis of the above-mentioned computer vision-based recognition method for short drama content provided by the present invention shows that, in specific applications, by performing a preliminary scan of the text image to be detected, multiple similar feature text images that are similar to the text image to be detected can be obtained, reducing the speed of large-scale text inspection.
[0060] Furthermore, by dividing multiple similar feature text images and the text image to be detected into a grid image, similar sub-regions and a sub-region to be detected are formed. The gray-level difference between the maximum and minimum gray-level values of pixels within the sub-region to be detected is used to determine the changes in pixels within the sub-region to be detected. The changes in pixels are used to initially determine whether there are text lines inside. Then, seed points are determined to be detected and region growing is performed. When the seed points are detected, it can be further determined whether there are text lines inside the sub-region to be detected. Similar sub-regions are also filtered, and similar feature text images of similar sub-regions with text lines are selected.
[0061] Furthermore, the detection sub-region and similar sub-regions are compared to determine whether text lines exist. When all similar sub-regions have text lines, the number of text lines within the similar sub-regions is compared to the number of text lines within the detection sub-region. If the text lines are the same, the positions of the text lines in the similar sub-regions are compared. If the positions of the text lines are also the same, the similar sub-regions and the detection sub-regions are merged again to reconnect the text lines and form strokes. The similarity of the final strokes is then determined, and the text image with the highest similarity of the final strokes is used as the final text in the detection text image.
[0062] By comparing the presence, quantity, position, and stroke similarity of text lines step by step, the most similar text images are selected, continuously increasing the accuracy of text image recognition. At the same time, by comparing the similar sub-regions of the nine-square grid with the sub-region to be detected, the pressure of excessive recognition data is reduced, and the detection speed is increased. Attached Figure Description
[0063] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0064] Figure 1 This is an overall flowchart of a method for recognizing short drama content based on computer vision recognition, provided in Embodiment 1 of the present invention.
[0065] Figure 2 This is a flowchart illustrating the process of obtaining text lines in a method for recognizing short drama content based on computer vision, as provided in Embodiment 1 of the present invention.
[0066] Figure 3 This is a schematic diagram showing the stopping of growth of a seed point at the contact edge in a short drama content recognition method based on computer vision, as provided in Embodiment 1 of the present invention.
[0067] Figure 4 This is a schematic diagram showing the seed point to be detected stopping growth midway through the process, which is a method for identifying short drama content based on computer vision recognition provided in Embodiment 1 of the present invention.
[0068] Figure 5 This is a schematic diagram illustrating the growth of multiple seed points to be detected in a method for identifying short drama content based on computer vision recognition provided in Embodiment 1 of the present invention.
[0069] Figure 6 The flowchart of text line comparison and judgment is provided for a method of recognizing short drama content based on computer vision recognition in Embodiment 1 of the present invention.
[0070] Figure 7 This is a schematic diagram illustrating the determination of whether text lines exist in a sub-region of a recognition method for short drama content based on computer vision recognition provided in Embodiment 1 of the present invention.
[0071] Figure 8 The flowchart illustrates the method for determining the position of text lines in a short drama content recognition process based on computer vision, as provided in Embodiment 1 of the present invention.
[0072] Figure 9 The projection histogram is provided in Embodiment 1 of the present invention for a method of recognizing and processing short drama content based on computer vision.
[0073] Figure 10 A flowchart of a computer vision-based short drama content recognition system provided in Embodiment 2 of the present invention;
[0074] Figure 11 A storage medium provided in Embodiment 3 of the present invention;
[0075] Markings: Obtain image module 10, image comparison module 20, final determination module 30; processor 1110; communication interface 1120; memory 1130; computer storage medium 1140. Specific implementation manners
[0076] Next, the technical solutions of the present invention will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0077] Next, the present invention will be further described in detail through specific embodiments in conjunction with the accompanying drawings.
[0078] Embodiment 1
[0079] As Figure 1 shown, the present invention proposes a recognition method for processing short drama content based on computer vision recognition, including the following operation steps:
[0080] S1: Obtain a text image to be detected, perform a preliminary scan on the text image to be detected, and obtain multiple similar feature text images;
[0081] It should be noted that by performing a preliminary scan and detection on the obtained text image to be detected, it can be preliminarily determined which character the current text image to be detected belongs to (assuming the true recognition result of the current text image to be detected is the Chinese character "field"), and then according to the preliminary determination result, multiple similar feature text images similar to the text image to be detected can be obtained (other similar feature text images may be "armor", "field", "you", etc. similar images). Subsequently, through analysis, and then select one of the similar feature text images with the highest difference to determine the target text of the text image to be detected.
[0082] S2: Divide the multiple similar feature text images and the text image to be detected into grid images (that is, the similar feature text images are used as sample images, and it is necessary to divide both the multiple similar feature text images and the text image to be detected into grid images), and obtain multiple similar feature grid images and a grid image to be detected; compare the corresponding grids of the multiple similar feature grid images and the grid image to be detected to obtain the target text of the text image to be detected (that is, the target text of the text image to be detected is finally recognized as "field");
[0083] It should be noted that by dividing multiple similar feature text images and the text image to be detected into grid images, multiple similar feature grid images and the text image to be detected can be obtained in a 3*3 grid image. The contrast between multiple similar feature text images and the text image to be detected is determined by comparing the strokes inside the grid at corresponding positions. The closest similar feature text image is selected based on the contrast and identified as the target text in the text image to be detected.
[0084] S3: The target text is determined to be the final text of the text image to be detected;
[0085] It should be noted that the target text is the most similar feature grid image that is closest to the text image to be detected. The final text of the text image to be detected is determined by the closest similar feature grid image.
[0086] Specifically, such as Figure 2 As shown, in step S2, the multiple similar feature text images and the text image to be detected are divided into grid images to obtain multiple similar feature grid images and the grid image to be detected; the corresponding grids of the multiple similar feature grid images and the grid image to be detected are compared to obtain the target text of the text image to be detected. The specific operation steps are as follows:
[0087] S21: Divide the text image to be detected into a grid image: Divide the grid image to be detected into a 3*3 sub-region to be detected (that is, the grid image to be detected is composed of 3*3 sub-regions to be detected), and then divide each sub-region to be detected into several grids (this time it is divided into N*N grids). The current sub-region to be detected after the above re-division is recorded as the growth region to be detected.
[0088] The text lines are grown by traversing the region to be detected and using a region growing algorithm. The grayscale value of each pixel in the region to be detected is calculated. The grayscale difference between the maximum and minimum grayscale values of pixels in two grids in the region to be detected is calculated (not arbitrarily selected, but the grid containing the pixel with the maximum grayscale value is selected, and the grid containing the pixel with the minimum grayscale value is identified; it should be noted that during the secondary division, it is ensured that each grid contains one pixel, so as to prepare for the subsequent calculation of the grayscale difference between the maximum and minimum grayscale values of pixels in any two grids in the region to be detected; of course, extraction processing can also be performed, that is, ensuring that each grid contains a fixed number of pixels (e.g., 4 pixels), and treating these 4 pixels in the grid as one pixel, the extraction situation will not be elaborated further).
[0089] The grayscale difference between the maximum and minimum grayscale values of pixels within the sub-region to be detected is used to aid subsequent calculations. This grayscale difference reflects the range of pixel variation within the sub-region to be detected (i.e., the range of pixel variation can reflect changes in pixel brightness or texture). The range of pixel variation is used to determine whether text lines may exist.
[0090] If there is a text line in the sub-region to be detected, the gray values of the pixels of the text line and the surrounding background will be different, resulting in different changes. Therefore, the difference between the maximum and minimum gray values of the sub-region to be detected will be relatively large. At the same time, it can also be used to exclude sub-regions to be detected that do not have text lines.
[0091] Generally speaking, the grayscale values of pixels in a grid with text lines are larger, while the grayscale values of pixels in a grid without text lines are generally smaller.
[0092] The grayscale value of each pixel in the grid is compared with the grayscale difference to find the pixel closest to the grayscale difference. A preset comparison threshold e (essentially a grayscale value threshold) is used to determine whether the grayscale value of the pixel closest to the grayscale difference is greater than the comparison threshold e. If not, it is initially determined that there are no text lines in the sub-region to be detected. If so, it is determined that there are text lines in the sub-region to be detected, and the pixel closest to the grayscale difference is used as the seed point to be detected.
[0093] Therefore, the study found that after identifying the pixel closest to the grayscale difference, it is necessary to compare the grayscale value of the current pixel closest to the grayscale difference. If the grayscale value of the current pixel closest to the grayscale difference is too small, it can be preliminarily determined that there are no text lines in the grid of the current pixel closest to the grayscale difference (that is, by comparing the grayscale value of the pixel with the grayscale difference and introducing a comparison threshold e as a preliminary screening condition, pixels with too low grayscale values that are unlikely to belong to text lines can be filtered out, and a large number of obviously unqualified sub-regions to be detected can be quickly eliminated, increasing the detection speed).
[0094] For example, in case 1, the extreme value range of a pixel in a certain growth region to be detected is 10-200; that is, in a certain growth region to be detected, the maximum gray value of a pixel is 200 and the minimum gray value of a pixel is 10, with a gray value difference of 190; when the gray value of the pixel in the current grid is identified as 180, it is found that it is not only very close to the gray value difference of 190, but the current gray value of 180 is also relatively large and exceeds the comparison threshold e, assuming the comparison threshold e is 40.
[0095] For example, in Case 2, the extreme value range of pixel points in a growth area to be detected is 50 - 60. In a growth area to be detected, the maximum gray value of pixel points is 60 and the minimum gray value of pixel points is 50, with a gray difference of 10. When the gray value of pixel points in the current grid is recognized as 8, it is found that it is not only very close to the gray difference of 10, but at this time, the comparison threshold e value of the growth area to be detected is also 40. However, although the gray value of pixel points in the current grid is 8 and is very close to the gray difference of 10, it is less than the comparison threshold e. Then, it can be initially determined that there are no text lines in the current grid.
[0096] If there are multiple pixel points closest to the gray difference, and it is detected that the gray values of multiple pixel points closest to the gray difference are greater than the comparison threshold e at the same time, all the multiple pixel points closest to the gray difference are used as seed points to be detected.
[0097] Perform neighborhood growth on the seed points to be detected, and determine whether the gray value of the seed points to be detected is greater than or equal to the gray value of the pixel points in the neighborhood. If not, stop growing the seed points to be detected, and determine that there are ultimately no text lines in the sub - area to be detected in this growth area to be detected (that is, by judging twice that there are no text lines in the sub - area to be detected, it can be more clear for subsequent comparison of text lines between the sub - area to be detected and the corresponding similar sub - areas, and more precisely eliminate the similar feature text images that do not meet the requirements in the corresponding similar sub - areas).
[0098] If so, grow the seed points to be detected. When the seed points to be detected grow and touch the edge of the growth area to be detected, the seed points to be detected stop growing (that is, when the seed points to be detected are less than the gray value of the pixel points in the neighborhood during the growth process, it will also be determined that a text line is grown. For example, the third point of the three - point water radical in the character "河"). (That is, the stroke "提"). After the first division, the text line will touch the edge of the sub - area to be detected, as Figure 3 shown; while the first point "丶" of the three - point water radical may be separately divided into a sub - area to be detected after dividing the sub - area to be detected, and it will not touch the edge of the sub - area to be detected. So when the seed points to be detected stop growing during the growth process, a text line will also be grown (that is, the first point "丶" of the three - point water radical in the character "江"), as Figure 4 shown), forming a text line.
[0099] If all the seed points to be detected have completed growth, multiple text lines are formed (that is, for example, after dividing the sub - area to be detected for the four - point water radical "氵" at the bottom of the character "江", the second point "丶" (that is, the stroke "捺") of the four - point water radical "氵" at the bottom of the character "江", the third (That is, the stroke "tí") is divided into a sub-region to be detected, thus forming two seeds to be detected, and two text lines are formed (that is, when growing the seeds to be detected with text, due to the complexity of the text, multiple seeds to be detected will grow, such as the character "lín"). As Figure 5 shown);
[0100] It should be noted that the grid image to be detected is first divided into 3*3 nine-square grid sub-regions to be detected, and then further divided into smaller grids to form a growth region to be detected, which can more accurately identify the local text lines in the image;
[0101] Due to the simplicity and complexity of the text (i.e., the simple character "yī" and the complex character "lín"); each 3*3 sub-region to be detected first uses the region growing algorithm to determine whether there are text lines inside. If there are text lines, it means that there are some strokes of the text in this sub-region to be detected. For example, after the character "yī" is divided, it will occupy 3 horizontal sub-regions to be detected; while the character "lín" will occupy more sub-regions to be detected due to the complexity of its strokes (i.e., more strokes). By judging whether there are text lines in the sub-region to be detected, it can be determined whether the text is simple or complex, and the text lines of the text can be quickly detected through the divided sub-regions to be detected, reducing the detection time of the overall text image to be detected and the detection efficiency of excessive data volume;
[0102] The text lines are the individual text lines formed after the overall strokes of the text are divided. The text lines may form separate strokes, such as: strokes "zhǔ" and "shù" (i.e., the strokes "dot" and "vertical"), or may be part of a stroke, such as: after the stroke "fú" is divided, it becomes "yī" and "piě" (i.e., the strokes "horizontal" and "left-falling stroke");
[0103] Compare the gray value of each pixel point in the grid with the previously calculated gray difference value to find the pixel point whose gray value is closest to the gray difference value; the pixel point closest to the gray difference value may be a text feature point (i.e., a seed to be detected, a point on the text line, and multiple text feature points are obtained by growing from the seed to be detected and connected to form a text line), indicating the position where the pixel points in the sub-region to be detected change most significantly; it may also indicate that there is no text feature point and no text line;
[0104] S22: The similar feature grid image is composed of 3*3 similar sub-regions. Each similar sub-region is further divided into grids (i.e., the grids after further division are N*N) to obtain a similar growth region;
[0105] Traverse the similar growth regions of each similar feature text image, and perform region growth on the text lines through the region growth algorithm; calculate the gray values of the pixel points of each grid in the similar growth region, and calculate the average gray value of the pixel points; select the pixel points in the grid equal to the average gray value and use them as similar seed points;
[0106] Judge whether the gray value of the neighborhood pixel points is greater than or equal to the gray value of the similar seed point; if so, then determine to grow the similar seed point. When the similar seed point grows and touches the edge of the similar growth region, the similar seed point stops growing and generates a text line; if not, the similar seed point stops growing and determines that there is no text line in the similar sub-region;
[0107] If there are multiple pixel points with gray values equal to the average gray value, all of them are used as similar seed points to complete growth, and multiple text lines are obtained;
[0108] It should be noted that the similar feature text image is intact and can know what the text is. Therefore, similar seed points are directly selected for growth through the gray values of the pixel points to obtain text lines (that is, the example description of step S22 is the same as the example description of step S21 and will not be elaborated here);
[0109] S23: Judge the text lines by comparing each sub-region to be detected in the grid image to be detected with each similar sub-region of the corresponding multiple similar feature text images, so as to judge the target text of the text image to be detected;
[0110] It should be noted that by comparing each sub-region to be detected with each similar sub-region at the corresponding position to judge whether there is a text line. If there is no text line in the similar sub-region at the corresponding position, then eliminate the similar feature text image without a text line; if there is, judge whether the strokes formed by the text lines of the overall text of the final similar feature grid image match, so as to judge the target text of the text image to be detected.
[0111] For example, the current text image to be detected is "field", but it cannot be confirmed that it is "field" at present; in this case, divide the grid image "field" to be detected into a nine-square grid and other processing to obtain its corresponding multiple sub-regions to be detected; then multiple similar feature text images may be images such as "armor" or "from"; divide the above similar feature text images into nine-square grids to obtain their corresponding each similar sub-region, and then perform subsequent processing to judge the target text of the text image to be detected. See the subsequent steps S231 - S235 for details.
[0112] Specifically, as Figure 7As shown, in step S23, the text lines are judged by comparing each sub-region of the grid image to be detected with each similar sub-region of the corresponding multiple similar feature text images, thereby determining the target text of the text image to be detected. The specific operation steps are as follows:
[0113] S231: Compare each of the sub-regions to be detected with each of the corresponding multiple similar feature text images;
[0114] It should be noted that after seeding growth is performed on each growth region to be detected in the grid image and each similar growth region of multiple similar feature text images, each sub-region to be detected and each similar sub-region will obtain their own text lines. By comparing the text lines of the corresponding sub-region to be detected and the similar sub-region, the similar feature text image with the highest contrast of the text image to be detected is obtained as the target text.
[0115] S232: Determine whether text lines exist in the corresponding similar sub-regions (determine whether text lines exist between all the sub-regions to be detected and all corresponding similar sub-regions, such as...). Figure 7 (as shown);
[0116] If not, then remove the similar feature text images of the corresponding similar sub-regions;
[0117] If so, determine whether the number of text lines in the corresponding similar sub-regions is the same;
[0118] S233: If not, remove similar feature text images of similar sub-regions that do not conform to the number of text lines;
[0119] If so, then check whether the positions of the text lines inside the sub-region to be detected and the similar sub-region correspond to each other;
[0120] S234: If not, then similar feature text images of similar sub-regions of the sub-regions of the sub-regions of the sub-region to be detected that do not correspond to each other are removed;
[0121] If so, the sub-regions to be detected are re-merged into a grid image to be detected, and the text lines are connected to each other to form strokes to be detected;
[0122] Multiple similar sub-regions are merged back into a similar feature grid image, and the text lines are connected to each other to form similar strokes;
[0123] S235: Compare the stroke to be detected with the similar strokes, and determine the similar feature text image with the highest contrast between the stroke to be detected and the similar strokes, and use it as the target text of the text image to be detected;
[0124] It should be noted that when the number and position of the text lines in each similar sub-region and each sub-region to be detected are the same, similar text images that do not conform to the similar sub-regions can be initially filtered out. The text image with the highest contrast between the final stroke to be detected and the similar stroke is selected as the target text image.
[0125] Specifically, such as Figure 8 As shown, in step S233, the specific steps for determining whether the positions of the text lines within the sub-region to be detected correspond to those within the similar sub-region are as follows:
[0126] Research suggests that any image can be transformed into a corresponding histogram, such as a grayscale histogram, using projection analysis methods. A grayscale histogram is also called a luminance histogram. For example, in a given histogram, the horizontal axis represents grayscale values from 0 to 255, and the vertical axis represents the number of pixels corresponding to those grayscale values in the original image. This graph of the function is called a histogram. Of course, a histogram will have peaks and troughs. For instance, in a particular histogram, the peak might be located slightly to the left of the center (in the shaded area), indicating that there are many dark gray or dark-colored parts in the image.
[0127] S2331: Perform projection processing on the sub-region to be detected to generate a histogram of the projection to be detected (in this embodiment, it is a histogram of the projection to be detected); that is, the vertical coordinate of the y-axis and the horizontal coordinate of the x-axis of the generated histogram can be displayed;
[0128] It should be noted that, in the above generation process, the vertical coordinate of the y-axis of the grayscale histogram can display the number of pixels corresponding to the grayscale value of the text lines, and the horizontal coordinate of the x-axis of the grayscale histogram can display the calculated grayscale value of the pixels of the text lines (i.e., grayscale value values from 0 to 255).
[0129] S2332: Obtain the distribution of pixel brightness (grayscale value distribution) in the histogram of the current projection to be detected through the histogram of the projection to be detected; obtain the peak to be detected of pixel brightness in the histogram of the projection to be detected through the distribution of pixel brightness; calculate the highest peak value and the lowest peak value to be detected through the peak to be detected in the histogram of the projection to be detected.
[0130] The formula for calculating the highest peak value to be detected is:
[0131]
[0132] In the formula, a1 is the highest peak value to be detected within the first sub-region of the grid image to be detected, and u n Let n be the nth pixel in terms of the number of pixels in the vertical direction of the y-axis of the projection histogram to be detected. Let y be the average grayscale value of the pixels at the x-axis of the projection histogram to be detected. nv Let v be the pixel brightness distribution of the projection histogram to be detected, v be the highest point of the peak to be detected in the projection histogram to be detected, Qn be the brightness threshold around the nth pixel in the projection histogram to be detected, and sigmoid{} be the histogram function.
[0133] Adding a brightness threshold Qn to the above formula can exclude areas with excessively low or high brightness from the projection histogram of the target image. It can detect the brightness of pixels in a specific range, which can help reduce noise and interference and improve the accuracy of feature extraction. The text image to be detected may have brightness changes caused by various factors (such as uneven lighting, sensor noise, etc.). By setting a brightness threshold, the brightness abnormality caused by noise can be suppressed, making the algorithm more robust.
[0134] The formula for calculating the lowest peak value to be detected is:
[0135]
[0136] In the formula, b1 is the lowest peak value to be detected within the first sub-region of the grid image to be detected, u m Let m be the m-th pixel, representing the number of pixels in the y-axis direction of the projection histogram to be detected. Let y be the average grayscale value of the pixels at the x-axis of the projection histogram to be detected. mv Let be the pixel brightness distribution of the projection histogram to be detected, v be the trough of the lowest point of the peak to be detected in the projection histogram, and Qm be the shadow threshold around the m-th pixel in the projection histogram to be detected; sigmoid{} is the histogram function. Subtracting the shadow threshold Qm in the above formula represents the darker parts of the projection histogram to be detected. These parts may include lighting conditions, the reflective properties of the object's surface, etc., but may also contain noise. By subtracting the shadow threshold Qm, shadow areas can be better distinguished from other areas (such as areas with uneven brightness distribution), thus more accurately extracting the features of interest, such as the lowest peak value b1.
[0137] As described in the above embodiments, the distribution of pixel brightness in the projection histogram to be detected is obtained by the number of pixels and the change in the grayscale value of the pixels. The distribution of pixel brightness is used to obtain the peak of the pixel brightness in the projection histogram to be detected. When the peak of the target projection histogram reaches its highest point, a bright area appears in the projection histogram to be detected, and at the same time, a shadow area of the trough of the lowest point also appears. The brightness threshold Qn is used to determine whether v is the highest point of the peak of the target projection histogram to be detected, and the shadow threshold Qm is used to determine whether v is the trough of the lowest point of the peak of the target projection histogram to be detected.
[0138] Meanwhile, by observing the number of pixels and the changes in the grayscale value of pixels, we can determine which region the pixels are clustered in. By observing the brightness of the region where the pixels are clustered, we can obtain the peak to be detected in the projection histogram. Therefore, Qn is used as the brightness threshold around the nth pixel in the projection histogram to be detected (i.e., the brightness of the region where the pixels are clustered).
[0139] It should be noted that the sub-region to be detected is projected using a projection analysis method to generate a projection histogram to be detected. Furthermore, the text lines within the sub-region to be detected have already been obtained using a region growing algorithm. Therefore, the number of pixels in the y-axis and the change in grayscale value of pixels in the x-axis are calculated by finding the text lines in the projection histogram to be detected. The troughs of the highest and lowest points of the peaks to be detected can be determined by identifying the peaks, and the highest and lowest peak values to be detected are then calculated using these troughs.
[0140] S2333: If there are multiple text lines inside the sub-region to be detected, the generated projection histogram to be detected is cut to separate the text lines, generate multiple sub-projection histograms to be detected, and perform step S2332 to obtain the highest peak value and the lowest peak value of the projection histogram to be detected.
[0141] It should be noted that when there are multiple text lines inside the sub-region to be detected, the characteristics of the projection analysis method are used to divide the generated projection histogram to be detected into text lines, which will result in a sub-projection histogram to be detected containing a single text line. Then, step S2332 is performed on the sub-projection histogram to be detected to obtain the highest peak value and the lowest peak value of the pixel brightness in the projection histogram to be detected.
[0142] S2334: For the similar sub-regions, a similar projection histogram is established using the projection analysis method of steps S2331-S2333, and the similar highest peak value and similar lowest peak value of the similar projection histogram are determined.
[0143] It should be noted that a similar projection histogram is established for the similar sub-regions using the same projection analysis method as the sub-region to be detected. The highest and lowest similar peak values are obtained from the similar projection histogram. By comparing the highest similar peak value with the highest peak value to be detected and the lowest similar peak value with the lowest peak value to be detected, it is determined whether the difference between them is less than the peak value threshold. This determines whether the positions of the text lines in the similar sub-regions correspond to those in the sub-region to be detected.
[0144] S2335: Determine the difference between the similar highest peak value and the highest peak value to be detected, and determine whether the positions of the text lines in the sub-region to be detected and the text lines in the similar sub-region are close by using the difference; determine whether the difference between the similar highest peak value and the highest peak value to be detected is less than the preset highest peak value threshold g by using a preset highest peak value threshold g.
[0145] If not, determine that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region, and remove the similar feature text images of the similar sub-region;
[0146] If so, it is determined that the text lines of the sub-region to be detected are close in position to the text lines of the similar sub-region; and a minimum peak value threshold h is preset, and it is further determined whether the difference between the minimum peak value of the similar sub-region and the minimum peak value to be detected is less than the preset minimum peak value threshold h;
[0147] If not, it is determined that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region, and the similar feature text images of the similar sub-region are removed;
[0148] If so, the text lines of the sub-region to be detected are in the same position as the text lines of the similar sub-region;
[0149] S2336: If the difference between the similar highest peak value and the highest peak value to be detected, and the difference between the similar lowest peak value and the lowest peak value to be detected, all meet the peak value threshold (i.e., the peak value threshold includes the highest peak value threshold g and the lowest peak value threshold h) judgment, then it is determined that the text lines of the sub-region to be detected are in the same position as the text lines of the similar sub-region.
[0150] If one of them does not meet the threshold judgment, it is determined that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region;
[0151] It should be noted that by judging whether the difference between the similar highest peak value and the highest peak value to be detected, and the difference between the similar lowest peak value and the lowest peak value to be detected are less than the threshold, when all the differences are less than the peak value threshold, it is determined that the text lines of the sub-region to be detected and the text lines of the similar sub-region are in the same position.
[0152] If either the difference between the highest peak value of the similarity and the highest peak value to be detected, or the difference between the lowest peak value of the similarity and the lowest peak value to be detected, does not meet the condition of being less than the peak value threshold, it is determined that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region, and the similar feature text images of the similar sub-region are removed.
[0153] The above-mentioned technical solution uses histograms to project histograms onto similar sub-regions and sub-regions to be detected. The peaks of the histograms can be obtained by the number of pixels and the gray values of the pixels. By judging the maximum and minimum peak values, it is determined whether the positions of the text lines inside the similar sub-regions and the sub-regions to be detected correspond, thereby further filtering out similar feature text images with high similarity.
[0154] Example 2
[0155] like Figure 10 As shown, the present invention also proposes a recognition system for short drama content based on computer vision recognition, including: an image acquisition module 10, an image comparison module 20, and a final determination module 30;
[0156] The image acquisition module 10 is used to acquire the text image to be detected, perform a preliminary scan on the text image to be detected, and obtain multiple text images with similar features;
[0157] The image comparison module 20 is used to divide the multiple similar feature text images and the text image to be detected into grid images to obtain multiple similar feature grid images and the grid image to be detected; and to compare the corresponding grids of the multiple similar feature grid images and the grid image to be detected to obtain the target text of the text image to be detected.
[0158] The final determination module 30 is used to determine the target text as the final text of the text image to be detected.
[0159] Example 3
[0160] like Figure 11 As shown, on the other hand, this third embodiment, based on the computer vision recognition method for processing short drama content provided in the first embodiment, also provides a computer storage medium 1140 (hereinafter referred to as the storage medium). A schematic diagram of the computer storage medium structure framework provided in this third embodiment is shown, which includes:
[0161] Memory 1130 is used to store computer programs;
[0162] The communication interface 1120 is used to connect the memory 1130 to the processor 1110;
[0163] The processor 1110 is configured to execute a computer program to implement a method for identifying short drama content based on computer vision recognition, as disclosed in Embodiment 1 of any combination of the above embodiments.
[0164] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits, digital signal processors, digital signal processing devices, programmable logic devices, field-programmable gate arrays, general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0165] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0166] In summary, the present invention provides a method and system for identifying short drama content based on computer vision recognition. By performing a preliminary scan of the text image to be detected, multiple similar feature text images that are similar to the text image to be detected can be obtained, thus reducing the speed of large-scale text inspection.
[0167] Furthermore, in its specific implementation, multiple similar feature text images and the text image to be detected are divided into grid images to form similar sub-regions and sub-regions to be detected. The gray-level difference between the maximum and minimum gray-level values of pixels within the sub-region to be detected is used to determine the changes in pixels within the sub-region to be detected, and the presence of text lines is initially determined by these pixel changes. Furthermore, seed points are selected for region growing, and the presence of text lines within the sub-region to be detected can be further determined. Similarly, similar sub-regions are selected to identify similar feature text images that contain text lines.
[0168] Furthermore, the detection sub-region and similar sub-regions are compared to determine whether text lines exist. When all similar sub-regions have text lines, the number of text lines within the similar sub-regions is compared to the number of text lines within the detection sub-region. If the text lines are the same, the positions of the text lines in the similar sub-regions are compared. If the positions of the text lines are also the same, the similar sub-regions and the detection sub-regions are merged again to reconnect the text lines and form strokes. The similarity of the final strokes is then determined, and the text image with the highest similarity of the final strokes is used as the final text in the detection text image.
[0169] By using the above methods to screen and confirm step by step, including judging the presence, quantity, and position of text lines, and comparing the similarity of strokes, the most similar text image with the highest similarity is selected. This continuously increases the recognition accuracy of the text image to be detected. At the same time, by comparing the similar sub-regions of the nine-square grid with the sub-region to be detected separately, the pressure of excessive recognition data is reduced, and the detection speed is increased.
[0170] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0171] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0172] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; those skilled in the art can modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying short drama content based on computer vision recognition, characterized in that, The following steps are included: A text image to be detected is acquired, and a preliminary scan is performed on the text image to be detected to obtain multiple text images with similar features; The multiple similar feature text images and the text image to be detected are divided into grid images to obtain multiple similar feature grid images and the grid image to be detected; By comparing the corresponding grids of the multiple similar feature grid images with the grid image to be detected, the target text of the text image to be detected is obtained; The target text is determined as the final text in the text image to be detected; The multiple similar feature text images and the text image to be detected are divided into grid images to obtain multiple similar feature grid images and a grid image to be detected; the corresponding grids of the multiple similar feature grid images and the grid image to be detected are compared to obtain the target text of the text image to be detected. The specific operation steps are as follows: The text image to be detected is divided into a grid image: the grid image to be detected is divided into 3*3 sub-regions to be detected, and then each sub-region to be detected is further divided into grids to obtain several grids. The current sub-region to be detected after the above-mentioned further division is recorded as the growth region to be detected. The region to be detected is traversed and the region growth algorithm is used to grow the text lines; the gray value of each pixel in the region to be detected is calculated, and the gray value difference between the maximum and minimum gray values of pixels in two grids in the region to be detected is calculated. The grayscale value of each pixel in the grid is compared with the grayscale difference value to determine and find the pixel that is closest to the grayscale difference value; A preset comparison threshold e is used to determine whether the gray value of the pixel closest to the gray value difference is greater than the comparison threshold e; if not, it is preliminarily determined that there are no text lines in the sub-region to be detected. If so, it is determined that there are text lines in the sub-region to be detected, and the pixel point with the closest grayscale difference is taken as the seed point to be detected. If there are multiple pixels that are closest to the grayscale difference, and the grayscale value of multiple pixels that are closest to the grayscale difference is found to be greater than the comparison threshold e, then all of the multiple pixels that are closest to the grayscale difference are used as seed points to be detected. The neighboring region of the seed point to be detected is grown, and it is determined whether the gray value of the seed point to be detected is greater than or equal to the gray value of the neighboring pixels; if not, the growth of the seed point to be detected is stopped, and it is determined that the sub-region to be detected in the growth area to be detected ultimately does not contain text lines. If so, the seed point to be detected is grown. When the seed point to be detected grows to the edge of the growth area to be detected, the seed point to be detected stops growing and forms text lines. If all the seed points to be tested have completed their growth, multiple text lines will be formed; The similar feature grid image is composed of 3*3 similar sub-regions. Each similar sub-region is further divided into grids to obtain similar growth regions. The similar growth regions of each similar feature text image are traversed, and the text lines are grown using a region growing algorithm; the gray value of each pixel in the similar growth region is calculated, and the average gray value of the pixels is calculated; the pixels in the grid with the average gray value are selected as similarity seed points. Determine whether the gray value of a neighboring pixel is greater than or equal to the gray value of a similar seed point; if so, determine whether to grow the similar seed point. When the similar seed point grows to the edge of the similar growth area, the similar seed point stops growing and generates a text line. If not, the similar seed points stop growing, and it is determined that there are no text lines in the similar sub-regions; If there are multiple pixels with gray values equal to the average gray value, then all of them are used as similar seed points to complete the growth and obtain multiple text lines. By comparing each sub-region of the grid image to be detected with each similar sub-region of a plurality of similar feature text images, the text lines are judged, thereby determining the target text in the text image to be detected.
2. The method for identifying short drama content based on computer vision recognition according to claim 1, characterized in that, By comparing each sub-region of the grid image to be detected with each similar sub-region of multiple similar feature text images, the text lines are judged to identify the target text in the text image to be detected. The specific operation steps are as follows: Each sub-region to be detected is compared with each similar sub-region of the corresponding multiple similar feature text images; Determine whether the corresponding similar sub-regions contain text lines; If not, then remove the similar feature text images of the corresponding similar sub-regions; If so, determine whether the number of text lines in the corresponding similar sub-regions is the same; If not, similar feature text images of similar sub-regions that do not conform to the number of text lines will be removed; If so, then check whether the positions of the text lines inside the sub-region to be detected and the similar sub-region correspond to each other; If not, similar feature text images of similar sub-regions whose text lines do not correspond to each other in the sub-region to be detected are removed; If so, the sub-regions to be detected are re-merged into a grid image to be detected, and the text lines are connected to each other to form strokes to be detected; Multiple similar sub-regions are merged back into a similar feature grid image, and the text lines are connected to each other to form similar strokes; The stroke to be detected is compared with the similar strokes, and the character image with the highest contrast between the stroke to be detected and the similar strokes is determined as the target character of the character image to be detected.
3. The method for identifying short drama content based on computer vision recognition according to claim 2, characterized in that, The specific steps for determining whether the positions of the text lines within the sub-region to be detected correspond to those within the similar sub-region are as follows: A projection process is performed on the sub-region to be detected to generate a histogram of the projection to be detected; The distribution of pixel brightness in the histogram of the current projection to be detected is obtained through the histogram of the projection to be detected. The peak to be detected in the histogram of the projection to be detected is obtained through the distribution of pixel brightness. The highest peak value and the lowest peak value to be detected are calculated through the peak to be detected in the histogram of the projection to be detected. If there are multiple text lines inside the sub-region to be detected, the generated projection histogram to be detected is cut to separate the text lines, generating multiple sub-projection histograms to be detected, and the above steps are performed to obtain the highest peak value and the lowest peak value of the projection histogram to be detected. The similar sub-regions are analyzed using the above steps to establish a similar projection histogram, and the highest and lowest similar peak values of the similar projection histogram are determined. The difference between the similar highest peak value and the highest peak value to be detected is determined, and the position of the text lines in the sub-region to be detected is determined by the difference. The difference is used to determine whether the position of the text lines in the sub-region to be detected is close to that of the text lines in the similar sub-region. The difference between the similar highest peak value and the highest peak value to be detected is determined by a preset highest peak value threshold g. If not, determine that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region, and remove the similar feature text images of the similar sub-region; If so, it is determined that the text lines of the sub-region to be detected are close in position to the text lines of the similar sub-region; And a minimum peak value threshold h is preset, and it is further determined whether the difference between the similar minimum peak value and the minimum peak value to be detected is less than the preset minimum peak value threshold h; If not, it is determined that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region, and the similar feature text images of the similar sub-region are removed; If so, the text lines of the sub-region to be detected are in the same position as the text lines of the similar sub-region; If the difference between the highest peak value of the similarity and the highest peak value to be detected, and the difference between the lowest peak value of the similarity and the lowest peak value to be detected, all meet the peak value threshold judgment, then it is determined that the text lines of the sub-region to be detected and the text lines of the similar sub-region are in the same position. If one of them does not meet the threshold judgment, it is determined that the position of the text lines in the sub-region to be detected is different from that of the text lines in the similar sub-region.
4. The method for identifying short drama content based on computer vision recognition according to claim 3, characterized in that, The formula for calculating the highest peak value to be detected is: In the formula, a1 is the highest peak value to be detected within the first sub-region of the grid image to be detected, and u n Let n be the nth pixel in terms of the number of pixels in the vertical direction of the y-axis of the projection histogram to be detected. Let y be the average grayscale value of the pixels at the x-axis of the projection histogram to be detected. nv Let v be the pixel brightness distribution of the projection histogram to be detected, v be the highest point of the peak to be detected in the projection histogram to be detected, Qn be the brightness threshold around the nth pixel in the projection histogram to be detected, and sigmoid{} be the histogram function.
5. The method for identifying short drama content based on computer vision recognition according to claim 4, characterized in that, The formula for calculating the lowest peak value to be detected is: In the formula, b1 is the lowest peak value to be detected within the first sub-region of the grid image to be detected, u m Let m be the m-th pixel, representing the number of pixels in the y-axis direction of the projection histogram to be detected. Let y be the average grayscale value of the pixels at the x-axis of the projection histogram to be detected. mv Let v be the pixel brightness distribution of the projection histogram to be detected, v be the trough of the lowest point of the peak to be detected in the projection histogram to be detected, Qm be the shadow threshold around the m-th pixel in the projection histogram to be detected, and sigmoid{} be the histogram function.
6. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the identification method for processing short drama content based on computer vision recognition as described in any one of claims 1-5.