Image processing method, device and equipment

By binarizing large-size images and determining segmentation lines, the problem of inaccurate text recognition under equal segmentation is solved, and more efficient risk detection is achieved.

CN120411979APending Publication Date: 2025-08-01ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510415827.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

When the prior art performs risk detection on large-sized image data, the equal segmentation method causes some text to be unrecognized, affecting the accuracy of text recognition and risk detection.

Method used

By receiving the risk detection request, the target image is binarized, candidate segmentation lines are determined, and the image is divided according to the preset segmentation length, multiple sub-images are obtained, and text recognition processing is performed to determine the risk detection result.

Benefits of technology

It improves the accuracy of risk detection of large-size image data, avoids the situation of text being segmented, and ensures the integrity of image segmentation processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411979A_ABST
    Figure CN120411979A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method, device and equipment, and the method comprises the steps: receiving a risk detection request for a target image, and enabling the size of the target image to meet a preset cutting demand; in response to the risk detection request, performing binarization processing on the target image to obtain a first image; determining a candidate segmentation line based on a white area in the first image; according to the candidate segmentation lines and a preset segmentation length, performing segmentation processing on the target image to obtain a plurality of sub-images; and performing text recognition processing on each sub-image, and determining a risk detection result for the target image according to a text recognition result corresponding to each sub-image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer technology, and in particular, to an image processing method, apparatus, and device. Background Art

[0002] With the rapid development of the Internet industry, there are more and more ultra-large-sized image data generated during the business service provision process. Therefore, how to perform risk detection on large-sized image data to better provide business services for users (such as detecting whether there are risks in the long-page image data generated during the resource transfer service triggered by users to protect the privacy data of users from being leaked, etc.) has become the focus of attention of network operators.

[0003] When performing risk detection on large-sized image data, the large-sized image data can be equally divided into multiple small-sized image data through an equal division method, and then text data processing is performed on each small-sized image data to perform risk detection processing based on the text recognition result. However, the equal division method may result in some text being unrecognizable, leading to low text recognition accuracy and affecting the subsequent risk detection accuracy. Therefore, the embodiments of this specification provide a better technical solution for risk detection of large-sized images. Summary of the Invention

[0004] The purpose of the embodiments of this specification is to provide a better technical solution for risk detection of large-sized images.

[0005] To achieve the above technical solution, the embodiments of this specification are implemented as follows: An image processing method provided by the embodiments of this specification, the method includes: receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; in response to the risk detection request, performing binarization processing on the target image to obtain a first image; determining candidate dividing lines based on the white areas in the first image; performing segmentation processing on the target image according to the candidate dividing lines and a preset segmentation length to obtain multiple sub-images; respectively performing text recognition processing on each sub-image, and determining a risk detection result for the target image according to the text recognition result corresponding to each sub-image.

[0006] An image processing device provided by an embodiment of this specification, the device includes: a request receiving module, configured to receive a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; a first processing module, configured to perform binarization processing on the target image in response to the risk detection request to obtain a first image; a candidate determination module, configured to determine a candidate segmentation line based on the white area in the first image; an image segmentation module, configured to perform segmentation processing on the target image according to the candidate segmentation line and a preset segmentation length to obtain a plurality of sub-images; a risk detection module, configured to perform text recognition processing on each of the sub-images respectively, and determine a risk detection result for the target image according to the text recognition result corresponding to each sub-image.

[0007] An image processing device provided by an embodiment of this specification, the image processing device includes: a processor; and a memory arranged to store computer-executable instructions, the executable instructions, when executed, cause the processor to: receive a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; in response to the risk detection request, perform binarization processing on the target image to obtain a first image; determine a candidate segmentation line based on the white area in the first image; perform segmentation processing on the target image according to the candidate segmentation line and a preset segmentation length to obtain a plurality of sub-images; perform text recognition processing on each of the sub-images respectively, and determine a risk detection result for the target image according to the text recognition result corresponding to each sub-image.

[0008] An embodiment of this specification further provides a storage medium, the storage medium is used to store computer-executable instructions, and the executable instructions, when executed by a processor, implement the following processes: receive a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; in response to the risk detection request, perform binarization processing on the target image to obtain a first image; determine a candidate segmentation line based on the white area in the first image; perform segmentation processing on the target image according to the candidate segmentation line and a preset segmentation length to obtain a plurality of sub-images; perform text recognition processing on each of the sub-images respectively, and determine a risk detection result for the target image according to the text recognition result corresponding to each sub-image.

[0009] An embodiment of this specification also provides a computer program product, including a computer program, which, when executed by a processor, implements the following processes: receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; in response to the risk detection request, performing binarization processing on the target image to obtain a first image; determining a candidate segmentation line based on the white areas in the first image; performing segmentation processing on the target image according to the candidate segmentation line and a preset segmentation length to obtain a plurality of sub-images; respectively performing text recognition processing on each sub-image, and determining a risk detection result for the target image according to the text recognition result corresponding to each sub-image. Description of the Drawings

[0010] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. Figure 1 For an embodiment of an image processing method in this specification; Figure 2 For a schematic diagram of a first image in this specification; Figure 3 For another embodiment of an image processing method in this specification; Figure 4 For a schematic diagram of the sliding process of a preset detection window in this specification; Figure 5 For a schematic diagram of an image processing process in this specification; Figure 6 For a schematic diagram of the process of screening target candidate segmentation lines in this specification; Figure 7 For another schematic diagram of an image processing process in this specification; Figure 8 For a schematic diagram of multiple sub-images after segmentation in this specification; Figure 9 For another schematic diagram of an image processing process in this specification; Figure 10 For another schematic diagram of multiple sub-images after segmentation in this specification; Figure 11 For an embodiment of an image processing device in this specification; Figure 12 For an embodiment of an image processing device in this specification. Detailed Embodiments

[0011] An embodiment of this specification provides an image processing method, apparatus, and device.

[0012] To enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification with reference to the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all of them. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.

[0013] An embodiment of this specification provides a better processing mechanism for risk detection of large-size images. With the rapid development of the Internet industry, there are more and more ultra-large-size image data generated during the business service provision process. Therefore, how to perform risk detection on large-size image data to better provide business services for users (such as detecting whether there is a risk in the long-page image data generated when a user triggers the execution of a resource transfer service to protect the user's privacy data from being leaked, etc.) has become the focus of attention of network operators. When performing risk detection on large-size image data, the large-size image data can be equally divided into multiple small-size image data through equal division segmentation, and then text data processing is performed on each small-size image data to perform risk detection processing based on the text recognition result. However, the equal division segmentation method may have a situation where some text cannot be recognized, resulting in low text recognition accuracy and affecting the subsequent risk detection accuracy. For this reason, an embodiment of this specification provides a better technical solution for risk detection of large-size images. In this solution, by receiving a risk detection request for a target image, where the target image is an image whose size meets the preset cropping requirements, in response to the risk detection request, the target image is binarized to obtain a first image. Then, based on the white regions in the first image, candidate segmentation lines can be determined, and according to the candidate segmentation lines and the preset segmentation length, the target image is segmented to obtain multiple sub-images. Furthermore, text recognition processing is respectively performed on each sub-image, and based on the text recognition result corresponding to each sub-image, the risk detection result for the target image is determined. Since the candidate segmentation lines are determined based on the white regions in the first image obtained by binarization processing, segmenting the target image through the candidate segmentation lines can avoid the situation where text is split during image segmentation, ensuring the integrity of the image segmentation process. In this way, based on the text recognition results of each sub-image, the risk detection result for the target image can be accurately determined, improving the accuracy of risk detection for large-size images. The specific processing can refer to the specific content in the following embodiments.

[0014] Such as Figure 1As shown in the figure, an embodiment of this specification provides an image processing method. The execution subject of this method can be a server. The server can be an independent server or a server cluster composed of multiple servers, etc. In this embodiment, the server is used as an example of the execution subject for detailed description. The method can specifically include the following steps: In step S102, receive a risk detection request for a target image.

[0015] Among them, the target image can be an image whose size meets the preset cropping requirements. For example, the preset cropping requirements can be the cropping requirements set for splitting the image into multiple sub-images for risk detection during the risk detection process of the image. The purpose of setting the preset cropping requirements can be to make the image to be risk-detected clearer (split into multiple sub-images), more convenient for image processing, etc. Therefore, the preset cropping requirements can be set according to the size of the image. For example, if the length of the image is too large (i.e., the length is greater than the preset length threshold), then the image can be split into multiple sub-images in its length direction through the preset cropping requirements. Another example is that if the width of the image is too large (i.e., the width is greater than the preset width threshold), then the image can be split into multiple sub-images in its width direction through the preset cropping requirements. Another example is that if both the length and width of the image are too large (i.e., the length is greater than the preset length threshold and the width is greater than the preset width threshold), then the image can be split into multiple sub-images so that each sub-image is clearer and the image processing of each sub-image is more convenient. The target image can be an image with a size larger than the preset cropping size. Specifically, for example, assuming the preset cropping size is 100*100, then the target image can be any image with a size larger than 100*100.

[0016] In practice, taking the target image as an image provided by the user for identity authentication as an example, when the server receives an identity authentication request triggered by the user, it can receive the identity authentication image input by the user and perform size detection processing on the received identity authentication image. When the server detects that the size of the identity authentication image input by the user meets the preset cropping requirements, it can determine the identity authentication image as the target image and trigger a risk detection request for the target image.

[0017] In addition, the server can also set different cropping requirements according to the different business types to which the target image belongs to meet the risk detection requirements in different application scenarios. Among them, the business type to which the target image belongs can be identity authentication business, tampering detection business, resource transfer business, etc. The corresponding cropping requirements for different business types can be different.

[0018] In step S104, in response to the risk detection request, perform binarization processing on the target image to obtain a first image.

[0019] In implementation, in response to a risk detection request, the server may obtain the grayscale threshold corresponding to the service to which the target image belongs, and perform binarization processing on the target image according to the obtained grayscale threshold to obtain a first image. For example, assuming that the grayscale threshold corresponding to the service to which the target image belongs is 120, then the server may set the grayscale value of the pixel points in the target image with a grayscale value greater than 120 to 255, and set the grayscale value of the pixel points with a grayscale value not greater than 120 to 0. In this way, a first image that only presents black and white visually can be obtained.

[0020] Among them, the grayscale threshold corresponding to the service to which the target image belongs may be determined according to the historical images corresponding to the service to which the target image belongs and the text recognition results of the historical images.

[0021] In addition, the above method for performing binarization processing on the target image is an optional and implementable processing method. In actual application scenarios, there may also be various different processing methods, and different processing methods can be selected according to the differences in actual application scenarios. The embodiments of this specification do not make specific limitations on this.

[0022] In step S106, based on the white area in the first image, a candidate segmentation line is determined.

[0023] In implementation, the server may determine the candidate segmentation line according to the preset segmentation direction, the size of the white area in the first image, and the size of the first image. For example, assuming that the segmentation direction is to perform segmentation along the short side of the image, and the size of the first image is 100*50, then the server may determine the candidate segmentation line according to the long side of the first image and the long side of the white area. [[ID=!6]]

[0024] For example, the server performs screening processing on the white area according to the long side of the first image and the long side of the white area to obtain a target white area. For example, the server may determine, as the target white area, the white area whose long side is equal to the long side of the first image. Specifically, in the white area shown in Figure 2 the server may determine area 4 as the target white area.

[0025] Alternatively, the server may also determine, as the target white area, the area where the difference between the long side and the long side of the first image is less than a preset difference threshold. For example, in the white area shown in Figure 2 the server may also determine area 3 as the target white area.

[0026] The method for screening the white area described above is an optional and implementable determination method. In actual application scenarios, there can be various different screening methods, and different screening methods can be selected according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.

[0027] After screening out the target white area, the server can determine multiple candidate dividing lines based on the target white area according to the preset dividing line width.

[0028] In step S108, the target image is segmented according to the candidate dividing lines and the preset dividing length to obtain multiple sub-images.

[0029] In implementation, the server can screen the candidate dividing lines according to whether the distance between two adjacent candidate dividing lines in the candidate dividing lines is not less than the preset dividing length to obtain multiple target candidate dividing lines, and segment the target image according to the multiple target candidate dividing lines.

[0030] Alternatively, the server can also use a pre-trained segmentation model to segment the target image according to the candidate dividing lines and the preset dividing length to obtain multiple sub-images. Among them, the segmentation model can be a model constructed according to a preset deep learning algorithm.

[0031] In step S110, text recognition processing is performed on each sub-image respectively, and a risk detection result for the target image is determined according to the text recognition result corresponding to each sub-image.

[0032] In implementation, the server can perform optical character recognition (OCR) processing on each sub-image respectively to obtain the text recognition result corresponding to each sub-image. Alternatively, the server can also use a pre-trained text recognition model to perform text recognition processing on each sub-image respectively to obtain the text recognition result corresponding to each sub-image. Among them, the text recognition model can be a model constructed according to a preset deep learning algorithm.

[0033] After obtaining the text recognition result corresponding to each sub-image, the server can perform risk detection processing on the text recognition result corresponding to each sub-image according to the risk detection rules corresponding to the service to which the target image belongs to obtain a risk detection result for the target image.

[0034] Among them, when performing risk detection, the server can use a pre-trained risk detection model to perform risk detection processing on the text recognition result corresponding to each sub-image respectively to obtain the risk detection result corresponding to each sub-image, and determine the risk detection result for the target image according to the risk detection result corresponding to each sub-image.

[0035] Alternatively, the server can also splice the text recognition results corresponding to each sub-image according to the position information of each sub-image, and use a pre-trained risk detection model to perform risk detection processing on the spliced text recognition results to obtain a risk detection result for the target image.

[0036] The above method for determining the risk detection result for the target image is an optional and implementable determination method. In actual application scenarios, there can be various different determination methods, and different determination methods can be selected according to the different actual application scenarios. The embodiments of this specification do not make specific limitations on this.

[0037] The embodiments of this specification provide an image processing method. By receiving a risk detection request for a target image, where the target image is an image whose size meets the preset cropping requirements, in response to the risk detection request, the target image is binarized to obtain a first image. Then, based on the white regions in the first image, candidate segmentation lines can be determined, and according to the candidate segmentation lines and a preset segmentation length, the target image is segmented to obtain multiple sub-images. Furthermore, text recognition processing is respectively performed on each sub-image, and based on the text recognition results corresponding to each sub-image, a risk detection result for the target image is determined. Since the candidate segmentation lines are determined according to the white regions in the first image obtained by binarization processing, segmenting the target image through the candidate segmentation lines can avoid the situation where text is split during image segmentation, ensuring the integrity of the image segmentation processing. In this way, based on the text recognition results of each sub-image, the risk detection result for the target image can be accurately determined, improving the accuracy of risk detection for large-size images.

[0038] In practical applications, the specific processing method for determining candidate segmentation lines based on the white regions in the first image in step S106 can be various. The following provides an optional processing method, as Figure 3 shown, which can specifically include the processing steps S1062 to S10610 as follows.

[0039] In step S1062, according to the white regions in the first image, a first candidate segmentation line is determined.

[0040] In implementation, the method for determining the first candidate segmentation line can refer to the method for determining candidate segmentation lines in the above step S106, which will not be elaborated here.

[0041] In step S1064, the target image is subjected to grayscale conversion processing to obtain a second image.

[0042] In implementation, the server can perform noise reduction processing on the target image, and then perform grayscale conversion processing on the denoised target image through processing methods such as linear transformation and piecewise linear transformation to obtain a second image.

[0043] Among them, the noise reduction processing can include filter denoising (such as Gaussian denoising) processing, etc.

[0044] In step S1066, according to a preset detection window, perform sliding detection processing on the second image, and determine the area where the grayscale change value of the area corresponding to the preset detection window is within a preset change range as the target area in the second image.

[0045] In implementation, since there may be gradient colors in the image, there may be a situation of missed selection when determining the candidate segmentation line only through the first image obtained by binarization processing. Therefore, the server can screen out the target area through the grayscale change value of the area corresponding to the preset detection window.

[0046] The server can perform sliding detection processing on the second image according to a preset segmentation direction and a preset detection window. Among them, since the cropping requirements corresponding to different services are different, the width of the preset detection window can be related to the service to which the target image belongs.

[0047] In step S1068, determine a second candidate segmentation line according to the target area in the second image.

[0048] In implementation, for example, taking the second image as the image shown in Figure 4 The sliding direction of the preset detection window can be different from the segmentation direction. The server can determine the area where the grayscale change value of the area corresponding to the preset detection window is within a preset change range (such as (-3, 3)) as the target area in the second image. That is, the server can perform horizontal row-level pixel change value detection on the grayscale image (i.e., the second image), and can select the rows with grayscale change values within the preset change range (such as the row start pixel value ±3) as the avoidable text segmentation line (i.e., the second candidate segmentation line).

[0049] In addition, to avoid repeated detection of the same avoidable text segmentation line on the grayscale image and the binarized image, the binarized image can be detected first, and then the grayscale image can be detected. That is, when determining the second candidate segmentation line, if a detected segmentation line (i.e., the first candidate segmentation line) is encountered, it can be directly skipped.

[0050] In step S10610, determine the candidate segmentation line according to the first candidate segmentation line and the second candidate segmentation line.

[0051] In implementation, the server can perform duplicate removal processing on the first candidate segmentation line and the second candidate segmentation line, and determine the segmentation line after duplicate removal processing as the candidate segmentation line.

[0052] In practical applications, the specific processing method of segmenting the target image according to the candidate segmentation lines and the preset segmentation length in step S108 can be various. The following provides an optional processing method. For example, Figure 3 as shown, it can specifically include the processing of the following step S1082.

[0053] In step S1082, the candidate segmentation lines are screened according to whether the distance between two adjacent candidate segmentation lines in the candidate segmentation lines is not less than the preset segmentation length, and multiple target candidate segmentation lines are obtained. Then, according to the multiple target candidate segmentation lines, the target image is segmented to obtain multiple sub-images.

[0054] In implementation, for example, Figure 5 as shown, after determining the candidate segmentation lines, the server can adopt a dynamic backtracking method to calculate the segmentation points from the detected candidate segmentation lines, that is, the appropriate segmentation lines can be selected from the candidate segmentation lines as the target candidate segmentation lines, so as to segment the target image according to the target candidate segmentation lines to obtain multiple sub-images.

[0055] In practical applications, the specific processing method of screening the candidate segmentation lines according to whether the distance between two adjacent candidate segmentation lines in the candidate segmentation lines is not less than the preset segmentation length in step S1082 to obtain multiple target candidate segmentation lines can be various. The following provides an optional processing method, which can specifically include the processing of the following steps A1 to A6.

[0056] In step A1, the candidate segmentation line located at any end of the target image in the candidate segmentation lines is determined as the starting segmentation line.

[0057] In step A2, the first segmentation line adjacent to the starting segmentation line in the candidate segmentation lines is obtained.

[0058] In step A3, it is judged whether the distance between the starting segmentation line and the first segmentation line is not less than the preset segmentation length.

[0059] In step A4, when the distance between the starting segmentation line and the first segmentation line is not less than the preset segmentation length, the first segmentation line is determined as the target candidate segmentation line, and the second segmentation line adjacent to the first segmentation line in the candidate segmentation lines is obtained.

[0060] In step A5, it is judged whether the distance between the first segmentation line and the second segmentation line is not less than the preset segmentation length.

[0061] In step A6, when the distance between the first dividing line and the second dividing line is not less than the preset dividing length, the second dividing line is determined as the target candidate dividing line, and the candidate dividing lines are continuously screened according to the preset dividing length to obtain multiple target candidate dividing lines.

[0062] In implementation, as Figure 6 shown, the candidate dividing line 1 at one end of the target image can be determined as the starting dividing line, and the candidate dividing line 2 adjacent to the candidate dividing line 1 can be determined as the first dividing line. When the server determines that the distance between the candidate dividing line 1 and the candidate dividing line 2 is not less than the preset dividing length, the first dividing line can be determined as the target candidate dividing line, that is, the candidate dividing line 2 can be the target candidate dividing line, and the candidate dividing line 3 adjacent to the candidate dividing line 2 can be determined as the second dividing line. When the distance between the candidate dividing line 2 and the candidate dividing line 3 is not less than the preset dividing length, the candidate dividing line 3 is determined as the target candidate dividing line. The server can continue to screen the candidate dividing lines according to the above method to obtain multiple target candidate dividing lines.

[0063] In addition, when the distance between the first dividing line and the second dividing line is less than the preset dividing length, the server can process according to the following steps B1 to B3.

[0064] In step B1, when the distance between the first dividing line and the second dividing line is less than the preset dividing length, the third dividing line adjacent to the second dividing line among the candidate dividing lines is obtained.

[0065] In step B2, it is judged whether the distance between the first dividing line and the third dividing line is less than the preset dividing length.

[0066] In step B3, when the distance between the first dividing line and the third dividing line is not less than the preset dividing length, the third dividing line is determined as the target candidate dividing line, and the candidate dividing lines are continuously screened according to the preset dividing length to obtain multiple target candidate dividing lines.

[0067] In implementation, as Figure 6 shown, when the distance between the candidate dividing line 2 (i.e., the first dividing line) and the candidate dividing line 3 (i.e., the second risk) is less than the preset dividing length, the server can obtain the third dividing line adjacent to the second dividing line among the candidate dividing lines, that is, the candidate dividing line 4, and judge whether the distance between the candidate dividing line 2 and the candidate dividing line 4 is not less than the preset dividing length.

[0068] When the distance between the first dividing line and the third dividing line is not less than the preset dividing length, the server may determine the third dividing line (i.e., the candidate dividing line 4) as the target candidate dividing line, and continue to perform screening processing on the candidate dividing lines according to the preset dividing length to obtain multiple target candidate dividing lines.

[0069] In addition, when the distance between the first dividing line and the second dividing line is not less than the preset dividing length, the server may process according to the following steps C1~C5.

[0070] In step C1, when the distance between the first dividing line and the second dividing line is less than the preset dividing length, obtain the third dividing line adjacent to the second dividing line among the candidate dividing lines.

[0071] In step C2, determine whether the distance between the first dividing line and the third dividing line is less than the preset dividing length.

[0072] In step C3, when the distance between the first dividing line and the third dividing line is not less than the preset dividing length, determine whether the distance between the first dividing line and the third dividing line is equal to the preset dividing length.

[0073] In step C4, when the distance between the first dividing line and the third dividing line is equal to the preset dividing length, determine the third dividing line as the target candidate dividing line, and continue to perform screening processing on the candidate dividing lines according to the preset dividing length to obtain multiple target candidate dividing lines.

[0074] In step C5, when the distance between the first dividing line and the third dividing line is greater than the preset dividing length, determine the second dividing line as the target candidate dividing line, and continue to perform screening processing on the candidate dividing lines according to the preset dividing length to obtain multiple target candidate dividing lines.

[0075] In implementation, as Figure 6 shown, when the distance between the candidate dividing line 2 (i.e., the first dividing line) and the candidate dividing line 3 (i.e., the second risk) is less than the preset dividing length, the server may obtain the third dividing line adjacent to the second dividing line among the candidate dividing lines, that is, the candidate dividing line 4.

[0076] When the distance between the first dividing line (i.e., the candidate dividing line 2) and the third dividing line (i.e., the candidate dividing line 4) is equal to the preset dividing length, the server may determine the candidate dividing line 4 as the target candidate dividing line, and continue to perform screening processing on the candidate dividing lines according to the preset dividing length to obtain multiple target candidate dividing lines.

[0077] When the distance between the first dividing line and the third dividing line is greater than the preset dividing length, the server can determine the second dividing line (i.e., candidate dividing line 3) as the target candidate dividing line, and continue to screen and sort the candidate dividing lines according to the preset dividing length to obtain multiple target candidate dividing lines.

[0078] In addition, as Figure 7 shown, the previous target candidate dividing line can be set to point to the last selected target candidate dividing line, the PRE dividing line can be set to the previous candidate dividing line of the current candidate dividing line, and the candidate dividing line list can be set to the list of dividable lines that can avoid text.

[0079] As Figure 7 shown, the screening process of the target candidate dividing line in each round can be as follows: 1. Detect whether the last row of the target image exists. If not, the last row of the target image needs to be added to the candidate dividing line list (the last row of the target image can be used as an end signal to ensure that the target image can be completely divided through the last row of the target image).

[0080] 2. Loop through the candidate dividing line list and calculate the relationship between the difference between the current candidate dividing line and the previous target candidate dividing line and the preset dividing length: 2.1 If the difference between the current candidate dividing line and the previous target candidate dividing line < the preset dividing length, it indicates that the current candidate dividing line is not a suitable dividing line. Skip the subsequent determination and continue to loop.

[0081] 2.2 If the difference between the current candidate dividing line and the previous target candidate dividing line = the preset dividing length, it indicates that the current candidate dividing line meets the requirements. Determine the current candidate dividing line as the target candidate dividing line. At the same time, the current candidate dividing line can be used as the previous target candidate dividing line, and continue to screen the next target candidate dividing line.

[0082] 2.3 If the difference between the current candidate dividing line and the previous target candidate dividing line > the preset dividing length, it indicates that the sub-image between the current candidate dividing line and the previous target candidate dividing line is too long, exceeding the preset dividing length. At this time, backtracking is required. The specific backtracking scheme needs to be discussed in different cases: 2.3.1 Backtrack to the previous optional dividing line (i.e., the PRE dividing line) of the current candidate dividing line. If the PRE dividing line is the previous target candidate dividing line, it means that there is no optional candidate dividing line between the current candidate dividing line and the previous target candidate dividing line. At this time, the current candidate dividing line can be added to the target candidate dividing line list.

[0083] 2.3.2. Backtrack to the previous optional dividing line (PRE dividing line) of the current candidate dividing line. If the PRE dividing line is not the previous target candidate dividing line, the PRE dividing line can be added to the marked dividing line list. After completion, the latest dividing line needs to be set as the PRE dividing line.

[0084] In addition, when the distance between candidate dividing lines is not less than the preset dividing length, the server can process according to the following steps D1 - D2.

[0085] In step D1, when the distance between the starting dividing line and the first dividing line is greater than the preset dividing length, according to the preset dividing length, a fourth dividing line is added between the starting dividing line and the first dividing line.

[0086] In implementation, if the sub - image between two target candidate dividing lines is greater than the preset dividing length and not suitable for direct text recognition processing, then the server can dynamically add a brute - force segmentation scheme for this sub - image, and at the same time add the dividing lines of the brute - force segmentation to the set of target candidate dividing lines.

[0087] Take Figure 8 as an example. Since the length of sub - image 2 between target candidate dividing line A and target candidate dividing line B is greater than the preset dividing length, the server can perform brute - force segmentation on sub - image 2, that is, the server can divide sub - image 2 according to the preset dividing length in the preset dividing direction (such as from top to bottom). Since secondary segmentation is performed, dividing line B may not be the most suitable at this time, so the brute - force dividing line can be determined as the fourth dividing line.

[0088] In addition, the server can also perform text recognition processing on the regions corresponding to the starting dividing line and the first dividing line in the target image to obtain the target text recognition result. Then, the server can determine the dividing position according to the target text recognition result and the preset dividing length, and add a fourth dividing line between the starting dividing line and the first dividing line according to the dividing position.

[0089] The above method for determining the fourth dividing line is an optional and implementable determination method. In actual application scenarios, there can be various different determination methods, and different determination methods can be selected according to different actual application scenarios. This specification embodiment does not make specific limitations on this.

[0090] In step D2, the fourth dividing line is determined as the target candidate dividing line, and the candidate dividing lines are continued to be screened according to the preset dividing length to obtain multiple target candidate dividing lines.

[0091] In implementation, for example, as Figure 6As shown, when the distance between the starting dividing line (i.e., candidate dividing line 1) and the first dividing line (i.e., candidate dividing line 2) is greater than the preset dividing length, the server can add a fourth dividing line between the starting dividing line and the first dividing line according to the preset dividing length.

[0092] After adding the fourth dividing line to the target candidate dividing line set, as Figure 9 shown, the server also needs to backtrack to the last target candidate dividing line and re-screen the candidate dividing lines according to the preset dividing length to obtain multiple target candidate dividing lines.

[0093] In this way, adding the fourth dividing line can ensure that the size of each sub-image after segmentation meets the requirements of text recognition processing. At the same time, dynamic backtracking can also ensure that the sub-images are not split too fragmented, thereby reducing the text recognition cost.

[0094] As Figure 10 shown, by using the above backtracking scheme to determine the target candidate dividing lines for image segmentation processing, the effect of avoiding text can be achieved, avoiding cutting into text, and preventing situations such as text being unrecognizable or recognized as garbled. Moreover, this scheme only relies on image transformation, image pixel detection, etc., does not involve data collection, model training, etc., and there is no problem of graphics card resource consumption, and no additional graphics card resource cost needs to be consumed.

[0095] In addition, the above segmentation scheme is not limited by the length of the extra-long screenshot and can be applied to screenshots of any length. Compared with the model training scheme, it has stronger and higher robustness.

[0096] In practical applications, the target image can be an image obtained by taking a long screenshot of a preset page.

[0097] An embodiment of this specification provides an image processing method. By receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement, in response to the risk detection request, performing binarization processing on the target image to obtain a first image. Then, based on the white regions in the first image, candidate segmentation lines can be determined, and according to the candidate segmentation lines and a preset segmentation length, the target image is segmented to obtain a plurality of sub-images. Furthermore, text recognition processing is respectively performed on each sub-image, and based on the text recognition results corresponding to each sub-image, a risk detection result for the target image is determined. Since the candidate segmentation lines are determined according to the white regions in the first image obtained by binarization processing, when the target image is segmented by the candidate segmentation lines, the situation where text is split during image segmentation can be avoided, ensuring the integrity of the image segmentation processing. In this way, based on the text recognition results of each sub-image, the risk detection result for the target image can be accurately determined, improving the accuracy of risk detection for large-size images.

[0098] The above is the image processing method provided by the embodiments of this specification. Based on the same idea, the embodiments of this specification also provide an image processing device, as Figure 11 shown.

[0099] The image processing device includes: a request receiving module 1101, a first processing module 1102, a candidate determination module 1103, an image segmentation module 1104, and a risk detection module 1105, where: The request receiving module 1101 is configured to receive a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; The first processing module 1102 is configured to, in response to the risk detection request, perform binarization processing on the target image to obtain a first image; The candidate determination module 1103 is configured to determine candidate segmentation lines based on the white regions in the first image; The image segmentation module 1104 is configured to segment the target image according to the candidate segmentation lines and a preset segmentation length to obtain a plurality of sub-images; The risk detection module 1105 is configured to respectively perform text recognition processing on each sub-image, and based on the text recognition results corresponding to each sub-image, determine a risk detection result for the target image.

[0100] In the embodiments of this specification, the candidate determination module 1103 is configured to: Determine a first candidate segmentation line according to the white regions in the first image; Perform grayscale conversion processing on the target image to obtain a second image; Perform a sliding detection process on the second image according to a preset detection window, and determine the area where the gray value change of the area corresponding to the preset detection window is within a preset change range as the target area in the second image; Determine a second candidate segmentation line according to the target area in the second image; Determine the candidate segmentation line according to the first candidate segmentation line and the second candidate segmentation line.

[0101] In the embodiments of this specification, the image segmentation module 1104 is used for: Perform a screening process on the candidate segmentation lines according to whether the distance between two adjacent candidate segmentation lines in the candidate segmentation lines is not less than the preset segmentation length, obtain multiple target candidate segmentation lines, and perform a segmentation process on the target image according to the multiple target candidate segmentation lines to obtain the multiple sub-images.

[0102] In the embodiments of this specification, the image segmentation module 1104 is used for: Determine the candidate segmentation line located at any end of the target image in the candidate segmentation lines as the starting segmentation line; Obtain the first segmentation line adjacent to the starting segmentation line in the candidate segmentation lines; Judge whether the distance between the starting segmentation line and the first segmentation line is not less than the preset segmentation length; In the case where the distance between the starting segmentation line and the first segmentation line is not less than the preset segmentation length, determine the first segmentation line as the target candidate segmentation line, and obtain the second segmentation line adjacent to the first segmentation line in the candidate segmentation lines; Judge whether the distance between the first segmentation line and the second segmentation line is not less than the preset segmentation length; In the case where the distance between the first segmentation line and the second segmentation line is not less than the preset segmentation length, determine the second segmentation line as the target candidate segmentation line, and continue to perform a screening process on the candidate segmentation lines according to the preset segmentation length to obtain the multiple target candidate segmentation lines.

[0103] In the embodiments of this specification, the device further includes: A first screening module, configured to obtain a third segmentation line adjacent to the second segmentation line in the candidate segmentation lines when the distance between the first segmentation line and the second segmentation line is less than the preset segmentation length; A first judgment module, configured to judge whether the distance between the first segmentation line and the third segmentation line is less than the preset segmentation length; A second screening module, configured to, when the distance between the first dividing line and the third dividing line is not less than the preset dividing length, determine the third dividing line as the target candidate dividing line, and continue to perform screening processing on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines.

[0104] In an embodiment of the present specification, the apparatus further includes: A third screening module, configured to, when the distance between the first dividing line and the second dividing line is less than the preset dividing length, obtain a third dividing line adjacent to the second dividing line among the candidate dividing lines; A second determination module, configured to determine whether the distance between the first dividing line and the third dividing line is less than the preset dividing length; A fourth screening module, configured to, when the distance between the first dividing line and the third dividing line is not less than the preset dividing length, determine whether the distance between the first dividing line and the third dividing line is equal to the preset dividing length; A fifth screening module, configured to, when the distance between the first dividing line and the third dividing line is equal to the preset dividing length, determine the third dividing line as the target candidate dividing line, and continue to perform screening processing on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines; A sixth screening module, configured to, when the distance between the first dividing line and the third dividing line is greater than the preset dividing length, determine the second dividing line as the target candidate dividing line, and continue to perform screening processing on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines.

[0105] In an embodiment of the present specification, the apparatus further includes: An adding module, configured to, when the distance between the starting dividing line and the first dividing line is greater than the preset dividing length, add a fourth dividing line between the starting dividing line and the first dividing line according to the preset dividing length; A seventh screening module, configured to determine the fourth dividing line as the target candidate dividing line, and continue to perform screening processing on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines.

[0106] In an embodiment of the present specification, the adding module is configured to: Perform text recognition processing on the regions corresponding to the starting dividing line and the first dividing line in the target image to obtain a target text recognition result; Determine the splitting positions according to the target text recognition result and the preset splitting length, and add the fourth splitting line between the starting splitting line and the first splitting line according to the splitting positions.

[0107] In the embodiments of the present specification, the target image is an image obtained by performing a long screenshot on a preset page.

[0108] The embodiments of the present specification provide an image processing apparatus. By receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement, in response to the risk detection request, perform binarization processing on the target image to obtain a first image. Then, based on the white regions in the first image, determine candidate splitting lines, and according to the candidate splitting lines and the preset splitting length, perform splitting processing on the target image to obtain a plurality of sub-images. Furthermore, perform text recognition processing on each sub-image respectively, and determine the risk detection result for the target image according to the text recognition result corresponding to each sub-image. Since the candidate splitting lines are determined according to the white regions in the first image obtained by binarization processing, splitting the target image through the candidate splitting lines can avoid the situation where text is split during image splitting, ensuring the integrity of the image splitting process. In this way, according to the text recognition results of each sub-image, the risk detection result for the target image can be accurately determined, improving the accuracy of risk detection for large-size images.

[0109] The above is the image processing apparatus provided by the embodiments of the present specification. Based on the same concept, the embodiments of the present specification also provide an image processing device, as Figure 12 shown.

[0110] The image processing device may be the terminal device or server provided in the above embodiments, etc.

[0111] The image processing device may vary greatly due to configuration or performance differences, and may include one or more processors 1201 and a memory 1202. One or more application programs or data may be stored in the memory 1202. Among them, the memory 1202 may be short-term storage or persistent storage. The application programs stored in the memory 1202 may include one or more modules (not shown in the figure), and each module may include a series of computer-executable instructions in the image processing device. Further, the processor 1201 may be configured to communicate with the memory 1202 and execute a series of computer-executable instructions in the memory 1202 on the image processing device. The image processing device may also include one or more power supplies 1203, one or more wired or wireless network interfaces 1204, one or more input / output interfaces 1205, and one or more keyboards 1206.

[0112] Specifically, in this embodiment, the image processing device includes a memory and one or more programs. One or more of the programs are stored in the memory, and one or more of the programs may include one or more modules. Each module may include a series of computer-executable instructions in the image processing device and is configured to be executed by one or more processors. The one or more programs include the following computer-executable instructions for: Receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; In response to the risk detection request, performing binarization processing on the target image to obtain a first image; Based on the white regions in the first image, determining candidate segmentation lines; According to the candidate segmentation lines and a preset segmentation length, performing segmentation processing on the target image to obtain a plurality of sub-images; Performing text recognition processing on each of the sub-images respectively, and determining a risk detection result for the target image according to the text recognition result corresponding to each sub-image.

[0113] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the embodiment of the image processing device, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, reference can be made to the partial description of the method embodiment.

[0114] The embodiment of this specification provides an image processing device. By receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement, in response to the risk detection request, performing binarization processing on the target image to obtain a first image. Then, based on the white regions in the first image, candidate segmentation lines can be determined, and according to the candidate segmentation lines and a preset segmentation length, performing segmentation processing on the target image to obtain a plurality of sub-images. Furthermore, performing text recognition processing on each of the sub-images respectively, and determining a risk detection result for the target image according to the text recognition result corresponding to each sub-image. Since the candidate segmentation lines are determined based on the white regions in the first image obtained by binarization processing, when performing segmentation processing on the target image through the candidate segmentation lines, the situation where text is split during image segmentation can be avoided, ensuring the integrity of the image segmentation processing. In this way, according to the text recognition results of each sub-image, the risk detection result for the target image can be accurately determined, improving the accuracy of risk detection for large-size images.

[0115] Further, based on the aboveFigures 1 to 10 For the method shown, one or more embodiments of this specification also provide a storage medium for storing computer-executable instruction information. In a specific embodiment, the storage medium can be a USB flash drive, an optical disc, a hard disk, etc. When the computer-executable instruction information stored in the storage medium is executed by a processor, the following process can be implemented: Receive a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; In response to the risk detection request, perform binarization processing on the target image to obtain a first image; Based on the white regions in the first image, determine candidate segmentation lines; According to the candidate segmentation lines and a preset segmentation length, perform segmentation processing on the target image to obtain multiple sub-images; Perform text recognition processing on each of the sub-images respectively, and based on the text recognition results corresponding to each sub-image, determine the risk detection result for the target image.

[0116] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the above-mentioned storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference can be made to the relevant parts of the method embodiment for the related content.

[0117] An embodiment of this specification provides a storage medium. By receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement, in response to the risk detection request, perform binarization processing on the target image to obtain a first image. Then, based on the white regions in the first image, candidate segmentation lines can be determined, and according to the candidate segmentation lines and a preset segmentation length, perform segmentation processing on the target image to obtain multiple sub-images. Furthermore, perform text recognition processing on each of the sub-images respectively, and based on the text recognition results corresponding to each sub-image, determine the risk detection result for the target image. Since the candidate segmentation lines are determined based on the white regions in the first image obtained by binarization processing, when performing segmentation processing on the target image through the candidate segmentation lines, the situation where text is split during image segmentation can be avoided, ensuring the integrity of the image segmentation processing. In this way, based on the text recognition results of each sub-image, the risk detection result for the target image can be accurately determined, improving the accuracy of risk detection for large-size images.

[0118] Further, based on the above Figures 1 to 10For the method shown above, one or more embodiments of this specification also provide a computer program product, including a computer program. When the computer program in this computer program product is executed by a processor, the following processes can be implemented: Receive a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; In response to the risk detection request, perform binarization processing on the target image to obtain a first image; Based on the white areas in the first image, determine candidate segmentation lines; According to the candidate segmentation lines and a preset segmentation length, perform segmentation processing on the target image to obtain multiple sub-images; Perform text recognition processing on each of the sub-images respectively, and based on the text recognition results corresponding to each sub-image, determine the risk detection result for the target image.

[0119] The various embodiments in this specification are all described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the above embodiment of a computer program product, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, reference can be made to the partial description of the method embodiment.

[0120] An embodiment of this specification provides a computer program product. By receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement, in response to the risk detection request, perform binarization processing on the target image to obtain a first image. Then, based on the white areas in the first image, candidate segmentation lines can be determined, and according to the candidate segmentation lines and a preset segmentation length, perform segmentation processing on the target image to obtain multiple sub-images. Furthermore, perform text recognition processing on each of the sub-images respectively, and based on the text recognition results corresponding to each sub-image, determine the risk detection result for the target image. Since the candidate segmentation lines are determined based on the white areas in the first image obtained by binarization processing, when performing segmentation processing on the target image through the candidate segmentation lines, the situation where text is split during image segmentation can be avoided, ensuring the integrity of the image segmentation processing. In this way, based on the text recognition results of each sub-image, the risk detection result for the target image can be accurately determined, improving the accuracy of risk detection for large-sized images.

[0121] The foregoing describes particular embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0122] In the 1990s, an improvement in a technology could be clearly distinguished as either a hardware improvement (e.g., an improvement in the circuit structure of diodes, transistors, switches, etc.) or a software improvement (an improvement in the method flow). However, with the development of technology, many improvements in method flows today can be regarded as direct improvements in hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user programming the device. The designer can program by himself to "integrate" a digital system on a piece of PLD without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a hardware description language (HDL), and there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that as long as the method flow is slightly logically programmed with the above-mentioned several hardware description languages and programmed into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.

[0123] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to make the controller implement the same function in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or structures within the hardware component.

[0124] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0125] For the convenience of description, the above devices are described by dividing them into various units according to their functions. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0126] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0127] Embodiments of this specification are described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable serial-parallel devices for fraud cases to generate a machine, such that the instructions executed by the processor of the computer or other programmable serial-parallel devices for fraud cases generate means for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0128] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable serial-parallel devices for fraud cases to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0129] These computer program instructions can also be loaded onto a computer or other programmable serial-parallel devices for fraud cases, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, so that the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0130] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0131] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.

[0132] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0133] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.

[0134] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0135] One or more embodiments of this specification can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0136] The various embodiments in this specification are described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiments.

[0137] The above is only the embodiment of this specification and is not used to limit this document. For those skilled in the art, various modifications and changes can be made to this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this specification.

Claims

1. An image processing method, comprising: Receiving a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; In response to the risk detection request, performing binarization processing on the target image to obtain a first image; Based on the white regions in the first image, determining candidate dividing lines; According to the candidate dividing lines and a preset dividing length, performing segmentation processing on the target image to obtain a plurality of sub-images; Performing text recognition processing on each of the sub-images respectively, and determining a risk detection result for the target image according to the text recognition result corresponding to each sub-image.

2. The method according to claim 1, wherein the determining candidate dividing lines based on the white regions in the first image comprises: Determining a first candidate dividing line according to the white regions in the first image; Performing gray-scale conversion processing on the target image to obtain a second image; Performing sliding detection processing on the second image according to a preset detection window, and determining a region in the second image where the gray-scale change value of the region corresponding to the preset detection window is within a preset change range as the target region in the second image; Determining a second candidate dividing line according to the target region in the second image; Determining the candidate dividing line according to the first candidate dividing line and the second candidate dividing line.

3. The method according to claim 2, wherein the performing segmentation processing on the target image according to the candidate dividing lines and a preset dividing length to obtain a plurality of sub-images comprises: According to whether the distance between two adjacent candidate dividing lines in the candidate dividing lines is not less than the preset dividing length, performing screening processing on the candidate dividing lines to obtain a plurality of target candidate dividing lines, and performing segmentation processing on the target image according to the plurality of target candidate dividing lines to obtain the plurality of sub-images.

4. The method according to claim 3, wherein the performing screening processing on the candidate dividing lines according to whether the distance between two adjacent candidate dividing lines in the candidate dividing lines is not less than the preset dividing length to obtain a plurality of target candidate dividing lines comprises: Determining a starting dividing line among the candidate dividing lines that is located at any end of the target image; Obtaining a first dividing line adjacent to the starting dividing line among the candidate dividing lines; Judging whether the distance between the starting dividing line and the first dividing line is not less than the preset dividing length; In the case where the distance between the starting dividing line and the first dividing line is not less than the preset dividing length, determining the first dividing line as the target candidate dividing line, and obtaining a second dividing line adjacent to the first dividing line among the candidate dividing lines; Judging whether the distance between the first dividing line and the second dividing line is not less than the preset dividing length; When the distance between the first dividing line and the second dividing line is not less than the preset dividing length, determine the second dividing line as the target candidate dividing line, and continue to perform a screening process on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines.

5. The method according to claim 4, the method further comprising: When the distance between the first dividing line and the second dividing line is less than the preset dividing length, obtain a third dividing line adjacent to the second dividing line among the candidate dividing lines; Determine whether the distance between the first dividing line and the third dividing line is less than the preset dividing length; When the distance between the first dividing line and the third dividing line is not less than the preset dividing length, determine the third dividing line as the target candidate dividing line, and continue to perform a screening process on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines.

6. The method according to claim 4, the method further comprising: When the distance between the first dividing line and the second dividing line is less than the preset dividing length, obtain a third dividing line adjacent to the second dividing line among the candidate dividing lines; Determine whether the distance between the first dividing line and the third dividing line is less than the preset dividing length; When the distance between the first dividing line and the third dividing line is not less than the preset dividing length, determine whether the distance between the first dividing line and the third dividing line is equal to the preset dividing length; When the distance between the first dividing line and the third dividing line is equal to the preset dividing length, determine the third dividing line as the target candidate dividing line, and continue to perform a screening process on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines; When the distance between the first dividing line and the third dividing line is greater than the preset dividing length, determine the second dividing line as the target candidate dividing line, and continue to perform a screening process on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines.

7. The method according to claim 4, the method further comprising: When the distance between the starting dividing line and the first dividing line is greater than the preset dividing length, add a fourth dividing line between the starting dividing line and the first dividing line according to the preset dividing length; Determine the fourth dividing line as the target candidate dividing line, and continue to perform a screening process on the candidate dividing lines according to the preset dividing length to obtain the multiple target candidate dividing lines.

8. The method according to claim 7, the adding a fourth dividing line between the starting dividing line and the first dividing line according to the preset dividing length includes: Perform text recognition processing on the regions corresponding to the starting dividing line and the first dividing line in the target image to obtain a target text recognition result; Determine the segmentation position according to the target text recognition result and the preset segmentation length, and add the fourth segmentation line between the starting segmentation line and the first segmentation line according to the segmentation position.

9. The method according to claim 8, wherein the target image is an image obtained by performing a long screenshot process on a preset page.

10. An image processing apparatus, comprising: A request receiving module, configured to receive a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; A first processing module, configured to perform binarization processing on the target image in response to the risk detection request to obtain a first image; A candidate determination module, configured to determine a candidate segmentation line based on the white area in the first image; An image segmentation module, configured to perform segmentation processing on the target image according to the candidate segmentation line and a preset segmentation length to obtain a plurality of sub-images; A risk detection module, configured to perform text recognition processing on each of the sub-images respectively, and determine a risk detection result for the target image according to the text recognition result corresponding to each sub-image.

11. An image processing device, the image processing device comprising: A processor; And A memory arranged to store computer-executable instructions, the executable instructions, when executed, causing the processor to: Receive a risk detection request for a target image, where the target image is an image whose size meets a preset cropping requirement; Perform binarization processing on the target image in response to the risk detection request to obtain a first image; Determine a candidate segmentation line based on the white area in the first image; Perform segmentation processing on the target image according to the candidate segmentation line and a preset segmentation length to obtain a plurality of sub-images; Perform text recognition processing on each of the sub-images respectively, and determine a risk detection result for the target image according to the text recognition result corresponding to each sub-image.