Method, device, electronic device, storage medium and program product for detecting a book page
By combining object detection and indicator confirmation models with fuzzy detection models, clear images are filtered and the validity of target regions is confirmed, thus solving the problem of misjudgment in page detection and achieving more accurate page region output.
Patent Information
- Application Number
- CN202411338628.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-09-24
AI Technical Summary
Existing technologies are prone to misjudging pages when detecting a user's finger pointing at a page, resulting in the output of invalid page areas.
An object detection model is used to detect the target region of the indicator object. The validity of the target region is confirmed by an indicator confirmation model. If the target region is valid, page detection is performed. A fuzzy detection model is used to filter clear images and reduce false positives.
It improves the accuracy and effectiveness of page detection, reduces false positives, and enhances the user experience.
Smart Images

Figure CN119131827B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, specifically to a method, apparatus, electronic device, storage medium, and program product for page detection. Background Technology
[0002] With the rapid development of smart devices, finger and page detection is usually performed through learning devices (such as learning machines) to detect the content of the page that the user's finger is pointing to in the book.
[0003] In the current technology, the presence of a finger in an image is usually detected first, and then the page area is detected and output from that image.
[0004] However, this method often results in some misjudgments in the page detection results, such as outputting invalid page areas that the user's finger is not pointing to. Summary of the Invention
[0005] The purpose of this disclosure is to provide a method, apparatus, electronic device, storage medium, and program product for page detection, so as to reduce misjudgments during page detection.
[0006] On one hand, this disclosure provides a method for detecting book pages, including: An object detection model is used to detect objects in the image to obtain the target region where the indicator object is located; the indicator object is used to indicate the page. An indication confirmation model is adopted to obtain the indication confirmation result of the target region based on the image to be detected, the target region, and the first constraint matrix. The indication confirmation result indicates whether the target region is valid. The first constraint matrix is generated based on the constraint factor of the constraint function and is used to assist in judging the indication confirmation result. If the confirmation result indicates that the target area is valid, the page detection model is used to detect pages based on the image to be detected, and the target page area is obtained. Based on the target region and the target page region, the image to be detected is cropped to obtain the page region image.
[0007] In one embodiment, the indication confirmation model includes a first classification network, a first limitation network, and a first output network; Using an indication confirmation model, based on the image to be detected, the target region, and the first constraint matrix, the indication confirmation result of the target region is obtained, including: Based on the target region, a local image containing the indicated object is cropped from the image to be detected; The local image is input into the first classification network to obtain the first image features; Input the first constraint matrix into the first constraint network to obtain the first constraint features; The first image features and the first limiting features are input into the first output network to obtain the indication confirmation result.
[0008] In one embodiment, inputting a first image feature and a first defining feature into a first output network to obtain an indication confirmation result includes: A first limiting value is obtained through a first output network based on the first image features and the first limiting features; If the first limit value is determined to be the first target limit value corresponding to the first limit matrix, then the confirmation result is determined to be that the target area is valid; Otherwise, the confirmation result indicates that the target area is invalid.
[0009] In one implementation, before using an object detection model to perform object detection on the image to be detected and obtaining the target region of the target indicator object, the following steps are included: Repeat the following steps until the image to be detected is obtained: Acquire images; A fuzzy detection model is used to perform fuzziness detection based on the acquired image and the second constraint matrix to obtain the fuzzy detection result. The fuzzy detection result indicates whether the acquired image is clear. The second constraint matrix is generated based on the constraint factor of the constraint function and is used to assist in judging the fuzzy detection result. If the blur detection result indicates that the image is clear, then the acquired image is determined as the image to be detected; otherwise, the acquired image is discarded.
[0010] In one embodiment, the fuzzy detection model includes a second classification network, a second constraint network, and a second output network; A fuzzy detection model is used to perform fuzziness detection based on the acquired image and the second constraint matrix, obtaining the fuzzy detection results, including: The acquired images are input into the second classification network to obtain the second image features; The second constraint matrix is input into the second constraint network to obtain the second constraint features; The second image features and the second limiting features are input into the second output network to obtain the blur detection result.
[0011] In one embodiment, the second image features and the second limiting features are input into a second output network to obtain a blur detection result, including: The second output network obtains the second constraint value based on the second image features and the second constraint features; If the second constraint value is determined to be the second target constraint value corresponding to the second constraint matrix, then the blur detection result is determined to be image blur. Otherwise, the blur detection result is determined to be a clear image.
[0012] In one embodiment, the image to be detected is cropped based on the target region and the target page region to obtain a page region image, including: The object detection model also outputs the indicated location of the object in the target area; Determine the overlapping area between the indicated location and the target page area; Determine the percentage of overlapping areas within the target area; If the proportion is higher than the set proportion threshold, then the image containing the target page area is cropped from the image to be detected.
[0013] On one hand, this disclosure provides a page detection apparatus, including: The detection unit is used to perform object detection based on the image to be detected using an object detection model, and to obtain the target area where the indicated object is located; the indicated object is used to indicate a page. The confirmation unit is used to obtain the confirmation result of the target region by adopting the indication confirmation model, based on the image to be detected, the target region, and the first constraint matrix; the indication confirmation result indicates whether the target region is valid; the first constraint matrix is generated based on the constraint factor of the constraint function and is used to assist in judging the indication confirmation result; The obtaining unit is used to obtain the target page region by using a page detection model to detect pages based on the image to be detected if the confirmation result indicates that the target area is valid; The cropping unit is used to crop the image to be detected based on the target region and the target page region to obtain the page region image.
[0014] In one embodiment, the indication confirmation model includes a first classification network, a first limitation network, and a first output network; The confirmation unit is used for: Based on the target region, a local image containing the indicated object is cropped from the image to be detected; The local image is input into the first classification network to obtain the first image features; Input the first constraint matrix into the first constraint network to obtain the first constraint features; The first image features and the first limiting features are input into the first output network to obtain the indication confirmation result.
[0015] In one embodiment, the confirmation unit is used for: A first limiting value is obtained through a first output network based on the first image features and the first limiting features; If the first limit value is determined to be the first target limit value corresponding to the first limit matrix, then the confirmation result is determined to be that the target area is valid; Otherwise, the confirmation result indicates that the target area is invalid.
[0016] In one embodiment, the detection unit is further configured to: Repeat the following steps until the image to be detected is obtained: Acquire images; A fuzzy detection model is used to perform fuzziness detection based on the acquired image and the second constraint matrix to obtain the fuzzy detection result. The fuzzy detection result indicates whether the acquired image is clear. The second constraint matrix is generated based on the constraint factor of the constraint function and is used to assist in judging the fuzzy detection result. If the blur detection result indicates that the image is clear, then the acquired image is determined as the image to be detected; otherwise, the acquired image is discarded.
[0017] In one embodiment, the fuzzy detection model includes a second classification network, a second constraint network, and a second output network; The detection unit is also used for: The acquired images are input into the second classification network to obtain the second image features; The second constraint matrix is input into the second constraint network to obtain the second constraint features; The second image features and the second limiting features are input into the second output network to obtain the blur detection result.
[0018] In one embodiment, the detection unit is further configured to: The second output network obtains the second constraint value based on the second image features and the second constraint features; If the second constraint value is determined to be the second target constraint value corresponding to the second constraint matrix, then the blur detection result is determined to be image blur. Otherwise, the blur detection result is determined to be a clear image.
[0019] In one embodiment, the cutting unit is used for: The object detection model also outputs the indicated location of the object in the target area; Determine the overlapping area between the indicated location and the target page area; Determine the percentage of overlapping areas within the target area; If the proportion is higher than the set proportion threshold, then the image containing the target page area is cropped from the image to be detected.
[0020] In one aspect, this disclosure provides an electronic device, including: Processor; and The memory stores computer instructions that cause the processor to perform the steps of the methods provided in the various alternative implementations of any of the page detection methods described above.
[0021] On one hand, this disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to perform the steps of the method provided in any of the optional implementations of page detection described above.
[0022] On one hand, this disclosure provides a computer program product including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the steps of the method provided in any of the above-described alternative implementations of page detection.
[0023] The page detection method in this embodiment of the present disclosure, after detecting the presence of an indicator object in the image to be detected, also confirms the validity of the indicator object (i.e., whether the indicator object is pointing to the page). Only when the indicator object is valid will the page area image be detected and output, thereby outputting the page area image pointed to by the user, so as to identify the content of the page pointed to by the user and reduce the misjudgment of page detection. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or 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 this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0025] Figure 1 This is a flowchart of a page detection method according to an embodiment of this disclosure.
[0026] Figure 2 This is a schematic diagram of the structure of a fuzzy detection model in an embodiment of this disclosure.
[0027] Figure 3 This is a detailed implementation flowchart of a page detection method in this embodiment of the disclosure.
[0028] Figure 4 This is a structural block diagram of a page detection device according to an embodiment of the present disclosure.
[0029] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation
[0030] The technical solutions of this disclosure will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure. Furthermore, the technical features involved in the different embodiments of this disclosure described below can be combined with each other as long as they do not conflict with each other.
[0031] In related technologies, learning machines typically detect a finger by capturing an image, and then use that image to detect the page area. However, in some application scenarios, there may be multiple pages, making it difficult to accurately output the page area indicated by the user. Furthermore, the user's finger may not be pointing on a page, resulting in the detection of an invalid page area. Therefore, page detection often involves some misjudgments.
[0032] In view of the deficiencies of the above-mentioned related technologies, this disclosure provides a method, apparatus, electronic device, storage medium and program product for page detection, which aims to reduce misjudgments in page detection.
[0033] This disclosure provides a method for detecting book pages. This method can be applied to electronic devices. This disclosure does not limit the type of electronic device, which can be any suitable type of device, such as terminal devices and servers, etc. This disclosure will not elaborate further.
[0034] See Figure 1 The diagram shown is a flowchart of the page detection method in this embodiment of the present disclosure. The following is a description of the method in conjunction with... Figure 1 The method is described below, and the specific implementation process is as follows: Step 101: Use an object detection model to perform object detection on the image to be detected and obtain the target region where the indicated object is located.
[0035] Optionally, the object detection model can be built based on the object detection (You Only Look Once version 5, yolov5) model, or other models can be used; there are no restrictions here.
[0036] The indicator object is used to point to a page, such as a user's finger or a tool used to point to the page, such as a pen. The target region is the area in the image to be detected where the indicator object is located; it can be a polygonal region, such as a rectangular region.
[0037] Furthermore, the position of the indicated object within the target area can also be obtained; for example, if the indicated object is the user's finger, the indicated position is the area where the user's fingertip is located.
[0038] In one implementation, the image to be detected is input into an object detection model to obtain the target region where the indicated object is located, and the indicated position of the indicated object in the target region.
[0039] Furthermore, before performing step 101, the image to be processed may be preprocessed. Optionally, the preprocessing may include at least one of the following: scaling to a fixed size and image normalization.
[0040] Furthermore, before performing step 101, image filtering can be performed to select clear images to be detected, thereby reducing the failure rate of subsequent page detection.
[0041] In one implementation, during image screening, the following steps can be performed repeatedly until the image to be detected is obtained: S1011: Acquire the captured image.
[0042] Optionally, the images can be captured using a camera device installed in an electronic device.
[0043] Furthermore, the acquired images can be preprocessed to obtain preprocessed acquired images.
[0044] S1012: Using a fuzzy detection model, fuzziness detection is performed based on the acquired image and the second constraint matrix to obtain the fuzzy detection result.
[0045] The following is combined Figure 2 The fuzzy detection model is explained. Figure 2 This is a schematic diagram of the structure of a fuzzy detection model. Figure 2 In this model, the fuzzy detection model includes a second classification network, a second constraint network, and a second output network. For example, the acquired image is input into the second classification network to obtain second image features; the second constraint matrix is input into the second constraint network to obtain second constraint features; and the second image features and the second constraint features are input into the second output network to obtain the fuzzy detection result.
[0046] Here, the blur detection result indicates whether the acquired image is clear; the second constraint matrix is generated based on the constraint factor of the constraint function. Both the second classification network and the second constraint network are used for feature extraction and can be built based on the MobileNetv3 model, optional; they can also be built based on other models, without restriction. For example, based on the MobileNetv3 model, the second classification network and the second constraint network are constructed separately, and the penultimate layers of the second classification network and the second constraint network are merged and connected to the second output network for a fully connected configuration.
[0047] Optionally, the size of the second constraint matrix can be the same as or different from that of the acquired image. Each value in the second constraint matrix can be a constraint factor of the constraint function. Alternatively, the second constraint matrix can be input into a transformation function to obtain a new second constraint matrix, which can then be used as the input to the second constraint network.
[0048] For example, when inputting the second image features and the second limiting features into the second output network to obtain the blur detection result, the following steps can be taken: The second output network obtains a second limiting value based on the second image features and the second limiting features. If the second limiting value is determined to be the second target limiting value corresponding to the second limiting matrix, then the blur detection result is determined to be an image blur; otherwise, the blur detection result is determined to be an image clear.
[0049] The constraint function's constraint factor set contains multiple constraint factors, and the second constraint matrix can be generated based on one or more constraint factors. The constraint factors used in the second constraint matrix can be randomly selected, the constraint factors with the highest accuracy found in the test, or selected in other ways; no restrictions are placed here.
[0050] For example, in high-recall application scenarios, a second constraint matrix can be generated based on a randomly selected constraint factor. If the second constraint value corresponding to the determined constraint factor is the same as the second target constraint value, the image is determined to be blurry; otherwise, the image is determined to be sharp. This can improve the accuracy of image blur detection.
[0051] To improve the accuracy of blur detection, multiple constraint factors can be used to generate a second constraint matrix. If the second constraint value corresponding to each constraint factor is the same as the second target constraint value, or the proportion of the same value is higher than a specified proportion, then the image is determined to be blurry; otherwise, the image is determined to be sharp. This approach can be applied to scenarios where high blur accuracy is required.
[0052] In this embodiment, a recurrent function is introduced into the neural network to assist in feature extraction and improve the network's generalization ability. When a recurrent function is applied in the neural network, it is called a constraint function, allowing the constraint network in the model (e.g., a second constraint network) to make predictions according to the input and output of the recurrent function. The domain of the recurrent function is the set of constraint factors. The output value of the recurrent function is the constraint value corresponding to the constraint factor.
[0053] In this loop function, the domain and range contain the same number of values, and both are finitely discrete. All numbers in the domain are distinct. We can call any number in the domain the first number. The loop function can then begin calculating from the first number, obtaining the second number (the next number). Next, it calculates from the second number to obtain the third number, and so on, until the last number not yet used in the calculation is used to obtain the first number again. This completes the loop calculation of the function.
[0054] For example, in this embodiment, the constraint function can be a loop function: f(x) = x%5 + 1. The domain and range of this loop function are both (1, 2, 3, 4, 5). Where x is the input variable, f(1) = 2, f(2) = 3, f(3) = 4, f(4) = 5, f(5) = 1. When training the fuzzy detection model, a second constraint matrix can be constructed based on the constraint factors of this constraint function, and training data can be constructed based on the image samples, the second constraint matrix and its corresponding constraint values, and the model can be trained based on the training data. Then, a fuzzy image sample is trained with constraint factor 1 to obtain output value 2, trained with constraint factor 2 to obtain output value 3, trained with constraint factor 3 to obtain output value 4, trained with constraint factor 4 to obtain output value 5, and trained with constraint factor 5 to obtain output value 1. A clear image sample, i.e., a clear image, is trained with any constraint factor to obtain output value 0.
[0055] S1013: If the blur detection result is that the image is clear, then the acquired image is determined as the image to be detected; otherwise, discard the acquired image and execute S1011.
[0056] This allows for the selection of clear images to be detected, reducing the failure rate of detection.
[0057] Step 102: Using the indication confirmation model, obtain the indication confirmation result of the target region based on the image to be detected, the target region, and the first constraint matrix.
[0058] The indication confirmation result indicates whether the target area is valid; that is, the validity of the target area is determined based on whether the indicated object points to a page area. The first constraint matrix is generated based on the constraint factors of the constraint function and is used to assist in judging the indication confirmation result.
[0059] The indication confirmation model includes a first classification network, a first constraint network, and a first output network. Both the first classification network and the first constraint network are used for feature extraction and can be built based on a lightweight neural network (Ghostnet) or in other ways. No restrictions are placed here.
[0060] In one implementation, step 102 may be performed using the following steps: S1021: Based on the target region, crop out a local image containing the indicated object from the image to be detected.
[0061] For example, if the target area is a rectangular area, then a partial image containing only that rectangular area can be cropped.
[0062] Furthermore, local images can be preprocessed, such as scaling them to a fixed size and normalizing them (e.g., brightness normalization).
[0063] S1022: Input the local image into the first classification network to obtain the first image features.
[0064] S1023: Input the first constraint matrix into the first constraint network to obtain the first constraint feature.
[0065] The first constraint matrix can be generated and applied based on a similar principle to the generation and application of the second constraint matrix, which will not be elaborated here. The first constraint matrix and the second constraint matrix can be the same or different, and the constraint functions used for them can also be the same or different; there are no restrictions here.
[0066] S1024: Input the first image features and the first limiting features into the first output network to obtain the indication confirmation result.
[0067] In one embodiment, a first limiting value is obtained through a first output network based on a first image feature and a first limiting feature; if the first limiting value is determined to be the first target limiting value corresponding to the first limiting matrix, then the indication confirmation result is determined to be that the target region is valid; otherwise, the indication confirmation result is determined to be that the target region is invalid.
[0068] In this way, the validity of the target area can be determined by whether the first constraint value corresponding to the constraint factor is the same as the first target constraint value, i.e., whether the user's pointing object (e.g., finger) is pointing on the page. This, combined with the constraint function, improves the accuracy of target area validity judgment. This is because multiple judgments can improve accuracy; using several constraint factors results in multiple confirmation mechanisms, and the more constraint factors used, the higher the accuracy of validity judgment. Different numbers of constraint factors can be used for different scenarios and network sizes. For example, fewer constraint factors can be used in high-recall scenarios to balance accuracy and efficiency, while more constraint factors can be used in scenarios requiring high accuracy to ensure high precision. This avoids subsequent page detection errors caused by incorrect validity judgments, thus improving user experience.
[0069] Step 103: If the confirmation result indicates that the target area is valid, then the page detection model is used to detect the page based on the image to be detected, and the target page area is obtained.
[0070] In one implementation, if the target region is determined to be valid, the image to be detected is input into the page detection model for forward reasoning to obtain the target page region.
[0071] The page detection model can be constructed using an image segmentation network (U2Net Small) model; however, other models can also be used in practice, and there are no restrictions. Optionally, the target page region can be a quadrilateral, represented by the coordinates of its four vertices, or by other methods, and there are no restrictions. Furthermore, the image to be processed can be preprocessed.
[0072] Step 104: Based on the target region and the target page region, crop the image to be detected to obtain the page region image.
[0073] In one implementation, step 104 may be performed using the following steps: S1041: The object detection model also outputs the indication position of the object in the target area.
[0074] The optional pointing location can be a polygonal area. For example, if the pointing object is a finger, the pointing location is the rectangular area where the fingertip is located.
[0075] S1042: Determine the overlapping area between the indicated position and the target page area.
[0076] S1043: Determine the proportion of overlapping areas in the target area.
[0077] S1044: If the proportion is higher than the set proportion threshold, then crop out the image of the page region containing the target page region from the image to be detected.
[0078] In practical applications, the percentage threshold can be set according to the actual application scenario, and there are no restrictions here.
[0079] Furthermore, when there are multiple target page regions, each target page region can be judged separately by setting a percentage threshold, so that only the page region image corresponding to the target page region indicated by the indicator object can be cropped.
[0080] Furthermore, after obtaining the image of the page area and the indicated position, the content of the page indicated by the user in the page area image can be identified, and the associated content of the identified content can be obtained and output.
[0081] For example, if the identified content is a Chinese word, and the associated content is the audio of that Chinese word, then the audio can be displayed and played.
[0082] The following is combined Figure 3 The above embodiments will be described in detail. Figure 3 This is a detailed flowchart of a book page detection method. The process includes: Step 301: Acquire the captured image.
[0083] Step 302: Use a fuzz detection model to perform fuzz detection on the acquired image.
[0084] Step 303: Determine whether the blur detection result is a clear image. If yes, proceed to step 304; otherwise, proceed to step 301.
[0085] Step 304: Use an object detection model to perform object detection on the image to be detected, and obtain the target region where the indicated object is located.
[0086] Step 305: Using the indication confirmation model, obtain the indication confirmation result of the target region based on the image to be detected, the target region, and the first constraint matrix.
[0087] Step 306: Determine whether the confirmation result indicates that the target area is valid. If yes, proceed to step 307; otherwise, proceed to step 301.
[0088] Step 307: Based on the target region and the target page region, crop the image to be detected to obtain the page region image.
[0089] For details on steps 301-307, please refer to steps 101-104 above, which will not be repeated here.
[0090] In this embodiment, fuzzy detection can filter out clear images to be detected, reducing the detection failure rate caused by image blur. After detecting the pointing object, it is further confirmed whether the pointing object is pointing on a page. This is because only when the pointing object is pointing on a page is it necessary to perform subsequent page detection to display the relevant content of the page to the user. Furthermore, when there are multiple pages, the page area pointed to by the user can be filtered and cropped, improving the effectiveness and accuracy of page detection and enhancing the user experience.
[0091] Based on the same inventive concept, this disclosure also provides a page detection device. Since the principle of the above-described device and apparatus for solving the problem is similar to that of a page detection method, the implementation of the above-described device can refer to the implementation of the method, and repeated details will not be elaborated further. This device can be applied to electronic devices. This disclosure does not limit the type of electronic device; it can be any suitable type of device, such as terminal devices and servers, etc., which will not be elaborated further in this disclosure.
[0092] See Figure 4 The diagram shown is a structural block diagram of a page detection apparatus according to an embodiment of this disclosure. In some embodiments, the page detection apparatus of this disclosure includes: Detection unit 401 is used to perform object detection based on the image to be detected using an object detection model to obtain the target area where the indicated object is located; the indicated object is used to indicate a page. The confirmation unit 402 is used to obtain the indication confirmation result of the target region by adopting the indication confirmation model, based on the image to be detected, the target region, and the first constraint matrix; the indication confirmation result indicates whether the target region is valid; the first constraint matrix is generated based on the constraint factor of the constraint function and is used to assist in judging the indication confirmation result; The obtaining unit 403 is used to obtain the target page region by using a page detection model to perform page detection based on the image to be detected if the indication confirmation result indicates that the target area is valid; The cropping unit 404 is used to crop the image to be detected based on the target region and the target page region to obtain the page region image.
[0093] In one embodiment, the indication confirmation model includes a first classification network, a first limitation network, and a first output network; The confirmation unit 402 is used for: Based on the target region, a local image containing the indicated object is cropped from the image to be detected; The local image is input into the first classification network to obtain the first image features; Input the first constraint matrix into the first constraint network to obtain the first constraint features; The first image features and the first limiting features are input into the first output network to obtain the indication confirmation result.
[0094] In one embodiment, the confirmation unit 402 is used to: A first limiting value is obtained through a first output network based on the first image features and the first limiting features; If the first limit value is determined to be the first target limit value corresponding to the first limit matrix, then the confirmation result is determined to be that the target area is valid; Otherwise, the confirmation result indicates that the target area is invalid.
[0095] In one embodiment, the detection unit 401 is further configured to: Repeat the following steps until the image to be detected is obtained: Acquire images; A fuzzy detection model is used to perform fuzziness detection based on the acquired image and the second constraint matrix to obtain the fuzzy detection result. The fuzzy detection result indicates whether the acquired image is clear. The second constraint matrix is generated based on the constraint factor of the constraint function and is used to assist in judging the fuzzy detection result. If the blur detection result indicates that the image is clear, then the acquired image is determined as the image to be detected; otherwise, the acquired image is discarded.
[0096] In one embodiment, the fuzzy detection model includes a second classification network, a second constraint network, and a second output network; The detection unit 401 is also used for: The acquired images are input into the second classification network to obtain the second image features; The second constraint matrix is input into the second constraint network to obtain the second constraint features; The second image features and the second limiting features are input into the second output network to obtain the blur detection result.
[0097] In one embodiment, the detection unit 401 is further configured to: The second output network obtains the second constraint value based on the second image features and the second constraint features; If the second constraint value is determined to be the second target constraint value corresponding to the second constraint matrix, then the blur detection result is determined to be image blur. Otherwise, the blur detection result is determined to be a clear image.
[0098] In one embodiment, the cutting unit 404 is used for: The object detection model also outputs the indicated location of the object in the target area; Determine the overlapping area between the indicated location and the target page area; Determine the percentage of overlapping areas within the target area; If the proportion is higher than the set proportion threshold, then the image containing the target page area is cropped from the image to be detected.
[0099] The page detection method in this embodiment of the present disclosure, after detecting the presence of an indicator object in the image to be detected, also confirms the validity of the indicator object (i.e., whether the indicator object is pointing to the page). Only when the indicator object is valid will the page area image be detected and output, thereby outputting the page area image pointed to by the user, so as to identify the content of the page pointed to by the user and reduce the misjudgment of page detection.
[0100] In this embodiment of the disclosure, an electronic device is provided, including: Processor; and The memory stores computer instructions that cause the processor to execute the methods of any of the above-described embodiments.
[0101] In this embodiment of the disclosure, a computer-readable storage medium is provided, storing computer instructions for causing a computer to perform the methods of any of the above embodiments.
[0102] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the method described in any of the above embodiments.
[0103] Figure 5 A schematic diagram of the structure of an electronic device 5000 is shown. (See also...) Figure 5 As shown, the electronic device 5000 includes a processor 5010 and a memory 5020, and optionally may also include a power supply 5030, a display unit 5040, and an input unit 5050.
[0104] The processor 5010 is the control center of the electronic device 5000. It connects various components through various interfaces and lines, and performs various functions of the electronic device 5000 by running or executing software programs and / or data stored in the memory 5020, thereby performing overall monitoring of the electronic device 5000.
[0105] In this embodiment of the present disclosure, the processor 5010 executes the steps in the above embodiments when it calls the computer program stored in the memory 5020.
[0106] Optionally, processor 5010 may include one or more processing units; preferably, processor 5010 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into processor 5010. In some embodiments, the processor and memory may be implemented on a single chip; in some embodiments, they may also be implemented separately on independent chips.
[0107] The memory 5020 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, various applications, etc.; the data storage area may store data created based on the use of the electronic device 5000, etc. In addition, the memory 5020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device, etc.
[0108] Electronic device 5000 also includes a power supply 5030 (such as a battery) that supplies power to various components. The power supply can be logically connected to processor 5010 through a power management system, thereby enabling the management of charging, discharging, and power consumption.
[0109] The display unit 5040 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 5000. In this embodiment, it is mainly used to display the display interfaces of various applications in the electronic device 5000, as well as text, images, and other objects displayed on the display interfaces. The display unit 5040 may include a display panel 5041. The display panel 5041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0110] The input unit 5050 can be used to receive information such as numbers or characters input by the user. The input unit 5050 may include a touch panel 5051 and other input devices 5052. The touch panel 5051, also known as a touch screen, can collect touch operations on or near the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 5051).
[0111] Specifically, the touch panel 5051 can detect user touch operations and the signals generated by these operations, convert them into touch point coordinates, send them to the processor 5010, and receive and execute commands from the processor 5010. Furthermore, the touch panel 5051 can be implemented using various types of sensors, including resistive, capacitive, infrared, and surface acoustic wave sensors. Other input devices 5052 can include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, and joystick.
[0112] Of course, the touch panel 5051 can cover the display panel 5041. When the touch panel 5051 detects a touch operation on or near it, it transmits the information to the processor 5010 to determine the type of touch event. Subsequently, the processor 5010 provides corresponding visual output on the display panel 5041 according to the type of touch event. Although in Figure 5 In this embodiment, the touch panel 5051 and the display panel 5041 are two separate components to realize the input and output functions of the electronic device 5000. However, in some embodiments, the touch panel 5051 and the display panel 5041 can be integrated to realize the input and output functions of the electronic device 5000.
[0113] The electronic device 5000 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity sensor, etc. Of course, depending on the specific application, the electronic device 5000 may also include other components such as a camera. Since these components are not the focus of this disclosure, they will not be discussed further. Figure 5 It is not shown in the text and will not be described in detail here.
[0114] Those skilled in the art will understand that Figure 5 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown, or a combination of certain components, or different components.
[0115] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this disclosure, the functions of each module (or unit) can be implemented in one or more software or hardware components.
Claims
1. A method for detecting book pages, characterized in that, The method includes: An object detection model is used to detect objects in the image to obtain the target region where the indicated object is located; the indicated object is used to indicate a page. An indication confirmation model is used to obtain an indication confirmation result for the target region based on the image to be detected, the target region, and a first constraint matrix; the indication confirmation result indicates whether the target region is valid; the first constraint matrix is generated based on the constraint factor of the constraint function and is used to assist in judging the indication confirmation result. If the confirmation result indicates that the target area is valid, then the page detection model is used to detect pages based on the image to be detected, and the target page area is obtained. Based on the target region and the target page region, the image to be detected is cropped to obtain a page region image; The indication confirmation model includes a first classification network, a first constraint network, and a first output network; the step of using the indication confirmation model to obtain the indication confirmation result of the target region based on the image to be detected, the target region, and the first constraint matrix includes: Based on the target region, a partial image containing the indicated object is cropped from the image to be detected; The local image is input into the first classification network to obtain the first image features; Input the first constraint matrix into the first constraint network to obtain the first constraint feature; The first image feature and the first limiting feature are input into the first output network to obtain the indication confirmation result.
2. The method according to claim 1, characterized in that, The step of inputting the first image features and the first limiting features into the first output network to obtain the indication confirmation result includes: A first limiting value is obtained through the first output network based on the first image features and the first limiting features; If the first limiting value is determined to be the first target limiting value corresponding to the first limiting matrix, then the indication confirmation result is determined to be that the target area is valid; Otherwise, the indication confirmation result is determined to be that the target area is invalid.
3. The method according to claim 1 or 2, characterized in that, Before employing an object detection model to perform object detection on the image to be detected and obtaining the target region indicating the target object, the process includes: Repeat the following steps until the image to be detected is obtained: Acquire images; A fuzz detection model is used to perform fuzziness detection based on the acquired image and a second constraint matrix to obtain a fuzz detection result; the fuzz detection result indicates whether the acquired image is clear; the second constraint matrix is generated based on the constraint factor of the constraint function and is used to assist in judging the fuzz detection result; If the blur detection result indicates that the image is clear, then the acquired image is determined as the image to be detected; otherwise, the acquired image is discarded.
4. The method according to claim 3, characterized in that, The fuzzy detection model includes a second classification network, a second constraint network, and a second output network; The step involves employing a fuzzy detection model to perform fuzziness detection based on the acquired image and the second constraint matrix, obtaining fuzzy detection results, including: The acquired image is input into the second classification network to obtain the second image features; The second constraint matrix is input into the second constraint network to obtain the second constraint feature; The second image features and the second limiting features are input into the second output network to obtain the blur detection result.
5. The method according to claim 4, characterized in that, The step of inputting the second image features and the second limiting features into the second output network to obtain the blur detection result includes: The second output network obtains the second limiting value based on the second image features and the second limiting features; If the second limiting value is determined to be the second target limiting value corresponding to the second limiting matrix, then the blur detection result is determined to be image blur. Otherwise, the blur detection result is determined to be a clear image.
6. The method according to claim 1 or 2, characterized in that, The step of cropping the image to be detected based on the target region and the target page region to obtain the page region image includes: The object detection model also outputs the indicated position of the indicated object in the target area; Determine the overlapping area between the indicated position and the target page area; Determine the proportion of the overlapping area in the target area; If the percentage is higher than the set percentage threshold, then the image of the page region containing the target page region is cropped from the image to be detected.
7. A device for detecting book pages, characterized in that, The device includes: The detection unit is used to perform object detection based on the image to be detected using an object detection model to obtain the target area where the indicated object is located; the indicated object is used to indicate a page. A confirmation unit is configured to use an indication confirmation model to obtain an indication confirmation result for the target region based on the image to be detected, the target region, and a first constraint matrix; the indication confirmation result indicates whether the target region is valid; the first constraint matrix is generated based on the constraint factor of a constraint function and is used to assist in judging the indication confirmation result; wherein, the indication confirmation model includes a first classification network, a first constraint network, and a first output network; the step of using the indication confirmation model to obtain the indication confirmation result for the target region based on the image to be detected, the target region, and the first constraint matrix includes: cropping a local image containing the indicated object from the image to be detected based on the target region; inputting the local image into the first classification network to obtain a first image feature; inputting the first constraint matrix into the first constraint network to obtain a first constraint feature; and inputting the first image feature and the first constraint feature into the first output network to obtain the indication confirmation result; The obtaining unit is configured to, if the indication confirmation result indicates that the target area is valid, use a page detection model to perform page detection based on the image to be detected, and obtain the target page area; The cropping unit is used to crop the image to be detected based on the target region and the target page region to obtain a page region image.
8. An electronic device, characterized in that, include: processor; as well as A memory storing computer instructions for causing the processor to perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer contains computer instructions for causing the computer to perform the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device performs the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Book point reading method and system based on deep learning
CN111353501A
