Image display method, terminal, chip and storage medium
By comparing the similarity clustering of the quadrilateral borders and comparing the historical stable borders, we determine that the current stable borders are displayed for image display, which solves the problem of unstable display of the quadrilateral borders in the preview screen, and achieves a smoother image preview.
Patent Information
- Application Number
- CN202180084568.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-10
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2041-02-10
AI Technical Summary
In the prior art, the display of quadrilateral borders in the image preview screen is unstable, resulting in the problem that the display of the preview screen is not smooth.
By performing similarity clustering of the quadrilateral border, selecting the target border group and determining the initial stable border, comparing it with the historical stable border, and determining the current stable border for image display.
Solve the problem of unstable display of quadrilateral borders in the preview screen, and improve the smoothness of image preview.
Smart Images

Figure CN116686281B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image display method, a terminal, and a storage medium. Background Art
[0002] With the advancement of internet technology, an increasing number of businesses, such as those in the telecommunications, financial, and immigration sectors, require the collection and registration of user ID information for real-name management. To improve the efficiency of ID information collection and registration, a photo-based document scanning technology has been proposed, enabling automatic identification of information through photo scanning.
[0003] Among them, the scanning technology relies on the image quadrilateral detection method. Before using scanning for information recognition, the terminal needs to first use the detection method to find the quadrilateral bounding box containing the target object from the captured image, and then preview the currently captured picture and the found quadrilateral bounding box in real time to further realize the acquisition of information about the target object in the quadrilateral bounding box.
[0004] However, due to the influence of various abnormal factors, the accuracy of the detected quadrilateral frame cannot be guaranteed. Therefore, there may be display instability problems such as jitter and jump of the quadrilateral frame in the preview screen, resulting in the defect of unsmooth display of the preview screen. Summary of the Invention
[0005] The embodiments of the present application provide an image display method, terminal, chip, and storage medium, which solve the problem of unstable display of a quadrilateral border in a preview screen and overcome the defect of unsmooth display of the preview screen.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides an image display method, the method comprising:
[0008] Obtaining an i-th preview image corresponding to a target object, and performing border detection on the i-th preview image to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0;
[0009] Performing similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group;
[0010] Selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group;
[0011] Determine an i-th stable bounding box based on the initial stable bounding box and the (i-1)-th stable bounding box;
[0012] Display processing is performed on the i-th frame preview image according to the i-th stable border.
[0013] In a second aspect, an embodiment of the present application provides a terminal, comprising: an acquisition part, a detection part, a clustering part, a selection part, a determination part, and a display part.
[0014] The acquisition part is configured to acquire the i-th frame preview image corresponding to the target object;
[0015] The detection part is configured to perform border detection processing on the i-th preview image frame to obtain the i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0;
[0016] The clustering part is configured to perform similarity clustering processing based on the first quadrilateral bounding box to the i-th quadrilateral bounding box corresponding to the target object to obtain at least one bounding box group;
[0017] The selection part is configured to select a target frame group from the at least one frame group;
[0018] The determining part is configured to determine an initial stable bounding box from the target bounding box group; and determine an i-th stable bounding box based on the initial stable bounding box and the (i-1)-th stable bounding box;
[0019] The display part is configured to display the i-th frame preview image according to the i-th stable border.
[0020] In a third aspect, an embodiment of the present application provides a terminal, comprising: a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, and a preview module.
[0021] The quadrilateral detection module is configured to obtain an i-th preview image frame corresponding to the target object; and perform border detection processing on the i-th preview image frame to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0;
[0022] The temporal stabilization module is configured to perform similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group; select a target bounding box group from the at least one bounding box group; and determine an initial stable bounding box from the target bounding box group;
[0023] The denoising and stabilization module is configured to determine an i-th stable bounding box based on the initial stable bounding box and the (i-1)-th stable bounding box;
[0024] The preview module is configured to display the i-th frame preview image according to the i-th stable border.
[0025] In a fourth aspect, an embodiment of the present application provides a terminal, which includes a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, a preview module, a processor, and a memory storing instructions executable by the processor. When the instructions are executed by the processor, the image display method as described above is implemented.
[0026] In a fifth aspect, an embodiment of the present application provides a chip, characterized in that the chip includes a processor and an interface, the processor obtains program instructions through the interface, and the processor is used to run the program instructions to execute the image display method as described above.
[0027] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium on which a program is stored, which is applied to a terminal. When the program is executed by a processor, the image display method as described above is implemented.
[0028] An embodiment of the present application provides an image display method, a terminal, a chip, and a storage medium. The terminal obtains an i-th preview image corresponding to a target object, and performs border detection processing on the i-th preview image to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0; similarity clustering processing is performed based on the first quadrilateral border corresponding to the target object to the i-th quadrilateral border to obtain at least one border group; a target border group is selected from the at least one border group, and an initial stable border is determined from the target border group; an i-th stable border is determined based on the initial stable border and the (i-1)th stable border; and display processing is performed on the i-th preview image according to the i-th stable border. That is to say, in an embodiment of the present application, after performing border detection processing on the current preview image containing the target object and obtaining the quadrilateral border corresponding to the target object, the terminal can first perform clustering processing on the quadrilateral border based on border similarity, and select a target border group from at least one obtained border group, and further determine an initial stable border from the target border group, and then further determine the current stable border based on the comparison of the initial stable border and the historical stable border, so that the current preview image will be displayed according to the current stable border. It can be seen that in the present application, the terminal no longer directly previews the image based on the quadrilateral border obtained by border detection, but performs similarity clustering, target border group selection, and initial stable border determination on the quadrilateral border obtained by detection, and performs denoising and stabilization operations such as comparing the detected quadrilateral border to obtain the current stable quadrilateral border, and then performs image preview based on the stable quadrilateral border, thereby solving the problem of unstable display of the quadrilateral border in the preview image and overcoming the defect of unsmooth display of the preview image. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 1 ;
[0030] Figure 2 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 2 ;
[0031] Figure 3 This is a schematic diagram of a curve for the border group smoothing filter proposed in an embodiment of the present application;
[0032] Figure 4 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 3 ;
[0033] Figure 5 A schematic diagram of a scene for the initial stable border smoothing filter proposed in an embodiment of the present application;
[0034] Figure 6 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 4 ;
[0035] Figure 7 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 5 ;
[0036] Figure 8 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 6 ;
[0037] Figure 9 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 7 ;
[0038] Figure 10 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 8 ;
[0039] Figure 11 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 9 ;
[0040] Figure 12 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 10 ;
[0041] Figure 13A Schematic diagram of the target stable border determination scenario proposed in the embodiment of the present application Figure 1 ;
[0042] Figure 13B Schematic diagram of the target stable border determination scenario proposed in the embodiment of the present application Figure 2 ;
[0043] Figure 14 A schematic diagram of the execution flow of image processing proposed in an embodiment of the present application;
[0044] Figure 15 Schematic diagram of the terminal structure proposed in this application embodiment Figure 1 ;
[0045] Figure 16 Schematic diagram of the terminal structure proposed in this application embodiment Figure 2 ;
[0046] Figure 17 Schematic diagram of the terminal structure proposed in this application embodiment Figure 3 . DETAILED DESCRIPTION
[0047] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to explain the related applications and are not intended to limit the applications. It should also be noted that for ease of description, only the portions relevant to the related applications are shown in the drawings.
[0048] With the advancement of internet technology, more and more businesses, such as those in the telecommunications, financial, and immigration sectors, require the collection and registration of user ID information for real-name management. To improve the efficiency of ID information collection and registration, photo-based document scanning technology has emerged, enabling automatic information recognition through photo scanning.
[0049] Among them, the scanning technology relies on the image quadrilateral detection method. The terminal can apply this detection method to first find the quadrilateral bounding box containing the target object from the captured image, and then preview the currently captured picture and the found quadrilateral bounding box in real time, so as to finally obtain information about the target object in the quadrilateral bounding box.
[0050] However, the results obtained by quadrilateral detection are often affected by various factors and cannot be guaranteed to be completely correct. As a result, when the preview image is displayed in real time, there will be display instability problems such as jitter and jump of the quadrilateral border, which leads to the defect of unsmooth preview image display and inefficient image scanning.
[0051] In related technologies, the field uses direct time-series filtering methods, such as Kalman filtering, mean filtering, etc. to reduce the negative impact of unstable quadrilateral display. However, although the direct application of time-series filtering makes the filtered quadrilateral border results appear smoother in time series, it still cannot rule out the influence of some outliers. The existence of these outliers directly leads to the deviation of the quadrilateral output results due to their influence, especially when the frequency of outliers is high, the deviation of the results will deviate greatly. In other words, direct filtering cannot obtain accurate and stable quadrilateral output results, and cannot meet the needs of existing scenarios.
[0052] In order to solve the problems existing in the existing quadrilateral output results, the embodiments of the present application provide an image display method, terminal, chip and storage medium. Specifically, after performing border detection processing on the current preview image containing the target object and obtaining the quadrilateral border corresponding to the target object, the terminal can first perform a clustering process on the quadrilateral border based on border similarity, and select a target border group from at least one obtained border group, and further determine an initial stable border from the target border group, and then further determine the current stable border based on the comparison of the initial stable border and the historical stable border, so that the current preview image will be displayed according to the current stable border. It can be seen that in the present application, the terminal no longer directly previews the image based on the quadrilateral border obtained by border detection, but performs abnormal frame removal operations such as similarity clustering, target border group selection and initial stable border determination on the quadrilateral border obtained by detection, and performs a denoising and stabilization operation by comparing with the historical stable border to obtain the current stable quadrilateral border, and then performs image preview based on the stable quadrilateral border, thereby solving the problem of unstable display of the quadrilateral border in the preview screen and overcoming the defect of unsmooth display of the preview screen.
[0053] 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.
[0054] Figure 1 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 1 ,like Figure 1 As shown, in an embodiment of the present application, the method for performing image processing by a terminal may include the following steps:
[0055] Step 101: Obtain an i-th preview image corresponding to a target object, and perform border detection on the i-th preview image to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0.
[0056] In an embodiment of the present application, the terminal can obtain a preview image containing a target object, i.e., the i-th frame preview image, in real time, and perform border detection processing on the i-th frame preview image to obtain a real-time quadrilateral border corresponding to the target object, i.e., the i-th quadrilateral border.
[0057] It should be noted that, in the embodiments of the present application, the terminal may be any electronic device with a document scanning function. Specifically, the terminal may have a camera and capture image frames through the camera.
[0058] Optionally, the terminal is not limited to electronic devices such as smart phones, tablet computers, personal computers (PCs), and laptop computers.
[0059] It should be understood that the i-th preview image frame refers to a preview image of the document image captured by the terminal at the i-th moment when the terminal captures the document image through the camera. Correspondingly, the target object refers to the target object specified in the preview image, such as a rectangular object with a rectangular frame.
[0060] For example, a document image may include documents, paper, business cards, photos, whiteboards, screens, etc., and the target object may be various rectangular objects such as person photos, ID cards, passports, driver's licenses, bills, business cards, and work cards in the document image.
[0061] It should be noted that in an embodiment of the present application, after the terminal obtains a preview image including a target object in real time, the terminal can perform border detection processing on the preview image, such as quadrilateral detection, to obtain a quadrilateral border corresponding to the target object.
[0062] Optionally, since the quadrilateral detection is for rectangular objects, whose outlines are composed of straight line segments, the terminal can use a feature line detection method to determine the outline of the rectangular object, that is, the quadrilateral frame.
[0063] Optionally, the terminal may also establish a quadrilateral detection model based on deep learning. After obtaining the preview image in real time, the preview image is input into a pre-trained model to perform quadrilateral detection on the image frame to be detected, and then output the quadrilateral border.
[0064] Furthermore, in an embodiment of the present application, after obtaining the i-th frame preview image containing the target object and performing border detection processing on the i-th frame preview image, and obtaining the i-th quadrilateral border corresponding to the target object, the terminal can further perform clustering processing based on border similarity based on the quadrilateral borders.
[0065] Step 102: Perform similarity clustering processing based on the first to i-th quadrilateral bounding boxes corresponding to the target object to obtain at least one bounding box group.
[0066] In an embodiment of the present application, after the terminal performs border detection processing and obtains the i-th quadrilateral border, the terminal can further perform similarity clustering processing based on the first quadrilateral border to the i-th quadrilateral border to obtain at least one border group.
[0067] It is understandable that clustering is unsupervised machine learning that groups similar objects. In an embodiment of the present application, the terminal can cluster the quadrilateral frames based on frame similarity and group quadrilateral frames with high similarity into one category.
[0068] Specifically, in an embodiment of the present application, the terminal may obtain vertex coordinate data corresponding to the quadrilateral bounding box, and perform similarity calculation based on the vertex coordinate data, thereby classifying the quadrilateral bounding box based on the similarity result.
[0069] Here, the terminal may obtain vertex coordinate data corresponding to the first quadrilateral frame to the i-th quadrilateral frame, and then perform similarity clustering processing based on the vertex coordinate data to construct at least one frame group.
[0070] Furthermore, in an embodiment of the present application, after performing clustering processing based on border similarity based on the first quadrilateral border to the i-th quadrilateral border and obtaining at least one border group, the terminal can further perform target border group selection processing based on the at least one border group.
[0071] Step 103: Select a target frame group from at least one frame group, and determine an initial stable frame from the target frame group.
[0072] In an embodiment of the present application, after the terminal performs similarity clustering processing and obtains at least one frame group, the terminal can first select a frame group from the at least one frame group as a target frame group (step 103a), and then determine a frame from the target frame group as an initial stable frame (step 103b).
[0073] It can be understood that in at least one border group obtained based on similarity clustering, the number of quadrilateral border samples in each border group may not be the same. The border group with a larger number of quadrilateral border samples has a larger proportion of its corresponding quadrilateral borders in all quadrilateral border samples, and the border group with a smaller number of quadrilateral border samples has a smaller proportion of its corresponding quadrilateral borders in all quadrilateral border samples. The smaller the proportion here, the greater the probability that the quadrilateral border is dissimilar to other quadrilaterals, and the greater the probability that the quadrilateral border in the corresponding border group is an abnormal border.
[0074] Therefore, in an embodiment of the present application, in order to ensure the stability of the quadrilateral bounding box, filter out abnormal quadrilateral bounding boxes and retain relatively stable quadrilateral bounding boxes, the terminal can select a quadrilateral bounding box group with relatively stable quadrilateral bounding box samples from at least one bounding box group as the target bounding box group.
[0075] Specifically, Figure 2 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 2 ,like Figure 2 As shown, the method for the terminal to select a target frame group from at least one frame group (step 103a) includes the following steps:
[0076] Step 103a1: Obtain the number of quadrilateral frames contained in each frame group in at least one frame group.
[0077] Step 103a2: Determine the frame group corresponding to the maximum number of quadrilateral frames as the target frame group.
[0078] Optionally, in an embodiment of the present application, the terminal may directly determine the frame group having the largest number of quadrilateral frame samples in at least one frame group as the target frame group.
[0079] Optionally, because the number of quadrilateral bounding box samples in a bounding box group is prone to fluctuate at a certain moment and then return to normal, it may cause erroneous operation when selecting the target bounding box group. Therefore, to address this situation, the terminal can first perform a certain smoothing filter processing on each bounding box group, such as mean filtering, to reduce the jump when selecting the target bounding box group.
[0080] The terminal may track each frame group in time sequence, perform smoothing filtering on the number of quadrilateral frame samples in the frame group, and then select a frame group with the largest number of quadrilateral frame samples from at least one filtered frame group as the target frame group.
[0081] For example, Figure 3 This is a curve diagram of the frame group smoothing filter proposed in the embodiment of the present application, as shown in FIG. Figure 3As shown, the horizontal axis of the curve diagram indicates different time sequences, and the vertical axis indicates the change in the number of samples in the border group; wherein, the thick solid line represents the curve of the number of quadrilateral border samples in the original border group 1, and the thin solid line represents the curve of the number of quadrilateral border samples in the original border group 2; the thick dashed line represents the curve of the number of quadrilateral border samples in the filtered border group 1, and the thin dashed line represents the curve of the number of quadrilateral border samples in the filtered border group 2. It can be seen that in the time period from 0 to t1, before filtering, the number of quadrilaterals in the original border group 2 is greater than the number of quadrilaterals in the original border group 1 for a period of time, and then jumps and becomes less than the number of quadrilaterals in the original border group 1 for a period of time, making it impossible to accurately select the target border group. At this time, the terminal performs smoothing filtering, and in the time period t1, the number of quadrilaterals in the filtered border group 2 is always greater than the number of quadrilaterals in the filtered border group 1. At this time, the target border group is determined to be border group 2. Similarly, in the time period from t1 to t2, after smoothing filtering, the number of quadrilateral samples in the filtered border group 1 is always greater than that in the filtered border group 2. At this time, the terminal can select border group 1 as the target border group; similarly, in the time period from t2 to t3, after smoothing filtering, the number of quadrilateral samples in the filtered border group 2 is always greater than that in the filtered border group 1. At this time, the terminal can select border group 2 as the target border group.
[0082] Furthermore, in an embodiment of the present application, after the terminal selects a target frame group from at least one frame group, it may further determine a frame from the target frame group as an initial stable frame.
[0083] Specifically, Figure 4 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 3 ,like Figure 4 As shown, in an embodiment of the present application, the method for the terminal to determine the initial stable frame from the target frame group (step 103b) includes the following steps:
[0084] Step 103b1: Arrange the quadrilateral frames in the target frame group in chronological order to obtain a frame list.
[0085] Step 103b2: Determine the last quadrilateral border in the border list as the initial stable border.
[0086] It is understandable that since each quadrilateral frame in the target frame group corresponds to a preview image, based on the time sequence of the preview image, the quadrilateral frame also corresponds to its time sequence. Therefore, in an embodiment of the present application, the terminal can arrange all quadrilateral frames in the target frame group in order of time from first to last to obtain a frame time sequence list. Further, the terminal can determine the last quadrilateral frame in the list as the initial stable frame, that is, the quadrilateral frame corresponding to the latest preview image in the target frame group is determined as the initial stable frame.
[0087] Optionally, in an embodiment of the present application, the terminal may also perform mean filtering on all quadrilateral borders in the target border group, such as Kalman filtering, where the filtering object is the vertex coordinate data or center point coordinate data of the quadrilateral border, thereby obtaining an initial stable border.
[0088] For example, Figure 5 This is a schematic diagram of the scene of the initial stable border smoothing filter proposed in the embodiment of the present application. Assume that the target border group includes a quadrilateral border A, a quadrilateral border B, and a quadrilateral border C. Figure 5 As shown, although the three borders A, B, and C belong to the same border group and are similar borders, there are actually differences between the three borders. The vertex coordinate data and the center point coordinate data are different. Therefore, the terminal can perform mean filtering on the three borders in chronological order to obtain a more stable quadrilateral border D, and determine its border D as the initial stable border.
[0089] Furthermore, after successfully selecting the target frame group and successfully determining the initial stable frame, the terminal may further perform a target stable frame determination process.
[0090] Step 104: Determine the i-th stable bounding box based on the initial stable bounding box and the (i-1)-th stable bounding box.
[0091] In an embodiment of the present application, after the terminal selects a target frame group from at least one frame group and determines an initial stable frame from the target frame group, the terminal can further determine a quadrilateral frame for final preview output, i.e., the i-th stable frame, based on the initial stable frame and the historical stable reference frame, i.e., the (i-1)th stable frame.
[0092] It should be noted that, in the embodiment of the present application, the (i-1)th stable border refers to the stable border of the final output preview of the previous preview image.
[0093] Specifically, after the terminal completes the similarity clustering processing, target border group selection, initial stable border determination, and stable border determination corresponding to each frame preview image, it will store the stable border information corresponding to the current frame preview image and use it as a historical reference stable border when determining the stable border of the next frame preview image.
[0094] It should be understood that in an embodiment of the present application, in order to reduce the jitter of the quadrilateral border when displayed in the preview interface, the terminal will not directly determine the currently obtained initial stable border as the i-th stable border corresponding to the current i-th frame preview image, but will compare the currently obtained initial stable border with the pre-stored historical (i-1)th stable border for similarity, and then determine the i-th stable border for the final output preview based on the comparison result.
[0095] Furthermore, in an embodiment of the present application, after the terminal successfully determines the i-th stable border, it can further display the i-th preview image according to the stable border.
[0096] Step 105: Display the i-th preview image according to the i-th stable border.
[0097] In an embodiment of the present application, after the terminal successfully determines the i-th stable border, the terminal may further display the i-th preview image according to the stable border.
[0098] Specifically, in an embodiment of the present application, the terminal may render the i-th preview image based on the i-th stable border to obtain a rendered preview image, and then display the rendered preview image.
[0099] In detail, the terminal renders the i-th stable border in the i-th preview image to obtain a rendered stable border, and then generates a rendered preview image based on the rendered stable border and the i-th preview image, thereby displaying the rendered preview image in the preview screen.
[0100] Furthermore, in an embodiment of the present application, the terminal can perform real-time scanning processing on the rendered preview image to obtain specific parameters of the target object. Specifically, the terminal can only perform real-time scanning processing on the target object within the target stable frame to automatically identify the information.
[0101] The embodiment of the present application provides an image display method. After performing border detection processing on the current preview image containing the target object and obtaining the quadrilateral border corresponding to the target object, the terminal can first perform clustering processing on the quadrilateral border based on border similarity, and select a target border group from at least one obtained border group, and further determine an initial stable border from the target border group, and then further determine the current stable border based on the comparison of the initial stable border and the historical stable border, so that the current preview image will be displayed according to the current stable border. It can be seen that in the present application, the terminal no longer directly previews the image based on the quadrilateral border obtained by border detection, but performs similarity clustering, target border group selection, and initial stable border determination on the quadrilateral border obtained by detection, and performs denoising and stabilization operations such as comparing the detected quadrilateral border with the historical stable border to obtain the current stable quadrilateral border. Then, the image is previewed based on the stable quadrilateral border, solving the problem of unstable display of the quadrilateral border in the preview screen and overcoming the defect of unsmooth display of the preview screen.
[0102] Based on the above embodiment, in another embodiment of the present application, Figure 6 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 4 ,like Figure 6 As shown, after the terminal performs border detection processing on the i-th frame preview image and obtains the i-th quadrilateral border corresponding to the target object, that is, after step 101, and performs similarity clustering processing based on the first quadrilateral border corresponding to the target object to the i-th quadrilateral border, before obtaining at least one border group, that is, before step 102, the terminal performs an image processing method including:
[0103] Step 106 : Store the i-th quadrilateral frame into the N-th position of a first-in-first-out (FIFO) queue; wherein N is an integer greater than 2 and represents the maximum storage capacity of the FIFO.
[0104] It should be noted that in an embodiment of the present application, the terminal performs quadrilateral detection processing on each frame of preview image. After obtaining each quadrilateral border, the quadrilateral border corresponding to the current preview image will be stored at the tail of the FIFO queue, that is, the last position of the queue.
[0105] Specifically, the number of FIFO queues is determined by their maximum storage capacity. That is, the maximum storage capacity determines the number of image frames that can be stored in the FIFO queue. For example, if there are N bits in the current FIFO queue, then the maximum storage number of the FIFO queue is N.
[0106] It should be understood that FIFO follows the "first in, first out" principle. In the embodiment of the present application, the terminal always stores the i-th quadrilateral bounding box obtained by the current i-th frame preview image detection at the end of the FIFO queue, that is, at the Nth position. At this time, the historical quadrilateral bounding boxes obtained by the historical preview image detection are shifted forward one position in the FIFO queue; among them, the historical quadrilateral bounding box originally located at the first position in the FIFO queue will be moved out of the queue, and the (i-1)th historical quadrilateral bounding box will be shifted to the (N-1)th position.
[0107] Based on the above embodiment, in another embodiment of the present application, Figure 7 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 5 ,like Figure 7 As shown, the terminal stores the i-th quadrilateral bounding box after the N-th position of the first-in-first-out queue FIFO, that is, after step 106. If i is less than N, the terminal performs similarity clustering processing based on the first quadrilateral bounding box to the i-th quadrilateral bounding box corresponding to the target object. The method for obtaining at least one bounding box group includes the following steps:
[0108] Step 102a: Read the first quadrilateral frame to the i-th quadrilateral frame from the FIFO.
[0109] Step 102b: perform similarity clustering processing based on the first quadrilateral frame to the i-th quadrilateral frame to obtain at least one frame group.
[0110] It should be noted that, in the embodiment of the present application, the number of quadrilateral borders stored in the FIFO is associated with the maximum storage number N of the FIFO queue.
[0111] Specifically, if i is less than N, then after the terminal stores the i-th quadrilateral border to the N-th position of the FIFO queue, the FIFO queue now contains the first to i-th quadrilateral borders, that is, the FIFO queue space is large enough and there is no quadrilateral border that is removed.
[0112] Furthermore, the terminal may read the first to i-th quadrilateral bounding boxes corresponding to the first to i-th preview images from the FIFO queue, and perform clustering based on bounding box similarity based on the i quadrilateral bounding boxes.
[0113] Specifically, Figure 8 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 6 ,like Figure 8 As shown, the terminal performs similarity clustering processing based on the first quadrilateral frame to the i-th quadrilateral frame to obtain at least one frame group, including:
[0114] Step 102b1: Obtain the coordinate data of the kth vertex corresponding to the kth quadrilateral bounding box, and the coordinate data of the first (k-1) vertices corresponding to the first (k-1) quadrilateral bounding boxes; wherein k is an integer greater than 1 and less than or equal to i.
[0115] Step 102b2: Calculate the first (k-1) distance differences between the k-th vertex coordinate data and the first (k-1) vertex coordinate data according to a preset similarity function.
[0116] Step 102b3: Determine the minimum distance difference from the first (k-1) distance differences.
[0117] Step 102b4: Construct at least one frame group based on the minimum distance difference and the first historical frame group corresponding to the first (k-1) quadrilateral frames.
[0118] It should be noted that, in an embodiment of the present application, the terminal first performs clustering processing on the first quadrilateral border among the first to i-th quadrilateral borders in the FIFO queue. Since there are no quadrilateral border samples that have completed clustering before the first quadrilateral border, that is, there is no border group, at this time, the terminal can first establish a new border group for the first quadrilateral border.
[0119] Furthermore, when clustering the second quadrilateral bounding box in the FIFO queue, that is, when k is equal to 2, the terminal can first compare the similarity between the second quadrilateral bounding box and the clustered first quadrilateral bounding box, and determine the bounding box group to which the second quadrilateral bounding box belongs based on the comparison result.
[0120] Specifically, the terminal may respectively obtain vertex coordinate data of the second quadrilateral frame and vertex coordinate data of the first quadrilateral frame, and then calculate a distance difference that can represent similarity based on a preset similarity function and the two vertex coordinate data.
[0121] Here, the terminal may calculate the distance difference based on formulas (1) to (3) to determine the similarity of the quadrilateral frames.
[0122] Specifically, it is assumed that the quadrilateral information Q is the coordinate positions of the four vertices of each quadrilateral border.
[0123] Q={p i |p i =(x i ,y i ), i = {0, 1, 2, 3}} (1)
[0124] Among them, when i=1, p1=(x1, y1), which is the coordinate data of the first vertex of the quadrilateral; similarly, when i=2, p2=(x2, y2), which is the coordinate data of the second vertex; when i=3, p3=(x3, y3), which is the coordinate data of the third vertex; when i=4, p4=(x4, y4), which is the coordinate data of the fourth vertex.
[0125] At this time, the preset similarity function is to obtain the distance difference between the two quadrilaterals.
[0126] Distance(A, B)=|M(A)-M(B)| p (2)
[0127] Among them, || p For L p The spatial norm is commonly used. When p is 1, it is the Manhattan distance. When p is 2, it is the Euclidean distance. When p is ∞, it is the maximum absolute value. M(Q) is the mapping function of the quadrilateral information, which is used to map the original quadrilateral information Q to the distance calculation space.
[0128] Here, the method of determining M(Q) in formula (2) is as follows.
[0129] M(Q)=(k0(Q),k1(Q),k2(Q),...) (3)
[0130] Among them, k i (Q) is a specific mapping function. For example, That is, calculate the center point position, area, etc. of the quadrilateral as mapping items.
[0131] In detail, the terminal can first map the two quadrilateral borders to the distance space based on formula (1) and formula (3) in the preset similarity function, as well as the vertex coordinate data of the first quadrilateral border and the vertex coordinate data of the second quadrilateral border, obtain the distances corresponding to the two quadrilateral borders, and then calculate the distance difference based on formula (3), thereby determining the similarity comparison result between the first quadrilateral border and the second quadrilateral border.
[0132] Furthermore, the terminal may pre-set a preset distance threshold that can characterize the similarity result, and the terminal may compare the distance difference with the preset distance threshold, and then determine the similarity result between the first quadrilateral frame and the second quadrilateral frame based on the comparison result.
[0133] Among them, if the distance difference is less than the above-mentioned preset distance threshold, then the terminal can determine that the first quadrilateral frame is similar to the second quadrilateral frame, and the terminal determines that the second quadrilateral frame is classified into the frame group to which the first quadrilateral frame belongs. If the distance difference is greater than or equal to the above-mentioned preset distance threshold, then the terminal can determine that the first quadrilateral frame is not similar to the second quadrilateral frame, and the terminal re-establishes a new frame group and classifies the second quadrilateral frame into the new frame group.
[0134] Furthermore, the above steps are repeated to continue the judgment process of whether the k-th quadrilateral border is similar to the previous (k-1) quadrilateral borders, and the k-th quadrilateral border is grouped based on the similarity judgment result until the grouping process of the i-th quadrilateral border is completed, thereby obtaining at least one border group; wherein k is an integer less than i.
[0135] It should be noted that when continuing to execute the judgment process of whether the kth quadrilateral border is similar to the previous (k-1) quadrilateral border, the terminal can calculate the (k-1) distance difference between the kth quadrilateral border and the previous (k-1) quadrilateral border, and determine the minimum difference from this (k-1) distance difference, and then construct at least one border group based on the minimum difference and the border group corresponding to the previous (k-1) quadrilateral border.
[0136] Specifically, if the minimum distance difference is greater than or equal to a preset distance threshold, that is, there is no border group corresponding to the k-th quadrilateral border, and the k-th quadrilateral border cannot be classified into the border group corresponding to the first (k-1) quadrilateral borders, then the terminal can establish a new border group corresponding to the k-th quadrilateral border, and construct at least one border group based on the new border group and the first historical border group.
[0137] Specifically, if the minimum distance difference is less than the preset distance threshold, that is, there is a border group corresponding to the k-th quadrilateral border, and the k-th quadrilateral border can be classified into the border group corresponding to the first (k-1) quadrilateral borders, then the terminal can classify the k-th quadrilateral border into the border group corresponding to the first (k-1) quadrilateral borders and the target border group corresponding to the minimum distance difference, and construct at least one border group based on the border group after the number of quadrilateral border samples is updated.
[0138] For example, when the terminal performs clustering processing on the third quadrilateral border in the FIFO queue, the terminal calculates the distance difference between the third quadrilateral border and the first quadrilateral border and the second quadrilateral border respectively based on the vertex coordinate data using formulas (1) to (3). If the distance difference between the third quadrilateral and the first quadrilateral border is less than the preset distance threshold, and the distance difference between the third quadrilateral and the second quadrilateral border is greater than the preset distance threshold, then the terminal can determine that the third quadrilateral border is classified into the border group to which the first quadrilateral border belongs; if the distance difference between the third quadrilateral and the first quadrilateral border is less than the preset distance threshold, and the distance difference between the third quadrilateral and the second quadrilateral border is also less than the preset distance threshold, then the terminal classifies the third quadrilateral border into the border group to which the first quadrilateral border with the smaller distance difference belongs; if the distance differences are both greater than the preset distance threshold, then the terminal re-establishes the border group and classifies the third quadrilateral border into the new border group.
[0139] Repeat the above steps until the clustering process of the first to the i-th quadrilateral borders in the FIFO queue is completed, thereby obtaining at least one quadrilateral border group.
[0140] Based on the above embodiment, in another embodiment of the present application, Figure 9 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 7 ,like Figure 9 As shown, after the terminal stores the i-th quadrilateral bounding box to the N-th bit of the FIFO, that is, after step 106, if i is greater than or equal to N, the terminal performs similarity clustering processing based on the first quadrilateral bounding box to the i-th quadrilateral bounding box corresponding to the target object, and the method for obtaining at least one bounding box group may further include the following steps:
[0141] Step 102c: Read the (i-N+1)th quadrilateral frame to the i-th quadrilateral frame from the FIFO.
[0142] Step 102d: Perform similarity clustering based on the (i-N+1)th quadrilateral bounding box to the i-th quadrilateral bounding box to obtain at least one bounding box group.
[0143] Specifically, if i is equal to or greater than N, then after the terminal stores the i-th quadrilateral border to the N-th position of the FIFO queue, the FIFO queue now contains the (i-N+1)th to i-th quadrilateral borders, that is, the FIFO queue space is insufficient, and the first (i-N+2) quadrilateral borders have been removed from the FIFO queue.
[0144] Furthermore, the terminal may read the (i-N+1)th to i-th four deformation frames corresponding to the (i-N+1)th to i-th preview images from the FIFO queue, and perform clustering based on frame similarity.
[0145] Specifically, Figure 10 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 8 ,like Figure 10 As shown, the terminal performs similarity clustering processing based on the (i-N+1)th quadrilateral frame to the i-th quadrilateral frame, and the method for obtaining at least one frame group includes:
[0146] Step 102d1. Obtain the (i-N+k)th vertex coordinate data corresponding to the (i-N+k)th quadrilateral border, and the first (i-N+k-1)th vertex coordinate data corresponding to the first (i-N+k-1)th quadrilateral border; where k is an integer greater than 1 and less than or equal to N.
[0147] Step 102d2: Calculate the first (i-N+k-1) distance differences between the (i-N+k)th vertex coordinate data and the first (i-N+k-1)th vertex coordinate data according to a preset similarity function.
[0148] Step 102d3: Determine the minimum distance difference from the first (i-N+k-1) distance differences.
[0149] Step 102d4: Construct at least one frame group based on the minimum distance difference and the second historical frame groups corresponding to the first (i-N+k-1) quadrilateral frames.
[0150] It should be noted that, in the embodiment of the present application, the terminal always performs clustering processing only on all the quadrilateral bounding boxes currently existing in the FIFO sequence, and does not save the clustering results of the quadrilateral bounding boxes in the historical FIFO sequence.
[0151] It should be noted that, in an embodiment of the present application, the terminal first performs clustering processing on the (i-N+1)th to the i-th quadrilateral borders and the (i-N+1)th quadrilateral border in the FIFO queue. Since there are no clustered quadrilateral border samples before the (i-N+1)th quadrilateral border, that is, there is no border group, at this time, the terminal can first establish a new border group for the (i-N+1)th quadrilateral border.
[0152] Furthermore, when clustering the (i-N+2)th quadrilateral border in the FIFO queue, that is, when k is equal to 2, the terminal can first compare the similarity of the (i-N+2)th quadrilateral border with the clustered (i-N+1)th quadrilateral border, and determine the border group to which the (i-N+2)th quadrilateral border belongs based on the comparison result.
[0153] Specifically, the terminal can obtain the vertex coordinate data of the (i-N+2)th quadrilateral border and the vertex coordinate data of the (i-N+1)th quadrilateral border respectively, and then calculate the distance difference based on formula (1) to formula (3), and compare it with the preset distance threshold representing the similarity result. If the distance difference is less than or equal to the above-mentioned preset distance threshold, then the terminal can determine that the (i-N+1)th quadrilateral border is similar to the (i-N+2)th quadrilateral border, and then the terminal determines that the (i-N+2)th quadrilateral border is classified as the border group to which the (i-N+1)th quadrilateral border belongs. If the distance difference is greater than the above-mentioned preset distance threshold, then the terminal can determine that the (i-N+1)th quadrilateral border is not similar to the (i-N+2)th quadrilateral border, and then the terminal re-establishes a new border group and classifies the (i-N+2)th quadrilateral border into the new border group.
[0154] Furthermore, the above steps are repeated to continue the judgment process of whether the (i-N+k)th quadrilateral border is similar to the previous (i-N+k-1)th quadrilateral border, and the (i-N+k)th quadrilateral border is grouped based on the similarity judgment result until the grouping process of the i-th quadrilateral border is completed, thereby obtaining at least one border group; wherein k is an integer less than i.
[0155] It should be noted that when continuing to execute the judgment process of whether the (i-N+k)th quadrilateral border is similar to the previous (i-N+k-1)th quadrilateral border, the terminal can calculate the (i-N+k-1) distance difference between the (i-N+k)th quadrilateral border and the previous (i-N+k-1) quadrilateral border, and determine the minimum difference from this (i-N+k-1) distance difference, and then construct at least one border group based on the minimum difference and the border group corresponding to the previous (i-N+k-1) quadrilateral border.
[0156] Specifically, if the minimum distance difference is greater than or equal to the preset distance threshold, that is, there is no border group corresponding to the (i-N+k)th quadrilateral border, and the (i-N+k)th quadrilateral border cannot be classified into the border group corresponding to the previous (i-N+k-1)th quadrilateral border, then the terminal can establish a new border group corresponding to the (i-N+k)th quadrilateral border, and construct at least one border group based on the new border group and the first historical border group.
[0157] Specifically, if the minimum distance difference is less than the preset distance threshold, that is, there is a border group corresponding to the (i-N+k)th quadrilateral border, the (i-N+k)th quadrilateral border can be classified into the border group corresponding to the previous (i-N+k-1) quadrilateral border, then the terminal can classify the (i-N+k)th quadrilateral border into the border group corresponding to the previous (i-N+k-1) quadrilateral border and the target border group corresponding to the minimum distance difference, and construct at least one border group based on the border group after the number of quadrilateral border samples is updated.
[0158] For example, when the terminal performs clustering processing on the (i-N+3)th quadrilateral border in the FIFO queue, the terminal calculates the distance difference between the (i-N+3)th quadrilateral border and the (i-N+1)th quadrilateral border and the (i-N+2)th quadrilateral border based on the vertex coordinate data using formulas (1) to (3). If the distance difference between the (i-N+3)th quadrilateral and the (i-N+1)th quadrilateral border is less than a preset distance threshold, and the distance difference between the (i-N+2)th quadrilateral border and the (i-N+2)th quadrilateral border is greater than the preset distance threshold, then the terminal can determine that the (i-N+3)th quadrilateral border is classified into the border group to which the (i-N+1)th quadrilateral border belongs; if the distance difference between the (i-N+3)th quadrilateral and the (i-N+1)th quadrilateral border is less than the preset distance threshold, and the distance difference between the (i-N+2)th quadrilateral border and the (i-N+2)th quadrilateral border is also less than the preset distance threshold, then the terminal classifies the (i-N+3)th quadrilateral border into the border group to which the (i-N+1)th quadrilateral border with the smaller distance difference belongs; if both distance differences are greater than the preset distance threshold, then the terminal re-establishes the border group and classifies the (i-N+3)th quadrilateral border into the new border group.
[0159] Repeat the above steps until the clustering process of the (i-N+1)th to i-th quadrilateral frames in the FIFO queue is completed, thereby obtaining at least one quadrilateral frame group.
[0160] Based on the above embodiment, in another embodiment of the present application, Figure 11 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 9 ,like Figure 11 As shown, after step 101, the terminal performs similarity clustering processing based on the first quadrilateral bounding box to the i-th quadrilateral bounding box corresponding to the target object. The method for obtaining at least one bounding box group may further include the following steps:
[0161] Step 102e: Obtain the coordinate data of the i-th vertex corresponding to the i-th quadrilateral bounding box and the coordinate data of the first (i-1) vertex corresponding to the first (i-1) quadrilateral bounding box that has been grouped in history.
[0162] Step 102f: Calculate the (i-1) distance differences between the i-th vertex coordinate data and the (i-1)th vertex coordinate data before the history according to the preset similarity function.
[0163] Step 102g: Determine the minimum distance difference from the (i-1) distance differences.
[0164] Step 102h: construct at least one frame group based on the minimum distance difference and the third historical frame group corresponding to the first (i-1) quadrilateral frames.
[0165] In an embodiment of the present application, the terminal does not need to store the detected quadrilateral bounding boxes in a FIFO queue, but directly compares the similarity between the latest frame detected, that is, the i-th quadrilateral bounding box corresponding to the current i-th preview image and the classified quadrilateral bounding box samples to achieve clustering of the quadrilateral bounding boxes.
[0166] Specifically, the terminal can use formula (1) to formula (3) to respectively calculate the distance difference between the i-th quadrilateral border and each of the previous (i-1) quadrilateral borders in history, that is, (i-1) distance differences, and compare the distance difference with the preset distance threshold, thereby determining the border similarity result according to the comparison result and realizing the clustering of the quadrilateral borders.
[0167] Specifically, the terminal may determine a minimum distance difference from the (i-1) distance differences, and construct at least one frame group based on the minimum distance difference and the historical frame groups corresponding to the previous (i-1) quadrilateral frames.
[0168] Here, if the minimum distance difference is greater than or equal to the preset distance threshold, that is, there is no border group corresponding to the i-th quadrilateral border, and the i-th quadrilateral border cannot be classified into the border group corresponding to the previous (i-1) quadrilateral borders, then the terminal can establish a new border group corresponding to the i-th quadrilateral border, and construct at least one border group based on the new border group and the first historical border group.
[0169] Here, if the minimum distance difference is less than the preset distance threshold, that is, there is a border group corresponding to the i-th quadrilateral border, the i-th quadrilateral border can be classified into the border group corresponding to the previous (i-1) quadrilateral border, then the terminal can classify the i-th quadrilateral border into the border group corresponding to the previous (i-1) quadrilateral border and the target border group corresponding to the minimum distance difference, and construct at least one border group based on the border group after the number of quadrilateral border samples is updated.
[0170] An embodiment of the present application proposes an image display method, in which the terminal cannot perform similarity clustering, target frame group selection, initial stable frame determination and other abnormal frame removal operations on the detected quadrilateral borders, thereby solving the problem of unstable display of the quadrilateral borders in the preview screen and overcoming the defect of unsmooth preview screen display.
[0171] Based on the above embodiment, in another embodiment of the present application, Figure 12 Schematic diagram of the implementation process of the image display method proposed in the embodiment of this application Figure 10 ,like Figure 12 As shown, the method for the terminal to determine the i-th stable border based on the initial stable border and the (i-1)-th stable border may include the following steps:
[0172] Step 104a: Obtain the first vertex coordinate data corresponding to the initial stable bounding box and the second vertex coordinate data corresponding to the (i-1)th stable bounding box.
[0173] Step 104b: Calculate the distance difference between the first vertex coordinate data and the second vertex coordinate data according to a preset similarity function.
[0174] Step 104c: If the distance difference is less than the preset distance threshold, the (i-1)th stable bounding box is determined as the i-th stable bounding box.
[0175] Step 104d: If the distance difference is greater than or equal to the preset distance threshold, the initial stable bounding box is determined as the i-th stable bounding box.
[0176] Specifically, in an embodiment of the present application, in the process of determining the i-th stable border based on the initial stable border and the (i-1)-th stable border, the terminal can first obtain the first vertex coordinate data corresponding to the initial stable border and the second vertex coordinate data corresponding to the (i-1)-th stable border, and then calculate the similarity between the initial stable quadrilateral border and the (i-1)-th stable border based on the above two coordinate data and the preset similarity function, that is, formula (1) to formula (3).
[0177] In detail, the terminal can first map its two quadrilateral bounding boxes to the distance space based on formula (1) and formula (3) in the preset similarity function, as well as the first vertex coordinate data of the initial stable quadrilateral bounding box and the second vertex coordinate data of the (i-1)th stable bounding box, obtain the first distance corresponding to the initial stable quadrilateral bounding box and the second distance corresponding to the (i-1)th stable bounding box, and then calculate the distance difference based on formula (3).
[0178] Furthermore, the terminal may preset a preset distance threshold representing the similarity result, and the terminal may compare the above distance difference with the preset distance threshold, and then determine the similarity result between the initial stable quadrilateral bounding box and the (i-1)th stable bounding box based on the comparison result.
[0179] Among them, on the one hand, if the distance difference is less than or equal to the above-mentioned preset distance threshold, the terminal can determine that the initial stable quadrilateral border is similar to the (i-1)th stable border. Then, in order to ensure the smoothness of the preview picture, the terminal uses the same stable quadrilateral border as the previous frame image, that is, the (i-1)th stable border continues to be determined as the i-th stable border corresponding to the current i-th preview image.
[0180] It should be noted that since the i-th stable border has not changed, the terminal does not update the pre-stored (i-1)th stable border for stable border comparison, and continues to use it as the reference stable quadrilateral border when determining the next frame, that is, the (i+1)th stable quadrilateral border.
[0181] For example, Figure 13A Schematic diagram of the scenario for determining the stable border proposed in the embodiment of the present application Figure 1 , assuming that the dotted line is the (i-1)th stable border and the solid line is the initial stable border, such as Figure 13A As shown, the initial stable border has a high similarity with the (i-1)th stable border, so the terminal can retain the (i-1)th stable border as the i-th stable border of the current image frame.
[0182] Among them, on the other hand, if the distance difference is greater than the above-mentioned preset distance threshold, then the terminal can determine that the initial stable border is not similar to the (i-1)th stable border, that is, the quadrilateral border corresponding to the target object in the preview image has changed, then in order to ensure the accuracy of the preview picture, the terminal will determine the currently determined initial stable quadrilateral border as the stable quadrilateral border corresponding to the current i-th frame preview image.
[0183] It should be noted that since the target stable quadrilateral border changes, the terminal needs to simultaneously update the (i-1)th stable quadrilateral border pre-stored for stable border comparison, and continue to use the initial stable quadrilateral border corresponding to the current i-th preview image as the reference stable quadrilateral border for the next frame, that is, the (i+1)th stable quadrilateral border when determining the stable quadrilateral border.
[0184] For example, Figure 13B Schematic diagram of the scenario for determining the stable border proposed in the embodiment of the present application Figure 2 , assuming that the dotted line is the (i-1)th stable border and the solid line is the initial stable border, such as Figure 13BAs shown, the initial stable border has a poor similarity with the (i-1)th stable border, so the terminal can update the stored (i-1)th stable border and use the initial stable border as the i-th stable border of the i-th frame image.
[0185] An embodiment of the present application provides an image display method, in which the terminal can compare the similarity between the quadrilateral border of the current latest frame and the reference stable quadrilateral border stored historically, and then perform different determinations of the current stable quadrilateral border based on different similarity results, thereby solving the problem of unstable display of the quadrilateral border in the preview screen, overcoming the defect of unsmooth display of the preview screen, and further realizing efficient image scanning.
[0186] Based on the above embodiment, in yet another embodiment of the present application, Figure 14 This is a schematic diagram of the execution flow of the image processing proposed in the embodiment of the present application, such as Figure 14 As shown, in an embodiment of the present application, the terminal first obtains a preview image (step S01), and then the terminal performs border detection on the preview image, such as quadrilateral detection processing (step S02); and the obtained quadrilateral border is first stored at the tail of the FIFO, that is, the last position of the queue (step S03).
[0187] Furthermore, the terminal may select unclassified quadrilateral bounding box samples from the quadrilateral bounding box samples in the current FIFO queue in order of entering the FIFO queue (step S03), and perform distance calculation according to the preset similarity function (step S04), and then determine whether there is a classifiable bounding box group corresponding to the unclassified quadrilateral bounding box sample in the clustered bounding box group based on the distance difference (step S05); wherein, on the one hand, if there is a bounding box group with a similar distance among the classified bounding box groups, it can be determined that the unclassified quadrilateral bounding box sample belongs to the bounding box group with a similar distance, and the quadrilateral bounding box can be directly added to the bounding box group (step S06); on the other hand, if there are multiple bounding box groups with similar distances that meet the conditions among the classified bounding box groups, the distances can be sorted and the quadrilateral bounding box can be added to the bounding box group with the closest distance; on the other hand, if there is no bounding box group with a similar distance among the classified bounding box groups, the terminal can establish a new bounding box group and add the quadrilateral bounding box to the new bounding box group (step S07).
[0188] Afterwards, the terminal can determine whether all unclassified quadrilateral bounding box samples in the FIFO sequence have completed clustering, that is, whether there are unclassified quadrilateral bounding box samples in the current FIFO queue (step S08, if it is determined that there are, then the terminal jumps to step S03 and repeats the above steps; if not, then the terminal can select a target bounding box group from at least one bounding box group obtained by clustering, such as the bounding box group with the largest number of quadrilateral bounding box samples in at least one bounding box group as the target bounding box group (step S09), and select the quadrilateral bounding box sample corresponding to the latest frame from the target bounding box group based on the time sequence to determine it as the initial stable quadrilateral bounding box (step S010).
[0189] Furthermore, the terminal can perform a distance calculation based on similarity between the initial stable quadrilateral border and the historically stored reference stable quadrilateral border (step S011). And determine whether the distance is less than a preset distance threshold (step S012). If it is less than, the terminal does not need to update the historical reference stable quadrilateral border, but directly uses the historical reference stable quadrilateral border as the target stable quadrilateral border corresponding to the current preview image and outputs it (step S013); if it is not less than, the terminal can use the initial stable quadrilateral border to update the historical reference stable quadrilateral border (step S014), and determine the currently determined new historical reference stable quadrilateral border as the target stable quadrilateral border corresponding to the current preview image and output it. Furthermore, the terminal can render the obtained stable quadrilateral border, and generate a rendered preview image based on the rendered quadrilateral border and the current preview image and display it (step S015).
[0190] Based on the above steps S01 to S015, the terminal removes abnormal frames through similarity clustering, target border group selection, and target border determination, as well as the denoising and stabilization operation of comparing with historical reference stable borders. The terminal no longer directly previews the image frame based on the detected quadrilateral border. Instead, after obtaining a stable quadrilateral border, the terminal previews the image based on the stable quadrilateral border, thereby solving the problem of unstable display of the quadrilateral border in the preview screen and overcoming the defect of unsmooth display of the preview screen.
[0191] Based on the above embodiment, in another embodiment of the present application, Figure 15 Schematic diagram of the terminal structure proposed in this application Figure 1 ,like Figure 15 As shown, the terminal 10 proposed in the embodiment of the present application may include a quadrilateral detection module 11, a timing stabilization module 12, a denoising stabilization module 13 and a preview module 14.
[0192] The quadrilateral detection module 11 is configured to obtain an i-th preview image frame corresponding to the target object; and perform border detection processing on the i-th preview image frame to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0;
[0193] The temporal stabilization module 12 is configured to perform similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group; select a target bounding box group from the at least one bounding box group; and determine an initial stable bounding box from the target bounding box group;
[0194] The denoising and stabilization module 13 is configured to determine an i-th stable bounding box based on the initial stable bounding box and the (i-1)-th stable bounding box;
[0195] The preview module 14 is configured to display the i-th preview image frame according to the i-th stable border.
[0196] Based on the above embodiment, in another embodiment of the present application, Figure 16 Schematic diagram of the terminal structure proposed in this application Figure 2 ,like Figure 16 As shown, the terminal 10 proposed in the embodiment of the present application may include an acquisition part 15, a detection part 16, a clustering part 17, a selection part 18, a determination part 19, a display part 110, and a storage part 111.
[0197] The acquisition part 15 is configured to acquire the i-th frame preview image corresponding to the target object;
[0198] The detection part 16 is configured to perform border detection processing on the i-th preview image frame to obtain the i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0;
[0199] The clustering part 17 is configured to perform similarity clustering processing based on the first quadrilateral bounding box to the i-th quadrilateral bounding box corresponding to the target object to obtain at least one bounding box group;
[0200] The selection part 18 is configured to select a target frame group from the at least one frame group;
[0201] The determining part 19 is configured to determine an initial stable frame from the target frame group; and determine an i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
[0202] The display portion 110 is configured to display the i-th frame preview image according to the i-th stable border.
[0203] Furthermore, in an embodiment of the present application, the storage part 111 is configured to store the i-th quadrilateral bounding box to the N-th bit of the FIFO after obtaining the i-th quadrilateral bounding box corresponding to the target object and before performing similarity clustering processing based on the i-th quadrilateral bounding box and obtaining at least one bounding box group; wherein N is an integer greater than 2, and N represents the maximum storage capacity of the FIFO.
[0204] Furthermore, in an embodiment of the present application, when i is less than N, the clustering part 17 is specifically configured to read the first quadrilateral border to the i-th quadrilateral border from the FIFO; and perform the similarity clustering processing based on the first quadrilateral border to the i-th quadrilateral border to obtain the at least one border group.
[0205] Furthermore, in an embodiment of the present application, when the i is greater than or equal to the N, the clustering part 17 is further specifically configured to read the (i-N+1)th quadrilateral border to the i-th quadrilateral border from the FIFO; and perform the similarity clustering processing based on the (i-N+1)th quadrilateral border to the i-th quadrilateral border to obtain the at least one border group.
[0206] Furthermore, in an embodiment of the present application, the clustering part 17 is further specifically configured to obtain the kth vertex coordinate data corresponding to the kth quadrilateral border and the first (k-1) vertex coordinate data corresponding to the first (k-1) quadrilateral border; wherein k is an integer greater than 1 and less than or equal to i; and calculate the first (k-1) distance differences corresponding to the kth vertex coordinate data and the first (k-1) vertex coordinate data according to a preset similarity function; and determine the minimum distance difference from the first (k-1) distance differences; and construct the at least one border group based on the minimum distance difference and the first historical border group corresponding to the first (k-1) quadrilateral border.
[0207] Furthermore, in an embodiment of the present application, the clustering part 17 is further specifically configured to establish a new border group corresponding to the k-th quadrilateral border if the minimum distance difference is greater than or equal to a preset distance threshold, and construct the at least one border group based on the new border group and the first historical border group; and if the minimum distance difference is less than the preset distance threshold, classify the k-th quadrilateral border into the first historical border group, and construct the at least one border group based on the first historical border group.
[0208] Further, in an embodiment of the present application, the clustering part 17 is further specifically configured to obtain the (i-N+k)th vertex coordinate data corresponding to the (i-N+k)th quadrilateral border and the first (i-N+k-1) vertex coordinate data corresponding to the first (i-N+k-1) quadrilateral border; wherein k is an integer greater than 1 and less than or equal to N; and calculate the first (i-N+k-1) distance differences corresponding to the (i-N+k)th vertex coordinate data and the first (i-N+k-1) vertex coordinate data according to a preset similarity function; and determine the minimum distance difference from the first (i-N+k-1) distance differences; and construct the at least one border group based on the minimum distance difference and the second historical border group corresponding to the first (i-N+k-1) quadrilateral border.
[0209] Furthermore, in an embodiment of the present application, the clustering part 17 is further specifically configured to obtain the i-th vertex coordinate data corresponding to the i-th quadrilateral border and the first (i-1) vertex coordinate data corresponding to the first (i-1) quadrilateral border that has been historically grouped; and calculate the (i-1) distance differences corresponding to the i-th vertex coordinate data and the first (i-1) vertex coordinate data in history according to a preset similarity function; and determine the minimum distance difference from the (i-1) distance differences; and construct the at least one border group based on the minimum distance difference and the third historical border group corresponding to the first (i-1) quadrilateral border.
[0210] Furthermore, in an embodiment of the present application, the selection part 18 is specifically configured to obtain the number of quadrilateral frames contained in each frame group in the at least one frame group; and determine the frame group corresponding to the maximum number of quadrilateral frames as the target frame group.
[0211] Furthermore, in an embodiment of the present application, the determining part 19 is specifically configured to arrange the quadrilateral borders in the target border group in chronological order to obtain a border list; and determine the last quadrilateral border in the border list as the initial stable border.
[0212] Furthermore, in an embodiment of the present application, the determining part 19 is further specifically configured to perform mean filtering on the quadrilateral frames in the target frame group to obtain an initial stable frame.
[0213] Furthermore, in an embodiment of the present application, the determination part 19 is further specifically configured to obtain the first vertex coordinate data corresponding to the initial stable bounding box and the second vertex coordinate data corresponding to the (i-1)th stable bounding box; and calculate the distance difference between the first vertex coordinate data and the second vertex coordinate data according to a preset similarity function; and if the distance difference is less than a preset distance threshold, determine the (i-1)th stable bounding box as the i-th stable bounding box; and if the distance difference is greater than or equal to the preset distance threshold, determine the initial stable bounding box as the i-th stable bounding box.
[0214] Furthermore, in an embodiment of the present application, the display portion 110 is specifically configured to perform rendering processing on the i-th stable border to obtain a rendered stable border; and generate a rendered preview image based on the rendered stable border and the i-th frame preview image; and display the rendered preview image.
[0215] In the embodiments of the present application, further, Figure 17 Schematic diagram of the terminal structure proposed in this application embodiment Figure 3 ,like Figure 17 As shown, the terminal 10 proposed in the embodiment of the present application may also include a processor 112, a memory 113 storing executable instructions of the processor 112, and further, the terminal 10 may also include a communication interface 114, and a bus 115 for connecting the processor 112, the memory 113 and the communication interface 114.
[0216] In an embodiment of the present application, the processor 112 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiment of the present application does not specifically limit this. The terminal 10 may further include a memory 113, which may be connected to the processor 112, wherein the memory 113 is used to store executable program code, which includes computer operating instructions. The memory 113 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.
[0217] In the embodiment of the present application, the bus 115 is used to connect the communication interface 114, the processor 112 and the memory 113, and to facilitate mutual communication between these devices.
[0218] In the embodiment of the present application, the memory 113 is used to store instructions and data.
[0219] Furthermore, in an embodiment of the present application, the processor 112 is configured to obtain an i-th preview image frame corresponding to a target object, and perform border detection processing on the i-th preview image frame to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0; perform similarity clustering processing based on the first quadrilateral border corresponding to the target object to the i-th quadrilateral border to obtain at least one border group; select a target border group from the at least one border group, and determine an initial stable border from the target border group; determine an i-th stable border based on the initial stable border and the (i-1)th stable border; and display the i-th preview image frame according to the i-th stable border.
[0220] In practical applications, the memory 113 may be a volatile memory, such as a random-access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 112.
[0221] In addition, the functional modules in this embodiment can be integrated into a file restoration unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional modules.
[0222] If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0223] The embodiment of the present application provides a terminal, which performs border detection processing on the current preview image containing the target object and obtains the quadrilateral border corresponding to the target object. The terminal can first perform clustering processing on the quadrilateral border based on border similarity, select a target border group from at least one obtained border group, and further determine an initial stable border from the target border group, and then further determine the current stable border based on the comparison between the initial stable border and the historical stable border, so that the current preview image will be displayed according to the current stable border. It can be seen that in the present application, the terminal no longer directly previews the image based on the quadrilateral border obtained by border detection, but performs similarity clustering, target border group selection, and initial stable border determination on the quadrilateral border obtained by detection, and performs denoising and stabilization operations such as comparison with the historical stable border to obtain the current stable quadrilateral border. Then, the image is previewed based on the stable quadrilateral border, which solves the problem of unstable display of the quadrilateral border in the preview screen and overcomes the defect of unsmooth display of the preview screen.
[0224] An embodiment of the present application provides a computer-readable storage medium having a program stored thereon, which implements the image display method described above when the program is executed by a processor.
[0225] Specifically, the program instructions corresponding to an image display method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, or a USB flash drive. When the program instructions corresponding to an image display method in the storage medium are read or executed by an electronic device, the following steps are included:
[0226] Obtaining an i-th preview image corresponding to a target object, and performing border detection on the i-th preview image to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0;
[0227] Performing similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group;
[0228] Selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group;
[0229] Determine an i-th stable bounding box based on the initial stable bounding box and the (i-1)-th stable bounding box;
[0230] Display processing is performed on the i-th frame preview image according to the i-th stable border.
[0231] The embodiment of the present application provides a chip, which includes a processor and an interface. The processor obtains program instructions through the interface, and the processor is used to execute the program instructions to implement the image display method described above. Specifically, the image display method includes the following steps:
[0232] Obtaining an i-th preview image corresponding to a target object, and performing border detection on the i-th preview image to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0;
[0233] Performing similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group;
[0234] Selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group;
[0235] Determine an i-th stable bounding box based on the initial stable bounding box and the (i-1)-th stable bounding box;
[0236] Display processing is performed on the i-th frame preview image according to the i-th stable border.
[0237] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.
[0238] The present application is described with reference to the implementation flow charts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flow charts and / or block diagrams, as well as the combination of processes and / or boxes in the flow charts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the implementation flow charts. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0239] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which is implemented in the implementation flow diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0240] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process described in the flowchart. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0241] The above description is merely a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application.
[0242] Industrial Applicability
[0243] An embodiment of the present application discloses an image display method, a terminal, and a storage medium. The method includes: obtaining an i-th preview image corresponding to a target object, and performing border detection processing on the i-th preview image to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0; performing similarity clustering processing based on the first quadrilateral border to the i-th quadrilateral border corresponding to the target object to obtain at least one border group; selecting a target border group from the at least one border group, and determining an initial stable border from the target border group; determining an i-th stable border based on the initial stable border and the (i-1)th stable border; and displaying the i-th preview image according to the i-th stable border. That is to say, in an embodiment of the present application, the terminal no longer directly previews the image based on the quadrilateral border obtained by border detection, but performs similarity clustering, target border group selection, and initial stable border determination on the quadrilateral border obtained by detection, and other abnormal frame removal operations, as well as denoising and stabilization operations by comparing with historical stable borders. After obtaining the current stable quadrilateral border, the terminal performs image preview based on the stable quadrilateral border, which solves the problem of unstable display of the quadrilateral border in the preview screen and overcomes the defect of unsmooth display of the preview screen.
Claims
1. A method for displaying an image, comprising: Obtaining an i-th preview image corresponding to a target object, and performing border detection on the i-th preview image to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0; Performing similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group; Selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group; Determine an i-th stable bounding box based on the initial stable bounding box and the i-1-th stable bounding box; Display processing is performed on the i-th frame preview image according to the i-th stable border.
2. The method according to claim 1, wherein After obtaining the i-th quadrilateral bounding box corresponding to the target object and before performing similarity clustering processing based on the i-th quadrilateral bounding box and obtaining at least one bounding box group, the method further includes: The i-th quadrilateral border is stored in the N-th position of a first-in-first-out queue FIFO; wherein N is an integer greater than 2, and the N represents the maximum storage capacity of the FIFO.
3. The method according to claim 2, wherein: When i is less than N, performing similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group includes: Read the first quadrilateral frame to the i-th quadrilateral frame from the FIFO; The similarity clustering process is performed based on the first quadrilateral frame to the i-th quadrilateral frame to obtain the at least one frame group.
4. The method according to claim 2, wherein: When i is greater than or equal to N, performing similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group includes: Read the (i-N+1)th quadrilateral frame to the (i)th quadrilateral frame from the FIFO; The similarity clustering process is performed based on the (i-N+1)th quadrilateral frame to the (i)th quadrilateral frame to obtain the at least one frame group.
5. The method according to claim 3, wherein The performing the similarity clustering process based on the first quadrilateral frame to the i-th quadrilateral frame to obtain the at least one frame group includes: Get the coordinate data of the kth vertex corresponding to the kth quadrilateral border, and the coordinate data of the first k-1 vertices corresponding to the first k-1 quadrilateral borders; where k is an integer greater than 1 and less than or equal to i; Calculating the first k-1 distance differences between the k-th vertex coordinate data and the first k-1 vertex coordinate data according to a preset similarity function; Determine the minimum distance difference from the first k-1 distance differences; The at least one frame group is constructed based on the minimum distance difference and the first historical frame groups corresponding to the first k-1 quadrilateral frames.
6. The method according to claim 5, characterized in that The constructing the at least one frame group based on the minimum distance difference and the first historical frame group corresponding to the first k-1 quadrilateral frames includes: If the minimum distance difference is greater than or equal to a preset distance threshold, establishing a new border group corresponding to the k-th quadrilateral border, and constructing the at least one border group based on the new border group and the first historical border group; If the minimum distance difference is less than a preset distance threshold, the k-th quadrilateral frame is classified into the first historical frame group, and the at least one frame group is constructed based on the first historical frame group.
7. The method according to claim 4, characterized in that The performing the similarity clustering process based on the (i-N+1)th quadrilateral frame to the (i)th quadrilateral frame to obtain the at least one frame group includes: Obtain the coordinate data of the i-N+kth vertex corresponding to the i-N+kth quadrilateral frame, and the coordinate data of the first i-N+k-1 vertices corresponding to the first i-N+k-1 quadrilateral frames; wherein k is an integer greater than 1 and less than or equal to N; Calculate the first i-N+k-1 distance differences corresponding to the i-N+k-th vertex coordinate data and the first i-N+k-1 vertex coordinate data according to a preset similarity function; Determine the minimum distance difference from the first i-N+k-1 distance differences; The at least one frame group is constructed based on the minimum distance difference and the second historical frame groups corresponding to the first i-N+k-1 quadrilateral frames.
8. The method according to claim 1, wherein The performing similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group includes: Obtain the coordinate data of the i-th vertex corresponding to the i-th quadrilateral bounding box and the coordinate data of the first i-1 vertices corresponding to the first i-1 quadrilateral bounding boxes that have been grouped historically; Calculate the i-1 distance differences between the i-th vertex coordinate data and the i-1 previous vertex coordinate data according to a preset similarity function; Determine the minimum distance difference from the i-1 distance differences; The at least one frame group is constructed based on the minimum distance difference and a third historical frame group corresponding to the first i-1 quadrilateral frames.
9. The method according to claim 1, characterized in that The selecting a target frame group from the at least one frame group includes: Obtaining the number of quadrilateral frames contained in each frame group in the at least one frame group; The frame group corresponding to the maximum number of quadrilateral frames is determined as the target frame group.
10. The method according to claim 1, wherein The determining of an initial stable frame from the target frame group includes: Arranging the quadrilateral frames in the target frame group in chronological order to obtain a frame list; The last quadrilateral border in the border list is determined as the initial stable border.
11. The method according to claim 1, wherein The selecting an initial stable frame from the target frame group includes: Perform mean filtering on the quadrilateral frames in the target frame group to obtain an initial stable frame.
12. The method according to claim 1, wherein The determining the i-th stable bounding box based on the initial stable bounding box and the i-1-th stable bounding box includes: Obtaining first vertex coordinate data corresponding to the initial stable border and second vertex coordinate data corresponding to the (i-1)th stable border; Calculating the distance difference between the first vertex coordinate data and the second vertex coordinate data according to a preset similarity function; If the distance difference is less than a preset distance threshold, determining the (i-1)th stable bounding box as the (i)th stable bounding box; If the distance difference is greater than or equal to the preset distance threshold, the initial stable bounding box is determined as the i-th stable bounding box.
13. The method according to claim 1, wherein The display processing of the i-th frame preview image according to the i-th stable border includes: Rendering the i-th stable border to obtain a rendered stable border; Generate a rendered preview image based on the rendered stable border and the i-th frame preview image; The rendered preview image is displayed.
14. A terminal, comprising: Acquisition part, detection part, clustering part, selection part, determination part and display part, The acquisition part is configured to acquire the i-th frame preview image corresponding to the target object; The detection part is configured to perform border detection processing on the i-th preview image frame to obtain the i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0; The clustering part is configured to perform similarity clustering processing based on the first quadrilateral bounding box to the i-th quadrilateral bounding box corresponding to the target object to obtain at least one bounding box group; The selection part is configured to select a target frame group from the at least one frame group; The determining part is configured to determine an initial stable frame from the target frame group; and determine an i-th stable frame based on the initial stable frame and the i-1-th stable frame; The display part is configured to display the i-th frame preview image according to the i-th stable border.
15. A terminal, comprising: Quadrilateral detection module, timing stabilization module, denoising stabilization module and preview module, The quadrilateral detection module is configured to obtain an i-th preview image frame corresponding to the target object; and perform border detection processing on the i-th preview image frame to obtain an i-th quadrilateral border corresponding to the target object; wherein i is an integer greater than 0; The temporal stabilization module is configured to perform similarity clustering processing based on the first quadrilateral bounding box corresponding to the target object to the i-th quadrilateral bounding box to obtain at least one bounding box group; select a target bounding box group from the at least one bounding box group; and determine an initial stable bounding box from the target bounding box group; The denoising and stabilization module is configured to determine an i-th stable bounding box based on the initial stable bounding box and the i-1-th stable bounding box; The preview module is configured to display the i-th frame preview image according to the i-th stable border.
16. A terminal comprising a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, a preview module, a processor, and a memory storing instructions executable by the processor, wherein when the instructions are executed by the processor, the method according to any one of claims 1 to 13 is implemented.
17. A chip, characterized in that: The chip includes a processor and an interface, the processor obtains program instructions through the interface, and the processor is used to run the program instructions to execute the method according to any one of claims 1-13.
18. A computer-readable storage medium storing a program, applied to a terminal, wherein when the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Certificate scanning method, apparatus and device, and storage medium
CN111464716A
Face detection, augmentation, spatial cueing and clutter reduction for the visually impaired
US20170017831A1