Method for obtaining page number in video, screenshot method and division method
By receiving the video stream and using the OCR algorithm to detect the page number in the video, the problem of inaccurate page number marking in the courseware video is solved, and the accurate identification and marking of page number in the courseware video is achieved.
Patent Information
- Application Number
- CN202411978401.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, courseware videos cannot be accurately identified when marking page numbers, resulting in the slides on the same page being marked as multiple slides.
By receiving the video stream, intercepting a frame of detection pictures, using the OCR algorithm to detect the text box of the candidate specific area, determining the page number identifier, and extracting the page number.
It realizes accurate identification and marking of page numbers in courseware videos, avoiding the problem of the same page being mistakenly marked as multiple pages.
Smart Images

Figure CN119835493A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multimedia processing, and more specifically, to a method for obtaining page numbers in a video, a method for taking screenshots, and a method for dividing the pages. Background Art
[0002] In current smart classrooms, the courseware demonstration process during the teacher's lecture is usually recorded as a complete video file for later screenshots of the courseware, display, analysis, etc. For the above-mentioned videos generated by slides, it is often necessary to mark in the video to mark which sub-video in the video corresponds to which slide.
[0003] At present, the process of marking is usually implemented based on the page turning signal triggered by the teacher's wireless presenter. However, in fact, one slide contains many animations. In this process, a page turning signal from the wireless presenter may only trigger the animations in the same page of slide, and there is no actual page turning. This will cause the same page of slides to be marked as multiple slides, which is unrealistic. Summary of the invention
[0004] In order to solve the technical problem in the prior art that the page numbers of courseware videos cannot be accurately found, the present invention provides a method for obtaining page numbers in videos, a method for screenshots, and a method for division. The technical solution adopted by the present invention is as follows.
[0005] In a first aspect, the present invention provides a method for obtaining a page number in a video, comprising:
[0006] Receive video stream;
[0007] Get a frame of detection picture from the video stream;
[0008] Intercepting a candidate specific area of the detection image, wherein the candidate specific area is a pre-demarcated area, and there are multiple candidate specific areas;
[0009] Using the OCR algorithm, the text box of each candidate specific area is detected to obtain the recognition result of each candidate specific area;
[0010] Determine whether the recognition result of each candidate specific area contains an identifier in a preset page number identifier list, and determine the candidate specific area containing the identifier in the preset page number identifier list as the page area;
[0011] According to the recognition result of the page area, the page number of the detected image is obtained.
[0012] In one implementation, the process of obtaining the page number of the detected image according to the recognition result of the page area includes:
[0013] Determine the style of the page annotation based on the relationship between the characters included in the recognition result of the page area and the preset key characters;
[0014] Confirm the page number of the detected image based on the number in the recognition result of the page area and the style of the page annotation.
[0015] In a second aspect, the present invention provides a method for capturing a video, comprising:
[0016] Receive video stream;
[0017] When receiving the page turning action information, a frame of image is captured from the video stream as a candidate screen image;
[0018] Using the aforementioned method for obtaining page numbers in a video, extract the page numbers of the candidate screen images;
[0019] Get the page number of the previous screen image in the screen screenshot collection;
[0020] Determine whether the page number of the candidate screen image is the same as the page number of the previous screen image;
[0021] When the page number of the candidate screen image is different from the page number of the previous screen image, the candidate screen image is added to the screen screenshot set as a screen screenshot.
[0022] In one embodiment, it further includes:
[0023] When the page number of the candidate screen picture is the same as the page number of the previous screen picture, the previous screen picture is replaced by the candidate screen picture in the screen screenshot set.
[0024] In one embodiment, it further includes:
[0025] While intercepting a frame of image from the video stream as the candidate screen image, also obtaining timestamp information of the candidate screen image;
[0026] When a candidate screen image is added to the screen screenshot set as a screen screenshot, the timestamp information corresponding to the newly added screen screenshot is also saved in the screen screenshot set.
[0027] In one embodiment, it further includes:
[0028] When a candidate screen image is added as a screen screenshot in the screen screenshot collection, the page number corresponding to the newly added screen screenshot is also saved in the screen screenshot collection.
[0029] In one embodiment, it further includes:
[0030] The page turning action information is generated based on receiving a page turning signal triggered by an external device, or a situation where the image content change degree of the slide video stream is greater than a threshold range.
[0031] In a third aspect, the present invention provides a method for dividing a courseware video stream, characterized in that it comprises:
[0032] Receive courseware video stream;
[0033] When receiving the page turning action information, intercepting a frame of courseware image from the video stream, and the timestamp information of the courseware image;
[0034] Extracting the page number of the courseware image;
[0035] Determine whether the page number of the newly captured courseware image is the same as the page number of the previous courseware image;
[0036] When the page number of the newly captured courseware image is different from the page number of the previous courseware image, the timestamp information corresponding to the page number of the newly captured courseware image is marked as the first type of timestamp information;
[0037] The courseware video stream is divided according to the first type of timestamp information to obtain the video stream divided according to each page of the courseware.
[0038] In one implementation, the process of extracting the page number of the courseware image includes:
[0039] Get a frame of detection picture from the courseware video stream;
[0040] Intercepting a candidate specific area of the detection image, wherein the candidate specific area is a pre-demarcated area, and there are multiple candidate specific areas;
[0041] Using the OCR algorithm, the text box of each candidate specific area is detected to obtain the recognition result of each candidate specific area;
[0042] Determine whether the recognition result of each candidate specific area contains an identifier in a preset page number identifier list, and determine the candidate specific area containing the identifier in the preset page number identifier list as the page area;
[0043] Using an OCR algorithm to detect the area in the courseware image that is located at the same position as the page area, and obtaining a recognition result of the page area of the courseware image;
[0044] According to the recognition result of the page area of the courseware image, the page number of the courseware image is obtained.
[0045] In one implementation, the process of extracting the page number of the courseware image further includes:
[0046] Determine the style of page annotation based on the relationship between the characters included in the recognition result of the page area of the detected image and the preset key characters;
[0047] The process of obtaining the page number of the courseware image according to the recognition result of the page area of the courseware image includes:
[0048] The page number of the courseware image is confirmed based on the numbers in the recognition result of the page area of the courseware image and the style of the page marking.
[0049] In one embodiment, it is characterized by further comprising:
[0050] When the page number of the newly captured courseware image is the same as the page number of the previous courseware image, the timestamp information corresponding to the page number of the newly captured courseware image is marked as the second type of timestamp information;
[0051] The second type of timestamp information is marked on the video stream of each page of the courseware.
[0052] In one embodiment, it further includes:
[0053] The page turning action information is generated based on receiving a page turning signal triggered by an external device, or a situation where the image content change degree of the slide video stream is greater than a threshold range.
[0054] In a fourth aspect, the present invention provides a device for obtaining a page number in a video, comprising:
[0055] A receiving module is used to receive a video stream and obtain a frame of detection picture from the video stream;
[0056] A capture module, used to capture a candidate specific area of the detection image, wherein the candidate specific area is a pre-defined area, and there are multiple candidate specific areas;
[0057] The recognition module is used to detect the text box of each candidate specific area by using the OCR algorithm to obtain the recognition result of each candidate specific area;
[0058] A judging module, used for judging whether the recognition result of each candidate specific area contains an identifier in a preset page number identifier list, and determining the candidate specific area containing the identifier in the preset page number identifier list as the page area;
[0059] The generation module is used to obtain the page number of the detected image according to the recognition result of the page area.
[0060] A device for capturing video, comprising:
[0061] The acquisition module is used to receive the video stream; when receiving the page turning action information, capture a frame of image from the video stream as a candidate screen image; and obtain the page number of the previous screen image in the screen capture set;
[0062] An extraction module, used to extract the page number of the candidate screen image by using the device for obtaining the page number in the video;
[0063] A comparison module, used to determine whether the page number of the candidate screen image is the same as the page number of the previous screen image;
[0064] The archiving module is used to add the candidate screen image as a screen screenshot in the screen screenshot collection when the page number of the candidate screen image is different from the page number of the previous screen image.
[0065] A device for dividing a courseware video stream, comprising:
[0066] The receiving module is used to receive the courseware video stream; when receiving the page turning action information, a frame of the courseware image is intercepted from the video stream, and the timestamp information of the courseware image;
[0067] An extraction module, used for extracting the page number of the courseware image;
[0068] A comparison module is used to determine whether the page number of the newly captured courseware image is the same as the page number of the previous courseware image;
[0069] The archiving module is used to mark the timestamp information corresponding to the page number of the newly intercepted courseware image as the first type of timestamp information when the page number of the newly intercepted courseware image is different from the page number of the previous courseware image;
[0070] A generating module is used to divide the courseware video stream according to the first type of timestamp information to obtain the video stream divided according to each page of the courseware.
[0071] In a fifth aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned methods when executing the program.
[0072] In a sixth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the method of any of the above-mentioned embodiments is implemented.
[0073] In the present invention, the page number of the courseware is marked in certain specific location areas, several areas are pre-demarcated as candidate specific areas, and then the text boxes of these several small areas are detected by using the OCR algorithm, and one of the identifiers in the preset page number identifier list is found in the text boxes of these small areas, and this area is determined as the real page area, and the page number of this page area is extracted as the page number of the detection picture. Finally, by comparing the page numbers, it is determined whether the new screenshot in the video is a new courseware page screenshot, so as to decide how to define the new screenshot. The present invention can accurately find the page number marked in the courseware video, accurately judge the nature of the new screenshot, and has low requirements for computing power, which is convenient and practical. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 It is a schematic diagram of the overall process of an implementation method of Example 1 of the present invention.
[0075] Figure 2 It is a schematic diagram of a detection picture according to the first embodiment of the present invention.
[0076] Figure 3 It is a schematic diagram of the overall process of an implementation method of the second embodiment of the present invention.
[0077] Figure 4 It is a schematic diagram of the overall process of an implementation method of the second embodiment of the present invention.
[0078] Figure 5 It is a schematic diagram of the overall structure of an implementation method of Example 31 of the present invention.
[0079] Figure 6 It is a schematic diagram of the overall structure of another implementation method of Example 3 of the present invention.
[0080] Figure 7 It is a schematic diagram of the overall structure of another implementation method of Example 3 of the present invention. DETAILED DESCRIPTION
[0081] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0082] It should be noted that the terms "first\second\..." involved in the embodiments of the present invention are only used to distinguish similar objects, and do not represent a specific order for the objects. It is understandable that the specific order or sequence of "first\second\..." can be interchanged where permitted. It should be understood that the objects distinguished by "first\second\..." can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.
[0083] Embodiment 1
[0084] See also Figure 1 , Figure 1 1 is a flow chart of a method for obtaining a page number in a video provided in Embodiment 1 of the present invention, the method comprising step S110, step S120, step S130, step S140, step S150 and step S160. It should be noted that step S110, step S120, step S130, step S140, step S150 and step S160 are merely reference numerals for the purpose of clearly explaining the embodiment and the appendix. Figure 1 The corresponding relationship does not limit the order of the steps in this embodiment.
[0085] Step S110, receiving a video stream;
[0086] Step S120, obtaining a frame of detection picture from the video stream;
[0087] Step S130, intercepting a candidate specific region of the detection image, wherein the candidate specific region is a pre-demarcated region, and there are multiple candidate specific regions;
[0088] Step S140, using an OCR algorithm to detect the text box of each candidate specific area and obtain a recognition result of each candidate specific area;
[0089] Step S150, determining whether the recognition result of each candidate specific area has an identifier in a preset page number identifier list, and determining the candidate specific area having an identifier in the preset page number identifier list as a page area;
[0090] Step S160, obtaining the page number of the detected image according to the recognition result of the page area.
[0091] As described in the background technology, the process of the teacher's PPT output during the lecture is recorded as a video file, and in step S110, the recorded video stream is obtained. For the entire course video stream, one frame can be understood as a screenshot of one page in the course, so in step S120, one frame is obtained from the course video stream as a detection picture for detection.
[0092] It should be noted that PPT is only a common means of courseware. In practice, courseware may be presented through other software. For these other courseware software, as long as they are presented in the form of video streams, they are applicable to this method. In addition, other scenarios such as remote conferences are similar to classroom scenarios, so as long as they are presented in the form of video streams, they are also applicable to this method.
[0093] Generally speaking, the page numbers of courseware are marked in certain specific areas, such as the lower right corner, lower left corner, lower middle, etc. Figure 2 As shown, Figure 2 It is a schematic diagram of the detection picture. Figure 2 The page number of the detection image is marked in the lower right corner. Steps S130 and S140 use the fact that the page numbers of the courseware are marked in certain specific location areas to pre-define several areas as candidate specific areas, and then cut out these several small areas, use the OCR algorithm to detect the text boxes in these several small areas, and obtain the recognition results of each candidate specific area. Compared with extracting the text box of the entire detection image, this method only detects several small areas, which can greatly save costs.
[0094] After detecting the recognition results of the text boxes in these small areas, we need to find out a real area marked with a page number in these small areas, that is, find out the actual page area. In step S150, a page number identifier list is preset, and this list contains some key characters that can be expressed as page numbers, such as page, page, " / ", "|" and numbers, etc. When the candidate specific area has an identifier in the preset page number identifier list, then this area is the real page area we want to find out.
[0095] It should be noted here that these key characters can be used alone or in combination. For example, when using " / " or "|", there must be numbers before and after to trigger the key characters.
[0096] Finally, after the real page area is found, the previously obtained recognition result is used again in step S160 to extract the page number of the page area, which is the page number of the detected image.
[0097] In one implementation, the process of step S160 includes: step S161 and step S162.
[0098] Step S161, determining the style of the page annotation based on the relationship between the characters included in the recognition result of the page area and the preset key characters;
[0099] Step S162: Confirm the page number of the detected picture according to the numbers in the recognition result of the page area and the style of the page annotation.
[0100] Preset key characters, such as " / ", "|", "page", "第", etc. For example, Figure 2 As shown, when " / " is detected, the style of the page annotation is: current page number / total number of pages, then the number before " / " can be confirmed as the page number of the detected picture. Another example, if only the character "第" is detected and neither " / " nor "|" is detected, then the style of the page annotation is: "第" + current page number + "页", and the number after "第" can be confirmed as the page number of the detected picture.
[0101] In this method, taking advantage of the feature that the page numbers of the courseware are marked in several specific position areas, several areas are pre-defined as candidate specific areas, and then the OCR algorithm is used to detect the text boxes in these small areas. An identifier in the preset page number identifier list is found in the text boxes of these small areas, and this area is determined as the real page area. Finally, the page number of this page area is extracted as the page number of the detected picture. This method can accurately find the page numbers marked in the courseware video and has low requirements for computing power, being convenient and practical.
[0102] Embodiment 2
[0103] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of a method for video screenshot provided in Embodiment 1 of the present invention. This method includes Step S210, Step S220, Step S230, Step S240, Step S250 and Step S260. It should be noted that Step S210, Step S220, Step S230, Step S240, Step S250 and Step S260 are only reference signs used to clearly explain the corresponding relationship between the embodiment and the Figure 3 accompanying drawings, and do not represent a limitation on the order of the steps in this embodiment.
[0104] Step S210: Receive the video stream;
[0105] Step S220: When the page turning action information is received, intercept a frame of image from the video stream as the candidate picture;
[0106] Step S230: Use the method for obtaining the page number in the video in Embodiment 1 to extract the page number of the candidate picture;
[0107] Step S240: Obtain the page number of the previous picture in the picture screenshot set;
[0108] Step S250: Determine whether the page number of the candidate picture is the same as the page number of the previous picture;
[0109] Step S260: When the page number of the candidate screen image is different from the page number of the previous screen image, the candidate screen image is added to the screen screenshot set as a screen screenshot.
[0110] This embodiment is used in a scenario where screenshots of each page of a courseware in a courseware video of a teacher's lecture are captured. These screenshots can be used as thumbnails of video dot locations, or can be compiled into courseware, etc.
[0111] When a page turning signal is received from an external device, such as a wireless presenter, a mouse, etc., or the image content of the video stream changes more than a threshold value, page turning action information is generated. In step S220, when page turning action information is received, it means that a potential page turning event occurs. This potential page turning event is as described in the background technology. It may be really turning from page n to page n+1, or it may just be an animation in page n. In any case, a frame of image is captured from the video stream at this time, and this captured frame of image is the image of the latest page.
[0112] Steps S230 to S260 are to verify whether the process of turning from page n to page n+1 actually occurs. At this time, step S230 extracts the page number of the latest page image just captured, step S240 obtains the page number of the previous page screen, and step S250 compares the page numbers of the two pages. If the page numbers are different, it means that the page has really been turned from page n to page n+1. At this time, the newly captured image is added to the screen capture collection for further use later.
[0113] It should be pointed out here that step S240 obtains only the page number of the previous screen image, and there is no restriction on how to obtain the page number. The screen image can be directly taken out and recognized again using the method of embodiment 1, or the data obtained when executing step S230 before can be obtained and saved.
[0114] In one implementation, the video screenshot method further includes: step S270.
[0115] Step S270: When the page number of the candidate screen image is the same as the page number of the previous screen image, the previous screen image is replaced with the candidate screen image in the screen screenshot collection.
[0116] For screenshots of the same page of courseware, some people like to use the initial screen to represent, while others like to use the final screen to represent. This embodiment is a case where the final screen is used to represent. In this embodiment, as long as it is detected that the page number of the new screen image is the same as the page number of the previous screen image, the new screen image is used to replace the previous screen image, thereby ensuring that the final screen is used to represent a page of courseware.
[0117] In one implementation, the video screenshot method further includes: step S310 and step S320.
[0118] Step S310, intercepting a frame of image from the video stream as the candidate picture, and obtaining the timestamp information of the candidate picture;
[0119] Step S320, when a candidate screen image is added to the screen screenshot set as a screen screenshot, the timestamp information corresponding to the newly added screen screenshot is also saved in the screen screenshot set.
[0120] Adding a candidate screen image as a screenshot in the screenshot collection means turning to the next page in the video. At this time, it is necessary to record the time of turning the page and associate this time with the screenshot. This will make it easier to process and analyze the video later.
[0121] In one implementation, the video screenshot method further includes: step S330.
[0122] Step S330, when a candidate screen image is added as a screen screenshot in the screen screenshot collection, a page number corresponding to the newly added screen screenshot is also saved in the screen screenshot collection.
[0123] Adding a candidate screen image as a screenshot in the screenshot collection means turning to the next page in the video. At this time, the new screen image has not been marked with any content. In this embodiment, a corresponding page is added to it, that is, the content of this screen image is marked.
[0124] It should be noted here that in step S270, the previous screen image is replaced with a new screen screenshot, and the previous screen image has gone through the process of marking content in step S330, so during the replacement process in step S270, the page number of the previous screen image is also inherited.
[0125] This method uses the comparison of page numbers to determine whether the new screenshot in the video is a new screenshot of the courseware page, and then decides how to define the new screenshot. This method uses the method of obtaining the page number in the first embodiment, can more accurately determine the nature of the new screenshot, and does not require high computing power, which is convenient and practical.
[0126] Embodiment 3
[0127] See also Figure 4 , Figure 41 is a flow chart of a method for dividing a courseware video stream provided in Embodiment 1 of the present invention, the method comprising step S410, step S420, step S430, step S440, step S450 and step S460. It should be noted that step S410, step S420, step S430, step S440, step S450 and step S460 are only reference numerals for the purpose of clearly explaining the embodiment and the appendix. Figure 4 The corresponding relationship does not limit the order of the steps in this embodiment.
[0128] Step S410, receiving a courseware video stream;
[0129] Step S420, when page turning action information is received, a frame of courseware image is intercepted from the video stream, and the timestamp information of the courseware image;
[0130] Step S430, extracting the page number of the courseware image;
[0131] Step S440, determining whether the page number of the newly captured courseware image is the same as the page number of the previous courseware image;
[0132] Step S450, when the page number of the newly captured courseware image is different from the page number of the previous courseware image, marking the timestamp information corresponding to the page number of the newly captured courseware image as the first type of timestamp information;
[0133] Step S460, dividing the courseware video stream according to the first type of timestamp information to obtain the video stream divided according to each page of the courseware.
[0134] As described in the background technology, the process of outputting the courseware PPT during the teacher's lecture is recorded as a video file, and in step S410, the recorded video stream is obtained. This embodiment is used to divide the scene of each page of the courseware in the courseware video of the teacher's lecture process.
[0135] When a page turning signal triggered by an external device, such as a wireless presenter, a mouse, etc., is received, or the image content change of the video stream is greater than the threshold range, page turning action information will be generated. In step S420, when the page turning action information is received, it means that a potential page turning event occurs. This potential page turning event is as described in the background technology. It may be really turning from the nth page to the n+1th page, or it may be just an animation on the nth page. In any case, a frame of courseware image is intercepted from the video stream at this time, and this intercepted frame of courseware image is the latest frame of courseware image. Since the purpose of this embodiment is to divide the courseware video into each video segment according to each page of the courseware, it is necessary to master the start time and end time of each video segment (in actual operation, the end time of this page is the start time of the next page). Therefore, in addition to intercepting a frame of courseware image from the video stream, the timestamp corresponding to this frame of courseware image must be saved.
[0136] In step S430, the page number of the courseware image is extracted. Generally, there are page number marks in the courseware, such as "page" and "page number", etc. The OCR algorithm can be used to perform text recognition on the courseware image to obtain the recognition result of the page number.
[0137] In one implementation, the process of extracting the page number of the courseware image in step S430 includes: step S431, step S432, step S433, step S434, step S435 and step S436.
[0138] Step S431, obtaining a frame of detection picture from the courseware video stream;
[0139] Step S432, intercepting a candidate specific region of the detection image, wherein the candidate specific region is a pre-demarcated region, and there are multiple candidate specific regions;
[0140] Step S433, using an OCR algorithm to detect the text box of each candidate specific area, and obtain a recognition result of each candidate specific area;
[0141] Step S434, determining whether the recognition result of each candidate specific area has an identifier in the preset page number identifier list, and determining the candidate specific area having an identifier in the preset page number identifier list as the page area;
[0142] Step S435, using an OCR algorithm to detect the area in the courseware image that is located at the same position as the page area, and obtain a recognition result of the page area of the courseware image;
[0143] Step S436, obtaining the page number of the courseware image according to the recognition result of the page area of the courseware image.
[0144] For the same set of courseware, the position of the page number is usually fixed, so the area of the page number position can be found by detecting a frame of the courseware image, and when the page number is to be identified in the future, only the text in this area can be detected. Based on the above principle, step S431 obtains a frame of detection image to detect the area of the page number position of this set of courseware.
[0145] Generally speaking, the page numbers of courseware are marked in certain specific areas, such as the lower right corner, lower left corner, lower middle, etc. Figure 2 As shown, Figure 2 It is a schematic diagram of the detection picture. Figure 2 The page number of the detection image is marked in the lower right corner. Therefore, in step S432 and step S433, only these areas are detected. In step S432 and step S433, the page numbers of the courseware are marked in certain specific location areas, and several areas are pre-demarcated as candidate specific areas. Then, these several small areas are cut out, and the text boxes of these several small areas are detected using the OCR algorithm to obtain the recognition results of each candidate specific area. Compared with extracting the text box of the entire detection image, only several small areas are detected in this embodiment, which can greatly save overhead.
[0146] It should be noted that PPT is only a common means of courseware. In practice, courseware may be presented through other software. For these other courseware software, as long as they are presented in the form of video streams, they are applicable to this method. In addition, other scenarios such as remote conferences are similar to classroom scenarios, so as long as they are presented in the form of video streams, they are also applicable to this method.
[0147] After detecting the recognition results of the text boxes in these several small areas, we need to find out a real area marked with a page number in these small areas, that is, find out the actual page area. In step S434, a page number identifier list is preset, and this list contains some key characters that can be expressed as page numbers, such as page, page, " / ", "|" and numbers, etc. When the candidate specific area has an identifier in the preset page number identifier list, then this area is the real page area we want to find out.
[0148] It should be noted here that these key characters can be used alone or in combination. For example, when using " / " or "|", there must be numbers before and after to trigger the key characters.
[0149] As described above, for the same set of courseware, the position of the page number is usually fixed. Steps S435 and S436 use the OCR algorithm to detect the area in the courseware image that is in the same position as the page area, and then obtain the recognition result, extract the page number of this area, which is the page number of the courseware image.
[0150] In this embodiment, taking advantage of the feature that the page numbers of the courseware are marked in several specific position areas, several areas are pre-designated as candidate specific areas, and then the OCR algorithm is used to detect the text boxes in these small areas. Among the text boxes in these small areas, an identifier in the preset page number identifier list is found, and this area is determined as the real page area. Finally, the page number of this page area is extracted as the page number of the courseware picture. This embodiment can accurately find the marked page numbers in the courseware video and has low requirements for computing power, being convenient and practical.
[0151] In one embodiment, the process of extracting the page number of the courseware image in step S430 further includes: step S437.
[0152] Step S437, based on the relationship between the characters included in the recognition result of the detected picture's page area and the preset key characters, determine the page annotation style;
[0153] The process of obtaining the page number of the courseware image according to the recognition result of the page area of the courseware image in step S436 includes:
[0154] Confirm the page number of the courseware image according to the numbers in the recognition result of the page area of the courseware image and the page annotation style.
[0155] Preset key characters, such as " / ", "|", "page", "第", etc. As Figure 2 shown, when " / " is detected, the page annotation style is: current page number / total number of pages, then the number before " / " can be confirmed as the page number of the detected picture. For another example, if only the character "第" is detected and neither " / " nor "|" is detected, then the page annotation style is: "第" + current page number + "页". In step S437, the page annotation style is obtained through some key characters.
[0156] The specific process of step S436 is to obtain the specific page number through the page annotation style. Continuing with the previous example where the style is: "第" + current page number + "页", the page number of the detected picture can be confirmed through the number after "第".
[0157] Steps S440 to S460 are to verify whether the process of turning from page n to page n+1 actually occurs. At this time, step S430 extracts the page number of the latest page image just captured, step S440 obtains the page number of the previous page, and step S450 compares the page numbers of the two pages. If the page numbers are different, it means that the page has really been turned from page n to page n+1. At this time, the timestamp information corresponding to the page number of the newly captured courseware image is marked as the first type of timestamp information for further use later.
[0158] In fact, each first-class timestamp information is the time period experienced by a page of courseware. In addition, the time length occupied by each page of courseware can be marked by the identified page number. Step S460 divides the courseware video stream in this way, thereby obtaining the video stream divided according to each page of courseware.
[0159] It should be pointed out here that step S440 obtains only the page number of the previous courseware image, and there is no restriction on how to obtain the page number. You can directly take out the image and recognize it again, or you can obtain and save the data obtained when executing step S430 before.
[0160] In this method, the page number of the new screenshot generated by the suspected page turning action is compared with the previous page number to determine whether the suspected page turning action in the video has caused the courseware to actually turn the page. When the page turning action occurs, the corresponding timestamp is recorded, so that the video can be divided according to the page. The process of dividing the video in this method does not require high computing power and is convenient and practical.
[0161] Embodiment 4
[0162] Corresponding to the method of embodiment 1, as Figure 5 As shown, the present invention further provides a device 4 for obtaining page numbers in a video, comprising: a receiving module 410 , a capturing module 420 , a recognition module 430 , a judgment module 440 and a generation module 450 .
[0163] The receiving module 410 is used to receive a video stream and obtain a detection picture frame from the video stream;
[0164] A capture module 420 is used to capture a candidate specific region of the detection image, wherein the candidate specific region is a pre-defined region, and there are multiple candidate specific regions;
[0165] The recognition module 430 is used to detect the text box of each candidate specific area by using an OCR algorithm to obtain a recognition result of each candidate specific area;
[0166] A determination module 440 is used to determine whether the recognition result of each candidate specific area contains an identifier in a preset page number identifier list, and determine the candidate specific area containing the identifier in the preset page number identifier list as the page area;
[0167] The generation module 450 is used to obtain the page number of the detected image according to the recognition result of the page area.
[0168] In one implementation, the generation module performs the process of obtaining the page number of the detected image according to the recognition result of the page area, including:
[0169] Determine the style of the page annotation based on the relationship between the characters included in the recognition result of the page area and the preset key characters;
[0170] Confirm the page number of the detected image based on the number in the recognition result of the page area and the style of the page annotation.
[0171] Corresponding to the method of the second embodiment, as Figure 6 As shown, the present invention also provides a video screenshot device 5, including: an acquisition module 510, an extraction module 520, a comparison module 530 and an archiving module 540.
[0172] The acquisition module 510 is used to receive the video stream; when receiving the page turning action information, capture a frame of image from the video stream as a candidate screen image; and obtain the page number of the previous screen image in the screen capture set;
[0173] An extraction module 520, configured to extract the page number of the candidate screen image by using the aforementioned device for obtaining the page number in the video;
[0174] A comparison module 530 is used to determine whether the page number of the candidate screen image is the same as the page number of the previous screen image;
[0175] The archiving module 540 is used to add the candidate screen image as a screen screenshot in the screen screenshot collection when the page number of the candidate screen image is different from the page number of the previous screen image.
[0176] In one implementation, the archiving module is further configured to replace the previous screen image with the candidate screen image in the screen screenshot collection when the page number of the candidate screen image is the same as the page number of the previous screen image.
[0177] In one implementation, the acquisition module is further used to acquire timestamp information of the candidate screen image;
[0178] The archiving module is also used for saving the timestamp information corresponding to the newly added screenshot in the screenshot collection when a candidate screenshot is added as a screenshot in the screenshot collection.
[0179] In one embodiment, the archiving module is further configured to, when a candidate screen image is added as a screen screenshot in the screen screenshot collection, save a page number corresponding to the newly added screen screenshot in the screen screenshot collection.
[0180] In one implementation, the page turning action information is generated based on receiving a page turning signal triggered by an external device, or a situation where the degree of change of the image content of the slide video stream is greater than a threshold range.
[0181] Corresponding to the method of embodiment 3, Figure 7 As shown, the present invention also provides a device 7 for obtaining page numbers in a video, including: a receiving module 710, an extraction module 720, a comparison module 730, an archiving module 740 and a generation module 750.
[0182] The receiving module 710 is used to receive the courseware video stream; when receiving the page turning action information, it intercepts a frame of the courseware image from the video stream, and the timestamp information of the courseware image;
[0183] Extraction module 720, used for extracting the page number of the courseware image;
[0184] A comparison module 730 is used to determine whether the page number of the newly captured courseware image is the same as the page number of the previous courseware image;
[0185] The archiving module 740 is used to mark the timestamp information corresponding to the page number of the newly intercepted courseware image as the first type of timestamp information when the page number of the newly intercepted courseware image is different from the page number of the previous courseware image;
[0186] The generating module 750 is used to divide the courseware video stream according to the first type of timestamp information to obtain the video stream divided according to each page of the courseware.
[0187] In one implementation, the extraction module performs the process of extracting the page number of the courseware image, including:
[0188] Get a frame of detection picture from the courseware video stream;
[0189] Intercepting a candidate specific area of the detection image, wherein the candidate specific area is a pre-demarcated area, and there are multiple candidate specific areas;
[0190] Using the OCR algorithm, the text box of each candidate specific area is detected to obtain the recognition result of each candidate specific area;
[0191] Determine whether the recognition result of each candidate specific area contains an identifier in a preset page number identifier list, and determine the candidate specific area containing the identifier in the preset page number identifier list as the page area;
[0192] Using an OCR algorithm to detect the area in the courseware image that is located at the same position as the page area, and obtaining a recognition result of the page area of the courseware image;
[0193] According to the recognition result of the page area of the courseware image, the page number of the courseware image is obtained.
[0194] In one implementation, the process of extracting the page number of the courseware image further includes:
[0195] Determine the style of page annotation based on the relationship between the characters included in the recognition result of the page area of the detected image and the preset key characters;
[0196] The process of obtaining the page number of the courseware image according to the recognition result of the page area of the courseware image includes:
[0197] The page number of the courseware image is confirmed based on the numbers in the recognition result of the page area of the courseware image and the style of the page marking.
[0198] In one embodiment, the archiving module is also used to mark the timestamp information corresponding to the page number of the newly captured courseware image as the second type of timestamp information when the page number of the newly captured courseware image is the same as the page number of the previous courseware image; and mark each second type of timestamp information in the video stream of each page of the courseware.
[0199] In one implementation, the page turning action information is generated based on receiving a page turning signal triggered by an external device, or a situation where the degree of change of the image content of the slide video stream is greater than a threshold range.
[0200] In this device, the page numbers of the courseware are marked in certain specific location areas, and several areas are pre-demarcated as candidate specific areas. Then, the OCR algorithm is used to detect the text boxes of these several small areas, and one of the identifiers in the preset page number identifier list is found in the text boxes of these small areas, and this area is determined as the real page area. The page number of this page area is extracted as the page number of the detected image. Finally, by comparing the page numbers, it is determined whether the new screenshot in the video is a new screenshot of the courseware page, so as to decide how to define the new screenshot and record the corresponding timestamp, so that the video can be divided according to the page. This device can accurately find the page numbers marked in the courseware video, accurately judge the nature of the new screenshot, and does not require high computing power, so it is convenient and practical.
[0201] Embodiment 4
[0202] An embodiment of the present invention further provides a storage medium on which computer instructions are stored. When the instructions are executed by a processor, the method for obtaining page numbers in a video, the method for taking video screenshots, and / or the method for dividing a courseware video stream of any of the above embodiments is implemented.
[0203] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, random access memories (RAM), read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0204] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, RAM, ROM, magnetic disks or optical disks.
[0205] Corresponding to the above-mentioned computer storage medium, in one embodiment, a computer device is also provided, which includes a memory, an encoder, and a computer program stored in the memory and run on the encoder, wherein when the encoder executes the program, it implements any one of the methods for obtaining page numbers in a video, the method for taking video screenshots, and / or the method for dividing a courseware video stream in the above-mentioned embodiments.
[0206] The above-mentioned computer device, using the characteristic that the page numbers of the courseware will be marked in certain specific location areas, pre-demarcates several areas as candidate specific areas, and then uses the OCR algorithm to detect the text boxes of these several small areas, finds one of the identifiers in the preset page number identifier list in the text boxes of these small areas, and determines this area as the real page area, extracts the page number of this page area as the page number of the detected image, and finally, uses the comparison of the page numbers to determine whether the new screenshot in the video is a new screenshot of the courseware page, so as to decide how to define the new screenshot. The above-mentioned computer device can accurately find the page numbers marked in the courseware video, accurately judge the nature of the new screenshot, and does not require high computing power, so it is convenient and practical.
[0207] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0208] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for obtaining a page number in a video, characterized in that: include: Receive video stream; Get a frame of detection picture from the video stream; Intercepting a candidate specific area of the detection image, wherein the candidate specific area is a pre-demarcated area, and there are multiple candidate specific areas; Using the OCR algorithm, the text box of each candidate specific area is detected to obtain the recognition result of each candidate specific area; Determine whether the recognition result of each candidate specific area contains an identifier in a preset page number identifier list, and determine the candidate specific area containing the identifier in the preset page number identifier list as the page area; According to the recognition result of the page area, the page number of the detected image is obtained.
2. The method for obtaining a page number in a video according to claim 1, characterized in that: The process of obtaining the page number of the detected image according to the recognition result of the page area includes: Determine the style of the page annotation based on the relationship between the characters included in the recognition result of the page area and the preset key characters; Confirm the page number of the detected image based on the number in the recognition result of the page area and the style of the page annotation.
3. A method for capturing a video, characterized in that: include: Receive video stream; When receiving the page turning action information, a frame of image is captured from the video stream as a candidate screen image; Utilize the method for obtaining page numbers in a video according to claim 1 or 2 to extract the page numbers of the candidate screen images; Get the page number of the previous screen image in the screen screenshot collection; Determine whether the page number of the candidate screen image is the same as the page number of the previous screen image; When the page number of the candidate screen image is different from the page number of the previous screen image, the candidate screen image is added to the screen screenshot set as a screen screenshot.
4. The method for capturing video according to claim 3, characterized in that: Also includes: When the page number of the candidate screen picture is the same as the page number of the previous screen picture, the previous screen picture is replaced by the candidate screen picture in the screen screenshot set.
5. The method for capturing video according to claim 4, characterized in that: Also includes: While intercepting a frame of image from the video stream as the candidate screen image, also obtaining timestamp information of the candidate screen image; When a candidate screen image is added to the screen screenshot set as a screen screenshot, the timestamp information corresponding to the newly added screen screenshot is also saved in the screen screenshot set.
6. The method for capturing video according to claim 4, characterized in that: Also includes: When a candidate screen image is added as a screen screenshot in the screen screenshot collection, the page number corresponding to the newly added screen screenshot is also saved in the screen screenshot collection.
7. The method for capturing video according to any one of claims 3 to 6, characterized in that: Also includes: The page turning action information is generated based on receiving a page turning signal triggered by an external device, or a situation where the image content change degree of the slide video stream is greater than a threshold range.
8. A method for dividing a courseware video stream, characterized in that: include: Receive courseware video stream; When receiving the page turning action information, intercepting a frame of courseware image from the video stream, and the timestamp information of the courseware image; Extracting the page number of the courseware image; Determine whether the page number of the newly captured courseware image is the same as the page number of the previous courseware image; When the page number of the newly captured courseware image is different from the page number of the previous courseware image, the timestamp information corresponding to the page number of the newly captured courseware image is marked as the first type of timestamp information; The courseware video stream is divided according to the first type of timestamp information to obtain the video stream divided according to each page of the courseware.
9. The method for dividing courseware video streams according to claim 8, characterized in that: The process of extracting the page number of the courseware image includes: Get a frame of detection picture from the courseware video stream; Intercepting a candidate specific area of the detection image, wherein the candidate specific area is a pre-demarcated area, and there are multiple candidate specific areas; Using the OCR algorithm, the text box of each candidate specific area is detected to obtain the recognition result of each candidate specific area; Determine whether the recognition result of each candidate specific area contains an identifier in a preset page number identifier list, and determine the candidate specific area containing the identifier in the preset page number identifier list as the page area; Using an OCR algorithm to detect the area in the courseware image that is located at the same position as the page area, and obtaining a recognition result of the page area of the courseware image; According to the recognition result of the page area of the courseware image, the page number of the courseware image is obtained.
10. The method for dividing courseware video streams according to claim 9, characterized in that: The process of extracting the page number of the courseware image also includes: Determine the style of page annotation based on the relationship between the characters included in the recognition result of the page area of the detected image and the preset key characters; The process of obtaining the page number of the courseware image according to the recognition result of the page area of the courseware image includes: The page number of the courseware image is confirmed based on the numbers in the recognition result of the page area of the courseware image and the style of the page marking.
11. The method for dividing a courseware video stream according to any one of claims 8 to 10, characterized in that: Also includes: When the page number of the newly captured courseware image is the same as the page number of the previous courseware image, the timestamp information corresponding to the page number of the newly captured courseware image is marked as the second type of timestamp information; The second type of timestamp information is marked on the video stream of each page of the courseware.
12. The method for dividing a courseware video stream according to any one of claims 8 to 10, characterized in that: Also includes: The page turning action information is generated based on receiving a page turning signal triggered by an external device, or a situation where the image content change degree of the slide video stream is greater than a threshold range.
13. A device for obtaining a page number in a video, characterized in that: include: A receiving module is used to receive a video stream and obtain a frame of detection picture from the video stream; A capture module, used to capture a candidate specific area of the detection image, wherein the candidate specific area is a pre-defined area, and there are multiple candidate specific areas; The recognition module is used to detect the text box of each candidate specific area by using the OCR algorithm to obtain the recognition result of each candidate specific area; A judging module, used for judging whether the recognition result of each candidate specific area contains an identifier in a preset page number identifier list, and determining the candidate specific area containing the identifier in the preset page number identifier list as the page area; The generation module is used to obtain the page number of the detected image according to the recognition result of the page area.
14. A device for capturing video, characterized in that: include: The acquisition module is used to receive the video stream; when receiving the page turning action information, capture a frame of image from the video stream as a candidate screen image; and obtain the page number of the previous screen image in the screen capture set; An extraction module, used to extract the page number of the candidate screen image using the device for obtaining the page number in the video according to claim 13; A comparison module, used to determine whether the page number of the candidate screen image is the same as the page number of the previous screen image; The archiving module is used to add the candidate screen image as a screen screenshot in the screen screenshot collection when the page number of the candidate screen image is different from the page number of the previous screen image.
15. A device for dividing a courseware video stream, characterized in that: include: The receiving module is used to receive the courseware video stream; when receiving the page turning action information, a frame of the courseware image is intercepted from the video stream, and the timestamp information of the courseware image; An extraction module, used for extracting the page number of the courseware image; A comparison module is used to determine whether the page number of the newly captured courseware image is the same as the page number of the previous courseware image; The archiving module is used to mark the timestamp information corresponding to the page number of the newly intercepted courseware image as the first type of timestamp information when the page number of the newly intercepted courseware image is different from the page number of the previous courseware image; A generating module is used to divide the courseware video stream according to the first type of timestamp information to obtain the video stream divided according to each page of the courseware.
16. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 12 is implemented.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.