A method and device for detecting the tilt of a picture with text plane
By performing straight line fitting and clustering of pictures in natural scenes and calculating the center slope value, the problem of difficulty in judging the tilt of pictures in the existing technology is solved, and robust detection and depth direction tilt discrimination of menu pictures are achieved, improving the efficiency text recognition rate and reduced labor costs.
Patent Information
- Application Number
- CN202011156715.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-26
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-10-26
AI Technical Summary
It is difficult for the existing technology to automatically determine whether a picture is too tilted in a natural scene, especially in menu pictures, which makes text recognition difficult and cannot distinguish between tilt in the plane and depth directions.
By obtaining the text box vertices of the text lines in the picture, perform straight line fitting, cluster the slopes, calculate the center slope value, and determine whether the picture is tilted based on the threshold, distinguishing the tilt in the plane and depth directions.
It realizes robust tilt detection of pictures in natural scenes, avoids the problem of pictures with different shooting quality, and can judge and distinguish the tilt in the plane and depth direction in real time, improves the text recognition rate and reduces labor costs.
Smart Images

Figure CN112257710B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular relates to a method and device for detecting the tilt of an image with a text plane. Background Art
[0002] Fresh food e-commerce companies hope to automatically identify the words on the menus through photos of the merchant menus taken by the sales. However, due to the different quality angles of the pictures taken, it poses a great challenge to the subsequent text recognition algorithm and also leads to some waste of manpower. Therefore, it is hoped that through some pre-judgment algorithms, real-time feedback can be given on whether the pictures are qualified when the sales take the pictures, and whether the pictures are suitable for the text recognition algorithm before text recognition. If it is judged to be unsuitable, it can be requested to retake the pictures on the spot to avoid unnecessary waste of manpower. At the same time, it can also improve the subsequent text recognition rate and reduce the cost of manual recognition.
[0003] Among all the image quality issues, one of the biggest problems is that the shooting angle is too tilted, causing serious deformation of the text, or the text at the far end is too small to be recognized. At present, most methods for judging the tilt of a single image use algorithms such as Hough transform to identify all the straight lines in the image, and then judge the tilt of the image by the tilt of the straight lines, or use the blank bars between lines of text to detect the tilt, but these methods are limited to certain specific application scenarios, such as bills, forms and other pictures with tables, and the background is required to be single and clear. And only the tilt parallel to the plane of the image can be identified, and the tilt perpendicular to the depth direction of the image cannot be identified. Summary of the invention
[0004] In order to solve at least one of the above technical problems, the present application provides a method and device that can automatically determine whether a menu picture taken in a natural scene is too tilted. By using algorithms such as clustering, the discrimination method can use higher-level statistical information to make the recognition more robust. The method is not limited to menu pictures, but is also applicable to the tilt judgment of pictures with text planes in various natural scenes, such as billboards.
[0005] The first aspect of the present application provides a method for detecting the inclination of an image with a text plane, comprising: obtaining a text box corresponding to each text line in the image to be detected, and representing it with four vertices of the text box where the text line is located; performing straight line fitting on the four vertices of each text box; clustering the slopes of the fitted straight lines; averaging the slopes of the straight lines in each clustered category to obtain multiple central slope values; and determining whether the image to be detected is tilted based on a comparison result of the multiple central slope values with a threshold.
[0006] Preferably, before clustering the slopes of the fitted straight lines, the method further includes: setting a first threshold to filter out straight lines whose slopes exceed the first threshold, wherein the first threshold is selected from any value in the range of 4 to 6.
[0007] Preferably, clustering the slopes of the fitted straight lines includes: setting a number of clustering categories of not less than two, and giving an initial center value in each category; initially clustering all the straight line slopes according to the Euclidean distance between each straight line slope and each of the initial center values; for each clustering category after the initial clustering, recalculating the average value of the straight line slopes therein, and using it as the new center value, and re-clustering all the straight line slopes, and iterating multiple times until convergence.
[0008] Preferably, determining whether the image to be detected is tilted includes: setting a second threshold, and when the central slope value of the straight line slopes in a category with the most straight line slopes after clustering is greater than the first threshold, determining that the image to be detected is a tilted image, wherein the second threshold is selected from any value between 0.8 and 1.2.
[0009] Preferably, determining whether the image to be detected is tilted includes: setting a third threshold, selecting the maximum and minimum values of multiple center slope values obtained after clustering, and calculating the difference; if the difference is greater than the third threshold, determining that the image to be detected is a depth tilted image, wherein the third threshold is selected from any value between 0.2 and 0.3.
[0010] The second aspect of the present application provides a device for detecting the inclination of an image with a text plane corresponding to the above-mentioned method, including: a text box detection module, used to obtain the text box corresponding to each text line in the image to be detected, represented by the four vertices of the text box where the text line is located; a straight line fitting module, used to perform straight line fitting on the four vertices of each text box; a clustering module, used to cluster the slopes of the fitted straight lines; a central slope value acquisition module, used to average the slopes of the straight lines in each category after clustering to obtain multiple central slope values; a judgment module, used to judge whether the image to be detected is tilted according to the comparison result of the multiple central slope values and the threshold.
[0011] Preferably, it further comprises a filtering module for filtering the straight lines whose slope after fitting exceeds the first threshold by setting the first threshold before clustering, wherein the first threshold is selected from any value in the range of 4 to 6.
[0012] Preferably, the clustering module includes: a clustering parameter setting unit, used to set a number of clustering categories of not less than two, and to give an initial center value in each category; an initial clustering unit, used to initially cluster all straight line slopes according to the Euclidean distance between each straight line slope and each of the initial center values; an iteration unit, used to recalculate the average value of the straight line slopes within each clustering category after the initial clustering, and use it as the new center value to re-cluster all straight line slopes, and perform multiple iterations until convergence.
[0013] Preferably, the determination module includes: a first determination unit, used to set a second threshold, and when the central slope value of the straight line slopes in a category with the most straight line slopes after clustering is greater than the first threshold, the image to be detected is determined to be a tilted image, wherein the second threshold is selected from any value between 0.8 and 1.2.
[0014] Preferably, the determination module includes: a second determination unit, used to set a third threshold, select the maximum value and the minimum value among the multiple center slope values obtained after clustering, and calculate the difference; if the difference is greater than the third threshold, the image to be detected is determined to be a depth tilted image, wherein the third threshold is selected from any value between 0.2 and 0.3.
[0015] This application uses a clustering algorithm of the slopes of multiple straight lines to determine the tilt of an image. On the one hand, it can combine the clustering algorithm to enhance the robustness of tilt recognition. On the other hand, it can distinguish between plane tilt and depth tilt to obtain more comprehensive detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of a preferred embodiment of the method for detecting the tilt of an image with text plane in the present application.
[0017] Figure 2 Time application Figure 1 A schematic diagram of obtaining a text box in the illustrated embodiment. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical scheme and advantages of the implementation of this application clearer, the technical scheme in the implementation of this application will be described in more detail in combination with the drawings in the implementation of this application. In the drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described implementation is a part of the implementation of this application, not all of the implementations. The implementation described below with reference to the drawings is exemplary and is intended to be used to explain this application, and cannot be understood as a limitation on this application. Based on the implementation in this application, all other implementations obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. The implementation of this application is described in detail below in combination with the drawings.
[0019] The first aspect of the present application provides a method for detecting the tilt of an image with a text plane, such as Figure 1 As shown, it mainly includes:
[0020] Step S1, obtaining a text box corresponding to each text line in the image to be detected, and representing it with four vertices of the text box where the text line is located.
[0021] Step S2: perform straight line fitting on the four vertices of each text box.
[0022] Step S3: clustering the slope of the fitted straight line.
[0023] Step S4, averaging the slopes of the straight lines in each category after clustering to obtain multiple central slope values.
[0024] Step S5: Determine whether the image to be detected is tilted according to the comparison results of the multiple center slope values and the threshold.
[0025] In step S1, deep learning is preferably used to identify the text box. There are many algorithms for detecting the position of text boxes in the current machine vision field. The present invention is not limited to which algorithm is used to obtain the text box. For example, the EAST network is used for detection. EAST is a text detection network based on deep learning. The input is a single picture, and the output is a series of polygon coordinates, each polygon corresponding to a text line in the picture. EAST is a fully convolutional network, which is mainly divided into three parts: feature extraction layer, feature fusion layer and output layer. The feature extraction layer can use any Backbone network, and PVANet is used in the paper. The feature fusion layer splices the two adjacent layers after upsampling to obtain richer semantic and position information.
[0026] The output layer is divided into three parts: score map, RBOX and QUAD. The score map gives the probability that each pixel belongs to the text area. RBOX outputs 5 values for each pixel, which represent the distance from the pixel to the top, right, bottom and left borders of the rectangle, as well as the rotation angle of the rectangle. QUAD outputs 8 values for each pixel, which are the coordinate offsets from the pixel to the four corner vertices of the quadrilateral.
[0027] Finally, NMS is performed on all the obtained text boxes to obtain the final result, such as Figure 2 As shown, it should be understood that Figure 2 In the text box detection by machine learning, the detection is generally based on the principle of character spacing. In this way, if each line of characters is relatively compact, it is generally recognized as one text box. If a line of characters is separated by spaces, it is usually recognized as multiple text boxes.
[0028] Generally speaking, the formed text box contains multiple characters, forming a rectangular text box, but based on other factors of the detection algorithm, sometimes a compact text line is also divided into multiple text boxes, that is, some text boxes contain one character, forming a square text box. In any case, the formed text box is basically a rectangle with four vertices, so four vertices are used to represent the text box in step S1.
[0029] In step S2, straight line fitting is performed on each text box, for example, a straight line is fitted to the four points by using the least square method, and the slopes of all the straight lines are calculated.
[0030] In step S3, clustering is performed on the above-calculated straight line slopes.
[0031] In some optional implementations, before clustering is performed, the method further includes: setting a first threshold to filter out straight lines whose slope exceeds the first threshold, wherein the first threshold is selected from any value between 4 and 6.
[0032] The purpose of this embodiment is to remove all lines with slopes greater than a threshold value, where the threshold value is set to 5 based on experience. The reason for filtering the slope is that the current text detection algorithm has certain limitations on vertical text, and the false detection rate is high. In addition, some single characters will be recognized as text lines, and will be fitted into vertical lines when fitting a straight line, which affects the algorithm effect. Therefore, these two types of abnormal values are filtered through the threshold value.
[0033] In some optional implementations, step S3 further includes:
[0034] Step S31: Set no less than two clustering categories, and give an initial center value in each category.
[0035] Step S32: Initially cluster all the straight line slopes according to the Euclidean distance between each straight line slope and each of the initial center values.
[0036] Step S33: for each cluster category after the initial clustering, recalculate the average value of the straight line slopes therein and use it as the new center value, re-cluster all the straight line slopes, and iterate multiple times until convergence.
[0037] The implementation of this application has the following beneficial effects:
[0038] (1) The tilt is directly determined by the algorithm, and the standard is unified, thus avoiding problems such as uneven quality of the captured images.
[0039] (2) The captured images can be judged in real time so that the photographer can decide whether to retake the photo.
[0040] (3) It can be applied to natural scenes. For images with complex backgrounds, the error rate of algorithms that identify straight lines is quite high, because straight lines in the background will be counted as table lines. However, the present invention avoids such misjudgment and will not be affected by lines or patterns in the background.
[0041] (4) The tilt in the depth direction perpendicular to the image can be determined. Existing determination methods are limited to determining the tilt caused by rotation parallel to the image plane. However, in menu images, many images are shot at too large an angle, causing the menu to have a large tilt in the direction perpendicular to the image. For example, one side of the menu is closer to the camera and the font is clearer, while the other side is farther away from the camera and the font is small and blurry.
[0042] It is understandable that after clustering, the slope obtained in this application can be made more statistically significant and the result can be made more robust. The kmeans algorithm is used here, and the number of categories n is set to the number of lines divided by 5. That is, if the number of lines in the filtered figure is 20, the number of categories n is set to 4. kmeans randomly sets n center values and calculates the Euclidean distance to distribute all lines to n classes. Then the new center value is calculated based on the slope of the line in each class, and then all the lines are redistributed. This is iterated multiple times until convergence. Eventually all lines will be assigned to their corresponding categories, and each category has a center value, called the center slope. The center slope is obtained by calculating the average slope of all lines in this category.
[0043] Step S4 is actually to obtain the central slopes of each category after the iteration convergence of step S3. Step S5 is to predict the tilt degree of the image based on these slopes.
[0044] In some optional implementations, determining whether the image to be detected is tilted includes:
[0045] A second threshold is set, and when the central slope value of the straight line slopes in a category with the most straight line slopes after clustering is greater than the first threshold, the image to be detected is determined to be a tilted image, wherein the second threshold is selected from any value between 0.8 and 1.2.
[0046] This embodiment mainly determines whether the image is tilted on the plane. By setting a second threshold, when the slope of the straight line after clustering exceeds the second threshold, it is determined that the image is tilted on the plane. Here, the central slope value of the straight line slope in a category with the most straight line slopes after clustering is preferentially selected as the comparison standard. Based on this, it is believed that the coverage rate during judgment is the most extensive and the result is more accurate. In an alternative implementation, the average value of all straight line slopes before non-clustering can also be used to make a judgment and comparison with the threshold.
[0047] In this embodiment, the second threshold is generally selected as 1, which means that when the central slope value c of the straight line slopes in a category with the most straight line slopes after clustering is greater than 1, it can be determined that the text plane is tilted in the direction parallel to the image.
[0048] It can be understood that another purpose of the present application is to use the image tilt determination as a pre-screening process for the text recognition algorithm to guide the front end to obtain higher quality photos. Therefore, the value of the second threshold can be determined according to the subsequent text recognition step. That is, in the text recognition step, the degree of image tilt will cause the text to be unrecognizable if it exceeds a certain value. This value can be counted and used as the selection criterion for the second threshold.
[0049] In addition to identifying the tilt of the image to be detected in the plane, the following steps may be used to determine whether the image to be detected is tilted in the depth direction. That is, in some optional implementations, determining whether the image to be detected is tilted includes:
[0050] A third threshold is set, the maximum value and the minimum value of the multiple central slope values obtained after clustering are selected, and the difference is calculated. If the difference is greater than the third threshold, the image to be detected is determined to be a depth tilted image, wherein the third threshold is selected from any value between 0.2 and 0.3.
[0051] In this embodiment, when the plane is tilted in the depth direction perpendicular to the picture direction, parallel lines tend to intersect at the vanishing point. That is, lines with consistent slopes in the real world will change in different directions when tilted in the depth direction. Therefore, the maximum difference in the center slope can be used to determine whether the plane is tilted in the direction perpendicular to the picture, that is, if the difference between the maximum and minimum center slope values of all categories is greater than the third threshold, it is determined to be a tilted picture.
[0052] As described above, considering the purpose of the present invention as a pre-screening process of the image as a text recognition algorithm, a suitable third threshold can still be calculated based on the recognition rate of the text recognition step. Usually, the third threshold can be selected as 0.25.
[0053] It is understandable that the detection of a single text line is accidental and prone to misjudgment. For example, if only one line of text is tilted, the reason for the tilt may be the effect of artistic words or other reasons, not the tilt of the picture. The method of using multiple text lines to indicate the tilt of the picture will be more stable and more accurate, avoiding accidental detection. The present application processes the slopes of the fitted lines of multiple text boxes through a clustering algorithm, thereby improving the accuracy of image tilt detection, and can distinguish between plane tilt and depth tilt to obtain more comprehensive detection results.
[0054] In a second aspect of the present application, a device for detecting the tilt of a picture with a text plane corresponding to the above method is provided, which mainly comprises:
[0055] A text box detection module is used to obtain the text box corresponding to each text line in the image to be detected, represented by the four vertices of the text box where the text line is located;
[0056] Line fitting module, used to perform line fitting on the four vertices of each text box;
[0057] Clustering module, used to cluster the slopes of the fitted straight lines;
[0058] A central slope value acquisition module is used to average the slopes of the straight lines in each category after clustering to obtain multiple central slope values;
[0059] The determination module is used to determine whether the image to be detected is tilted according to the comparison result of the multiple center slope values and the threshold.
[0060] In some optional embodiments, a filtering module is further included for filtering straight lines whose slopes after fitting exceed a set first threshold before clustering, wherein the first threshold is selected from any value between 4 and 6.
[0061] In some optional implementations, the clustering module includes:
[0062] A clustering parameter setting unit, used for setting the number of clustering categories to be no less than two, and giving an initial center value in each category;
[0063] An initial clustering unit, used for initially clustering all straight line slopes according to the Euclidean distance between each straight line slope and each of the initial center values;
[0064] The iteration unit is used to recalculate the average value of the straight line slopes in each cluster category after the initial clustering, and use it as the new center value to re-cluster all the straight line slopes, and iterate multiple times until convergence.
[0065] In some optional implementations, the determination module includes:
[0066] The first determination unit is used to set a second threshold value. When the central slope value of the straight line slopes in a category with the most straight line slopes after clustering is greater than the first threshold value, the image to be detected is determined to be a tilted image, wherein the second threshold value is selected from any value between 0.8 and 1.2.
[0067] In some optional implementations, the determination module includes:
[0068] The second determination unit is used to set a third threshold, select the maximum value and the minimum value of the multiple center slope values obtained after clustering, and calculate the difference. If the difference is greater than the third threshold, it is determined that the image to be detected is a depth tilted image, wherein the third threshold is selected from any value between 0.2 and 0.3.
[0069] In other aspects of the present application, a computer device is provided, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned method for detecting the tilt of an image with a text plane.
[0070] In this embodiment, the present invention can be run on a GPU or directly on a CPU, and the main time difference depends on the speed of the text recognition part. At present, the EAST algorithm is 0.3s / frame on a GPU and 1.07s / frame on a CPU. The development labor cost is about 2 man-days. The benefit is that when the sales visit the merchant and take a menu picture, the judgment result can be given on the spot to determine whether the picture is qualified. If it is unqualified, the sales can retake it on the spot, saving the labor cost of visiting again. In addition, through image quality control, the overall image quality can be improved to ensure the accuracy and efficiency of subsequent image information capture. At present, the text recognition rate of menu pictures is about 40%, mainly because the picture quality is too poor and the text that is too tilted cannot be recognized. After automatically reviewing the inclination and controlling the image quality, the recognition rate can be increased to about 70%.
[0071] In another aspect of the present application, a readable storage medium is provided, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the above-mentioned method for detecting the tilt of an image with a text plane.
[0072] In particular, according to the embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program, in particular a computer program installed on a mobile phone terminal, which can interact with a server. For example, the embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. The computer storage medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0073] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0074] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0075] The modules or units involved in the embodiments described in this application may be implemented by software or hardware. The modules or units described may also be set in a processor, and the names of these modules or units do not constitute limitations on the modules or units themselves in some cases.
[0076] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for detecting the tilt of a picture with text plane, characterized in that: include: Obtain the text box corresponding to each text line in the image to be detected, represented by the four vertices of the text box where the text line is located; Fit straight lines to the four vertices of each text box; Cluster the slopes of the fitted lines; The slopes of the straight lines in each clustered category are averaged to obtain multiple central slope values; Determining whether the image to be detected is tilted according to a comparison result of the plurality of center slope values and a threshold; Wherein, determining whether the image to be detected is tilted includes: A second threshold is set, and when the central slope value of the straight line slopes in a category with the most straight line slopes after clustering is greater than the second threshold, the image to be detected is determined to be a tilted image, wherein the second threshold is selected from any value between 0.8 and 1.2; A third threshold is set, the maximum value and the minimum value of the multiple central slope values obtained after clustering are selected, and the difference is calculated. If the difference is greater than the third threshold, the image to be detected is determined to be a depth tilted image, wherein the third threshold is selected from any value between 0.2 and 0.
3.
2. The method for detecting the inclination of a picture with text plane as claimed in claim 1, characterized in that: Before clustering the slope of the fitted straight line, the following is further included: A first threshold is set to filter out straight lines whose slope exceeds the first threshold, wherein the first threshold is selected from any value between 4 and 6.
3. The method for detecting the inclination of a picture with text plane as claimed in claim 1, characterized in that: Clustering the slope of the fitted line includes: Set the number of cluster categories to be no less than two, and give an initial center value in each category; All straight line slopes are initially clustered according to the Euclidean distance between each straight line slope and each of the initial center values; For each cluster category after the initial clustering, the average value of the straight line slope within it is recalculated and used as the new center value. All straight line slopes are re-clustered and repeated multiple times until convergence.
4. A device for detecting the inclination of a picture with a text plane, characterized in that: include: A text box detection module is used to obtain the text box corresponding to each text line in the image to be detected, represented by the four vertices of the text box where the text line is located; Line fitting module, used to perform line fitting on the four vertices of each text box; Clustering module, used to cluster the slopes of the fitted straight lines; A central slope value acquisition module is used to average the slopes of the straight lines in each category after clustering to obtain multiple central slope values; A determination module, used for determining whether the image to be detected is tilted according to a comparison result between the plurality of center slope values and a threshold; Wherein, the determination module comprises: A first determination unit is configured to set a second threshold value, and when the central slope value of the straight line slopes in a category with the most straight line slopes after clustering is greater than the second threshold value, the image to be detected is determined to be a tilted image, wherein the second threshold value is selected from any value between 0.8 and 1.2; The second determination unit is used to set a third threshold, select the maximum value and the minimum value of the multiple center slope values obtained after clustering, and calculate the difference. If the difference is greater than the third threshold, it is determined that the image to be detected is a depth tilted image, wherein the third threshold is selected from any value between 0.2 and 0.
3.
5. The device for detecting the inclination of a picture with text plane as claimed in claim 4, characterized in that: It also includes a filtering module for filtering the straight lines whose slopes after fitting exceed the first threshold by setting a first threshold before clustering, wherein the first threshold is selected from any value between 4 and 6.
6. The device for detecting the inclination of a picture with text plane as claimed in claim 4, characterized in that: The clustering module comprises: A clustering parameter setting unit, used for setting the number of clustering categories to be no less than two, and giving an initial center value in each category; An initial clustering unit, used for initially clustering all straight line slopes according to the Euclidean distance between each straight line slope and each of the initial center values; The iteration unit is used to recalculate the average value of the straight line slopes in each cluster category after the initial clustering, and use it as the new center value to re-cluster all the straight line slopes, and iterate multiple times until convergence.
