Seal image determination method and device, equipment, medium and program product

By recognizing and correcting the shape of seal images, especially circles, ellipses, and rectangles, and combining the HSV color space and target detection model, the problem of insufficient shape applicability in existing technologies is solved, and efficient extraction and correction of multi-shaped seal images is achieved.

CN120912901APending Publication Date: 2025-11-07AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511011208.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing technologies are not effective for extracting and correcting stamp images of shapes other than circles, ovals, and rectangles, and their applicability is poor.

Method used

By acquiring the image of the seal card, identifying the shape of the seal image, and performing rotation correction based on the shape, including identifying curved text regions and the deflection angle of the seal outline, segmenting the seal region using the HSV color space, and combining object detection and text region detection models, the extraction and correction of multi-shaped seal images can be achieved.

Benefits of technology

It improves the applicability to seal images of different shapes, effectively identifies and corrects circular, elliptical and rectangular seal images, and enhances the applicability and extraction efficiency of various seal images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120912901A_ABST
    Figure CN120912901A_ABST
Patent Text Reader

Abstract

The invention discloses a seal image determination method and device, equipment, a medium and a program product, and relates to the technical field of image processing, and the method comprises the steps: obtaining a seal card image; identifying a seal image in the seal card image and the shape of the seal image; the shapes comprise circles, ellipses and rectangles; and according to the shape and the seal image, performing rotation correction on the seal image to obtain a target seal image. According to the technical scheme of the embodiment of the invention, the method can achieve the recognition of the shape of the seal, carries out the extraction and correction according to the shape of the seal, and improves the applicability of seal images in different shapes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to a seal image determination method, device, equipment, medium and program product. BACKGROUND

[0002] With the deepening of digital transformation, the fields of government affairs, finance and law are gradually realizing the electronicization and intelligentization of business processes. As the core certificate of legal effectiveness, seals play an indispensable role in these fields. In the pre-reserved seal verification scene, seal extraction in paper images is a key link, which requires extracting and correcting the seal image in the paper image, and then storing it in a standardized manner.

[0003] At present, the existing technology mainly extracts and corrects seal images of a certain specific shape, and cannot be applied to extracting and correcting seal images of other shapes, and has poor applicability to seal images of other shapes. SUMMARY

[0004] The present application provides a seal image determination method, device, equipment and medium to improve the applicability of extracting and correcting seal images of various shapes.

[0005] In a first aspect, the present application provides a seal image determination method, comprising:

[0006] obtaining a seal card image;

[0007] identifying a seal image in the seal card image and a shape of the seal image; the shape includes a circle, an ellipse and a rectangle;

[0008] According to the shape and the seal image, the seal image is rotated and corrected to obtain a target seal image.

[0009] In a second aspect, the present application also provides a seal image determination device, comprising:

[0010] an acquisition module configured to obtain a seal card image;

[0011] an identification module configured to identify a seal image in the seal card image and a shape of the seal image; the shape includes a circle, an ellipse and a rectangle;

[0012] a correction module configured to rotate and correct the seal image according to the shape and the seal image to obtain a target seal image.

[0013] In a third aspect, the present application also provides an electronic device, comprising:

[0014] at least one processor; and

[0015] The memory is in communication connection with the at least one processor; wherein

[0016] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method for determining a seal image provided by any of the embodiments of the present application.

[0017] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining a seal image provided by any of the embodiments of the present application when the processor executes the computer instructions.

[0018] In a fifth aspect, the embodiments of the present application further provide a computer program product, characterized by comprising a computer program, and the computer program implements the method for determining a seal image provided by any of the embodiments of the present application when the computer program is executed by a processor.

[0019] The embodiments of the present application can obtain a seal card image, identify a seal image and a shape of the seal image in the seal card image, the shape includes a circular shape, an elliptical shape and a rectangular shape, and correct the seal image according to the shape and the seal image to obtain a target seal image. The shape of the seal image can be identified, the seal image can be corrected according to the shape of the seal image, the seal images of various shapes can be corrected and extracted, and compared with the prior art of extracting and correcting the seal image of a specific shape, the applicability of the seal images of different shapes is improved.

[0020] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0022] Figure 1A is a flow chart of the method for determining a seal image provided by the first embodiment of the present application;

[0023] Figure 1B is a training flow diagram of a target detection model provided by the first embodiment of the present application;

[0024] Figure 2Ais a flow chart of a method for determining a seal image according to the second embodiment of the present application;

[0025] Figure 2B is a schematic diagram of a curved text region in a seal image according to the second embodiment of the present application;

[0026] Figure 2C is a schematic diagram of a reserved line segment according to the second embodiment of the present application;

[0027] Figure 3A is a flow chart of a method for determining a seal image according to the third embodiment of the present application;

[0028] Figure 3B is a schematic diagram of a framework of a seal image extraction system;

[0029] Figure 4 is a schematic diagram of a structure of a seal image determination apparatus according to the fourth embodiment of the present application;

[0030] Figure 5 is a structural diagram of an electronic device for implementing a method for determining a seal image according to the present application. DETAILED DESCRIPTION

[0031] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0032] It should be noted that the terms "first", "second", "auxiliary" and "target" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0033] The acquisition, storage and application of the seal card image and the seal image and the like in the technical scheme of the embodiment of the present application all conform to the provisions of relevant laws and regulations and do not violate public order and good customs.

[0034] Embodiment one

[0035] Figure 1A A flowchart of a seal image determination method provided for the embodiment one of the present application, the embodiment can be applicable to the case of extracting a seal image from a seal card, the method can be executed by a seal image determination device, the seal image determination device can be realized in the form of hardware and / or software and be specifically configured in an electronic device.

[0036] Referring to Figure 1A The seal image determination method comprises the following steps of:

[0037] S101, acquiring a seal card image.

[0038] In the embodiment, the seal card image can be an image of a seal card; the seal card has at least one seal printed thereon, such as a unit seal, a legal representative seal and a financial special seal.

[0039] S102, identifying a seal image in the seal card image and a shape of the seal image; the shape includes a circular shape, an elliptical shape and a rectangular shape.

[0040] In the embodiment, the seal image can be an image of a seal in the seal card. Specifically, a certain algorithm is used to identify the seal image in the seal card image and the shape of the seal image.

[0041] Optionally, identifying the seal image in the seal card image and the shape of the seal image comprises: performing target detection on the seal card image to obtain coordinate information of a seal detection frame and a seal shape; converting the seal card image to an HSV (Hue, Saturation, Value) color space to obtain an HSV seal card image; determining an HSV seal area from the HSV seal card image according to the coordinate information of the seal detection frame; and determining the seal image from the HSV seal area according to a pixel value range of a seal color.

[0042] The coordinate information of the seal detection frame can be used to represent the position of the seal detection frame in the seal card image. The HSV seal card image is the seal card image converted to the HSV color space; and the HSV seal area can be an area in the HSV seal card image where the seal exists.

[0043] Specifically, the seal card image can be subjected to target detection by a target detection model to obtain coordinate information of a seal detection frame and a seal shape. It should be noted that the type of the machine learning model is not limited in the present application, for example, it can be an RTMDet (Real-Time Models for Object Detection) model.

[0044] Optionally, Figure 1B is a schematic diagram of a training process of a target detection model; as Figure 1B indicated, three types of seal image characteristics, i.e., circular, rectangular (i.e., rectangle) and elliptical, are used to construct a composite training data set to achieve the positioning and shape classification tasks of the seal image. First, part of the manually annotated real vouchers such as checks and / or invoices are used as part of the samples of the training set, and different seal images are generated by collecting and self-making seal images in combination with random scaling, random rotation angle, adjusting transparency and / or random blurring, and then superimposed and synthesized onto the background images of the report and / or contract documents without seal images to achieve data enhancement, solve the problem of fewer training samples, and improve the generalization ability of the model. Finally, a multi-shape seal image region detection model is generated after training, which can identify the region and type of multiple types of seal images at a time.

[0045] The seal card image is converted to an HSV (Hue, Saturation, Value) color space to obtain an HSV seal card image; the region represented by the coordinate information of the seal detection frame in the HSV seal card image is determined as an HSV seal region; and the HSV seal region is divided into a background region and a seal region according to a pixel value range of a set seal color, and the image corresponding to the seal region is determined as a seal image; wherein the seal color can include but is not limited to black, red or blue, etc.

[0046] It can be understood that by using the above technical solution, the seal image region detection is performed by the target detection model, which can adaptively process the semantic features of the seal image and adapt to more complex document backgrounds; the region detection and shape classification of the seal image can be completed at a time, avoiding the need to traverse a seal card image multiple times to extract different shapes of seal image regions, which can significantly improve the efficiency; by converting the seal card image to the HSV color space, the hue information and the brightness information are separated, making the color easier to be recognized and processed, and the specific color seal can be more effectively extracted. At the same time, the HSV space is not sensitive to light changes, and accurate seal images can be determined under different light conditions, improving the robustness of seal image extraction.

[0047] S103, according to the shape and the seal image, the seal image is subjected to rotation correction to obtain a target seal image.

[0048] In this embodiment, the target seal image can be a target seal image after rotation correction. Specifically, a certain algorithm is used to correct the seal image according to the shape and the seal image, and the target seal image is obtained.

[0049] The embodiment of the application can obtain a seal card image, identify a seal image and a shape of the seal image in the seal card image, the shape including a circle, an ellipse and a rectangle, correct the seal image according to the shape and the seal image, and obtain a target seal image. The shape of the seal image can be identified, the seal image can be corrected according to the shape, seal images of various shapes can be corrected and extracted, and the applicability of the seal images of different shapes is improved compared with the prior art of extracting and correcting a seal image of a specific shape.

[0050] Embodiment Two

[0051] Figure 2A A flowchart of a seal image determination method provided by the second embodiment of the application is provided, and the determination of the target data set is optimized and improved on the basis of the technical solutions of the above-mentioned embodiments.

[0052] Further, the operation of determining the target seal image is detailed as follows: if the shape is a circle, a curved text region in the seal image is identified, a rotation correction angle of the seal image is determined according to the curved text region, and the seal image is corrected according to the rotation correction angle to obtain the target seal image.

[0053] It should be noted that the parts not described in detail in the embodiments of the application can be referred to the descriptions of the above-mentioned embodiments.

[0054] Referring to Figure 2A A seal image determination method is shown, which includes the following steps.

[0055] S201, a seal card image is obtained.

[0056] S202, a seal image and a shape of the seal image in the seal card image are identified, the shape including a circle, an ellipse and a rectangle.

[0057] S203, if the shape is a circle, a curved text region in the seal image is identified.

[0058] In this embodiment, the curved text region can be a curved region with text in the seal image.

[0059] Specifically, a text region detection model can be used to identify the curved text region in the seal image. It should be noted that the model type of the text region detection model is not limited in the present application. For example, it can be a DBNet++ (Real-Time Scene Text Detection with Differentiable Binarization and Adaptive Scale Fusion) model.

[0060] In an optional embodiment, a training data set can be constructed for the curved text region in the seal to implement the curved text region detection task in the seal image. First, a circular seal image data set is collected and self-made, which includes circular seal images of any layout, such as seal images containing curved text and a five-pointed star, seal images containing only curved text, seal images containing curved text and horizontal text layout, etc. Then, scaling, rotation, transparency, and random blur enhancement processing are performed. Finally, the curved text region in the seal image is labeled to generate a training set. Through training, a detection model of the curved text region in the seal image is generated, which is used to detect the curved text region in the seal image.

[0061] Optionally, Figure 2B is a schematic diagram of a curved text region in a seal image. As Figure 2B shown, Figure 2B the overall image represents a seal image, and the white region is a curved text region. It should be noted that Figure 2B only as an example, the text and other elements in the seal are not shown.

[0062] S204, according to the curved text region, determine the rotation correction angle of the seal image.

[0063] In this embodiment, the rotation correction angle can be the angle at which the seal image needs to be rotated. Specifically, a certain algorithm is used to determine the rotation correction angle of the seal image according to the curved text region.

[0064] Optionally, the shape of the curved text region is an axisymmetric shape, and the number of symmetry axes is one; determining the rotation correction angle of the seal image according to the curved text region includes: determining the straight line where the symmetry axis of the curved text region is located; determining the deflection angle of the vertical direction of the seal image relative to the straight line where the symmetry axis is located; and determining the deflection angle as the rotation correction angle.

[0065] Specifically, taking the center point of the image as the origin, line segments of a set length are generated in each direction; line segments located in the curved text region are retained, and line segments located outside the curved text region are discarded; a straight line on which a line segment located in the middle of all retained line segments is located is determined as a straight line on which a symmetry axis of the curved text is located; and Figure 2C is a schematic diagram of a retained line segment.

[0066] A plane rectangular coordinate system is established with the center point of the image as the origin, the horizontal direction as the x-axis, the right direction as the positive direction, the vertical direction as the y-axis, and the upward direction as the positive direction; a point on the line segment corresponding to the straight line on which the symmetry axis is located is taken as a first point, and a first vector from the origin to the first point is calculated; and the first vector can be determined through the following formula:

[0067]

[0068] wherein, represents the first vector; x1 represents the horizontal coordinate value of the first point; and y1 represents the vertical coordinate value of the first point.

[0069] A unit vector on the vertical direction straight line, that is, the unit vector of the positive direction of the y-axis in the established coordinate system, is determined; and the unit vector can be represented by the following formula:

[0070]

[0071] wherein, represents the unit vector of the positive direction of the y-axis on the vertical direction straight line;

[0072] An included angle between the first vector and the unit vector of the positive direction of the y-axis is calculated; and the included angle can be calculated through the following formula:

[0073]

[0074] wherein, θ represents the included angle.

[0075] The determined included angle is determined as a deflection angle; and the deflection angle is determined as a rotation correction angle.

[0076] S205. Rotating and correcting the seal image according to the rotation correction angle to obtain a target seal image.

[0077] If the shape is a circle, the curved text region in the seal image is recognized, the rotation correction angle of the seal image is determined according to the curved text region, and the seal image is rotated and corrected according to the rotation correction angle to obtain a target seal image, so that the extraction and correction of the circular seal image are realized, and the circular seal image of various layouts can be adapted, such as a seal image not containing a five-pointed star, a seal image containing curved characters and horizontal characters together, and the correction function can still be realized under various seal layout conditions, and the generalization is stronger.

[0078] Embodiment three

[0079] Figure 3A A flowchart of a seal image determination method provided by the third embodiment of the application is provided, and the determination of the target data set is optimized and improved on the basis of the technical solutions of the above-mentioned embodiments.

[0080] Further, the step of 'rotating and correcting the seal image according to the shape and the seal image to obtain a target seal image' is refined as 'if the shape is an ellipse or a rectangle, a seal contour deflection angle of the seal image is determined, the seal image is rotated according to the seal contour deflection angle to obtain an auxiliary seal image, a text deflection angle in the auxiliary seal image is recognized, and the auxiliary seal image is rotated through the text deflection angle to obtain a target seal image', so as to perfect the determination operation of the target seal image.

[0081] It should be noted that the parts not described in detail in the embodiments of the application can refer to the descriptions of the foregoing embodiments.

[0082] Referring to Figure 3A A seal image determination method is shown, which comprises:

[0083] S301, a seal card image is acquired.

[0084] S302, a seal image in the seal card image and a shape of the seal image are recognized, and the shape comprises a circle, an ellipse and a rectangle.

[0085] S303, if the shape is an ellipse or a rectangle, a seal contour deflection angle of the seal image is determined.

[0086] Specifically, if the shape is an ellipse or a rectangle, a certain algorithm is used to determine the seal contour deflection angle of the seal image.

[0087] Optionally, the determination of the seal contour deflection angle of the seal image comprises: the contour of the seal image is detected to obtain a seal contour, a fitting region of the seal contour is determined according to the shape, and the seal contour deflection angle is determined according to the fitting region.

[0088] The fitting region can be a minimum circumscribed region of a seal contour matching a seal shape. The seal contour deflection angle can be a deflection angle of a direction of the seal contour relative to a standard direction. For example, for an elliptical seal image, the long axis of the ellipse is kept in the horizontal direction when the image is in the standard direction; for a rectangular seal image, a pair of opposite edges of the rectangle are kept in the horizontal direction and another pair of opposite edges are kept in the vertical direction when the image is in the standard direction.

[0089] Specifically, the canny edge detection algorithm can be used to extract the seal contour from the seal image. The extracted seal contour can be a set of continuous seal edge points in the seal image. If the shape is elliptical, the largest seal contour in area is selected for elliptical fitting to obtain a fitted elliptical region. The angle between the straight line where the major axis of the fitted elliptical region is located and the straight line where the horizontal right direction is located is determined as the seal contour deflection angle. If the shape is rectangular, the minimum circumscribed rectangle of the seal contour is determined, and the determined minimum circumscribed rectangle region is determined as the fitting region. The angle between the straight line where any side of the fitting region is located and the straight line where the horizontal direction is located is determined as the seal contour deflection angle.

[0090] It can be understood that by using the above technical solutions, the seal contour is obtained by contour detection on the seal image, the fitting region of the seal contour is determined according to the shape, and the seal contour deflection angle is determined according to the fitting region, thereby improving the accuracy of the seal contour deflection angle.

[0091] Further, before the contour detection on the seal image, the seal image can be converted into a gray seal image, thereby reducing the number of color channels to be processed in the contour detection process and improving the contour detection speed. The luminance gradient change in the seal image can also be highlighted, thereby more accurately capturing the edges and simplifying the subsequent edge detection and contour extraction operations.

[0092] S304, rotating the seal image according to the seal contour deflection angle to obtain an auxiliary seal image.

[0093] The auxiliary seal image is an image obtained by rotating the seal image according to the seal contour deflection angle.

[0094] S305, identifying a text deflection angle in the auxiliary seal image.

[0095] In this embodiment, the text deflection angle can be the angle of deflection of a text region in the auxiliary seal image.

[0096] Specifically, the deflection angle of the text area in the auxiliary seal image can be detected through a text area direction detection model. It should be noted that the model type of the text area direction detection model is not limited in the present application.

[0097] In an optional embodiment, the text area direction detection model can be based on a PP-LCNet (PaddlePaddle Lightweight Convolutional Network) model, four types of training data sets are constructed for two types of seal characteristics, i.e., rectangular and elliptical, to realize the direction detection and classification of the text area in the seal image. First, part of the real vouchers such as checks and invoices are manually labeled to extract the corresponding seals, and the seal text direction is classified into four categories. At the same time, by collecting and self-making seal images, the self-made seal images are rotated into four angles: 90, 180, 270, and 360, to generate corresponding training sets. All the data sets are divided into three categories, i.e., training set, test set, and validation set, according to the proportion, and the model is trained to obtain a text area direction detection model capable of predicting the text deflection angle according to the model.

[0098] S306, the auxiliary seal image is rotated through the text deflection angle to obtain a target seal image.

[0099] Optionally, Figure 3B is a schematic diagram of a framework of a seal image extraction system. As shown in Figure 3B , the seal image extraction system includes a seal image extraction unit and a seal image correction unit; the seal image extraction unit includes a multi-shape seal image area detector and a seal image extractor; the seal image correction unit includes a curved text area detector, a correction degree calculator, a square detection corrector, an elliptical detection corrector, a text direction degree detector, and a seal image rotator.

[0100] The processing flow of the seal image extraction system can include: inputting a reserved seal card image into the seal image extraction system; inputting the reserved seal card image into the seal image extraction unit, first entering the multi-shape seal image area detector, and outputting the detection box coordinate information of the seal image and the shape identifier of the seal image, the shape identifier including a circular identifier, a square (i.e., a rectangular) identifier, and an elliptical identifier; inputting the reserved seal card image, the detection box coordinate information of the seal image, and the shape of the seal image into the seal image extractor, and outputting the seal image segmented from the seal card image; inputting the seal image and the shape identifier into the seal image correction unit.

[0101] If the shape identifier is a circular identifier, the circular seal image is input into a curved text region detector to output coordinate information of a curved text region frame; the coordinate information of the curved text region frame and the seal image are input into a correction degree calculator to output a rotation correction degree of the circular seal image; the circular seal image and the rotation correction degree are input into a seal image rotator to extract a corrected circular seal image.

[0102] If the shape identifier is a square identifier, the square seal image is input into a square detection corrector to output an auxiliary seal image corresponding to the square seal image; the auxiliary seal image corresponding to the square seal image is input into a text direction degree detector to output a text deflection angle of the auxiliary seal image corresponding to the square seal image; the auxiliary seal image corresponding to the square seal image and the text deflection angle are input into the seal image rotator to extract a corrected circular seal image.

[0103] If the shape identifier is an elliptical identifier, the elliptical seal image is input into an elliptical detection corrector to output an auxiliary seal image corresponding to the elliptical seal image; the auxiliary seal image corresponding to the elliptical seal image is input into the text direction degree detector to output a text deflection angle of the auxiliary seal image corresponding to the elliptical seal image; the auxiliary seal image corresponding to the elliptical seal image and the text deflection angle are input into the seal image rotator to extract a corrected circular seal image.

[0104] The technical scheme of the embodiment of the present application, if the shape is an ellipse or a rectangle, determines a seal contour deflection angle of the seal image; rotates the seal image according to the seal contour deflection angle to obtain an auxiliary seal image; identifies a text deflection angle in the auxiliary seal image; and rotates the auxiliary seal image according to the text deflection angle to obtain a target seal image, which can solve the problem that the direction of the seal image is still inconsistent with the readable direction after rotation correction in the conventional method, and improve the display accuracy of the seal image after rotation correction.

[0105] Embodiment four

[0106] Figure 4 A structure diagram of a seal image determination device provided by the fourth embodiment of the present application. The embodiment of the present application can be applied to the case of extracting a seal image from a seal card, and the device can execute a seal image determination method. The seal image determination device can be realized in the form of hardware and / or software, and the device can be configured in an electronic device.

[0107] Referring to Figure 4 A seal image determination device is shown in the figure, which includes an acquisition module 401, an identification module 402 and a correction module 403, wherein,

[0108] The acquisition module 401 is configured to acquire the seal card image.

[0109] The identification module 402 is configured to identify the seal image in the seal card image and a shape of the seal image, wherein the shape comprises a circular shape, an elliptical shape and a rectangular shape.

[0110] The correction module 403 is configured to perform rotation correction on the seal image according to the shape and the seal image, to obtain a target seal image.

[0111] According to the embodiment of the present application, the seal image in the seal card image and the shape of the seal image are identified, so that the seal image is corrected according to the shape of the seal image, the seal images of various shapes can be corrected and extracted, and the applicability of the seal images of different shapes is improved compared with the prior art of extracting and correcting the seal image of a specific shape.

[0112] Optionally, the correction module 403 comprises:

[0113] The first identification unit is configured to identify a curved text region in the seal image if the shape is the circular shape.

[0114] The first determination unit is configured to determine a rotation correction angle of the seal image according to the curved text region.

[0115] The first rotation unit is configured to perform rotation correction on the seal image according to the rotation correction angle, to obtain the target seal image.

[0116] Optionally, the shape of the curved text region is an axisymmetric shape, and the number of the symmetry axes is one.

[0117] The first determination unit comprises:

[0118] The straight line determination subunit is configured to determine a straight line where the symmetry axis of the curved text region is located.

[0119] The deflection angle determination subunit is configured to determine a deflection angle of a straight line where the vertical direction of the seal image is located relative to the straight line where the symmetry axis is located.

[0120] The angle determination subunit is configured to determine the deflection angle as the rotation correction angle.

[0121] Optionally, the correction module 403 comprises:

[0122] The second determination unit is configured to determine a seal contour deflection angle of the seal image if the shape is the elliptical shape or the rectangular shape.

[0123] a second rotating unit, configured to rotate the seal image according to the seal contour deflection angle to obtain an auxiliary seal image;

[0124] a second identifying unit, configured to identify a text deflection angle in the auxiliary seal image;

[0125] a third rotating unit, configured to rotate the auxiliary seal image according to the text deflection angle to obtain a target seal image.

[0126] Optionally, the second determining unit comprises:

[0127] a detecting sub-unit, configured to perform contour detection on the seal image to obtain a seal contour;

[0128] a region determining sub-unit, configured to determine a fitting region of the seal contour according to the shape;

[0129] a second determining sub-unit, configured to determine the seal contour deflection angle according to the fitting region.

[0130] Optionally, the identifying module 402 is specifically configured to:

[0131] perform target detection on the seal card image to obtain coordinate information of a seal detection frame and a seal shape;

[0132] convert the seal card image to an HSV (Hue, Saturation, Value) color space to obtain an HSV seal card image;

[0133] determine an HSV seal region from the HSV seal card image according to the coordinate information of the seal detection frame;

[0134] determine the seal image from the HSV seal region according to a pixel value range of the seal color.

[0135] The determination device for the seal image provided in the embodiment of the present application can execute the determination method for the seal image provided in any embodiment of the present application, and has the corresponding function modules and beneficial effects of the determination method for the seal image.

[0136] Embodiment five

[0137] Figure 5A structural diagram of a stamp image determination device 510 that can be used to implement embodiments of the present application is shown. A stamp image determination device is intended to represent a variety of forms including digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. A stamp image determination device can also represent a variety of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices (e.g., headgear, eyewear, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the applications described and / or claimed in this document.

[0138] As shown in Figure 5 A stamp image determination device 510 includes at least one processor 511, and a memory, such as a read-only memory (ROM) 512, a random access memory (RAM) 513, etc., connected to the at least one processor 511, where the memory stores computer programs executable by the at least one processor. The processor 511 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 512 or loaded into the random access memory (RAM) 513 from the storage unit 518. In the RAM 513, various programs and data required for the operation of the stamp image determination device 510 can also be stored. The processor 511, the ROM 512, and the RAM 513 are connected to each other through a bus 514. An input / output (I / O) interface 515 is also connected to the bus 514.

[0139] Various components in the stamp image determination device 510 are connected to the I / O interface 515, including an input unit 516, such as a keyboard, a mouse, etc., an output unit 517, such as various types of displays, speakers, etc., a storage unit 518, such as a magnetic disk, an optical disk, etc., and a communication unit 519, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 519 allows the stamp image determination device 510 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0140] The processor 511 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 511 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 511 performs various methods and processes described above, such as a stamp image determination method.

[0141] In some embodiments, a method of seal image determination can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 518. In some embodiments, parts or all of the computer program can be loaded and / or installed onto a seal image determination device 510 via, e.g., ROM 512 and / or communication unit 519. When the computer program is loaded into RAM 513 and executed by processor 511, one or more steps of a method of seal image determination as described above can be performed. Alternatively, in other embodiments, processor 511 can be configured to perform a method of seal image determination by other means, e.g., with the aid of firmware.

[0142] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0143] Computer programs used to implement the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, can implement the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a separate software package, and partially on a remote machine or server.

[0144] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0145] To provide for interaction with a user, the systems and techniques described here can be implemented on a stamp image determination device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the stamp image determination device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0146] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0147] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS (Virtual Private Server) service.

[0148] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.

[0149] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method of determining a seal image, characterized by, The method comprises: obtaining a seal card image; identifying a seal image in the seal card image and a shape of the seal image; the shape comprises a circle, an ellipse and a rectangle; performing rotation correction on the seal image according to the shape and the seal image to obtain a target seal image.

2. The method of claim 1, wherein, The performing rotation correction on the seal image according to the shape and the seal image to obtain a target seal image comprises: if the shape is a circle, identifying a curved text region in the seal image; determining a rotation correction angle of the seal image according to the curved text region; performing rotation correction on the seal image according to the rotation correction angle to obtain a target seal image.

3. The method of claim 2, wherein, The curved text region has an axisymmetric shape, and the number of symmetry axes is one. The determining a rotation correction angle of the seal image according to the curved text region comprises: determining a straight line where the symmetry axis of the curved text region is located; determining a deflection angle of a straight line where a vertical direction of the seal image is located relative to the straight line where the symmetry axis is located; determining the deflection angle as the rotation correction angle.

4. The method of claim 1, wherein, The performing rotation correction on the seal image according to the shape and the seal image to obtain a target seal image comprises: if the shape is an ellipse or a rectangle, determining a seal contour deflection angle of the seal image; performing rotation on the seal image according to the seal contour deflection angle to obtain an auxiliary seal image; identifying a text deflection angle in the auxiliary seal image; performing rotation on the auxiliary seal image through the text deflection angle to obtain a target seal image.

5. The method of claim 4, wherein, The determining a seal contour deflection angle of the seal image comprises: performing contour detection on the seal image to obtain a seal contour; determining a fitting region of the seal contour according to the shape; determining the seal contour deflection angle according to the fitting region.

6. The method of claim 1, wherein, The identifying a seal image in the seal card image and a shape of the seal image comprises: performing target detection on the seal card image to obtain coordinate information of a seal detection box and the seal shape; converting the seal card image to an HSV (Hue, Saturation, Value) color space to obtain an HSV seal card image; determining an HSV seal region from the HSV seal card image according to the coordinate information of the seal detection box; determining a seal image from the HSV seal region according to a pixel value range of a seal color.

7. An apparatus for determining a seal image, characterized by The device comprises: an obtaining module configured to obtain a seal card image; an identifying module configured to identify a seal image in the seal card image and a shape of the seal image; the shape comprises a circle, an ellipse and a rectangle; a correction module configured to perform rotation correction on the seal image according to the shape and the seal image to obtain a target seal image.

8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the method for determining a seal image according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to perform the method for determining a seal image according to any one of claims 1-6 when the computer instructions are executed by the processor.

10. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program implements the method for determining a seal image according to any one of claims 1-6 when executed by the processor.