WO2022170554A1 - Image display method, terminal, chip and storage medium - Google Patents

Image display method, terminal, chip and storage medium Download PDF

Info

Publication number
WO2022170554A1
WO2022170554A1 PCT/CN2021/076494 CN2021076494W WO2022170554A1 WO 2022170554 A1 WO2022170554 A1 WO 2022170554A1 CN 2021076494 W CN2021076494 W CN 2021076494W WO 2022170554 A1 WO2022170554 A1 WO 2022170554A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
quadrilateral
group
stable
terminal
Prior art date
Application number
PCT/CN2021/076494
Other languages
French (fr)
Chinese (zh)
Inventor
顾磊
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2021/076494 priority Critical patent/WO2022170554A1/en
Priority to CN202180084568.4A priority patent/CN116686281A/en
Publication of WO2022170554A1 publication Critical patent/WO2022170554A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/04Scanning arrangements, i.e. arrangements for the displacement of active reading or reproducing elements relative to the original or reproducing medium, or vice versa

Definitions

  • the present invention relates to the technical field of image processing, and in particular, to an image display method, a terminal and a storage medium.
  • the related art proposes a document image scanning technology based on photos, which can realize automatic identification of information by scanning photos.
  • the scanning technology relies on the quadrilateral detection method of the image.
  • the terminal Before using scanning for information identification, the terminal needs to use the detection method to find the quadrilateral frame containing the target object from the captured image, and then preview the currently captured image in real time and search for The obtained quadrilateral frame, so as to further realize the information acquisition of the target object in the quadrilateral frame.
  • the embodiments of the present application provide an image display method, a terminal, a chip and a storage medium, which solve the problem of unstable display of a quadrangle frame in a preview picture, and overcome the defect that the preview picture is not displayed smoothly.
  • an embodiment of the present application provides an image display method, the method includes:
  • an embodiment of the present application provides a terminal, the terminal includes: an acquisition part, a detection part, a clustering part, a selection part, a determination part, and a 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 frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
  • the clustering part is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame 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 perform display processing on the i-th frame preview image according to the i-th stable frame.
  • an embodiment of the present application provides a terminal, where the terminal includes: a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, and a preview module,
  • the quadrilateral detection module is configured to obtain the i-th frame preview image corresponding to the target object; and perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object;
  • the i is an integer greater than 0;
  • the timing stabilization module is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group; and from the at least one frame group Selecting a target frame group; and determining an initial stable frame from the target frame group;
  • the denoising stabilization module is configured to determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
  • the preview module is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
  • an embodiment of the present application provides a terminal, where the terminal includes a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, a preview module, a processor, and a memory storing executable instructions of the processor.
  • the terminal includes a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, a preview module, a processor, and a memory storing executable instructions of the processor.
  • an embodiment of the present application provides a chip, wherein the chip 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 perform the image display method as described above.
  • an embodiment of the present application provides a computer-readable storage medium on which a program is stored and applied in a terminal.
  • the program is executed by a processor, the above-described image display method is implemented.
  • the embodiments of the present application provide an image display method, a terminal, a chip, and a storage medium.
  • the terminal acquires the ith frame preview image corresponding to the target object, and performs frame detection processing on the ith frame preview image to obtain the ith frame preview image corresponding to the target object.
  • i is an integer greater than 0; perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group; select the target from at least one frame group frame group, and determine the initial stable frame from the target frame group; determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame; display the i-th frame preview image according to the i-th stable frame . That is to say, in the embodiment of the present application, after performing frame detection processing on the current preview image containing the target object to obtain a quadrilateral frame corresponding to the target object, the terminal may first perform clustering based on frame similarity on the quadrilateral frame.
  • the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering on the quadrilateral frame obtained by detection, selection of the target frame group, and determination of the initial stable frame, etc.
  • the screen display is not smooth defect.
  • FIG. 1 is a schematic diagram 1 of an implementation flow of an image display method proposed by an embodiment of the present application
  • FIG. 2 is a second implementation flowchart of the image display method proposed by the embodiment of the present application.
  • FIG. 3 is a schematic diagram of a curve of a frame group smoothing filtering proposed by an embodiment of the present application
  • FIG. 4 is a schematic diagram 3 of the implementation flow of the image display method proposed by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of a scene of initial stable frame smoothing filtering proposed by an embodiment of the present application.
  • FIG. 6 is a fourth schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application.
  • FIG. 7 is a schematic diagram five of the implementation flow of the image display method proposed by the embodiment of the present application.
  • FIG. 8 is a sixth schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application.
  • FIG. 9 is a seventh schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application.
  • FIG. 10 is a schematic diagram eight of the implementation flow of the image display method proposed by the embodiment of the present application.
  • FIG. 11 is a schematic diagram 9 of the implementation flow of the image display method proposed by the embodiment of the present application.
  • FIG. 12 is a schematic diagram ten of the implementation flow of the image display method proposed by the embodiment of the present application.
  • FIG. 13A is a schematic diagram 1 of a scene for determining a target stable frame according to an embodiment of the present application
  • FIG. 13B is a second schematic diagram of a scene for determining a target stable frame proposed by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of an execution flow of image processing proposed by an embodiment of the present application.
  • FIG. 15 is a schematic diagram 1 of the composition structure of a terminal proposed by an embodiment of the present application.
  • FIG. 16 is a second schematic diagram of the composition and structure of a terminal according to an embodiment of the present application.
  • FIG. 17 is a third schematic diagram of the composition and structure of a terminal according to an embodiment of the present application.
  • the scanning technology relies on the quadrilateral detection method of the image.
  • the terminal can use the detection method to first find the quadrilateral frame containing the target object from the captured image, and then preview the currently captured image and the found quadrilateral frame in real time, so as to finally realize the Obtain information about the target object in the quadrilateral frame.
  • the field adopts a direct time series filtering method, such as Kalman filtering, mean filtering, etc., to reduce the negative influence of unstable quadrilateral display.
  • a direct time series filtering method such as Kalman filtering, mean filtering, etc.
  • the embodiments of the present application provide an image display method, a terminal, a chip and a storage medium. Specifically, after performing frame detection processing on the current preview image containing the target object to obtain a quadrilateral frame corresponding to the target object, the terminal may first perform clustering processing based on frame similarity on the quadrilateral frame, and obtain at least one frame from the obtained at least one frame.
  • the target frame group is selected from the group, and the initial stable frame is further determined from the target frame group, and the current stable frame is further determined based on the comparison between the initial stable frame and the historical stable frame, so that the current preview image will be adjusted according to the current stable frame Perform display processing.
  • the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering on the quadrilateral frame obtained by detection, selection of the target frame group, and determination of the initial stable frame, etc.
  • the screen display is not smooth defect.
  • FIG. 1 is a schematic diagram 1 of the implementation flow of the image display method proposed by the embodiment of the present application.
  • the method for performing image processing by a terminal may include the following steps:
  • Step 101 Obtain the ith frame preview image corresponding to the target object, and perform frame detection processing on the ith frame preview image to obtain the ith quadrilateral frame corresponding to the target object; wherein, i is an integer greater than 0.
  • the terminal may acquire a preview image including the target object in real time, that is, the i-th frame preview image, and perform frame detection processing on the i-th frame preview image to obtain the real-time quadrilateral frame corresponding to the target object, That is, the i-th quadrilateral border.
  • the terminal may be any electronic device with a text scanning function.
  • the terminal may have a camera, and image frames are collected through the camera.
  • the terminal is not limited to electronic devices such as a smart phone, a tablet computer, a personal computer (Personal Computer, PC), and a notebook computer.
  • electronic devices such as a smart phone, a tablet computer, a personal computer (Personal Computer, PC), and a notebook computer.
  • the ith frame preview image refers to a frame preview image of the document picture collected by the terminal at the ith moment when the terminal captures the document picture through the camera.
  • the target object refers to the target object specified in the preview image, such as a rectangular object whose frame is a rectangle.
  • a document picture may include documents, paper, business cards, photos, whiteboards, screens, etc.
  • the target objects may be various rectangles such as person photos, ID cards, passports, driver's licenses, tickets, business cards, work cards, etc. in the document picture object.
  • the terminal may perform frame detection processing on the preview image, such as quadrilateral detection, to acquire the quadrilateral corresponding to the target object frame.
  • the terminal may determine the contour of the rectangular object by using the method of feature line detection, that is, the quadrilateral frame.
  • the terminal may also establish a quadrilateral detection model based on deep learning, and after obtaining the preview image in real time, input the preview image into the pre-trained model to perform quadrilateral detection processing on the image frame to be detected, and then output the quadrilateral frame.
  • a quadrilateral detection model based on deep learning
  • the terminal may further The clustering processing based on the similarity of the border is performed based on the quadrilateral border.
  • Step 102 Perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group.
  • the terminal may further perform similarity clustering processing based on the first quadrilateral frame to the i-th quadrilateral frame, and then obtain at least one Set of borders.
  • the clustering process is unsupervised machine learning to group similar objects into groups.
  • the terminal may perform clustering on the quadrilateral borders based on the similarity of the borders, and classify the quadrilateral borders with high similarity into one category.
  • the terminal may obtain vertex coordinate data corresponding to the quadrilateral frame, and perform similarity calculation based on the vertex coordinate data, so as to realize the classification of the quadrilateral frame based on the similarity result.
  • 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.
  • the terminal may further perform the clustering process based on the at least one border group based on the at least one border group. Carry out the selection process of the target frame group.
  • Step 103 Select a target frame group from at least one frame group, and determine an initial stable frame from the target frame group.
  • the terminal may first select a frame group from the at least one frame group as a target frame group (step 103a), and then select one frame group from the at least one frame group as a target frame group (step 103a).
  • One frame in the frame group is determined as the initial stable frame (step 103b).
  • the number of quadrilateral frame samples in each frame group may be different.
  • the terminal may select a relatively stable frame group from the at least one frame group as a sample of the quadrilateral frame as Target border group.
  • FIG. 2 is a second implementation flowchart of the image display method proposed by the embodiment of the application.
  • the method for the terminal to select a target frame group from at least one frame group includes the following steps:
  • Step 103a1 Acquire the number of quadrilateral frames included in each frame group in at least one frame group.
  • Step 103a2 Determine the frame group corresponding to the maximum number of quadrilateral frames as the target frame group.
  • the terminal may directly determine a frame group in at least one frame group with a maximum number of quadrilateral frame samples as a target frame group.
  • the terminal may first perform a certain smoothing filtering process on each frame group, such as mean filtering, so as to reduce the jump when selecting the target frame group.
  • the terminal can track each frame group in time sequence, perform smooth 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 the filtered at least one frame group as a frame group.
  • Target border group a frame group with the largest number of quadrilateral frame samples from the filtered at least one frame group.
  • FIG. 3 is a schematic diagram of a curve for smoothing filtering of a frame group proposed by an embodiment of the present application.
  • the abscissa of the schematic diagram of the curve indicates different time sequences, and the ordinate indicates the change in the number of samples in the frame group;
  • the thick solid line represents the curve of the number of quadrilateral frame samples in the original frame group 1
  • the thin solid line represents the curve of the number of quadrilateral frame samples in the original frame group 2
  • the thick dashed line represents the curve of the number of quadrilateral frame samples in the filtered frame group 1
  • the thin dotted line represents the curve of the number of quadrilateral frame samples in frame group 2 after filtering.
  • the number of quadrilaterals in the original frame group 2 is greater than the number of quadrilaterals in the original frame group 1 for a period of time.
  • the target frame group cannot be accurately selected.
  • the terminal performs smooth filtering.
  • the number of quadrilaterals in frame group 2 is always greater than the number of quadrilaterals in frame group 1 after filtering.
  • the target frame group Determined as border group 2.
  • the number of quadrilateral samples in the filtered frame group 1 is always greater than that of the filtered frame group 2.
  • the terminal can select frame group 1 as the target frame group; During the time period from t2 to t3, after smooth filtering, the number of quadrilateral samples in filtered frame group 2 is always greater than that of filtered frame group 1. At this time, the terminal can select frame group 2 as the target frame group.
  • the terminal may further determine a frame from the target frame group as an initial stable frame.
  • FIG. 4 is a schematic diagram 3 of the implementation flow of the image display method proposed by the embodiment of the present application.
  • the terminal determines the initial stable frame (step 103b ) from the target frame group.
  • the method includes the following steps:
  • Step 103b1 arranging the quadrilateral frames in the target frame group in a chronological order to obtain a frame list.
  • Step 103b2 Determine the last quadrilateral frame in the frame list as the initial stable frame.
  • the terminal can All quadrilateral borders in the border group are arranged and processed in the order of time from first to last to obtain a border time series list. Further, the terminal may 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.
  • the terminal may also perform mean filtering processing on all quadrilateral frames in the target frame group, such as Kalman filtering, and the filtered object is the quadrilateral frame vertex coordinate data or the center point coordinate data, Then the initial stable frame is obtained.
  • mean filtering processing on all quadrilateral frames in the target frame group, such as Kalman filtering, and the filtered object is the quadrilateral frame vertex coordinate data or the center point coordinate data, Then the initial stable frame is obtained.
  • FIG. 5 is a schematic diagram of the initial stable frame smoothing filtering proposed by the embodiment of the present application. It is assumed that the target frame group includes a quadrilateral frame A, a quadrilateral frame B, and a quadrilateral frame C, as shown in FIG. 5 , although three Frames A, B, and C belong to a frame group and are similar frames, but there is actually a gap between the three frames, and the vertex coordinate data and the center point coordinate data are different. Therefore, the terminal can perform mean filtering on the three frames in chronological order. Thus, a more stable quadrilateral frame D is obtained, and its frame D is determined as the initial stable frame.
  • the terminal may further perform the determination process of the target stable frame.
  • Step 104 Determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame.
  • the terminal may further base on the initial stable frame and the historical stable reference frame, namely the first stable frame.
  • the (i-1) stable borders further determine the quadrilateral border for final preview output, that is, the i-th stable border.
  • the (i-1)th stable frame refers to the stable frame of the final output preview of the previous preview image.
  • the terminal After the terminal performs the processing procedures such as similarity clustering processing, target frame group selection, initial stable frame determination, and stable frame determination corresponding to the preview image of each frame, the terminal will process the stable frame information corresponding to the preview image of the current frame. It is stored and used as the historical reference stable frame when the next frame preview image is determined to be stable frame.
  • the processing procedures such as similarity clustering processing, target frame group selection, initial stable frame determination, and stable frame determination corresponding to the preview image of each frame.
  • the terminal in order to reduce the jitter of the quadrilateral frame when the preview interface is displayed, the terminal will not directly determine the currently obtained initial stable frame as the i-th stable frame corresponding to the current i-th frame preview image, Instead, the similarity is compared between the currently obtained initial stable frame and the pre-stored historical (i-1) stable frame, and then the i-th stable frame for final output preview is determined based on the comparison result.
  • the terminal may further perform display processing on the i-th preview image according to the stable frame.
  • Step 105 Perform display processing on the ith preview image according to the ith stable frame.
  • the terminal may further perform display processing on the i-th preview image according to the stable frame.
  • the terminal may perform rendering processing on the ith preview image based on the ith stable frame, obtain a rendered preview image, and then display the rendered preview image.
  • the terminal renders the i-th stable frame in the i-th preview image, obtains a post-rendering stable frame, and then generates a post-rendering preview image based on the post-rendering stable frame and the i-th preview image, so as to display it on the preview screen. Preview image after this rendering.
  • the terminal may perform real-time scanning processing on the rendered preview image, so as to obtain specific parameters of the target object. Specifically, the terminal may only perform real-time scanning processing on the target object in the target stable frame, so as to perform automatic information identification.
  • An embodiment of the present application provides an image display method. After performing frame detection processing on a current preview image containing a target object and obtaining a quadrilateral frame corresponding to the target object, the terminal may first perform clustering based on frame similarity on the quadrilateral frame. process, and select a target frame group from the obtained at least one frame group, and further determine an initial stable frame from the target frame group, and then further determine the current stable frame based on the comparison between the initial stable frame and the historical stable frame, so that The current preview image will be displayed according to the current stable frame.
  • the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering on the quadrilateral frame obtained by detection, selection of the target frame group, and determination of the initial stable frame, etc.
  • the screen display is not smooth defect.
  • FIG. 6 is a fourth schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application.
  • the terminal performs frame detection processing on the i-th frame preview image , after the i-th quadrilateral frame corresponding to the target object is obtained, that is, after step 101, and based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame, similarity clustering processing is performed, and before at least one frame group is obtained, that is, Before step 102, the method for the terminal to perform image processing includes:
  • Step 106 Store the i-th quadrilateral frame in the N-th position of a first-in-first-out queue (First Input First Output, FIFO); wherein, N is an integer greater than 2, and N represents the maximum storage capacity of the FIFO.
  • FIFO First Input First Output
  • the terminal performs quadrilateral detection processing on each frame of preview image, and after obtaining each quadrilateral frame, it will first store the quadrilateral frame corresponding to the current preview image in the FIFO queue. The tail, the last bit of the queue.
  • the number of FIFO queues is determined by its maximum storage capacity, that is, the maximum storage capacity is, and how many image frames can be stored in the FIFO queue. If it is assumed that there are N bits in the current FIFO queue, the maximum storage number representing the FIFO queue is N.
  • the FIFO follows the "first-in, first-out" principle.
  • the terminal always stores the i-th quadrilateral frame obtained by detecting the current i-th frame preview image to the tail of the FIFO queue, that is, the N-th position.
  • the historical quadrilateral frame obtained by the historical preview image detection is shifted forward in sequence in the FIFO queue; the historical quadrilateral frame originally located at the first position in the FIFO queue will be moved out of the queue, and the (i-1) The history quad border will be shifted to the (N-1)th bit.
  • FIG. 7 is a schematic diagram 5 of the implementation flow of the image display method proposed in the embodiment of the present application.
  • the terminal stores the i-th quadrilateral frame to the first-in-first-out order.
  • the terminal After dequeuing the Nth bit of the FIFO, that is, after step 106, if i is less than N, then the terminal performs similarity clustering processing based on the first quadrilateral border corresponding to the target object to the i-th quadrilateral border, and obtains at least one border group.
  • the method includes the following steps:
  • Step 102a Read the first quadrilateral frame to the i-th quadrilateral frame from the FIFO.
  • 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.
  • the number of quadrilateral borders stored in the FIFO is associated with the maximum storage number N of the FIFO queue.
  • the FIFO queue contains the first to i-th quadrilateral frames, that is, the FIFO queue space It's big enough that there's no quad bezel that's been removed.
  • the terminal may read the first to i-th quadrilateral frames corresponding to the preview images from the first frame to the i-th frame from the FIFO queue, and perform clustering processing based on frame similarity based on the i quadrilateral frames.
  • FIG. 8 is a schematic diagram 6 of the implementation process of the image display method proposed by the embodiment of the present application.
  • the terminal performs similarity clustering processing based on the first quadrilateral frame to the i-th quadrilateral frame, and obtains at least one
  • the methods of the border group include:
  • Step 102b1 obtain the kth vertex coordinate data corresponding to the kth quadrilateral frame, and the first (k-1) vertex coordinate data corresponding to the first (k-1) quadrilateral frame; wherein, k is greater than 1 and less than or an integer equal to i.
  • Step 102b2 Calculate the first (k-1) distance differences corresponding to the kth vertex coordinate data and the previous (k-1) vertex coordinate data according to the preset similarity function.
  • Step 102b3 Determine the minimum distance difference from the previous (k-1) distance differences.
  • Step 102b4 Construct at least one border group based on the minimum distance difference and the first historical border group corresponding to the first (k-1) quadrilateral borders.
  • the terminal first performs the clustering processing of the first quadrilateral frame from the first to the i-th quadrilateral frame in the FIFO queue, because the first quadrilateral frame does not exist before Any quadrilateral frame sample that has been clustered, that is, without any frame group, at this time, the terminal can first create a new frame group for the first quadrilateral frame.
  • the terminal when performing the clustering processing of the second quadrilateral frame in the FIFO queue, that is, when k is equal to 2, the terminal can first compare the similarity between the second quadrilateral frame and the clustered first quadrilateral frame, Determines the border group to which the second quadrilateral border belongs based on the comparison result.
  • the terminal may obtain the vertex coordinate data of the second quadrilateral frame and the vertex coordinate data of the first quadrilateral frame respectively, and then calculate the distance difference that can characterize the similarity based on the preset similarity function and the two vertex coordinate data.
  • the terminal may calculate the distance difference based on formula (1) to formula (3) to determine the similarity of the quadrilateral frame.
  • the quadrilateral information Q is the coordinate positions of the four vertices of each quadrilateral frame.
  • the preset similarity function is to obtain the distance difference between the two quadrilaterals.
  • p is the spatial norm of L p . More commonly, when p is 1, it is the Manhattan distance, when p is 2, it is the Euclidean distance, and when p is ⁇ , the maximum absolute value is calculated.
  • M(Q) is a mapping function of quadrilateral information, which is used to map the original quadrilateral information Q to the space of distance calculation.
  • k i (Q) is a specific mapping function. E.g, That is, the center point position, area, etc. of the quadrilateral are calculated as mapping items.
  • the terminal can first compare the two quadrilaterals based on the formula (1) and formula (3) in the preset similarity function, as well as the vertex coordinate data of the first quadrilateral frame and the vertex coordinate data of the second quadrilateral frame.
  • the borders are mapped to the distance space respectively, the corresponding distances of the two quadrilateral borders are obtained, and then the distance difference is calculated based on formula (3) to determine the similarity comparison result between the first quadrilateral border and the second quadrilateral border.
  • the terminal may preset a preset distance threshold that can characterize the similarity result, and the terminal may compare the above-mentioned distance difference with the preset distance threshold, and then determine the first quadrilateral frame and the second quadrilateral frame based on the comparison result. similarity results.
  • 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 as the frame group to which the first quadrilateral frame belongs . If the distance difference is greater than or equal to the above preset distance threshold, the terminal can determine that the first quadrilateral frame is not similar to the second quadrilateral frame, then the terminal re-establishes a new frame group, and classifies the second quadrilateral frame as The new border group.
  • the terminal can calculate the difference between the kth quadrilateral frame and the first (k-1) quadrilateral frame. (k-1) distance difference, and determine the minimum difference from the (k-1) distance differences, and then construct at least one border based on the border group corresponding to the first (k-1) quadrilateral borders based on the minimum difference Group.
  • the terminal may create a new frame group corresponding to the kth quadrilateral frame, and build at least one frame group based on the newly-added frame group and the first historical frame group.
  • the terminal can classify the k-th quadrilateral frame into the frame group corresponding to the first (k-1) quadrilateral frames and the target frame group corresponding to the minimum distance difference, and construct the frame group based on the updated sample number of the quadrilateral frame. At least one border group.
  • the terminal uses formula (1) to formula (3) to calculate the third quadrilateral frame and the first quadrilateral frame, The distance difference of the second quad border. If the distance difference between the third quadrilateral and the first quadrilateral frame is less than the preset distance threshold, and the distance difference between the third quadrilateral and the second quadrilateral frame is greater than the preset distance threshold, the terminal may determine that the third quadrilateral frame is classified as 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 from the second quadrilateral border is also less than the preset distance threshold, but Then the terminal classifies the third quadrilateral frame into the frame group to which the first quadrilateral frame with a smaller distance difference belongs; if the distance difference is greater than the preset distance threshold, the terminal re-establis
  • FIG. 9 is a seventh schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application.
  • the terminal stores the i-th quadrilateral frame in the FIFO.
  • the terminal After the Nth bit, 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 frame corresponding to the target object to the i-th quadrilateral frame, and the method for obtaining at least one frame group is also The following steps can be included:
  • Step 102c Read the (i-N+1)th quadrilateral frame to the i-th quadrilateral frame from the FIFO.
  • Step 102d Perform similarity clustering processing based on the (i-N+1)th quadrilateral frame to the ith quadrilateral frame to obtain at least one frame group.
  • the FIFO queue contains (i-N+1)-th to i-th quadrilateral frames at this time. , that is, there is not enough space in the FIFO queue, and the first (i-N+2) quadrilateral borders have been removed from the FIFO queue.
  • the terminal can read the (i-N+1)th to the ith four-deformed frame corresponding to the (i-N+1)th frame to the i-th frame preview image from the FIFO queue, and perform a frame-based similarity calculation. degree of clustering.
  • FIG. 10 is a schematic diagram 8 of the implementation process of the image display method proposed by the embodiment of the present application.
  • the terminal performs similarity aggregation based on the (i-N+1)th quadrilateral frame to the ith quadrilateral frame.
  • Class processing, the methods for obtaining at least one border group include:
  • Step 102d1 obtain the (i-N+k)th vertex coordinate data corresponding to the (i-N+k)th quadrilateral frame, and the first (i-N+k-1) quadrilateral frame corresponding to the previous (i- N+k-1) vertex coordinate data; wherein, k is an integer greater than 1 and less than or equal to N.
  • Step 102d2 calculate the first (i-N+k-1) corresponding to the (i-N+k)th vertex coordinate data and the previous (i-N+k-1) vertex coordinate data according to the preset similarity function distance difference.
  • Step 102d3 Determine the minimum distance difference from the previous (i-N+k-1) distance differences.
  • Step 102d4 Construct 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 borders.
  • the terminal always performs clustering processing only on all the quadrilateral frames currently existing in the FIFO sequence, and does not save the clustering results of the quadrilateral frames in the historical FIFO sequence.
  • the terminal first performs aggregation of the (i-N+1)th to the i-th quadrilateral frame and the (i-N+1)th quadrilateral frame in the FIFO queue.
  • Class processing since there is no quadrilateral frame sample that has completed clustering before the (i-N+1)th quadrilateral frame, that is, there is no frame group, at this time, the terminal can be the (i-N+1)th first.
  • the quad border creates a new border group.
  • the terminal when performing the clustering processing of the (i-N+2)th quadrilateral frame in the FIFO queue, that is, when k is equal to 2, the terminal can first perform clustering on the (i-N+2)th quadrilateral frame and the The similarity of the (i-N+1)th quadrilateral frame of the class is compared, and the frame group to which the (i-N+2)th quadrilateral frame belongs is determined based on the comparison result.
  • the terminal can obtain the vertex coordinate data of the (i-N+2)th quadrilateral frame and the vertex coordinate data of the (i-N+1)th quadrilateral frame respectively, and then can obtain the vertex coordinate data based on formula (1) to formula (3) ) Calculate the distance difference, and compare it with the preset distance threshold that characterizes the similarity result, if the distance difference is less than or equal to the above-mentioned preset distance threshold, then the terminal can determine the (i-N+1)th quadrilateral border and the first The (i-N+2) quadrilateral frames are similar, then the terminal determines that the (i-N+2) th quadrilateral frame is classified as the frame group to which the (i-N+1) th quadrilateral frame belongs.
  • the terminal can determine that the (i-N+1)th quadrilateral frame is not similar to the (i-N+2)th quadrilateral frame, then the terminal re-establishes a new frame group, And classify the (i-N+2)th quadrilateral frame into the new frame group.
  • the terminal can calculate the (i-N+ The (i-N+k-1) distance difference between k) quadrilateral borders and the previous (i-N+k-1) quadrilateral borders, and from these (i-N+k-1) distance differences The minimum difference value is determined, and then at least one frame group is constructed based on the frame group corresponding to the minimum difference value and the first (i-N+k-1) quadrilateral frames.
  • the terminal can establish a new border group corresponding to the (i-N+k)th quadrilateral border, and based on the new border group and the A historical border group constructs at least one border group.
  • the terminal can classify the (i-N+k) th quadrilateral frame as the one corresponding to the first (i-N+k-1) quadrilateral frame.
  • the target frame group corresponding to the minimum distance difference, and at least one frame group is constructed based on the frame group after the number of quadrilateral frame samples is updated.
  • the terminal uses formula (1) to formula (3) to calculate the (i-N+3th) based on the vertex coordinate data. ), the distance difference between the quadrilateral frame and the (i-N+1) th quadrilateral frame and the (i-N+2) th quadrilateral frame, respectively.
  • the terminal can determine the (i-N+3)th quadrilateral frame classification and the frame group to which the (i-N+1)th quadrilateral frame belongs; if the (i-N+3)th quadrilateral frame belongs to the frame group; The distance difference between the quadrilateral and the (i-N+1)th quadrilateral border is less than the preset distance threshold, and the distance difference with the (i-N+2)th quadrilateral border is also smaller than the preset distance threshold, but then the terminal Classify the (i-N+3)th quadrilateral frame into the frame group to which the (i-N+1)th quadrilateral frame with a smaller distance difference belongs; if the distance difference is greater than the preset distance threshold, the terminal restarts Create a border
  • FIG. 11 is a schematic diagram 9 of the implementation flow of the image display method proposed by the embodiment of the present application.
  • the terminal based on the first image display method corresponding to the target object may further include the following steps:
  • Step 102e Obtain the i-th vertex coordinate data corresponding to the i-th quadrilateral frame, and the first (i-1) vertex coordinate data corresponding to the previous (i-1) quadrilateral frames that have been grouped in history.
  • Step 102f Calculate (i-1) distance differences corresponding to the i-th vertex coordinate data and the previous (i-1) vertex coordinate data according to the preset similarity function.
  • Step 102g Determine the minimum distance difference from the (i-1) distance differences.
  • Step 102h construct at least one border group based on the minimum distance difference and the third historical border group corresponding to the first (i-1) quadrilateral borders.
  • the terminal does not need to store the quadrilateral frame obtained by the detection in the FIFO queue, but directly completes the classification of the latest frame obtained by the detection, that is, the i-th quadrilateral frame corresponding to the current i-th preview image and the classified frame.
  • the similarity of the quadrilateral border samples is compared, and the clustering of quadrilateral borders is carried out.
  • the terminal can use formula (1) to formula (3) to calculate the distance difference between the i-th quadrilateral frame and the previous (i-1) quadrilateral frame in the history, and the distance difference between each historical quadrilateral frame, that is, (i-1 ) distance difference, and compare the distance difference with the preset distance threshold, so as to determine the frame similarity result according to the comparison result, and realize the clustering of the quadrilateral frame.
  • 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 a historical frame group corresponding to the previous (i-1) quadrilateral frames.
  • the terminal may establish a new frame group corresponding to the i-th quadrilateral frame, and build at least one frame group based on the newly added frame group and the first historical frame group.
  • the terminal can classify the i-th quadrilateral frame into the frame group corresponding to the first (i-1) quadrilateral frame and the target frame group corresponding to the minimum distance difference, and construct at least the frame group based on the updated quadrilateral frame sample number.
  • a border group if the minimum distance difference is less than the preset distance threshold, that is, there is a frame group corresponding to the i-th quadrilateral frame, and the i-th quadrilateral frame can be classified into the frame group corresponding to the first (i-1) quadrilateral frame, Then the terminal can classify the i-th quadrilateral frame into the frame group corresponding to the first (i-1) quadrilateral frame and the target frame group corresponding to the minimum distance difference, and construct at least the frame group based on the updated quadrilateral frame sample number.
  • a border group if the minimum distance difference is less than the preset distance threshold, that is, there is a frame group corresponding to the i-th quadrilateral frame, and
  • the embodiment of the present application proposes an image display method, in which the terminal cannot perform the similarity clustering, the selection of the target frame group, the determination of the initial stable frame, etc. on the quadrilateral frame obtained by the detection to remove abnormal frames, which solves the problem of the quadrilateral in the preview screen.
  • the frame display is unstable, which overcomes the defect that the preview screen is not displayed smoothly.
  • FIG. 12 is a schematic diagram tenth of the implementation flow of the image display method proposed by the embodiment of the present application.
  • the terminal is based on the initial stable frame and the (i-1th) ) stable borders and the method for determining the i-th stable border may include the following steps:
  • Step 104a Obtain the first vertex coordinate data corresponding to the initial stable frame and the second vertex coordinate data corresponding to the (i-1)th stable frame.
  • Step 104b Calculate the distance difference between the first vertex coordinate data and the second vertex coordinate data according to the preset similarity function.
  • Step 104c If the distance difference is smaller than the preset distance threshold, determine the (i-1)th stable frame as the i-th stable frame.
  • Step 104d If the distance difference is greater than or equal to the preset distance threshold, determine the initial stable frame as the i-th stable frame.
  • the terminal in the process of determining the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame, may first obtain the coordinates of the first vertex corresponding to the initial stable frame data, and the second vertex coordinate data corresponding to the (i-1)th stable frame, and then calculate the initial stable quadrilateral frame and The similarity of the (i-1)th stable bounding box.
  • the terminal may first base on formula (1) and formula (3) in the preset similarity function, as well as the first vertex coordinate data of the initial stable quadrilateral frame and the second vertex coordinate of the (i-1)th stable frame.
  • the data first maps its two quadrilateral frames to the distance space respectively to obtain the first distance corresponding to the initial stable quadrilateral frame and the second distance corresponding to the (i-1)th stable frame, and then calculate the distance difference based on formula (3). .
  • the terminal may preset a preset distance threshold representing the similarity result, and the terminal may compare the above-mentioned distance difference with the preset distance threshold, and then determine the initial stable quadrilateral border and the (i-1)th threshold based on the comparison result. Similarity results for stable bounding boxes.
  • the terminal can determine that the initial stable quadrilateral frame is similar to the (i-1)th stable frame, then in order to ensure the smoothness of the preview screen, the terminal adopts the same The same stable quadrilateral frame of the previous frame image, that is, the (i-1)th stable frame is continuously determined as the i-th stable frame corresponding to the current i-th preview image.
  • the terminal since the i-th stable frame has not changed, the terminal also does not update the pre-stored (i-1)-th stable frame for stable frame comparison, and continues as the next frame, that is, the (i-th stable frame) +1) Reference stable quad bounding box when performing stable quad bounding box determination.
  • FIG. 13A is a schematic diagram 1 of a scenario for determining a stable frame proposed by an embodiment of the present application. It is assumed that the dotted line is the (i-1)th stable frame, and the solid line is the initial stable frame. As shown in FIG. 13A , the initial stable frame If the similarity with the (i-1) th stable frame is high, the terminal can retain the (i-1) th stable frame as the i-th stable frame of the current image frame.
  • the terminal can determine that the initial stable frame is not similar to the (i-1)th stable frame, that is, the quadrilateral frame corresponding to the target object in the preview image changes , then in order to ensure the accuracy of the preview image, the terminal determines the currently determined initial stable quadrilateral frame as the stable quadrilateral frame corresponding to the current i-th frame preview image.
  • the terminal needs to update the (i-1)th stable frame previously stored for stable frame comparison at the same time, and continue the initial stable frame corresponding to the current i-th preview image.
  • the next frame that is, the reference stable quadrilateral frame when the (i+1)th stable quadrilateral frame is determined.
  • FIG. 13B is a schematic diagram of the second scenario for determining the stable frame proposed by the embodiment of the present application. It is assumed that the dotted line is the (i-1)th stable frame, and the solid line is the initial stable frame. As shown in FIG. 13B , the initial stable frame If the similarity with the (i-1)th stable frame is poor, the terminal can update the stored (i-1)th stable frame, and use the initial stable frame as the i-th stable frame of the i-th frame image.
  • An embodiment of the present application provides an image display method.
  • the terminal can determine the current stable quadrilateral frame according to different similarity results by comparing the similarity between the quadrilateral frame of the current latest frame and the historically stored reference stable quadrilateral frame. , which solves the problem of unstable display of the quadrilateral frame in the preview screen, overcomes the defect that the preview screen is not displayed smoothly, and further realizes high-efficiency picture scanning.
  • FIG. 14 is a schematic diagram of the execution flow of the image processing proposed by the embodiment of the present application.
  • the terminal first obtains the preview image (step S01), then the terminal performs frame detection on the preview image, such as quadrilateral detection processing (step S02); and stores the obtained quadrilateral frame at the tail of the FIFO, that is, the last bit of the queue (step S03).
  • the terminal can sequentially select unclassified quadrilateral frame samples from the quadrilateral frame samples existing in the current FIFO queue according to the sequence of entering the FIFO queue (step S03), and perform distance calculation according to the above-mentioned preset similarity function (step S03).
  • step S04 judges based on the distance difference whether there is a classifiable border group corresponding to the unclassified quadrilateral border sample in the frame group that has been clustered (step S05); If there is a frame group with a similar distance, it can be determined that the unclassified quadrilateral frame sample belongs to the frame group with a similar distance, and the quadrilateral frame can be directly added to the frame group (step S06); There are multiple border groups with similar distances in the border group. You can also sort the distances and add the quadrilateral borders to the border group with the closest distance. On the other hand, if there is no similar distance in the sorted border groups The terminal can create a new frame group, and add the quadrilateral frame to the new frame group (step S07).
  • the terminal can judge whether all the unclassified quadrilateral frame samples in the FIFO sequence have completed the clustering, that is, whether there are unclassified quadrilateral frame samples in the current FIFO queue (step S08, if it is determined to exist, then the terminal jumps Go to step S03, repeat the above steps; if not, the terminal can select the target frame group from at least one frame group obtained by clustering, such as at least one frame group, the frame group with the largest number of quadrilateral frame samples as the target A frame group (step S09), and based on the time sequence, a quadrilateral frame sample corresponding to the latest frame is selected from the target frame group to determine the initial stable quadrilateral frame (step S010).
  • the terminal may perform similarity-based distance calculation on the initial stable quadrilateral frame and the historically stored reference stable quadrilateral frame (step S011 ). And determine whether the distance is less than a preset distance threshold (step S012). If it is less than, then the terminal does not need to update the historical reference stable quadrilateral frame, but directly uses the historical reference stable quadrilateral frame as the target stable quadrilateral frame corresponding to the current preview image and outputs (step S013); if not less than, then the terminal can use The initial stable quadrilateral frame is updated with the historical reference stable quadrilateral frame (step S014), and the currently determined new historical reference stable quadrilateral frame is determined as the target stable quadrilateral frame corresponding to the current preview image and output. Further, the terminal may render the obtained stable quadrilateral frame, and generate and display a rendered preview image based on the rendered quadrilateral frame and the current preview image (step S015).
  • the terminal no longer The image frame preview is directly based on the detected quadrilateral frame, but after a stable quadrilateral frame is obtained, the image preview is performed based on the stable quadrilateral frame, which solves the problem of unstable display of the quadrilateral frame in the preview screen and overcomes the preview screen. Displays not smooth defects.
  • FIG. 15 is a schematic diagram of the composition structure of the terminal proposed by the present application.
  • the terminal 10 proposed by the embodiment of the present application may include a quadrilateral detection module 11, Timing stabilization module 12, denoising stabilization module 13 and preview module 14,
  • the quadrilateral detection module 11 is configured to obtain the i-th frame preview image corresponding to the target object; and perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; wherein, The i is an integer greater than 0;
  • the timing stabilization module 12 is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group; and from the at least one frame group Choose a target frame group from the middle; And determine the initial stable frame from the target frame group;
  • the denoising stabilization module 13 is configured to determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
  • the preview module 14 is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
  • FIG. 16 is a second schematic diagram of the composition and structure of the terminal proposed by the present application.
  • the terminal 10 proposed by the embodiment of the present application may include an acquisition part 15 that detects part 16, clustering part 17, selection part 18, determination part 19, display part 110, storage part 111
  • the acquisition part 15 is configured to acquire the ith frame preview image corresponding to the target object
  • the detection part 16 is configured to perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
  • the clustering part 17 is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group;
  • the selection part 18 is configured to select a target frame group from the at least one frame group
  • the determining part 19 is configured to determine an initial stable frame from the target frame group; and determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
  • the display part 110 is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
  • the storage part 111 is configured to perform similarity clustering processing based on the i-th quadrilateral frame after obtaining the i-th quadrilateral frame corresponding to the target object, Before obtaining at least one frame group, the i-th quadrilateral frame is stored in the N-th bit of the FIFO; wherein, N is an integer greater than 2, and the N represents the maximum storage capacity of the FIFO.
  • the clustering part 17 is specifically configured to read the first quadrilateral border to the i-th from the FIFO and 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.
  • the clustering part 17 is further specifically configured to read the (i-N+1)th item from the FIFO From the quadrilateral frame to the i-th quadrilateral frame; and 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 .
  • the clustering part 17 is also specifically configured to obtain the kth vertex coordinate data corresponding to the kth quadrilateral border, which corresponds to the first (k-1) quadrilateral borders
  • the first historical frame group corresponding to the first (k-1) quadrilateral frames constructs the at least one frame group.
  • the clustering part 17 is also specifically configured to establish a new new feature corresponding to the kth quadrilateral frame if the minimum distance difference is greater than or equal to a preset distance threshold. a frame group, and construct the at least one frame group based on the newly added frame group and the first historical frame group; and if the minimum distance difference is less than a preset distance threshold, the kth quadrilateral frame It is classified into the first historical border group, and the at least one border group is constructed based on the first historical border group.
  • the clustering part 17 is also specifically configured to acquire the (i-N+k)th vertex coordinate data corresponding to the (i-N+k)th quadrilateral frame , and the first (i-N+k-1) vertex coordinate data corresponding to the first (i-N+k-1) quadrilateral borders; wherein, k is an integer greater than 1 and less than or equal to N; Let the similarity function calculate the first (i-N+k-1) distances corresponding to the (i-N+k)th vertex coordinate data and the first (i-N+k-1) vertex coordinate data difference; and determining a minimum distance difference from the first (i-N+k-1) distance differences; and based on the minimum distance difference and the first (i-N+k-1)
  • the second historical frame group corresponding to the quadrangular frame constructs the at least one frame group.
  • the clustering part 17 is also specifically configured to obtain the i-th vertex coordinate data corresponding to the i-th quadrilateral frame, and the previous grouped (i-1) The first (i-1) vertex coordinate data corresponding to the quadrilateral border; i-1) distance differences; and determining a minimum distance difference from the (i-1) distance differences; and corresponding to the first (i-1) quadrilateral borders based on the minimum distance difference.
  • the third historical border group of the at least one border group is constructed.
  • the selection part 18 is specifically configured to obtain the number of quadrilateral frames included in each frame group in the at least one frame group; The group is determined as the target border group.
  • the determining part 19 is specifically configured to arrange and process the quadrilateral frames in the target frame group in a chronological order to obtain a frame list; , the last quadrilateral border is determined as the initial stable border.
  • the determining part 19 is further specifically configured to perform mean filtering processing on the quadrilateral frames in the target frame group to obtain an initial stable frame.
  • the determining part 19 is further specifically configured to acquire the first vertex coordinate data corresponding to the initial stable frame and the second corresponding to the (i-1)th stable frame. vertex coordinate data; and calculating 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, the (i-1) stable frame is determined as the i-th stable frame; and if the distance difference is greater than or equal to the preset distance threshold, then the initial stable frame is determined as the i-th stable frame frame.
  • the display part 110 is specifically configured to perform rendering processing on the i-th stable frame to obtain a post-render stable frame; and based on the post-render stable frame and the ith stable frame
  • the i-frame preview image generates a preview image after rendering; and displays the preview image after rendering.
  • FIG. 17 is a schematic diagram 3 of the composition structure of the terminal proposed by the embodiment of the present application.
  • the terminal 10 proposed by the embodiment of the present application may further include a processor 112, a The processor 112 has a memory 113 for executing instructions.
  • the terminal 10 may further include a communication interface 114 and a bus 115 for connecting the processor 112 , the memory 113 and the communication interface 114 .
  • the above-mentioned processor 112 may be an application specific integrated circuit (ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD) ), Programmable Logic Device (ProgRAMmable Logic Device, PLD), Field Programmable Gate Array (Field ProgRAMmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor at least one of.
  • ASIC application specific integrated circuit
  • DSP Digital Signal Processor
  • DSPD digital signal processing device
  • PLD Programmable Logic Device
  • Field Programmable Gate Array Field ProgRAMmable Gate Array
  • FPGA Field ProgRAMmable Gate Array
  • CPU Central Processing Unit
  • controller microcontroller, microprocessor at least one of.
  • the terminal 10 may also include a memory 113, which may be connected to the processor 112, wherein the memory 113 is used for storing executable program codes, the program codes including computer operation instructions, the memory 113 may include high-speed RAM memory, or may also include Non-volatile memory, for example, at least two disk drives.
  • the bus 115 is used to connect the communication interface 114 , the processor 112 and the memory 113 and the mutual communication among these devices.
  • the memory 113 is used to store instructions and data.
  • the above-mentioned processor 112 is configured to obtain the ith frame preview image corresponding to the target object, and perform frame detection processing on the ith frame preview image to obtain the ith frame preview image corresponding to the target object.
  • the i-th quadrilateral frame wherein, the i is an integer greater than 0; based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame, similarity clustering is performed to obtain at least one frame group; Select a target frame group from the at least one frame group, and determine an initial stable frame from the target frame group; determine the ith stable frame based on the initial stable frame and the (i-1)th stable frame; according to The i-th stable frame performs display processing on the i-th frame preview image.
  • the above-mentioned memory 113 may be a volatile memory (volatile memory), such as a random access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and send it to the processor 112 Provide instructions and data.
  • volatile memory such as a random access memory (Random-Access Memory, RAM)
  • non-volatile memory such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and send it to the processor 112 Provide instructions and data.
  • each functional module in this embodiment may be integrated into one file restoration unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
  • the integrated unit is implemented in the form of software function modules and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or correct. Part of the contribution made by the prior art 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 several instructions to make a computer device (which can be a personal A computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • An embodiment of the present application provides a terminal. After performing frame detection processing on a current preview image containing a target object and obtaining a quadrilateral frame corresponding to the target object, the terminal may first perform clustering processing based on frame similarity on the quadrilateral frame. And select the target frame group from the obtained at least one frame group, and further determine the initial stable frame from the target frame group, and then further determine the current stable frame based on the comparison between the initial stable frame and the historical stable frame, so as to follow The current stable frame performs display processing on the current preview image.
  • the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering on the quadrilateral frame obtained by detection, selection of the target frame group, and determination of the initial stable frame, etc.
  • the screen display is not smooth defect.
  • An embodiment of the present application provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the above-described image display method is implemented.
  • a program instruction corresponding to an image display method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a U disk, etc.
  • a storage medium such as an optical disk, a hard disk, a U disk, etc.
  • An 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 configured to execute the program instructions to implement the image display method as described above.
  • the image display method includes the following steps:
  • the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • An apparatus implements the functions specified in a flow or flows of the implementation flow diagram and/or a block or blocks of the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the implementing flow diagram and/or the block or blocks of the block diagram.
  • the embodiments of the present application disclose an image display method, a terminal, and a storage medium.
  • the method includes: acquiring an i-th frame preview image corresponding to a target object, performing frame detection processing on the i-th frame preview image, and obtaining an i-th frame preview image corresponding to the target object.
  • the i-th quadrilateral frame wherein, i is an integer greater than 0; perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame, and obtain at least one frame group; from at least one frame group Select the target frame group, and determine the initial stable frame from the target frame group; determine the i-th stable frame based on the initial stable frame and the (i-1)th stable frame; perform the i-th frame preview image according to the i-th stable frame. Display processing.
  • the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering, selection of target frame group and initial Determination of the stable frame and other operations to remove abnormal frames, as well as the denoising stabilization operation compared with the historical stable frame, after obtaining the current stable quadrilateral frame, image preview is performed based on the stable quadrilateral frame, which solves the problem of unstable quadrilateral frame display in the preview screen. problem, overcome the defect that the preview screen is not displayed smoothly.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)

Abstract

Disclosed in the embodiments of the present application are an image display method, a terminal and a storage medium. The method comprises: acquiring an ith frame of preview image corresponding to a target object, and performing frame detection processing on the ith frame of preview image to obtain an ith quadrilateral frame corresponding to the target object, wherein i is an integer greater than 0; performing similarity clustering processing on the basis of a first quadrilateral frame to the ith quadrilateral frame that correspond to the target object, so as to obtain at least one frame group; selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group; determining an ith stable frame on the basis of the initial stable frame and an (i-1)th stable frame; and performing display processing on the ith frame of preview image according to the ith stable frame.

Description

图像显示方法、终端、芯片及存储介质Image display method, terminal, chip and storage medium 技术领域technical field
本发明涉及图像处理技术领域,尤其涉及一种图像显示方法、终端及存储介质。The present invention relates to the technical field of image processing, and in particular, to an image display method, a terminal and a storage medium.
背景技术Background technique
随着互联网技术的发达,越来越多的业务,如通信行业、金融行业、出入境等领域都需要对用户的证件信息进行采集和登记,以进行实名制管理。为了提高证件信息的采集和登记效率,相关技术提出了一种基于照片的文档图片扫描技术,能够通过扫描照片的方式实现信息的自动识别。With the development of Internet technology, more and more businesses, such as the communication industry, financial industry, entry and exit and other fields, need to collect and register the user's certificate information for real-name management. In order to improve the collection and registration efficiency of certificate information, the related art proposes a document image scanning technology based on photos, which can realize automatic identification of information by scanning photos.
其中,该扫描技术依赖于图像的四边形检测方法,在利用扫描进行信息识别之前,终端需要先利用该检测方法从拍摄的图像当中寻找包含目标对象的四边形边框,进而实时预览当前拍摄的画面以及寻找到的四边形边框,以进一步实现对四边形边框中的目标对象的信息获取。Among them, the scanning technology relies on the quadrilateral detection method of the image. Before using scanning for information identification, the terminal needs to use the detection method to find the quadrilateral frame containing the target object from the captured image, and then preview the currently captured image in real time and search for The obtained quadrilateral frame, so as to further realize the information acquisition of the target object in the quadrilateral frame.
然而,由于各种异常因素的影响,使得检测得到的四边形边框无法保证其准确性,因此在预览画面中可能存在四边形边框抖动和跳变等显示不稳定的问题,从而导致了预览画面显示不流畅的缺陷。However, due to the influence of various abnormal factors, the accuracy of the detected quadrilateral frame cannot be guaranteed. Therefore, there may be unstable display problems such as quadrilateral frame jittering and jumping in the preview screen, which leads to the unsmooth display of the preview screen. Defects.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种图像显示方法、终端、芯片及存储介质,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷。The embodiments of the present application provide an image display method, a terminal, a chip and a storage medium, which solve the problem of unstable display of a quadrangle frame in a preview picture, and overcome the defect that the preview picture is not displayed smoothly.
本申请实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present application are implemented as follows:
第一方面,本申请实施例提供了一种图像显示方法,所述方法包括:In a first aspect, an embodiment of the present application provides an image display method, the method includes:
获取目标对象对应的第i帧预览图像,并对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;Obtain the ith frame preview image corresponding to the target object, and perform frame detection processing on the ith frame preview image to obtain the ith quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;Perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group;
从所述至少一个边框组中选取目标边框组,并从所述目标边框组中确定初始稳定边框;Selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group;
基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;determining the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。Perform display processing on the i-th frame preview image according to the i-th stable frame.
第二方面,本申请实施例提供了一种终端,所述终端包括:获取部分,检测部分,聚类部分,选取部分、确定部分以及显示部分,In a second aspect, an embodiment of the present application provides a terminal, the terminal includes: an acquisition part, a detection part, a clustering part, a selection part, a determination part, and a display part,
所述获取部分,配置为获取目标对象对应的第i帧预览图像;The acquisition part is configured to acquire the i-th frame preview image corresponding to the target object;
所述检测部分,配置为对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;The detection part is configured to perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
所述聚类部分,配置为基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;The clustering part is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group;
所述选取部分,配置为从所述至少一个边框组中选取目标边框组;The selection part is configured to select a target frame group from the at least one frame group;
所述确定部分,配置为从所述目标边框组中确定初始稳定边框;以及基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;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;
所述显示部分,配置为按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。The display part is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
第三方面,本申请实施例提供了一种终端,所述终端包括:四边形检测模块、时序稳定模块、去噪稳定模块以及预览模块,In a third aspect, an embodiment of the present application provides a terminal, where the terminal includes: a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, and a preview module,
所述四边形检测模块,配置为获取目标对象对应的第i帧预览图像;并对对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;The quadrilateral detection module is configured to obtain the i-th frame preview image corresponding to the target object; and perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; The i is an integer greater than 0;
所述时序稳定模块,配置为基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;以及从所述至少一个边框组中选取目标边框组;以及从所述目标边框组中确定初始稳定边框;The timing stabilization module is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group; and from the at least one frame group Selecting a target frame group; and determining an initial stable frame from the target frame group;
所述去噪稳定模块,配置为基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;The denoising stabilization module is configured to determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
所述预览模块,配置为按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。The preview module is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
第四方面,本申请实施例提供了一种终端,所述终端包括四边形检测模块、时序稳定模块、去噪稳定模块、预览模块、处理器、存储有所述处理器可执行指令的存储器,当所述指令被所述处理器执行时,实现如上所述的图像显示方法。In a fourth aspect, an embodiment of the present application provides a terminal, where the terminal includes a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, a preview module, a processor, and a memory storing executable instructions of the processor. When the instructions are executed by the processor, the above-described image display method is implemented.
第五方面,本申请实施例提供了一种芯片,其特征在于,所述芯片包括处理器和接口,所述处理器通过所述接口获取程序指令,所述处理器用于运行所述程序指令,以执行如上所述的图像显示方法。In a fifth aspect, an embodiment of the present application provides a chip, wherein the chip 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 perform the image display method as described above.
第六方面,本申请实施例提供了一种计算机可读存储介质,其上存储有程序,应用于终端中,所述程序被处理器执行时,实现如上所述的图像显示方法。In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium on which a program is stored and applied in a terminal. When the program is executed by a processor, the above-described image display method is implemented.
本申请实施例提供了一种图像显示方法、终端、芯片及存储介质,终端获取目标对象对应的第i帧预览图像,并对第i帧预览图像进行边框检测处理,获得目标对象对应的第i个四边形边框;其中,i为大于0的整数;基于目标对象对应的第一个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组;从至少一个边框组中选取目标边框组,并从目标边框组中确定初始稳定边框;基于初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;按照第i个稳定边框对第i帧预览图像进行显示处理。也就是说,在本申请的实施例中,在对包含目标对象的当前预览图像进行边框检测处理,获得目标对象对应的四边形边框之后,终端可以先对该四边形边框进行基于边框相似度的聚类处理,并从获得的至少一个边框组中选取出目标边框组,以及进一步从该目标边框组中确定初始稳定边框,进而基于该初始稳定边框和历史稳定边框的对比进一步确定出当前稳定边框,从而将按照当前稳定边框对当前预览图像进行显示处理。可见,在本申请中,终端不再是基于边框检测得到的四边形边框直接进行图像预览,而是在对检测获得的四边形边框进行相似度聚类、目标边框组的选取和初始稳定边框的确定等去除异常帧操作,以及与历史稳定边框进行对比的去噪稳定操作,获得当前稳定四边形边框之后,基于该稳定四边形边框进行图像预览,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷。The embodiments of the present application provide an image display method, a terminal, a chip, and a storage medium. The terminal acquires the ith frame preview image corresponding to the target object, and performs frame detection processing on the ith frame preview image to obtain the ith frame preview image corresponding to the target object. where i is an integer greater than 0; perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group; select the target from at least one frame group frame group, and determine the initial stable frame from the target frame group; determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame; display the i-th frame preview image according to the i-th stable frame . That is to say, in the embodiment of the present application, after performing frame detection processing on the current preview image containing the target object to obtain a quadrilateral frame corresponding to the target object, the terminal may first perform clustering based on frame similarity on the quadrilateral frame. process, and select a target frame group from the obtained at least one frame group, and further determine an initial stable frame from the target frame group, and then further determine the current stable frame based on the comparison between the initial stable frame and the historical stable frame, so that The current preview image will be displayed according to the current stable frame. It can be seen that in this application, the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering on the quadrilateral frame obtained by detection, selection of the target frame group, and determination of the initial stable frame, etc. The operation of removing abnormal frames, and the denoising stabilization operation compared with the historical stable frame, after obtaining the current stable quadrilateral frame, the image preview is performed based on the stable quadrilateral frame, which solves the problem of unstable display of the quadrilateral frame in the preview screen, and overcomes the problem of previewing. The screen display is not smooth defect.
附图说明Description of drawings
图1为本申请实施例提出的图像显示方法的实现流程示意图一;FIG. 1 is a schematic diagram 1 of an implementation flow of an image display method proposed by an embodiment of the present application;
图2为本申请实施例提出的图像显示方法的实现流程示意图二;FIG. 2 is a second implementation flowchart of the image display method proposed by the embodiment of the present application;
图3为本申请实施例提出的边框组平滑滤波的曲线示意图;FIG. 3 is a schematic diagram of a curve of a frame group smoothing filtering proposed by an embodiment of the present application;
图4为本申请实施例提出的图像显示方法的实现流程示意图三;FIG. 4 is a schematic diagram 3 of the implementation flow of the image display method proposed by the embodiment of the present application;
图5为本申请实施例提出的初始稳定边框平滑滤波的场景示意图;FIG. 5 is a schematic diagram of a scene of initial stable frame smoothing filtering proposed by an embodiment of the present application;
图6为本申请实施例提出的图像显示方法的实现流程示意图四;FIG. 6 is a fourth schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application;
图7为本申请实施例提出的图像显示方法的实现流程示意图五;FIG. 7 is a schematic diagram five of the implementation flow of the image display method proposed by the embodiment of the present application;
图8为本申请实施例提出的图像显示方法的实现流程示意图六;FIG. 8 is a sixth schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application;
图9为本申请实施例提出的图像显示方法的实现流程示意图七;FIG. 9 is a seventh schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application;
图10为本申请实施例提出的图像显示方法的实现流程示意图八;FIG. 10 is a schematic diagram eight of the implementation flow of the image display method proposed by the embodiment of the present application;
图11为本申请实施例提出的图像显示方法的实现流程示意图九;FIG. 11 is a schematic diagram 9 of the implementation flow of the image display method proposed by the embodiment of the present application;
图12为本申请实施例提出的图像显示方法的实现流程示意图十;FIG. 12 is a schematic diagram ten of the implementation flow of the image display method proposed by the embodiment of the present application;
图13A为本申请实施例提出的目标稳定边框确定的场景示意图一;FIG. 13A is a schematic diagram 1 of a scene for determining a target stable frame according to an embodiment of the present application;
图13B为本申请实施例提出的目标稳定边框确定的场景示意图二;13B is a second schematic diagram of a scene for determining a target stable frame proposed by an embodiment of the present application;
图14为本申请实施例提出的图像处理的执行流程示意图;FIG. 14 is a schematic diagram of an execution flow of image processing proposed by an embodiment of the present application;
图15为本申请实施例提出的终端的组成结构示意图一;FIG. 15 is a schematic diagram 1 of the composition structure of a terminal proposed by an embodiment of the present application;
图16为本申请实施例提出的终端的组成结构示意图二;FIG. 16 is a second schematic diagram of the composition and structure of a terminal according to an embodiment of the present application;
图17为本申请实施例提出的终端的组成结构示意图三。FIG. 17 is a third schematic diagram of the composition and structure of a terminal according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to explain the related application, but not to limit the application. In addition, it should be noted that, for the convenience of description, only the parts related to the relevant application are shown in the drawings.
随着互联网技术的发达,越来越多的业务,如通信行业、金融行业、出入境等领域都需要对用户的证件信息进行采集和登记,以进行实名制管理。为了提高证件信息的采集和登记效率,基于照片的文档图片扫描技术应运而生,能够通过对照片进行扫描的方式实现信息自动识别。With the development of Internet technology, more and more businesses, such as the communication industry, financial industry, entry and exit and other fields, need to collect and register the user's certificate information for real-name management. In order to improve the collection and registration efficiency of certificate information, photo-based document image scanning technology has emerged, which can automatically identify information by scanning photos.
其中,该扫描技术依赖于图像的四边形检测方法,终端可以应用该检测方法先从拍摄的图像当中寻找包含目标对象的四边形边框,进而实时预览当前拍摄的画面以及寻找到的四边形边框,以最终实现对四边形边框中的目标对象的信息获取。Among them, the scanning technology relies on the quadrilateral detection method of the image. The terminal can use the detection method to first find the quadrilateral frame containing the target object from the captured image, and then preview the currently captured image and the found quadrilateral frame in real time, so as to finally realize the Obtain information about the target object in the quadrilateral frame.
然而,四边形检测得到的结果往往受到各种因素的影响无法保证完全的正确都行,使得在预览画面实时显示时,会出现四边形边框抖动和跳变等显示不稳定的问题,从而导致了预览画面显示不流畅的缺陷,无法高效率的实现图片扫描。However, the results obtained by quadrilateral detection are often affected by various factors and cannot be guaranteed to be completely correct. When the preview screen is displayed in real time, there will be unstable display problems such as quadrilateral frame jittering and jumping, which leads to the preview screen. The display is not smooth, and the image scanning cannot be realized efficiently.
相关技术中,场采用直接的时序滤波方式,如卡尔曼滤波,均值滤波等方式降低四边形显示不稳定的负面影响。但是,直接应用时序滤波,虽然使得经过滤波的四边形边框结果在时序上会呈现较为平滑,但是仍然无法排除部分异常值的影响。该部分异常值的存在直接导致了该四边形输出结果受其影响存在偏差,尤其是其异常值出现频率较高时,结果的偏差会偏离较大。也即是说,直接的滤波无法获得准确稳定的四边形输出结果,无法满足现有场景需求。In the related art, the field adopts a direct time series filtering method, such as Kalman filtering, mean filtering, etc., to reduce the negative influence of unstable quadrilateral display. However, by directly applying time series filtering, although the result of the filtered quadrilateral frame will appear smoother in time series, the influence of some outliers cannot be ruled out. The existence of this part of the outliers directly leads to the deviation of the quadrilateral output results affected by them, especially when the outliers appear frequently, the deviation of the results will be larger. That is to say, direct filtering cannot obtain accurate and stable quadrilateral output results, and cannot meet the needs of existing scenarios.
为了解决现有四边形输出结果所存在的问题,本申请实施例提供了一种图像显示方法、终端、芯片及存储介质。具体地,在对包含目标对象的当前预览图像进行边框检测处理,获得目标对象对应的四边形边框之后,终端可以先对该四边形边框进行基于边框相似度的聚类处理,并从获得的至少一个边框组中选取出目标边框组,以及进一步从该目标边框组中确定初始稳定边框,进而基于该初始稳定边框和历史稳定边框的对比进一步确定出当前稳定边框,从而将按照当前稳定边框对当前预览图像进行显示处理。可见,在本申请中,终端不再是基于边框检测得到的四边形边框直接进行图像预览,而是在对检测获得的四边形边框进行相似度聚类、目标边框组的选取和初始稳定边框的确定等去除异常帧操作,以及与历史稳定边框进行对比的去噪稳定操作,获得当前稳定四边形边框之后,基于该稳定四边形边框进行图像预览,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷。In order to solve the problems existing in the existing quadrilateral output results, the embodiments of the present application provide an image display method, a terminal, a chip and a storage medium. Specifically, after performing frame detection processing on the current preview image containing the target object to obtain a quadrilateral frame corresponding to the target object, the terminal may first perform clustering processing based on frame similarity on the quadrilateral frame, and obtain at least one frame from the obtained at least one frame. The target frame group is selected from the group, and the initial stable frame is further determined from the target frame group, and the current stable frame is further determined based on the comparison between the initial stable frame and the historical stable frame, so that the current preview image will be adjusted according to the current stable frame Perform display processing. It can be seen that in this application, the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering on the quadrilateral frame obtained by detection, selection of the target frame group, and determination of the initial stable frame, etc. The operation of removing abnormal frames, and the denoising stabilization operation compared with the historical stable frame, after obtaining the current stable quadrilateral frame, the image preview is performed based on the stable quadrilateral frame, which solves the problem of unstable display of the quadrilateral frame in the preview screen, and overcomes the problem of previewing. The screen display is not smooth defect.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
图1为本申请实施例提出的图像显示方法的实现流程示意图一,如图1所示,在本申请的实施例中,终端进行图像处理的方法可以包括以下步骤:FIG. 1 is a schematic diagram 1 of the implementation flow of the image display method proposed by the embodiment of the present application. As shown in FIG. 1 , in the embodiment of the present application, the method for performing image processing by a terminal may include the following steps:
步骤101、获取目标对象对应的第i帧预览图像,并对第i帧预览图像进行边框检测处理,获得目标对象对应的第i个四边形边框;其中,i为大于0的整数。Step 101: Obtain the ith frame preview image corresponding to the target object, and perform frame detection processing on the ith frame preview image to obtain the ith quadrilateral frame corresponding to the target object; wherein, i is an integer greater than 0.
在本申请的实施例中,终端可以实时获取包含目标对象的预览图像,即第i帧预览图像,并对该第i帧预览图像执行边框检测处理,得到了该目标对象对应的实时四边形边框,即第i个四边形边框。In the embodiment of the present application, the terminal may acquire a preview image including the target object in real time, that is, the i-th frame preview image, and perform frame detection processing on the i-th frame preview image to obtain the real-time quadrilateral frame corresponding to the target object, That is, the i-th quadrilateral border.
需要说明的是,在本申请的实施例中,终端可以为任何具备文扫描功能的电子设备。具体的,该终端可以具有摄像头,并通过摄像头采集图像帧。It should be noted that, in the embodiments of the present application, the terminal may be any electronic device with a text scanning function. Specifically, the terminal may have a camera, and image frames are collected through the camera.
可选的,该终端不局限于智能手机、平板电脑、个人计算机(Personal Computer,PC)、笔记本电脑等电子设备。Optionally, the terminal is not limited to electronic devices such as a smart phone, a tablet computer, a personal computer (Personal Computer, PC), and a notebook computer.
应理解,第i帧预览图像指终端通过摄像头对文档图片进行拍摄时,终端在第i个时刻采集的该文档图片的一帧预览图像。相应的,目标对象则指该预览图像中指定的目标物,如边框为矩形的矩形对象。It should be understood that the ith frame preview image refers to a frame preview image of the document picture collected by the terminal at the ith moment when the terminal captures the document picture through the camera. Correspondingly, the target object refers to the target object specified in the preview image, such as a rectangular object whose frame is a rectangle.
例如,文档图片可以包括诸如文档、纸、名片、照片、白板、屏幕等,目标对象可以是该文档图片中的人物照片、身份证、护照、驾驶证、票据、名片、工卡等各种矩形对象。For example, a document picture may include documents, paper, business cards, photos, whiteboards, screens, etc., and the target objects may be various rectangles such as person photos, ID cards, passports, driver's licenses, tickets, business cards, work cards, etc. in the document picture object.
需要说明的是,在本申请的实施例中,终端在实时获取到包括目标对象的预览图像之后,终端可以通过对该预览图像进行边框检测处理,如四边形检测,以获取到目标对象对应的四边形边框。It should be noted that, in the embodiment of the present application, after the terminal acquires the preview image including the target object in real time, the terminal may perform frame detection processing on the preview image, such as quadrilateral detection, to acquire the quadrilateral corresponding to the target object frame.
可选的,由于四边形检测针对的是矩形对象,其轮廓都由直线段组成,因此,终端可以利用特征线检测的方法确定出矩形对象的轮廓,也就是四边形边框。Optionally, since the quadrilateral detection is aimed at rectangular objects, the contours of which are composed of straight line segments. Therefore, the terminal may determine the contour of the rectangular object by using the method of feature line detection, that is, the quadrilateral frame.
可选的,终端也可以基于深度学习的方式建立四边形检测模型,在实时获取预览图像之后,将预览图像输入预先训练好的模型对待检测图像帧进行四边形检测处理,进而输出四边形边框。Optionally, the terminal may also establish a quadrilateral detection model based on deep learning, and after obtaining the preview image in real time, input the preview image into the pre-trained model to perform quadrilateral detection processing on the image frame to be detected, and then output the quadrilateral frame.
进一步地,在本申请的实施例中,终端在获取包含目标对象的第i帧预览图像,并对第i帧预览图像进行边框检测处理,获得目标对象对应的第i个四边形边框之后,可以进一步基于四边形边框进行基于边框相似度的聚类处理。Further, in the embodiment of the present application, after acquiring the i-th frame preview image containing the target object, and performing frame detection processing on the i-th frame preview image, and obtaining the i-th quadrilateral frame corresponding to the target object, the terminal may further The clustering processing based on the similarity of the border is performed based on the quadrilateral border.
步骤102、基于目标对象对应的第一个四边形边框至第i个四边形边框进行相似度聚类处理,获 得至少一个边框组。Step 102: Perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group.
在本申请的实施例中,终端在进行边框检测处理,获得第i个四边形边框之后,终端可以进一步基于第一个四边形边框至该第i个四边形边框进行相似度聚类处理,进而得到至少一个边框组。In the embodiment of the present application, after the terminal performs frame detection processing and obtains the i-th quadrilateral frame, the terminal may further perform similarity clustering processing based on the first quadrilateral frame to the i-th quadrilateral frame, and then obtain at least one Set of borders.
可以理解的是,聚类处理即无监督的机器学习,将相似的对象进行归类。在本申请的实施例中,终端可以对四边形边框进行基于边框相似度的聚类,将相似度高的四边形边框归为一类。Understandably, the clustering process is unsupervised machine learning to group similar objects into groups. In the embodiment of the present application, the terminal may perform clustering on the quadrilateral borders based on the similarity of the borders, and classify the quadrilateral borders with high similarity into one category.
具体的,在本申请的实施例中,终端可以获取四边形边框对应的顶点坐标数据,并基于顶点坐标数据进行相似度计算,从而基于该相似度结果实现四边形边框的归类。Specifically, in the embodiment of the present application, the terminal may obtain vertex coordinate data corresponding to the quadrilateral frame, and perform similarity calculation based on the vertex coordinate data, so as to realize the classification of the quadrilateral frame based on the similarity result.
这里,终端可以获取第一个四边形边框至第i个四边形边框分别对应的顶点坐标数据,进而基于这些顶点坐标数据进行相似度聚类处理,构建至少一个边框组。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.
进一步地,在本申请的实施例中,终端在基于第一个四边形边框至第i个四边形边框进行基于边框相似度的聚类处理,获得至少一个边框组之后,可以进一步基于该至少一个边框组进行目标边框组的选取处理。Further, in the embodiment of the present application, after the terminal performs clustering processing based on the similarity of the borders based on the first quadrilateral border to the i-th quadrilateral border, and obtains at least one border group, the terminal may further perform the clustering process based on the at least one border group based on the at least one border group. Carry out the selection process of the target frame group.
步骤103、从至少一个边框组中选取目标边框组,并从目标边框组中确定初始稳定边框。Step 103: Select a target frame group from at least one frame group, and determine an initial stable frame from the target frame group.
在本申请的实施例中,终端在进行相似度聚类处理,获得至少一个边框组之后,终端可以先从至少一个边框组中选取一个边框组作为目标边框组(步骤103a),进而从该目标边框组中确定出一个边框作为初始稳定边框(步骤103b)。In the embodiment of the present application, after the terminal performs similarity clustering processing and obtains at least one frame group, the terminal may first select a frame group from the at least one frame group as a target frame group (step 103a), and then select one frame group from the at least one frame group as a target frame group (step 103a). One frame in the frame group is determined as the initial stable frame (step 103b).
可以理解的是,基于相似度聚类得到的至少一个边框组中,每个边框组中的四边形边框样本个数可能并不相同,四边形边框样本个数越大的边框组其对应的四边形边框占全部四边形边框样本的越大,四边形边框样本个数越小的边框组其对应的四边形边框占全部四边形边框样本的越小,这里占比约小,则表明该四边形边框与其他四边形不相似的概率越大,该对应边框组中的四边形边框属于异常边框的概率越大。It can be understood that, in at least one frame group obtained by similarity clustering, the number of quadrilateral frame samples in each frame group may be different. The larger the sample of all quadrilateral frames, the smaller the number of samples of quadrilateral frames, the smaller the corresponding quadrilateral frame of the sample of quadrilateral frames, the smaller the proportion here, the probability that the quadrilateral frame is not similar to other quadrilaterals The larger the value, the greater the probability that the quadrilateral borders in the corresponding border group belong to abnormal borders.
因此,在本申请的实施例中,为了保证四边形边框的稳定性,滤除异常四边形边框而保留较为稳定的四边形边框,终端可以从至少一个边框组中选取一个四边形边框样本较为稳定的边框组作为目标边框组。Therefore, in the embodiment of the present application, in order to ensure the stability of the quadrilateral frame, filter out the abnormal quadrilateral frame and retain the relatively stable quadrilateral frame, the terminal may select a relatively stable frame group from the at least one frame group as a sample of the quadrilateral frame as Target border group.
具体的,图2为本申请实施例提出的图像显示方法的实现流程示意图二,如图2所示,终端从至少一个边框组中选取目标边框组(步骤103a)的方法包括以下步骤:Specifically, FIG. 2 is a second implementation flowchart of the image display method proposed by the embodiment of the application. As shown in FIG. 2 , the method for the terminal to select a target frame group from at least one frame group (step 103a) includes the following steps:
步骤103a1、获取至少一个边框组中、每个边框组包含的四边形边框个数。Step 103a1: Acquire the number of quadrilateral frames included in each frame group in at least one frame group.
步骤103a2、将最大四边形边框个数对应的边框组确定为目标边框组。Step 103a2: Determine the frame group corresponding to the maximum number of quadrilateral frames as the target frame group.
可选的,在本申请的实施例中,终端可以直接将至少一个边框组中、具有最多四边形边框样本个数的边框组确定为目标边框组。Optionally, in this embodiment of the present application, the terminal may directly determine a frame group in at least one frame group with a maximum number of quadrilateral frame samples as a target frame group.
可选的,由于边框组中的四边形边框样本个数在某个时刻易产生跳变波动,之后又回归正常,可能对目标边框组的选取产生误操作。因此,针对该情况,终端可以对各个边框组先进行一定的平滑滤波处理,如均值滤波,以此减少目标边框组选取时的跳变。Optionally, since the number of quadrilateral frame samples in the frame group is prone to jump and fluctuate at a certain moment, and then return to normal, a misoperation may occur in the selection of the target frame group. Therefore, in view of this situation, the terminal may first perform a certain smoothing filtering process on each frame group, such as mean filtering, so as to reduce the jump when selecting the target frame group.
其中,终端可以对各个边框组进行时序上的跟踪,对边框组中的四边形边框样本数进行平滑滤波,之后在从滤波后的至少一个边框组中选取四边形边框样本个数最大的一个边框组作为目标边框组。The terminal can track each frame group in time sequence, perform smooth 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 the filtered at least one frame group as a frame group. Target border group.
示例性的,图3为本申请实施例提出的边框组平滑滤波的曲线示意图,如图3所示,曲线示意图的横坐标指示不同时序,纵坐标指示边框组中样本个数的变化;其中,粗实线表征原始边框组1中的四边形边框样本个数曲线,细实线表征原始边框组2中的四边形边框样本个数曲线;粗虚线表征滤波后边框组1中的四边形边框样本个数曲线,细虚线表征滤波后边框组2中的四边形边框样本个数曲线。可见,在0至t1时间段,滤波前,原始边框组2中的四边形个数一段时间大于原始边框组1中的四边形个数,发生跳变又一段时间小于原始边框组1中的四边形个数,无法进行目标边框组的准确选取,此时终端进行平滑滤波,在t1时间段滤波后边框组2中的四边形个数始终大于滤波后边框组1中的四边形个数,此时目标边框组确定为边框组2。同理,在t1至t2时间段,平滑滤波之后,滤波后边框组1中的四边形样本个数始终大于滤波后边框组2,此时终端可选取边框组1作为目标边框组;同理,在t2至t3时间段,平滑滤波之后,滤波后边框组2中的四边形样本个数始终大于滤波后边框组1,此时终端可选取边框组2作为目标边框组。Exemplarily, FIG. 3 is a schematic diagram of a curve for smoothing filtering of a frame group proposed by an embodiment of the present application. As shown in FIG. 3 , the abscissa of the schematic diagram of the curve indicates different time sequences, and the ordinate indicates the change in the number of samples in the frame group; wherein, The thick solid line represents the curve of the number of quadrilateral frame samples in the original frame group 1, the thin solid line represents the curve of the number of quadrilateral frame samples in the original frame group 2; the thick dashed line represents the curve of the number of quadrilateral frame samples in the filtered frame group 1 , and the thin dotted line represents the curve of the number of quadrilateral frame samples in frame group 2 after filtering. It can be seen that in the time period from 0 to t1, before filtering, the number of quadrilaterals in the original frame group 2 is greater than the number of quadrilaterals in the original frame group 1 for a period of time. The target frame group cannot be accurately selected. At this time, the terminal performs smooth filtering. After filtering in the t1 time period, the number of quadrilaterals in frame group 2 is always greater than the number of quadrilaterals in frame group 1 after filtering. At this time, the target frame group Determined as border group 2. Similarly, in the time period from t1 to t2, after smoothing filtering, the number of quadrilateral samples in the filtered frame group 1 is always greater than that of the filtered frame group 2. At this time, the terminal can select frame group 1 as the target frame group; During the time period from t2 to t3, after smooth filtering, the number of quadrilateral samples in filtered frame group 2 is always greater than that of filtered frame group 1. At this time, the terminal can select frame group 2 as the target frame group.
进一步的,在本申请的实施例中,终端从至少一个边框组中选取到目标边框组之后,可以进一步从目标边框组中确定一边框作为初始稳定边框。Further, in the 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.
具体的,图4为本申请实施例提出的图像显示方法的实现流程示意图三,如图4所示,在本申请的实施例中,终端从目标边框组中确定初始稳定边框(步骤103b)的方法包括以下步骤:Specifically, FIG. 4 is a schematic diagram 3 of the implementation flow of the image display method proposed by the embodiment of the present application. As shown in FIG. 4 , in the embodiment of the present application, the terminal determines the initial stable frame (step 103b ) from the target frame group. The method includes the following steps:
步骤103b1、对目标边框组中的四边形边框按照时间先后的顺序进行排列处理,获得边框列表。Step 103b1 , arranging the quadrilateral frames in the target frame group in a chronological order to obtain a frame list.
步骤103b2、将边框列表中、最后一个四边形边框确定为初始稳定边框。Step 103b2: Determine the last quadrilateral frame in the frame list as the initial stable frame.
可以理解的是,由于目标边框组中的每一个四边形边框都对应一个预览图像,基于预览图像的时序序列,四边形边框也对应其时序序列,因此,在本申请的实施例中,终端可以对目标边框组中的全部四边形边框按照时间由先到后的顺序进行排列处理,获得边框时序列表。进一步的,终端可以将该列表中的最后一个四边形边框确定为初始稳定边框,即目标边框组中最新预览图像对应的四边形边框确定为初始稳定边框。It can be understood that, since each quadrilateral frame in the target frame group corresponds to a preview image, and based on the timing sequence of the preview image, the quadrilateral frame also corresponds to its timing sequence. Therefore, in this embodiment of the present application, the terminal can All quadrilateral borders in the border group are arranged and processed in the order of time from first to last to obtain a border time series list. Further, the terminal may 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.
可选的,在本申请的实施例中,终端也可以通过对目标边框组中的全部四边形边框进行均值滤波处理,如卡尔曼滤波,滤波的对象为四边形边框顶点坐标数据或者中心点坐标数据,进而获得初始稳定边框。Optionally, in the embodiment of the present application, the terminal may also perform mean filtering processing on all quadrilateral frames in the target frame group, such as Kalman filtering, and the filtered object is the quadrilateral frame vertex coordinate data or the center point coordinate data, Then the initial stable frame is obtained.
示例性的,图5为本申请实施例提出的初始稳定边框平滑滤波的场景示意图,假设目标边框组中包括四边形边框A、四边形边框B以及四边形边框C,如图5所示,,虽然三个边框A、B、C属于一个边框组,为相似边框,但是三个边框实际存在差距,顶点坐标数据以及中心点坐标数据都不相同,因此,终端可以对三个边框按照时间顺序进行均值滤波,从而获得更为稳定的四边形边框D,并将其边框D确定为初始稳定边框。Exemplarily, FIG. 5 is a schematic diagram of the initial stable frame smoothing filtering proposed by the embodiment of the present application. It is assumed that the target frame group includes a quadrilateral frame A, a quadrilateral frame B, and a quadrilateral frame C, as shown in FIG. 5 , although three Frames A, B, and C belong to a frame group and are similar frames, but there is actually a gap between the three frames, and the vertex coordinate data and the center point coordinate data are different. Therefore, the terminal can perform mean filtering on the three frames in chronological order. Thus, a more stable quadrilateral frame D is obtained, and its frame D is determined as the initial stable frame.
进一步地,终端在成功选取目标边框组以及成功确定初始稳定边框之后,终端可以进一步执行目标稳定边框的确定处理。Further, after the terminal successfully selects the target frame group and successfully determines the initial stable frame, the terminal may further perform the determination process of the target stable frame.
步骤104、基于初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框。Step 104: Determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame.
在本申请的实施例中,终端在从至少一个边框组中选取目标边框组,以及从目标边框组中确定出初始稳定边框之后,终端可以进一步基于该初始稳定边框,和历史稳定参考边框即第(i-1)个稳定边框进一步确定出最终进行预览输出的四边形边框,即第i个稳定边框。In the 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 may further base on the initial stable frame and the historical stable reference frame, namely the first stable frame. The (i-1) stable borders further determine the quadrilateral border for final preview output, that is, the i-th stable border.
需要说明的是,在本申请的实施例中,第(i-1)个稳定边框指前一个预览图像最终输出预览的稳定边框。It should be noted that, in the embodiment of the present application, the (i-1)th stable frame refers to the stable frame of the final output preview of the previous preview image.
具体的,终端在执行完每一帧预览图像对应的相似度聚类处理、目标边框组选取、初始稳定边框确定以及稳定边框确定等处理流程之后,都会将当前帧预览图像对应的稳定边框信息进行存储,并作为下一帧预览图像进行稳定边框确定时的历史参考稳定边框。Specifically, after the terminal performs the processing procedures such as similarity clustering processing, target frame group selection, initial stable frame determination, and stable frame determination corresponding to the preview image of each frame, the terminal will process the stable frame information corresponding to the preview image of the current frame. It is stored and used as the historical reference stable frame when the next frame preview image is determined to be stable frame.
应理解,在本申请的实施例中,为了降低在预览界面显示时四边形边框的抖动,终端不会直接将当前获得的初始稳定边框确定为当前第i帧预览图像对应的第i个稳定边框,而是将当前获得的初始稳定边框与预先存储的历史第(i-1)个稳定边框进行相似度的比较,进而基于比较结果确定出最终进行输出预览的第i个稳定边框。It should be understood that, in the embodiments of the present application, in order to reduce the jitter of the quadrilateral frame when the preview interface is displayed, the terminal will not directly determine the currently obtained initial stable frame as the i-th stable frame corresponding to the current i-th frame preview image, Instead, the similarity is compared between the currently obtained initial stable frame and the pre-stored historical (i-1) stable frame, and then the i-th stable frame for final output preview is determined based on the comparison result.
进一步地,在本申请的实施例中,终端成功确定出第i个稳定边框之后,可以进一步按照该稳定边框对第i个预览图像进行显示处理。Further, in the embodiment of the present application, after the terminal successfully determines the i-th stable frame, the terminal may further perform display processing on the i-th preview image according to the stable frame.
步骤105、按照第i个稳定边框对第i个预览图像进行显示处理。Step 105: Perform display processing on the ith preview image according to the ith stable frame.
在本申请的实施例中,终端成功确定第i个稳定边框之后,终端可以进一步按照该稳定边框对第i个预览图像进行显示处理。In the embodiment of the present application, after the terminal successfully determines the i-th stable frame, the terminal may further perform display processing on the i-th preview image according to the stable frame.
具体的,在本申请的实施例中,终端可以基于第i个稳定边框对第i个预览图像进行渲染处理,获得渲染后预览图像,进而将渲染后的预览图像显示。Specifically, in the embodiment of the present application, the terminal may perform rendering processing on the ith preview image based on the ith stable frame, obtain a rendered preview image, and then display the rendered preview image.
详细的,终端对第i个预览图像中的第i个稳定边框进行渲染,获得渲染后稳定边框,然后基于渲染后稳定边框和第i个预览图像生成渲染后预览图像,从而在预览画面中显示该渲染后预览图像。In detail, the terminal renders the i-th stable frame in the i-th preview image, obtains a post-rendering stable frame, and then generates a post-rendering preview image based on the post-rendering stable frame and the i-th preview image, so as to display it on the preview screen. Preview image after this rendering.
进一步的,在本申请的实施例中,终端可以对渲染后预览图像进行实时扫描处理,从而获得目标对象的具体参数。具体的,终端可以仅对目标稳定边框中的目标对象进行实时扫描处理,以进行信息自动识别。Further, in the embodiment of the present application, the terminal may perform real-time scanning processing on the rendered preview image, so as to obtain specific parameters of the target object. Specifically, the terminal may only perform real-time scanning processing on the target object in the target stable frame, so as to perform automatic information identification.
本申请实施例提供了一种图像显示方法,在对包含目标对象的当前预览图像进行边框检测处理,获得目标对象对应的四边形边框之后,终端可以先对该四边形边框进行基于边框相似度的聚类处理,并从获得的至少一个边框组中选取出目标边框组,以及进一步从该目标边框组中确定初始稳定边框,进而基于该初始稳定边框和历史稳定边框的对比进一步确定出当前稳定边框,从而将按照当前稳定边框对当前预览图像进行显示处理。可见,在本申请中,终端不再是基于边框检测得到的四边形边框直接进行图像预览,而是在对检测获得的四边形边框进行相似度聚类、目标边框组的选取和初始稳定边框的确定等去除异常帧操作,以及与历史稳定边框进行对比的去噪稳定操作,获得当前稳定四边形边框之后,基于该稳定四边形边框进行图像预览,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷。An embodiment of the present application provides an image display method. After performing frame detection processing on a current preview image containing a target object and obtaining a quadrilateral frame corresponding to the target object, the terminal may first perform clustering based on frame similarity on the quadrilateral frame. process, and select a target frame group from the obtained at least one frame group, and further determine an initial stable frame from the target frame group, and then further determine the current stable frame based on the comparison between the initial stable frame and the historical stable frame, so that The current preview image will be displayed according to the current stable frame. It can be seen that in this application, the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering on the quadrilateral frame obtained by detection, selection of the target frame group, and determination of the initial stable frame, etc. The operation of removing abnormal frames, and the denoising stabilization operation compared with the historical stable frame, after obtaining the current stable quadrilateral frame, the image preview is performed based on the stable quadrilateral frame, which solves the problem of unstable display of the quadrilateral frame in the preview screen, and overcomes the problem of previewing. The screen display is not smooth defect.
基于上述实施例,在本申请的另一实施例中,图6为本申请实施例提出的图像显示方法的实现流程示意图四,如图6所示,终端对第i帧预览图像进行边框检测处理,获得目标对象对应的第i个四边形边框之后,即步骤101之后,且基于目标对象对应的第一个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组之前,即步骤102之前,终端进行图像处理的方法包括:Based on the foregoing embodiment, in another embodiment of the present application, FIG. 6 is a fourth schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application. As shown in FIG. 6 , the terminal performs frame detection processing on the i-th frame preview image , after the i-th quadrilateral frame corresponding to the target object is obtained, that is, after step 101, and based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame, similarity clustering processing is performed, and before at least one frame group is obtained, that is, Before step 102, the method for the terminal to perform image processing includes:
步骤106、将第i个四边形边框存储至先入先出队列(First Input First Output,FIFO)的第N位;其中,N为大于2的整数,N表征FIFO的最大存储能力。Step 106: Store the i-th quadrilateral frame in the N-th position of a first-in-first-out queue (First Input First Output, FIFO); wherein, N is an integer greater than 2, and N represents the maximum storage capacity of the FIFO.
需要说明的是,在本申请的实施例中,终端对每一帧预览图像执行四边形检测处理,获得每一四边形边框之后,都会将当前预览图像对应的这一四边形边框先存储至FIFO队列中的尾部,即队列的最后一位。It should be noted that, in the embodiment of the present application, the terminal performs quadrilateral detection processing on each frame of preview image, and after obtaining each quadrilateral frame, it will first store the quadrilateral frame corresponding to the current preview image in the FIFO queue. The tail, the last bit of the queue.
具体的,FIFO队列个数由其最大存储能力决定,即最大存储能力为多少,FIFO队列中便可存储多少个图像帧。如假设当前FIFO队列中有N位,则表征该FIFO队列的最大存储个数为N个。Specifically, the number of FIFO queues is determined by its maximum storage capacity, that is, the maximum storage capacity is, and how many image frames can be stored in the FIFO queue. If it is assumed that there are N bits in the current FIFO queue, the maximum storage number representing the FIFO queue is N.
应理解,FIFO遵循“先入先出”原则,在本申请的实施例中,终端始终将当前第i帧预览图像检测获得的第i个四边形边框存储至FIFO队列的尾部,即第N位。此时,历史预览图像检测获得的历史四边形边框在FIFO队列中依次朝前平移一位;其中,原来位于FIFO队列中第一位的历史四边形边框将被移出该队列,而第(i-1)个历史四边形边框将被移位至第(N-1)位。It should be understood that the FIFO follows the "first-in, first-out" principle. In the embodiment of the present application, the terminal always stores the i-th quadrilateral frame obtained by detecting the current i-th frame preview image to the tail of the FIFO queue, that is, the N-th position. At this time, the historical quadrilateral frame obtained by the historical preview image detection is shifted forward in sequence in the FIFO queue; the historical quadrilateral frame originally located at the first position in the FIFO queue will be moved out of the queue, and the (i-1) The history quad border will be shifted to the (N-1)th bit.
基于上述实施例,在本申请的另一实施例中,图7为本申请实施例提出的图像显示方法的实现流程示意图五,如图7所示,终端将第i个四边形边框存储至先入先出队列FIFO的第N位之后,即步骤106之后,如果i小于N,那么终端基于目标对象对应的第一个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组的方法包括以下步骤:Based on the above-mentioned embodiment, in another embodiment of the present application, FIG. 7 is a schematic diagram 5 of the implementation flow of the image display method proposed in the embodiment of the present application. As shown in FIG. 7 , the terminal stores the i-th quadrilateral frame to the first-in-first-out order. After dequeuing the Nth bit of the FIFO, that is, after step 106, if i is less than N, then the terminal performs similarity clustering processing based on the first quadrilateral border corresponding to the target object to the i-th quadrilateral border, and obtains at least one border group. The method includes the following steps:
步骤102a、从FIFO中读取第一个四边形边框至第i个四边形边框。 Step 102a: Read the first quadrilateral frame to the i-th quadrilateral frame from the FIFO.
步骤102b、基于第一个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组。 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.
需要说明的是,在本申请的实施例中,FIFO中存储的四边形边框个数与FIFO队列最大存储个数N相关联。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.
具体的,如果i小于N,那么终端在将第i个四边形边框存储至FIFO队列的第N位之后,此时FIFO队列中包含第一个至第i个四边形边框,也就是说,FIFO队列空间足够大,并不存在被移除出去的四边形边框。Specifically, if i is less than N, after the terminal stores the i-th quadrilateral frame in the N-th bit of the FIFO queue, the FIFO queue contains the first to i-th quadrilateral frames, that is, the FIFO queue space It's big enough that there's no quad bezel that's been removed.
进一步的,终端可以从FIFO队列中读取第一帧至第i帧预览图像对应的第一个至第i个四边形边框,并基于这i个四边形边框进行基于边框相似度的聚类处理。Further, the terminal may read the first to i-th quadrilateral frames corresponding to the preview images from the first frame to the i-th frame from the FIFO queue, and perform clustering processing based on frame similarity based on the i quadrilateral frames.
具体的,图8为本申请实施例提出的图像显示方法的实现流程示意图六,如图8所示,终端基于第一个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组的方法包括:Specifically, FIG. 8 is a schematic diagram 6 of the implementation process of the image display method proposed by the embodiment of the present application. As shown in FIG. 8 , the terminal performs similarity clustering processing based on the first quadrilateral frame to the i-th quadrilateral frame, and obtains at least one The methods of the border group include:
步骤102b1、获取第k个四边形边框对应的第k个顶点坐标数据,和前(k-1)个四边形边框对应的前(k-1)个顶点坐标数据;其中,k为大于1、且小于或等于i的整数。Step 102b1, obtain the kth vertex coordinate data corresponding to the kth quadrilateral frame, and the first (k-1) vertex coordinate data corresponding to the first (k-1) quadrilateral frame; wherein, k is greater than 1 and less than or an integer equal to i.
步骤102b2、按照预设相似度函数计算第k个顶点坐标数据与前(k-1)个顶点坐标数据对应的前(k-1)个距离差值。Step 102b2: Calculate the first (k-1) distance differences corresponding to the kth vertex coordinate data and the previous (k-1) vertex coordinate data according to the preset similarity function.
步骤102b3、从前(k-1)个距离差值中确定最小距离差值。Step 102b3: Determine the minimum distance difference from the previous (k-1) distance differences.
步骤102b4、基于最小距离差值和前(k-1)个四边形边框对应的第一历史边框组构建至少一个边框组。Step 102b4: Construct at least one border group based on the minimum distance difference and the first historical border group corresponding to the first (k-1) quadrilateral borders.
需要说明的是,在本申请的实施例中,终端先进行FIFO队列中的第一个至第i个四边形边框中、第一个四边形边框的聚类处理,由于第一个四边形边框之前未存在任何已完成聚类的四边形边框样本,即无任何边框组,此时,终端可以先为第一个四边形边框建立一个新的边框组。It should be noted that, in the embodiment of the present application, the terminal first performs the clustering processing of the first quadrilateral frame from the first to the i-th quadrilateral frame in the FIFO queue, because the first quadrilateral frame does not exist before Any quadrilateral frame sample that has been clustered, that is, without any frame group, at this time, the terminal can first create a new frame group for the first quadrilateral frame.
进一步的,当进行FIFO队列中的第二个四边形边框的聚类处理时,即k等于2时,终端可以先对第二个四边形边框与已聚类的第一个四边形边框进行相似度比较,基于比较结果确定第二个四边形边框所属的边框组。Further, when performing the clustering processing of the second quadrilateral frame in the FIFO queue, that is, when k is equal to 2, the terminal can first compare the similarity between the second quadrilateral frame and the clustered first quadrilateral frame, Determines the border group to which the second quadrilateral border belongs based on the comparison result.
具体的,终端可以分别获取第二个四边形边框的顶点坐标数据和第一个四边形边框的顶点坐标数据,然后基于预设相似度函数、两个顶点坐标数据计算能够表征相似度的距离差值。Specifically, the terminal may obtain the vertex coordinate data of the second quadrilateral frame and the vertex coordinate data of the first quadrilateral frame respectively, and then calculate the distance difference that can characterize the similarity based on the preset similarity function and the two vertex coordinate data.
这里,终端可以基于公式(1)至公式(3)计算距离差值,以确定四边形边框的相似度。Here, the terminal may calculate the distance difference based on formula (1) to formula (3) to determine the similarity of the quadrilateral frame.
具体的,假设四边形信息Q为每个四边形边框的四个顶点的坐标位置。Specifically, it is assumed that the quadrilateral information Q is the coordinate positions of the four vertices of each quadrilateral frame.
Q={p i|p i=(x i,y i),i={0,1,2,3}}          (1) Q={pi | pi =(x i ,y i ), i ={0,1,2,3}} (1)
其中,当i=1时,p 1=(x 1,y 1),即四边形第一个顶点坐标数据;同理,i=2时,p 2=(x 2,y 2), 即第二个顶点坐标数据;i=3时,p 3=(x 3,y 3),即第三个顶点坐标数据;i=4时,p 4=(x 4,y 4),即第四个顶点坐标数据。 Among them, when i=1, p 1 =(x 1 , y 1 ), that is, the coordinate data of the first vertex of the quadrilateral; similarly, when i=2, p 2 =(x 2 , y 2 ), that is, the second vertex coordinate data; when i=3, p 3 =(x 3 ,y 3 ), that is, the third vertex coordinate data; when i=4, p 4 =(x 4 , y 4 ), that is, the fourth vertex Coordinate data.
此时,预设相似度函数即求取两个四边形的的距离差值。At this time, the preset similarity function is to obtain the distance difference between the two quadrilaterals.
Distance(A,B)=|M(A)-M(B)| p      (2) Distance(A,B)=|M(A)-M(B)| p (2)
其中,|| p为L p空间范数,较常用的当p取1时为曼哈顿距离,当p取2时为欧式距离,当p取∞时为计算最大绝对值。M(Q)为四边形信息的映射函数,用于将原始四边形信息Q映射到距离计算的空间。 Among them, || p is the spatial norm of L p . More commonly, when p is 1, it is the Manhattan distance, when p is 2, it is the Euclidean distance, and when p is ∞, the maximum absolute value is calculated. M(Q) is a mapping function of quadrilateral information, which is used to map the original quadrilateral information Q to the space of distance calculation.
这里,公式(2)中的M(Q)的确定方法如下所示。Here, the determination method of M(Q) in the formula (2) is as follows.
M(Q)=(k 0(Q),k 1(Q),k 2(Q),…)         (3) M(Q)=(k 0 (Q),k 1 (Q),k 2 (Q),…) (3)
其中,k i(Q)为具体的映射函数。例如,
Figure PCTCN2021076494-appb-000001
即计算四边形的中心点位置,面积等作为映射项。
Among them, k i (Q) is a specific mapping function. E.g,
Figure PCTCN2021076494-appb-000001
That is, the center point position, area, etc. of the quadrilateral are calculated as mapping items.
详细的,终端可以先基于预设相似度函数中的公式(1)和公式(3),以及第一个四边形边框的顶点坐标数据与第二个四边形边框的顶点坐标数据先将其两个四边形边框分别映射至距离空间,获得两个四边形边框分别对应的距离,进而基于公式(3)计算距离差值,从而确定出第一个四边形边框与第二个四边形边框的相似度比较结果。In detail, the terminal can first compare the two quadrilaterals based on the formula (1) and formula (3) in the preset similarity function, as well as the vertex coordinate data of the first quadrilateral frame and the vertex coordinate data of the second quadrilateral frame. The borders are mapped to the distance space respectively, the corresponding distances of the two quadrilateral borders are obtained, and then the distance difference is calculated based on formula (3) to determine the similarity comparison result between the first quadrilateral border and the second quadrilateral border.
进一步的,终端可以预先设置能够表征相似度结果的预设距离阈值,终端可以将上述距离差值与该预设距离阈值进行比较,进而基于比较结果确定第一个四边形边框与第二个四边形边框的相似度结果。Further, the terminal may preset a preset distance threshold that can characterize the similarity result, and the terminal may compare the above-mentioned distance difference with the preset distance threshold, and then determine the first quadrilateral frame and the second quadrilateral frame based on the comparison result. similarity results.
其中,若距离差值小于上述预设距离阈值,那么终端可以判定第一个四边形边框与第二个四边形边框相似,那么终端确定第二个四边形边框归类为第一个四边形边框所属的边框组。若距离差值大于或者等于上述预设距离阈值,那么终端可以判定第一个四边形边框与第二个四边形边框不相似,那么终端重新建立新的边框组,并将第二个四边形边框归类于该新的边框组。Wherein, if the distance difference is less than the preset distance threshold, 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 as the frame group to which the first quadrilateral frame belongs . If the distance difference is greater than or equal to the above preset distance threshold, the terminal can determine that the first quadrilateral frame is not similar to the second quadrilateral frame, then the terminal re-establishes a new frame group, and classifies the second quadrilateral frame as The new border group.
进一步的,重复上述步骤,继续执行第k个四边形边框与前(k-1)个四边形边框是否相似的判断处理,并对第k个四边形边框执行基于相似度判定结果的分组处理,直至完成第i个四边形边框的分组处理,进而获得至少一个边框组;其中,k为小于i的整数。Further, repeat the above steps, continue to perform the judgment processing of whether the kth quadrilateral frame is similar to the first (k-1) quadrilateral frame, and perform the grouping process based on the similarity judgment result to the kth quadrilateral frame, until the completion of the th The i quadrilateral frames are grouped to obtain at least one frame group; wherein, k is an integer smaller than i.
需要说明的是,在继续执行第k个四边形边框与前(k-1)个四边形边框的是否相似的判断处理时,终端可以计算第k个四边形边框与前(k-1)个四边形边框的(k-1)距离差值,并从这(k-1)个距离差值中确定最小差值,进而基于最小差值与前(k-1)个四边形边框对应的边框组构建至少一个边框组。It should be noted that, when continuing to perform the judgment process of whether the kth quadrilateral frame is similar to the first (k-1) quadrilateral frame, the terminal can calculate the difference between the kth quadrilateral frame and the first (k-1) quadrilateral frame. (k-1) distance difference, and determine the minimum difference from the (k-1) distance differences, and then construct at least one border based on the border group corresponding to the first (k-1) quadrilateral borders based on the minimum difference Group.
具体的,若最小距离差值大于或者等于预设距离阈值,即不存在第k个四边形边框对应的边框组,无法将第k个四边形边框归类于前(k-1)个四边形边框对应的边框组中,则终端可以建立第k个四边形边框对应的新增边框组,并基于新增边框组和第一历史边框组构建至少一个边框组。Specifically, if the minimum distance difference is greater than or equal to the preset distance threshold, that is, there is no frame group corresponding to the kth quadrilateral frame, and the kth quadrilateral frame cannot be classified as the first (k-1) quadrilateral frame corresponding to the frame. In the frame group, the terminal may create a new frame group corresponding to the kth quadrilateral frame, and build at least one frame group based on the newly-added frame group and the first historical frame group.
具体的,若最小距离差值小于预设距离阈值,即存在第k个四边形边框对应的边框组,可以将第k个四边形边框归类于前(k-1)个四边形边框对应的边框组中,则终端可以将第k个四边形边框归类于前(k-1)个四边形边框对应的边框组中、最小距离差值对应的目标边框组,并基于四边形边框样本数更新后的边框组构建至少一个边框组。Specifically, if the minimum distance difference is less than the preset distance threshold, that is, there is a frame group corresponding to the kth quadrilateral frame, and the kth quadrilateral frame can be classified into the frame group corresponding to the first (k-1) quadrilateral frames. , the terminal can classify the k-th quadrilateral frame into the frame group corresponding to the first (k-1) quadrilateral frames and the target frame group corresponding to the minimum distance difference, and construct the frame group based on the updated sample number of the quadrilateral frame. At least one border group.
例如,当终端对FIFO队列中的第三个四边形边框进行聚类处理时,终端基于顶点坐标数据,利用公式(1)至公式(3)计算第三个四边形边框分别与第一个四边形边框、第二个四边形边框的距离差值。如果第三个四边形与第一个四边形边框的距离差值小于预设距离阈值,而与第二个四边形边框的距离差值大于预设距离阈值,那么终端可以确定第三个四边形边框归类与第一个四边形边框所属的边框组;如果第三个四边形与第一个四边形边框的距离差值小于预设距离阈值,同时与第二个四边形边框的距离差值也小于预设距离阈值,但是那么终端将第三个四边形边框归类距离差值更小的第一个四边形边框所属的边框组;如果距离差值均大于预设距离阈值,那么终端重新建立边框组,并将第三个四边形边框归类于新的边框组。For example, when the terminal performs clustering processing on the third quadrilateral frame in the FIFO queue, the terminal uses formula (1) to formula (3) to calculate the third quadrilateral frame and the first quadrilateral frame, The distance difference of the second quad border. If the distance difference between the third quadrilateral and the first quadrilateral frame is less than the preset distance threshold, and the distance difference between the third quadrilateral and the second quadrilateral frame is greater than the preset distance threshold, the terminal may determine that the third quadrilateral frame is classified as 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 from the second quadrilateral border is also less than the preset distance threshold, but Then the terminal classifies the third quadrilateral frame into the frame group to which the first quadrilateral frame with a smaller distance difference belongs; if the distance difference is greater than the preset distance threshold, the terminal re-establishes the frame group and assigns the third quadrilateral frame to the frame group. Borders are grouped into a new border group.
重复上述步骤,直至完成FIFO队列中第一个至第i个四边形边框的聚类处理,进而获得至少一个四边形边框组。The above steps are repeated until the clustering processing of the first to i-th quadrilateral frames in the FIFO queue is completed, and at least one quadrilateral frame group is obtained.
基于上述实施例,在本申请的另一实施例中,图9为本申请实施例提出的图像显示方法的实现流程示意图七,如图9所示,终端将第i个四边形边框存储至FIFO的第N位之后,即步骤106之后,如果i大于或者等于N,那么终端基于目标对象对应的第一个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组的方法还可以包括以下步骤:Based on the above embodiment, in another embodiment of the present application, FIG. 9 is a seventh schematic diagram of the implementation flow of the image display method proposed by the embodiment of the present application. As shown in FIG. 9 , the terminal stores the i-th quadrilateral frame in the FIFO. After the Nth bit, 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 frame corresponding to the target object to the i-th quadrilateral frame, and the method for obtaining at least one frame group is also The following steps can be included:
步骤102c、从FIFO中读取第(i-N+1)个四边形边框至第i个四边形边框。 Step 102c: Read the (i-N+1)th quadrilateral frame to the i-th quadrilateral frame from the FIFO.
步骤102d、基于第(i-N+1)个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组。 Step 102d: Perform similarity clustering processing based on the (i-N+1)th quadrilateral frame to the ith quadrilateral frame to obtain at least one frame group.
具体的,如果i等于或者大于N,那么终端在将第i个四边形边框存储至FIFO队列的第N位之后,此时FIFO队列中包含第(i-N+1)个至第i个四边形边框,也就是说,FIFO队列空间不够,前(i-N+2)个四边形边框已被移出FIFO队列。Specifically, if i is equal to or greater than N, after the terminal stores the i-th quadrilateral frame in the N-th bit of the FIFO queue, the FIFO queue contains (i-N+1)-th to i-th quadrilateral frames at this time. , that is, there is not enough space in the FIFO queue, and the first (i-N+2) quadrilateral borders have been removed from the FIFO queue.
进一步的,终端可以从FIFO队列中读取第(i-N+1)帧至第i帧预览图像对应的第(i-N+1)个至第i个四变形边框,并进行基于边框相似度的聚类处理。Further, the terminal can read the (i-N+1)th to the ith four-deformed frame corresponding to the (i-N+1)th frame to the i-th frame preview image from the FIFO queue, and perform a frame-based similarity calculation. degree of clustering.
具体的,图10为本申请实施例提出的图像显示方法的实现流程示意图八,如图10所示,终端基于第(i-N+1)个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组的方法包括:Specifically, FIG. 10 is a schematic diagram 8 of the implementation process of the image display method proposed by the embodiment of the present application. As shown in FIG. 10 , the terminal performs similarity aggregation based on the (i-N+1)th quadrilateral frame to the ith quadrilateral frame. Class processing, the methods for obtaining at least one border group include:
步骤102d1、获取第(i-N+k)个四边形边框对应的第(i-N+k)个顶点坐标数据,和前(i-N+k-1)个四边形边框对应的前(i-N+k-1)个顶点坐标数据;其中,k为大于1、且小于或等于N的整数。Step 102d1, obtain the (i-N+k)th vertex coordinate data corresponding to the (i-N+k)th quadrilateral frame, and the first (i-N+k-1) quadrilateral frame corresponding to the previous (i- N+k-1) vertex coordinate data; wherein, k is an integer greater than 1 and less than or equal to N.
步骤102d2、按照预设相似度函数计算第(i-N+k)个顶点坐标数据与前(i-N+k-1)个顶点坐标数据对应的前(i-N+k-1)个距离差值。Step 102d2, calculate the first (i-N+k-1) corresponding to the (i-N+k)th vertex coordinate data and the previous (i-N+k-1) vertex coordinate data according to the preset similarity function distance difference.
步骤102d3、从前(i-N+k-1)个距离差值中确定最小距离差值。Step 102d3: Determine the minimum distance difference from the previous (i-N+k-1) distance differences.
步骤102d4、基于最小距离差值和前(i-N+k-1)个四边形边框对应的第二历史边框组构建至少一个边框组。Step 102d4: Construct 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 borders.
需要说明的是,在本申请的实施例中,终端始终仅针对FIFO序列中当前存在的全部四边形边框进行聚类处理,不保存历史FIFO序列的四边形边框的聚类结果。It should be noted that, in the embodiments of the present application, the terminal always performs clustering processing only on all the quadrilateral frames currently existing in the FIFO sequence, and does not save the clustering results of the quadrilateral frames in the historical FIFO sequence.
需要说明的是,在本申请的实施例中,终端先进行FIFO队列中的第(i-N+1)个至第i个四边形边框中、第(i-N+1)个四边形边框的聚类处理,由于第(i-N+1)个四边形边框之前未存在任何已完成聚类的四边形边框样本,即无任何边框组,此时,终端可以先为第(i-N+1)个四边形边框建立一个新的边框组。It should be noted that, in the embodiment of the present application, the terminal first performs aggregation of the (i-N+1)th to the i-th quadrilateral frame and the (i-N+1)th quadrilateral frame in the FIFO queue. Class processing, since there is no quadrilateral frame sample that has completed clustering before the (i-N+1)th quadrilateral frame, that is, there is no frame group, at this time, the terminal can be the (i-N+1)th first. The quad border creates a new border group.
进一步的,当进行FIFO队列中的第(i-N+2)个四边形边框的聚类处理时,即k等于2时,终端可以先对第(i-N+2)个四边形边框与已聚类的第(i-N+1)个四边形边框进行相似度比较,基于比较结果确定第(i-N+2)个四边形边框所属的边框组。Further, when performing the clustering processing of the (i-N+2)th quadrilateral frame in the FIFO queue, that is, when k is equal to 2, the terminal can first perform clustering on the (i-N+2)th quadrilateral frame and the The similarity of the (i-N+1)th quadrilateral frame of the class is compared, and the frame group to which the (i-N+2)th quadrilateral frame belongs is determined based on the comparison result.
具体的,终端可以分别获取第(i-N+2)个四边形边框的顶点坐标数据和第(i-N+1)个四边形边框的顶点坐标数据,然后可以基于公式(1)至公式(3)计算距离差值,并与表征相似度结果的预设距离阈值进行比较,若距离差值小于或者等于上述预设距离阈值,那么终端可以判定第(i-N+1)个四边形边框与第(i-N+2)个四边形边框相似,那么终端确定第(i-N+2)个四边形边框归类为第(i-N+1)个四边形边框所属的边框组。若距离差值大于上述预设距离阈值,那么终端可以判定第(i-N+1)个四边形边框与第(i-N+2)个四边形边框不相似,那么终端重新建立新的边框组,并将第(i-N+2)个四边形边框归类于该新的边框组。Specifically, the terminal can obtain the vertex coordinate data of the (i-N+2)th quadrilateral frame and the vertex coordinate data of the (i-N+1)th quadrilateral frame respectively, and then can obtain the vertex coordinate data based on formula (1) to formula (3) ) Calculate the distance difference, and compare it with the preset distance threshold that characterizes the similarity result, if the distance difference is less than or equal to the above-mentioned preset distance threshold, then the terminal can determine the (i-N+1)th quadrilateral border and the first The (i-N+2) quadrilateral frames are similar, then the terminal determines that the (i-N+2) th quadrilateral frame is classified as the frame group to which the (i-N+1) th quadrilateral frame 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 frame is not similar to the (i-N+2)th quadrilateral frame, then the terminal re-establishes a new frame group, And classify the (i-N+2)th quadrilateral frame into the new frame group.
进一步的,重复上述步骤,继续执行第(i-N+k)个四边形边框与前(i-N+k-1)个四边形边框是否相似的判断处理,并对第(i-N+k)个四边形边框执行基于相似度判定结果的分组处理,直至完成第i个四边形边框的分组处理,进而获得至少一个边框组;其中,k为小于i的整数。Further, repeat the above steps, continue to perform the (i-N+k) th quadrilateral frame and the first (i-N+k-1) judging processing whether the quadrilateral frame is similar, and to the (i-N+k) Perform the grouping process based on the similarity determination result for each quadrilateral frame until the grouping processing of the i-th quadrilateral frame is completed, and then at least one frame group is obtained; wherein, k is an integer less than i.
需要说明的是,在继续执行第(i-N+k)个四边形边框与前(i-N+k-1)个四边形边框的是否相似的判断处理时,终端可以计算第(i-N+k)个四边形边框与前(i-N+k-1)个四边形边框的(i-N+k-1)距离差值,并从这(i-N+k-1)个距离差值中确定最小差值,进而基于最小差值与前(i-N+k-1)个四边形边框对应的边框组构建至少一个边框组。It should be noted that, when continuing to perform the process of judging whether the (i-N+k)th quadrilateral frame is similar to the previous (i-N+k-1) quadrilateral frame, the terminal can calculate the (i-N+ The (i-N+k-1) distance difference between k) quadrilateral borders and the previous (i-N+k-1) quadrilateral borders, and from these (i-N+k-1) distance differences The minimum difference value is determined, and then at least one frame group is constructed based on the frame group corresponding to the minimum difference value and the first (i-N+k-1) quadrilateral frames.
具体的,若最小距离差值大于或者等于预设距离阈值,即不存在第(i-N+k)个四边形边框对应的边框组,无法将第(i-N+k)个四边形边框归类于前(i-N+k-1)个四边形边框对应的边框组中,则终端可以建立第(i-N+k)个四边形边框对应的新增边框组,并基于新增边框组和第一历史边框组构建至少一个边框组。Specifically, if the minimum distance difference is greater than or equal to the preset distance threshold, that is, there is no frame group corresponding to the (i-N+k)th quadrilateral frame, and the (i-N+k)th quadrilateral frame cannot be classified In the border group corresponding to the first (i-N+k-1) quadrilateral borders, the terminal can establish a new border group corresponding to the (i-N+k)th quadrilateral border, and based on the new border group and the A historical border group constructs at least one border group.
具体的,若最小距离差值小于预设距离阈值,即存在第(i-N+k)个四边形边框对应的边框组,可以将第(i-N+k)个四边形边框归类于前(i-N+k-1)个四边形边框对应的边框组中,则终端可以将第(i-N+k)个四边形边框归类于前(i-N+k-1)个四边形边框对应的边框组中、最小距离差值对应的目标边框组,并基于四边形边框样本数更新后的边框组构建至少一个边框组。Specifically, if the minimum distance difference is smaller than the preset distance threshold, that is, there is a frame group corresponding to the (i-N+k)th quadrilateral frame, and the (i-N+k)th quadrilateral frame can be classified as the first (i-N+k)th quadrilateral frame. In the frame group corresponding to the i-N+k-1) quadrilateral frames, the terminal can classify the (i-N+k) th quadrilateral frame as the one corresponding to the first (i-N+k-1) quadrilateral frame. In the frame group, the target frame group corresponding to the minimum distance difference, and at least one frame group is constructed based on the frame group after the number of quadrilateral frame samples is updated.
例如,当终端对FIFO队列中的第(i-N+3)个四边形边框进行聚类处理时,终端基于顶点坐标数据,利用公式(1)至公式(3)计算第(i-N+3)个四边形边框分别与第(i-N+1)个四边形边框、 第(i-N+2)个四边形边框的距离差值。如果第(i-N+3)个四边形与第(i-N+1)个四边形边框的距离差值小于预设距离阈值,而与第(i-N+2)个四边形边框的距离差值大于预设距离阈值,那么终端可以确定第(i-N+3)个四边形边框归类与第(i-N+1)个四边形边框所属的边框组;如果第(i-N+3)个四边形与第(i-N+1)个四边形边框的距离差值小于预设距离阈值,同时与第(i-N+2)个四边形边框的距离差值也小于预设距离阈值,但是那么终端将第(i-N+3)个四边形边框归类距离差值更小的第(i-N+1)个四边形边框所属的边框组;如果距离差值均大于预设距离阈值,那么终端重新建立边框组,并将第(i-N+3)个四边形边框归类于新的边框组。For example, when the terminal performs clustering processing on the (i-N+3)th quadrilateral frame in the FIFO queue, the terminal uses formula (1) to formula (3) to calculate the (i-N+3th) based on the vertex coordinate data. ), the distance difference between the quadrilateral frame and the (i-N+1) th quadrilateral frame and the (i-N+2) th quadrilateral frame, respectively. 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 from the (i-N+2)th quadrilateral border greater than the preset distance threshold, then the terminal can determine the (i-N+3)th quadrilateral frame classification and the frame group to which the (i-N+1)th quadrilateral frame belongs; if the (i-N+3)th quadrilateral frame belongs to the frame group; The distance difference between the quadrilateral and the (i-N+1)th quadrilateral border is less than the preset distance threshold, and the distance difference with the (i-N+2)th quadrilateral border is also smaller than the preset distance threshold, but then the terminal Classify the (i-N+3)th quadrilateral frame into the frame group to which the (i-N+1)th quadrilateral frame with a smaller distance difference belongs; if the distance difference is greater than the preset distance threshold, the terminal restarts Create a border group and classify the (i-N+3)th quadrilateral border into a new border group.
重复上述步骤,直至完成FIFO队列中第(i-N+1)个至第i个四边形边框的聚类处理,进而获得至少一个四边形边框组。The above steps are repeated until the clustering processing of the (i-N+1)th to ith quadrilateral frames in the FIFO queue is completed, thereby obtaining at least one quadrilateral frame group.
基于上述实施例,在本申请的另一实施例中,图11为本申请实施例提出的图像显示方法的实现流程示意图九,如图11所示,步骤101之后,终端基于目标对象对应的第一个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组的方法还可以包括以下步骤:Based on the above embodiment, in another embodiment of the present application, FIG. 11 is a schematic diagram 9 of the implementation flow of the image display method proposed by the embodiment of the present application. As shown in FIG. 11 , after step 101, the terminal based on the first image display method corresponding to the target object The method for obtaining at least one frame group by performing similarity clustering processing on a quadrilateral frame to the i-th quadrilateral frame may further include the following steps:
步骤102e、获取第i个四边形边框对应的第i个顶点坐标数据,和历史已分组的前(i-1)个四边形边框对应的前(i-1)个顶点坐标数据。 Step 102e: Obtain the i-th vertex coordinate data corresponding to the i-th quadrilateral frame, and the first (i-1) vertex coordinate data corresponding to the previous (i-1) quadrilateral frames that have been grouped in history.
步骤102f、按照预设相似度函数分别计算第i个顶点坐标数据与历史前(i-1)个顶点坐标数据对应的(i-1)个距离差值。 Step 102f: Calculate (i-1) distance differences corresponding to the i-th vertex coordinate data and the previous (i-1) vertex coordinate data according to the preset similarity function.
步骤102g、从(i-1)个距离差值中确定最小距离差值。 Step 102g: Determine the minimum distance difference from the (i-1) distance differences.
步骤102h、基于最小距离差值和前(i-1)个四边形边框对应的第三历史边框组构建至少一个边框组。 Step 102h, construct at least one border group based on the minimum distance difference and the third historical border group corresponding to the first (i-1) quadrilateral borders.
在本申请的实施例中,终端可以不必将检测获得的四边形边框存储至FIFO队列,而是直接对检测获得的最新帧,即当前第i预览图像对应的第i个四边形边框与已归类完成的四边形边框样本进行相似度比较,进行实现四边形边框的聚类。In the embodiment of the present application, the terminal does not need to store the quadrilateral frame obtained by the detection in the FIFO queue, but directly completes the classification of the latest frame obtained by the detection, that is, the i-th quadrilateral frame corresponding to the current i-th preview image and the classified frame. The similarity of the quadrilateral border samples is compared, and the clustering of quadrilateral borders is carried out.
具体的,终端可以利用公式(1)至公式(3)分别计算第i个四边形边框与历史前(i-1)个四边形边框中、每一个历史四边形边框的距离差值,即(i-1)个距离差值,并将其距离差值与预设距离阈值进行比较,从而根据比较结果确定边框相似度结果,并实现四边形边框的聚类。Specifically, the terminal can use formula (1) to formula (3) to calculate the distance difference between the i-th quadrilateral frame and the previous (i-1) quadrilateral frame in the history, and the distance difference between each historical quadrilateral frame, that is, (i-1 ) distance difference, and compare the distance difference with the preset distance threshold, so as to determine the frame similarity result according to the comparison result, and realize the clustering of the quadrilateral frame.
具体的,终端可以从(i-1)个距离差值中确定最小距离差值,并基于基于最小距离差值和前(i-1)个四边形边框对应的历史边框组构建至少一个边框组。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 a historical frame group corresponding to the previous (i-1) quadrilateral frames.
这里,若最小距离差值大于或者等于预设距离阈值,即不存在第i个四边形边框对应的边框组,无法将第i个四边形边框归类于前(i-1)个四边形边框对应的边框组中,则终端可以建立第i个四边形边框对应的新增边框组,并基于新增边框组和第一历史边框组构建至少一个边框组。Here, if the minimum distance difference is greater than or equal to the preset distance threshold, that is, there is no frame group corresponding to the i-th quadrilateral frame, and the i-th quadrilateral frame cannot be classified as the frame corresponding to the first (i-1) quadrilateral frame. In the group, the terminal may establish a new frame group corresponding to the i-th quadrilateral frame, and build at least one frame group based on the newly added frame group and the first historical frame group.
这里,若最小距离差值小于预设距离阈值,即存在第i个四边形边框对应的边框组,可以将第i个四边形边框归类于前(i-1)个四边形边框对应的边框组中,则终端可以将第i个四边形边框归类于前(i-1)个四边形边框对应的边框组中、最小距离差值对应的目标边框组,并基于四边形边框样本数更新后的边框组构建至少一个边框组。Here, if the minimum distance difference is less than the preset distance threshold, that is, there is a frame group corresponding to the i-th quadrilateral frame, and the i-th quadrilateral frame can be classified into the frame group corresponding to the first (i-1) quadrilateral frame, Then the terminal can classify the i-th quadrilateral frame into the frame group corresponding to the first (i-1) quadrilateral frame and the target frame group corresponding to the minimum distance difference, and construct at least the frame group based on the updated quadrilateral frame sample number. A border group.
本申请实施例提出了一种图像显示方法,终端不可以对检测获得的四边形边框进行相似度聚类、目标边框组的选取和初始稳定边框的确定等去除异常帧操作,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷。The embodiment of the present application proposes an image display method, in which the terminal cannot perform the similarity clustering, the selection of the target frame group, the determination of the initial stable frame, etc. on the quadrilateral frame obtained by the detection to remove abnormal frames, which solves the problem of the quadrilateral in the preview screen. The frame display is unstable, which overcomes the defect that the preview screen is not displayed smoothly.
基于上述实施例,在本申请的另一实施例中,图12为本申请实施例提出的图像显示方法的实现流程示意图十,如图12所示,终端基于初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框的方法可以包括以下步骤:Based on the above embodiment, in another embodiment of the present application, FIG. 12 is a schematic diagram tenth of the implementation flow of the image display method proposed by the embodiment of the present application. As shown in FIG. 12 , the terminal is based on the initial stable frame and the (i-1th) ) stable borders and the method for determining the i-th stable border may include the following steps:
步骤104a、获取初始稳定边框对应的第一顶点坐标数据和第(i-1)个稳定边框对应的第二顶点坐标数据。 Step 104a: Obtain the first vertex coordinate data corresponding to the initial stable frame and the second vertex coordinate data corresponding to the (i-1)th stable frame.
步骤104b、按照预设相似度函数计算第一顶点坐标数据与第二顶点坐标数据的距离差值。 Step 104b: Calculate the distance difference between the first vertex coordinate data and the second vertex coordinate data according to the preset similarity function.
步骤104c、若距离差值小于预设距离阈值,则将第(i-1)个稳定边框确定为第i个稳定边框。Step 104c: If the distance difference is smaller than the preset distance threshold, determine the (i-1)th stable frame as the i-th stable frame.
步骤104d、若距离差值大于或者等于预设距离阈值,则将初始稳定边框确定为第i个稳定边框。 Step 104d: If the distance difference is greater than or equal to the preset distance threshold, determine the initial stable frame as the i-th stable frame.
具体的,在本申请的实施例中,终端在基于初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框的过程中,终端可以先获取初始稳定边框对应的第一顶点坐标数据,以及第(i-1)个稳定边框对应的第二顶点坐标数据,然后基于上述两个坐标数据以及预设相似度函数,即公式(1)至公式(3)计算初始稳定四边形边框和第(i-1)个稳定边框的相似度。Specifically, in the embodiment of the present application, in the process of determining the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame, the terminal may first obtain the coordinates of the first vertex corresponding to the initial stable frame data, and the second vertex coordinate data corresponding to the (i-1)th stable frame, and then calculate the initial stable quadrilateral frame and The similarity of the (i-1)th stable bounding box.
详细的,终端可以先基于预设相似度函数中的公式(1)和公式(3),以及初始稳定四边形边框的第一顶点坐标数据与第(i-1)个稳定边框的第二顶点坐标数据先将其两个四边形边框分别映射至 距离空间,获得初始稳定四边形边框对应的第一距离和第(i-1)个稳定边框对应的第二距离,进而基于公式(3)计算距离差值。In detail, the terminal may first base on formula (1) and formula (3) in the preset similarity function, as well as the first vertex coordinate data of the initial stable quadrilateral frame and the second vertex coordinate of the (i-1)th stable frame. The data first maps its two quadrilateral frames to the distance space respectively to obtain the first distance corresponding to the initial stable quadrilateral frame and the second distance corresponding to the (i-1)th stable frame, and then calculate the distance difference based on formula (3). .
进一步的,终端可以预设表征相似度结果的预设距离阈值,终端可以将上述距离差值与该预设距离阈值进行比较,进而基于比较结果确定初始稳定四边形边框与第(i-1)个稳定边框的相似度结果。Further, the terminal may preset a preset distance threshold representing the similarity result, and the terminal may compare the above-mentioned distance difference with the preset distance threshold, and then determine the initial stable quadrilateral border and the (i-1)th threshold based on the comparison result. Similarity results for stable bounding boxes.
其中,一方面,若距离差值小于或者等于上述预设距离阈值,那么终端可以判定初始稳定四边形边框与第(i-1)个稳定边框相似,那么为了保证预览画面的流畅性,终端采用与前一帧图像相同的稳定四边形边框,也就是将第(i-1)个稳定边框继续确定为当前第i个预览图像对应的第i个稳定边框。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 frame is similar to the (i-1)th stable frame, then in order to ensure the smoothness of the preview screen, the terminal adopts the same The same stable quadrilateral frame of the previous frame image, that is, the (i-1)th stable frame is continuously determined as the i-th stable frame corresponding to the current i-th preview image.
需要说明的是,由于第i个稳定边框并未发生变化,那么终端同样不更新预先存储的用于稳定边框比较的第(i-1)个稳定边框,继续作为下一帧,即第(i+1)执行稳定四边形边框确定时的参考稳定四边形边框。It should be noted that since the i-th stable frame has not changed, the terminal also does not update the pre-stored (i-1)-th stable frame for stable frame comparison, and continues as the next frame, that is, the (i-th stable frame) +1) Reference stable quad bounding box when performing stable quad bounding box determination.
示例性的,图13A为本申请实施例提出的稳定边框确定的场景示意图一,假定虚线为第(i-1)个稳定边框,实线为初始稳定边框,如图13A所示,初始稳定边框与第(i-1)个稳定边框的相似度较高,那么终端可以保留第(i-1)个稳定边框作为当前图像帧的第i稳定边框。Exemplarily, FIG. 13A is a schematic diagram 1 of a scenario for determining a stable frame proposed by an embodiment of the present application. It is assumed that the dotted line is the (i-1)th stable frame, and the solid line is the initial stable frame. As shown in FIG. 13A , the initial stable frame If the similarity with the (i-1) th stable frame is high, the terminal can retain the (i-1) th stable frame as the i-th stable frame of the current image frame.
其中,另一方面,若距离差值大于上述预设距离阈值,那么终端可以判定初始稳定边框与第(i-1)个稳定边框并不相似,即预览图像中目标对象对应的四边形边框发生变化,那么为了保证预览画面的准确性,终端将当前确定出的初始稳定四边形边框确定为当前第i帧预览图像对应的稳定四边形边框。On the other hand, if the distance difference is greater than the above-mentioned preset distance threshold, the terminal can determine that the initial stable frame is not similar to the (i-1)th stable frame, that is, the quadrilateral frame corresponding to the target object in the preview image changes , then in order to ensure the accuracy of the preview image, the terminal determines the currently determined initial stable quadrilateral frame as the stable quadrilateral frame corresponding to the current i-th frame preview image.
需要说明的是,由于目标稳定四边形边框发生变化,那么终端需要同时更新预先存储的用于稳定边框比较的第(i-1)个稳定边框,将当前第i个预览图像对应的初始稳定边框继续作为下一帧,即第(i+1)个稳定四边形边框确定时的参考稳定四边形边框。It should be noted that, due to the change of the target stable quadrilateral frame, the terminal needs to update the (i-1)th stable frame previously stored for stable frame comparison at the same time, and continue the initial stable frame corresponding to the current i-th preview image. As the next frame, that is, the reference stable quadrilateral frame when the (i+1)th stable quadrilateral frame is determined.
示例性的,图13B为本申请实施例提出的稳定边框确定的场景示意图二,假定虚线为第(i-1)个稳定边框,实线为初始稳定边框,如图13B所示,初始稳定边框与第(i-1)个稳定边框的相似度较差,那么终端可以更新存储的第(i-1)个稳定边框,并将初始稳定边框作为第i帧图像的第i稳定边框。Exemplarily, FIG. 13B is a schematic diagram of the second scenario for determining the stable frame proposed by the embodiment of the present application. It is assumed that the dotted line is the (i-1)th stable frame, and the solid line is the initial stable frame. As shown in FIG. 13B , the initial stable frame If the similarity with the (i-1)th stable frame is poor, the terminal can update the stored (i-1)th stable frame, and use the initial stable frame as the i-th stable frame of the i-th frame image.
本申请实施例提供了一种图像显示方法,终端可以通过比较当前最新帧的四边形边框与历史存储的参考稳定四边形边框的相似度,进而根据不同的相似度结果执行不同的当前稳定四边形边框的确定,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷,进一步实现了高效率的图片扫描。An embodiment of the present application provides an image display method. The terminal can determine the current stable quadrilateral frame according to different similarity results by comparing the similarity between the quadrilateral frame of the current latest frame and the historically stored reference stable quadrilateral frame. , which solves the problem of unstable display of the quadrilateral frame in the preview screen, overcomes the defect that the preview screen is not displayed smoothly, and further realizes high-efficiency picture scanning.
基于上述实施例,在本申请的再一实施例中,图14为本申请实施例提出的图像处理的执行流程示意图,如图14所示,在本申请的实施例中,终端先获取预览图像(步骤S01),然后终端对该预览图像进行边框检测,如四边形检测处理(步骤S02);并将获得的四边形边框先存储至FIFO的尾部,即队列最后一位(步骤S03)。Based on the above embodiment, in yet another embodiment of the present application, FIG. 14 is a schematic diagram of the execution flow of the image processing proposed by the embodiment of the present application. As shown in FIG. 14 , in the embodiment of the present application, the terminal first obtains the preview image (step S01), then the terminal performs frame detection on the preview image, such as quadrilateral detection processing (step S02); and stores the obtained quadrilateral frame at the tail of the FIFO, that is, the last bit of the queue (step S03).
进一步的,终端可以按照进入FIFO队列的先后顺序,从当前FIFO队列中存在的四边形边框样本中依次选取未归类四边形边框样本(步骤S03),并按照上述预设相似度函数进行距离计算(步骤S04),进而基于距离差值判断已聚类完成的边框组当中是否存在未归类四边形边框样本对应的可归类边框组(步骤S05);其中,一方面如果已归类完成的边框组当中存在距离相近的边框组,则可以判定该未归类四边形边框样本属于该距离相近的边框组,可直接将该四边形边框加入该边框组(步骤S06);另一方面,如果在已分类完成的边框组当中存在多个符合条件的距离相近的边框组,还可以对距离进行排序,将四边形边框加入距离最近的边框组;再一方面,如果已归类完成的边框组当中并不存在距离相近的边框组,那么终端可以建立一个新的边框组,并将该四边形边框加入该新的边框组(步骤S07)。Further, the terminal can sequentially select unclassified quadrilateral frame samples from the quadrilateral frame samples existing in the current FIFO queue according to the sequence of entering the FIFO queue (step S03), and perform distance calculation according to the above-mentioned preset similarity function (step S03). S04), and then judge based on the distance difference whether there is a classifiable border group corresponding to the unclassified quadrilateral border sample in the frame group that has been clustered (step S05); If there is a frame group with a similar distance, it can be determined that the unclassified quadrilateral frame sample belongs to the frame group with a similar distance, and the quadrilateral frame can be directly added to the frame group (step S06); There are multiple border groups with similar distances in the border group. You can also sort the distances and add the quadrilateral borders to the border group with the closest distance. On the other hand, if there is no similar distance in the sorted border groups The terminal can create a new frame group, and add the quadrilateral frame to the new frame group (step S07).
之后,终端可以判断FIFO序列中的全部未归类四边形边框样本是否都完成聚类,也就是当前FIFO队列中是否存在未归类的四边形边框样本(步骤S08,如果确定存在,那么,终端跳转至步骤S03,重复循环上述步骤;如果不存在,那么终端可以从聚类获得的至少一个边框组中进行目标边框组的选取,如至少一个边框组中,四边形边框样本数最大的边框组作为目标边框组(步骤S09),并基于时序从该目标边框组中选取最新帧对应的四边形边框样本确定为初始稳定四边形边框(步骤S010)。After that, the terminal can judge whether all the unclassified quadrilateral frame samples in the FIFO sequence have completed the clustering, that is, whether there are unclassified quadrilateral frame samples in the current FIFO queue (step S08, if it is determined to exist, then the terminal jumps Go to step S03, repeat the above steps; if not, the terminal can select the target frame group from at least one frame group obtained by clustering, such as at least one frame group, the frame group with the largest number of quadrilateral frame samples as the target A frame group (step S09), and based on the time sequence, a quadrilateral frame sample corresponding to the latest frame is selected from the target frame group to determine the initial stable quadrilateral frame (step S010).
更进一步的,终端可以对初始稳定四边形边框和历史存储的参考稳定四边形边框进行基于相似度的距离计算(步骤S011)。并判断该距离是否小于预设距离阈值(步骤S012)。如果小于,那么终 端不需要更新历史参考稳定四边形边框,而是直接将该历史参考稳定四边形边框作为当前预览图像对应的目标稳定四边形边框并进行输出(步骤S013);如果不小于,那么终端可以利用初始稳定四边形边框更新历史参考稳定四边形边框(步骤S014),并将当前确定出的新的历史参考稳定四边形边框确定为当前预览图像对应的目标稳定四边形边框并进行输出。进一步的,终端可以对得到的稳定四边形边框进行渲染,并基于渲染后的四边形边框和当前预览图像生成渲染后预览图像并进行显示(步骤S015)。Further, the terminal may perform similarity-based distance calculation on the initial stable quadrilateral frame and the historically stored reference stable quadrilateral frame (step S011 ). And determine whether the distance is less than a preset distance threshold (step S012). If it is less than, then the terminal does not need to update the historical reference stable quadrilateral frame, but directly uses the historical reference stable quadrilateral frame as the target stable quadrilateral frame corresponding to the current preview image and outputs (step S013); if not less than, then the terminal can use The initial stable quadrilateral frame is updated with the historical reference stable quadrilateral frame (step S014), and the currently determined new historical reference stable quadrilateral frame is determined as the target stable quadrilateral frame corresponding to the current preview image and output. Further, the terminal may render the obtained stable quadrilateral frame, and generate and display a rendered preview image based on the rendered quadrilateral frame and the current preview image (step S015).
基于上述步骤S01至步骤S015所提出的终端通过相似度聚类、目标边框组的选取和目标边框的确定等去除异常帧操作,以及与历史参考稳定边框进行对比的去噪稳定操作,终端不再是基于检测得到的四边形边框直接进行图像帧预览,而是在获得稳定的四边形边框之后,基于该稳定的四边形边框进行图像预览,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷。Based on the above steps S01 to S015 proposed by the terminal to remove abnormal frames through similarity clustering, selection of target frame groups, determination of target frames, etc., as well as the denoising stabilization operation compared with the historical reference stabilization frame, the terminal no longer The image frame preview is directly based on the detected quadrilateral frame, but after a stable quadrilateral frame is obtained, the image preview is performed based on the stable quadrilateral frame, which solves the problem of unstable display of the quadrilateral frame in the preview screen and overcomes the preview screen. Displays not smooth defects.
基于上述实施例,在本申请的另一实施例中,图15为本申请提出的终端的组成结构示意图一,如图15所示,本申请实施例提出的终端10可以包括四边形检测模块11、时序稳定模块12、去噪稳定模块13以及预览模块14,Based on the above-mentioned embodiment, in another embodiment of the present application, FIG. 15 is a schematic diagram of the composition structure of the terminal proposed by the present application. As shown in FIG. 15 , the terminal 10 proposed by the embodiment of the present application may include a quadrilateral detection module 11, Timing stabilization module 12, denoising stabilization module 13 and preview module 14,
所述四边形检测模块11,配置为获取目标对象对应的第i帧预览图像;并对对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;The quadrilateral detection module 11 is configured to obtain the i-th frame preview image corresponding to the target object; and perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; wherein, The i is an integer greater than 0;
所述时序稳定模块12,配置为基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;以及从所述至少一个边框组中选取目标边框组;以及从所述目标边框组中确定初始稳定边框;The timing stabilization module 12 is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group; and from the at least one frame group Choose a target frame group from the middle; And determine the initial stable frame from the target frame group;
所述去噪稳定模块13,配置为基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;The denoising stabilization module 13 is configured to determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
所述预览模块14,配置为按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。The preview module 14 is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
基于上述实施例,在本申请的另一实施例中,图16为本申请提出的终端的组成结构示意图二,如图16所示,本申请实施例提出的终端10可以包括获取部分15,检测部分16,聚类部分17,选取部分18、确定部分19、显示部分110、存储部分111Based on the above embodiment, in another embodiment of the present application, FIG. 16 is a second schematic diagram of the composition and structure of the terminal proposed by the present application. As shown in FIG. 16 , the terminal 10 proposed by the embodiment of the present application may include an acquisition part 15 that detects part 16, clustering part 17, selection part 18, determination part 19, display part 110, storage part 111
所述获取部分15,配置为获取目标对象对应的第i帧预览图像;The acquisition part 15 is configured to acquire the ith frame preview image corresponding to the target object;
所述检测部分16,配置为对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;The detection part 16 is configured to perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
所述聚类部分17,配置为基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;The clustering part 17 is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group;
所述选取部分18,配置为从所述至少一个边框组中选取目标边框组;The selection part 18 is configured to select a target frame group from the at least one frame group;
所述确定部分19,配置为从所述目标边框组中确定初始稳定边框;以及基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;The determining part 19 is configured to determine an initial stable frame from the target frame group; and determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
所述显示部分110,配置为按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。The display part 110 is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
进一步地,在本申请的实施例中,所述存储部分111,配置为在获得所述目标对象对应的第i个四边形边框之后,且基于所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组之前,将所述第i个四边形边框存储至FIFO的第N位;其中,N为大于2的整数,所述N表征FIFO的最大存储能力。Further, in the embodiment of the present application, the storage part 111 is configured to perform similarity clustering processing based on the i-th quadrilateral frame after obtaining the i-th quadrilateral frame corresponding to the target object, Before obtaining at least one frame group, the i-th quadrilateral frame is stored in the N-th bit of the FIFO; wherein, N is an integer greater than 2, and the N represents the maximum storage capacity of the FIFO.
进一步地,在本申请的实施例中,当所述i小于所述N时,所述聚类部分17,具体配置为从所述FIFO中读取所述第一个四边形边框至所述第i个四边形边框;以及基于所述第一个四边形边框至所述第i个四边形边框进行所述相似度聚类处理,获得所述至少一个边框组。Further, in the embodiment of the present application, when the i is smaller than the N, the clustering part 17 is specifically configured to read the first quadrilateral border to the i-th from the FIFO and 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.
进一步地,在本申请的实施例中,当所述i大于或等于所述N时,所述聚类部分17,还具体配置为从所述FIFO中读取第(i-N+1)个四边形边框至所述第i个四边形边框;以及基于所述第(i-N+1)个四边形边框至所述第i个四边形边框进行所述相似度聚类处理,获得所述至少一个边框组。Further, in the 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 item from the FIFO From the quadrilateral frame to the i-th quadrilateral frame; and 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 .
进一步地,在本申请的实施例中,所述聚类部分17,还具体配置为获取所述第k个四边形边框对应的第k个顶点坐标数据,和前(k-1)个四边形边框对应的前(k-1)个顶点坐标数据;其中,k为大于1、且小于或等于i的整数;以及按照预设相似度函数计算所述第k个顶点坐标数据与所述前(k-1)个顶点坐标数据对应的前(k-1)个距离差值;以及从所述前(k-1)个距离差值中确定最小距离差值;以及基于所述最小距离差值和所述前(k-1)个四边形边框对应的第一历史边框组构建所述至少一个边框组。Further, in the embodiment of the present application, the clustering part 17 is also specifically configured to obtain the kth vertex coordinate data corresponding to the kth quadrilateral border, which corresponds to the first (k-1) quadrilateral borders The first (k-1) vertex coordinate data of ; wherein, k is an integer greater than 1 and less than or equal to i; and calculate the kth vertex coordinate data and the first (k- 1) the first (k-1) distance differences corresponding to the vertex coordinate data; and determining the minimum distance difference from the first (k-1) distance differences; and based on the minimum distance difference and all The first historical frame group corresponding to the first (k-1) quadrilateral frames constructs the at least one frame group.
进一步地,在本申请的实施例中,所述聚类部分17,还具体配置为若所述最小距离差值大于或 者等于预设距离阈值,则建立所述第k个四边形边框对应的新增边框组,并基于所述新增边框组和所述第一历史边框组构建所述至少一个边框组;以及若所述最小距离差值小于预设距离阈值,则将所述第k个四边形边框归类于所述第一历史边框组,并基于所述第一历史边框组构建所述至少一个边框组。Further, in the embodiment of the present application, the clustering part 17 is also specifically configured to establish a new new feature corresponding to the kth quadrilateral frame if the minimum distance difference is greater than or equal to a preset distance threshold. a frame group, and construct the at least one frame group based on the newly added frame group and the first historical frame group; and if the minimum distance difference is less than a preset distance threshold, the kth quadrilateral frame It is classified into the first historical border group, and the at least one border group is constructed based on the first historical border group.
进一步地,在本申请的实施例中,所述聚类部分17,还具体配置为获取所述第(i-N+k)个四边形边框对应的第(i-N+k)个顶点坐标数据,和前(i-N+k-1)个四边形边框对应的前(i-N+k-1)个顶点坐标数据;其中,k为大于1、且小于或等于N的整数;以及按照预设相似度函数计算所述第(i-N+k)个顶点坐标数据与所述前(i-N+k-1)个顶点坐标数据对应的前(i-N+k-1)个距离差值;以及从所述前(i-N+k-1)个距离差值中确定最小距离差值;以及基于所述最小距离差值和所述前(i-N+k-1)个四边形边框对应的第二历史边框组构建所述至少一个边框组。Further, in the embodiment of the present application, the clustering part 17 is also specifically configured to acquire the (i-N+k)th vertex coordinate data corresponding to the (i-N+k)th quadrilateral frame , and the first (i-N+k-1) vertex coordinate data corresponding to the first (i-N+k-1) quadrilateral borders; wherein, k is an integer greater than 1 and less than or equal to N; Let the similarity function calculate the first (i-N+k-1) distances corresponding to the (i-N+k)th vertex coordinate data and the first (i-N+k-1) vertex coordinate data difference; and determining a minimum distance difference from the first (i-N+k-1) distance differences; and based on the minimum distance difference and the first (i-N+k-1) The second historical frame group corresponding to the quadrangular frame constructs the at least one frame group.
进一步地,在本申请的实施例中,所述聚类部分17,还具体配置为获取所述第i个四边形边框对应的第i个顶点坐标数据,和历史已分组的前(i-1)个四边形边框对应的前(i-1)个顶点坐标数据;以及按照预设相似度函数分别计算所述第i个顶点坐标数据与所述历史前(i-1)个顶点坐标数据对应的(i-1)个距离差值;以及从所述(i-1)个距离差值中确定最小距离差值;以及基于所述最小距离差值和所述前(i-1)个四边形边框对应的第三历史边框组构建所述至少一个边框组。Further, in the embodiment of the present application, the clustering part 17 is also specifically configured to obtain the i-th vertex coordinate data corresponding to the i-th quadrilateral frame, and the previous grouped (i-1) The first (i-1) vertex coordinate data corresponding to the quadrilateral border; i-1) distance differences; and determining a minimum distance difference from the (i-1) distance differences; and corresponding to the first (i-1) quadrilateral borders based on the minimum distance difference The third historical border group of the at least one border group is constructed.
进一步地,在本申请的实施例中,所述选取部分18,具体配置为获取所述至少一个边框组中、每个边框组包含的四边形边框个数;以及将最大四边形边框个数对应的边框组确定为所述目标边框组。Further, in the embodiment of the present application, the selection part 18 is specifically configured to obtain the number of quadrilateral frames included in each frame group in the at least one frame group; The group is determined as the target border group.
进一步地,在本申请的实施例中,所述确定部分19,具体配置为对所述目标边框组中的四边形边框按照时间先后的顺序进行排列处理,获得边框列表;以及将所述边框列表中、最后一个四边形边框确定为初始稳定边框。Further, in the embodiment of the present application, the determining part 19 is specifically configured to arrange and process the quadrilateral frames in the target frame group in a chronological order to obtain a frame list; , the last quadrilateral border is determined as the initial stable border.
进一步地,在本申请的实施例中,所述确定部分19,还具体配置为对所述目标边框组中的四边形边框进行均值滤波处理,获得初始稳定边框。Further, in the embodiment of the present application, the determining part 19 is further specifically configured to perform mean filtering processing on the quadrilateral frames in the target frame group to obtain an initial stable frame.
进一步地,在本申请的实施例中,所述确定部分19,还具体配置为获取所述初始稳定边框对应的第一顶点坐标数据和所述第(i-1)个稳定边框对应的第二顶点坐标数据;以及按照预设相似度函数计算所述第一顶点坐标数据与所述第二顶点坐标数据的距离差值;以及若所述距离差值小于预设距离阈值,则将所述第(i-1)个稳定边框确定为所述第i个稳定边框;以及若所述距离差值大于或者等于所述预设距离阈值,则将所述初始稳定边框确定为所述第i个稳定边框。Further, in the embodiment of the present application, the determining part 19 is further specifically configured to acquire the first vertex coordinate data corresponding to the initial stable frame and the second corresponding to the (i-1)th stable frame. vertex coordinate data; and calculating 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, the (i-1) stable frame is determined as the i-th stable frame; and if the distance difference is greater than or equal to the preset distance threshold, then the initial stable frame is determined as the i-th stable frame frame.
进一步地,在本申请的实施例中,所述显示部分110,具体配置为对所述第i个稳定边框进行渲染处理,获得渲染后稳定边框;以及基于所述渲染后稳定边框和所述第i帧预览图像生成渲染后预览图像;以及显示所述渲染后预览图象。Further, in the embodiment of the present application, the display part 110 is specifically configured to perform rendering processing on the i-th stable frame to obtain a post-render stable frame; and based on the post-render stable frame and the ith stable frame The i-frame preview image generates a preview image after rendering; and displays the preview image after rendering.
在本申请的实施例中,进一步地,图17为本申请实施例提出的终端的组成结构示意图三,如图17所示,本申请实施例提出的终端10还可以包括处理器112、存储有处理器112可执行指令的存储器113,进一步地,终端10还可以包括通信接口114,和用于连接处理器112、存储器113以及通信接口114的总线115。In the embodiment of the present application, further, FIG. 17 is a schematic diagram 3 of the composition structure of the terminal proposed by the embodiment of the present application. As shown in FIG. 17 , the terminal 10 proposed by the embodiment of the present application may further include a processor 112, a The processor 112 has a memory 113 for executing instructions. Further, the terminal 10 may further include a communication interface 114 and a bus 115 for connecting the processor 112 , the memory 113 and the communication interface 114 .
在本申请的实施例中,上述处理器112可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(ProgRAMmable Logic Device,PLD)、现场可编程门阵列(Field ProgRAMmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。终端10还可以包括存储器113,该存储器113可以与处理器112连接,其中,存储器113用于存储可执行程序代码,该程序代码包括计算机操作指令,存储器113可能包含高速RAM存储器,也可能还包括非易失性存储器,例如,至少两个磁盘存储器。In the embodiment of the present application, the above-mentioned processor 112 may be an application specific integrated circuit (ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD) ), Programmable Logic Device (ProgRAMmable Logic Device, PLD), Field Programmable Gate Array (Field ProgRAMmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor at least one of. It can be understood that, for different devices, the electronic device used to implement the above processor function may also be other, which is not specifically limited in the embodiment of the present application. The terminal 10 may also include a memory 113, which may be connected to the processor 112, wherein the memory 113 is used for storing executable program codes, the program codes including computer operation instructions, the memory 113 may include high-speed RAM memory, or may also include Non-volatile memory, for example, at least two disk drives.
在本申请的实施例中,总线115用于连接通信接口114、处理器112以及存储器113以及这些器件之间的相互通信。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 the mutual communication among these devices.
在本申请的实施例中,存储器113,用于存储指令和数据。In the embodiment of the present application, the memory 113 is used to store instructions and data.
进一步地,在本申请的实施例中,上述处理器112,用于获取目标对象对应的第i帧预览图像,并对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;从所述至少一个边框组中选取目标边框组,并从所述目标边框 组中确定初始稳定边框;基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。Further, in the embodiment of the present application, the above-mentioned processor 112 is configured to obtain the ith frame preview image corresponding to the target object, and perform frame detection processing on the ith frame preview image to obtain the ith frame preview image corresponding to the target object. The i-th quadrilateral frame; wherein, the i is an integer greater than 0; based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame, similarity clustering is performed to obtain at least one frame group; Select a target frame group from the at least one frame group, and determine an initial stable frame from the target frame group; determine the ith stable frame based on the initial stable frame and the (i-1)th stable frame; according to The i-th stable frame performs display processing on the i-th frame preview image.
在实际应用中,上述存储器113可以是易失性存储器(volatile memory),例如随机存取存储器(Random-Access Memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(Read-Only Memory,ROM),快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器112提供指令和数据。In practical applications, the above-mentioned memory 113 may be a volatile memory (volatile memory), such as a random access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and send it to the processor 112 Provide instructions and data.
另外,在本实施例中的各功能模块可以集成在一个文件还原单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in this embodiment may be integrated into one file restoration unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of software function modules 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 is essentially or correct. Part of the contribution made by the prior art 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 several instructions to make a computer device (which can be a personal A computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
本申请实施例提供了一种终端,在对包含目标对象的当前预览图像进行边框检测处理,获得目标对象对应的四边形边框之后,终端可以先对该四边形边框进行基于边框相似度的聚类处理,并从获得的至少一个边框组中选取出目标边框组,以及进一步从该目标边框组中确定初始稳定边框,进而基于该初始稳定边框和历史稳定边框的对比进一步确定出当前稳定边框,从而将按照当前稳定边框对当前预览图像进行显示处理。可见,在本申请中,终端不再是基于边框检测得到的四边形边框直接进行图像预览,而是在对检测获得的四边形边框进行相似度聚类、目标边框组的选取和初始稳定边框的确定等去除异常帧操作,以及与历史稳定边框进行对比的去噪稳定操作,获得当前稳定四边形边框之后,基于该稳定四边形边框进行图像预览,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷。An embodiment of the present application provides a terminal. After performing frame detection processing on a current preview image containing a target object and obtaining a quadrilateral frame corresponding to the target object, the terminal may first perform clustering processing based on frame similarity on the quadrilateral frame. And select the target frame group from the obtained at least one frame group, and further determine the initial stable frame from the target frame group, and then further determine the current stable frame based on the comparison between the initial stable frame and the historical stable frame, so as to follow The current stable frame performs display processing on the current preview image. It can be seen that in this application, the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering on the quadrilateral frame obtained by detection, selection of the target frame group, and determination of the initial stable frame, etc. The operation of removing abnormal frames, and the denoising stabilization operation compared with the historical stable frame, after obtaining the current stable quadrilateral frame, the image preview is performed based on the stable quadrilateral frame, which solves the problem of unstable display of the quadrilateral frame in the preview screen, and overcomes the problem of previewing. The screen display is not smooth defect.
本申请实施例提供一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如上所述的图像显示方法。An embodiment of the present application provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the above-described image display method is implemented.
具体来讲,本实施例中的一种图像显示方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种图像显示方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:Specifically, a program instruction corresponding to an image display method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a U disk, etc. When the program instruction corresponding to an image display method in the storage medium is stored in a When the electronic device reads or is executed, it includes the following steps:
获取目标对象对应的第i帧预览图像,并对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;Obtain the ith frame preview image corresponding to the target object, and perform frame detection processing on the ith frame preview image to obtain the ith quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;Perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group;
从所述至少一个边框组中选取目标边框组,并从所述目标边框组中确定初始稳定边框;Selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group;
基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;determining the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。Perform display processing on the i-th frame preview image according to the i-th stable frame.
本申请实施例提供一种芯片,其包括处理器和接口,所述处理器通过接口获取程序指令,所述处理器用于运行所述程序指令,实现如上所述的图像显示方法。具体地,所述图像显示方法,包括以下步骤:An 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 configured to execute the program instructions to implement the image display method as described above. Specifically, the image display method includes the following steps:
获取目标对象对应的第i帧预览图像,并对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;Obtain the ith frame preview image corresponding to the target object, and perform frame detection processing on the ith frame preview image to obtain the ith quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;Perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group;
从所述至少一个边框组中选取目标边框组,并从所述目标边框组中确定初始稳定边框;Selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group;
基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;determining the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。Perform display processing on the i-th frame preview image according to the i-th stable frame.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的实现流程示意图和/或方框图来描述的。应理解可由计算机程序指令实现流程示意图和/或方框图中的每一流程和/或方框、以及实现流程示意图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to schematic flowcharts and/or block diagrams of implementations of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It will be understood that each process and/or block in the schematic flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the schematic flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a process or processes and/or a block or blocks in the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions An apparatus implements the functions specified in a flow or flows of the implementation flow diagram and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the implementing flow diagram and/or the block or blocks of the block diagram.
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application.
工业实用性Industrial Applicability
本申请实施例公开了一种图像显示方法、终端及存储介质,所述方法包括:获取目标对象对应的第i帧预览图像,并对第i帧预览图像进行边框检测处理,获得目标对象对应的第i个四边形边框;其中,i为大于0的整数;基于目标对象对应的第一个四边形边框至第i个四边形边框进行相似度聚类处理,获得至少一个边框组;从至少一个边框组中选取目标边框组,并从目标边框组中确定初始稳定边框;基于初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;按照第i个稳定边框对第i帧预览图像进行显示处理。也就是说,在本申请的实施例中,终端不再是基于边框检测得到的四边形边框直接进行图像预览,而是在对检测获得的四边形边框进行相似度聚类、目标边框组的选取和初始稳定边框的确定等去除异常帧操作,以及与历史稳定边框进行对比的去噪稳定操作,获得当前稳定四边形边框之后,基于该稳定四边形边框进行图像预览,解决了预览画面中四边形边框显示不稳定的问题,克服了预览画面显示不流畅的缺陷。The embodiments of the present application disclose an image display method, a terminal, and a storage medium. The method includes: acquiring an i-th frame preview image corresponding to a target object, performing frame detection processing on the i-th frame preview image, and obtaining an i-th frame preview image corresponding to the target object. The i-th quadrilateral frame; wherein, i is an integer greater than 0; perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame, and obtain at least one frame group; from at least one frame group Select the target frame group, and determine the initial stable frame from the target frame group; determine the i-th stable frame based on the initial stable frame and the (i-1)th stable frame; perform the i-th frame preview image according to the i-th stable frame. Display processing. That is to say, in the embodiment of the present application, the terminal no longer directly performs image preview based on the quadrilateral frame obtained by frame detection, but performs similarity clustering, selection of target frame group and initial Determination of the stable frame and other operations to remove abnormal frames, as well as the denoising stabilization operation compared with the historical stable frame, after obtaining the current stable quadrilateral frame, image preview is performed based on the stable quadrilateral frame, which solves the problem of unstable quadrilateral frame display in the preview screen. problem, overcome the defect that the preview screen is not displayed smoothly.

Claims (18)

  1. 一种图像显示方法,所述方法包括:An image display method, the method comprising:
    获取目标对象对应的第i帧预览图像,并对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;Obtain the ith frame preview image corresponding to the target object, and perform frame detection processing on the ith frame preview image to obtain the ith quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
    基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;Perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group;
    从所述至少一个边框组中选取目标边框组,并从所述目标边框组中确定初始稳定边框;Selecting a target frame group from the at least one frame group, and determining an initial stable frame from the target frame group;
    基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;determining the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
    按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。Perform display processing on the i-th frame preview image according to the i-th stable frame.
  2. 根据权利要求1所述的方法,其中,所述获得所述目标对象对应的第i个四边形边框之后,且基于所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组之前,所述方法还包括:The method according to claim 1, wherein, after obtaining the i-th quadrilateral frame corresponding to the target object, and performing similarity clustering processing based on the i-th quadrilateral frame, and before obtaining at least one frame group, The method also includes:
    将所述第i个四边形边框存储至先入先出队列FIFO的第N位;其中,N为大于2的整数,所述N表征FIFO的最大存储能力。The i-th quadrilateral frame is stored in the N-th bit of the 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. 根据权利要求2所述的方法,其中,当所述i小于所述N时,所述基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组,包括:The method according to claim 2, wherein when the i is smaller than the N, the similarity clustering process is performed based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame, Get at least one border group, including:
    从所述FIFO中读取所述第一个四边形边框至所述第i个四边形边框;reading the first quadrilateral frame to the i-th quadrilateral frame from the FIFO;
    基于所述第一个四边形边框至所述第i个四边形边框进行所述相似度聚类处理,获得所述至少一个边框组。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. 根据权利要求2所述的方法,其中,当所述i大于或等于所述N时,所述基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组,包括:The method according to claim 2, wherein when the i is greater than or equal to the N, the similarity clustering is performed based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame Process to obtain at least one border group, including:
    从所述FIFO中读取第(i-N+1)个四边形边框至所述第i个四边形边框;read the (i-N+1)th quadrilateral frame to the i-th quadrilateral frame from the FIFO;
    基于所述第(i-N+1)个四边形边框至所述第i个四边形边框进行所述相似度聚类处理,获得所述至少一个边框组。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. 根据权利要求3所述的方法,其中,所述基于所述第一个四边形边框至所述第i个四边形边框进行所述相似度聚类处理,获得所述至少一个边框组,包括: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 comprises:
    获取所述第k个四边形边框对应的第k个顶点坐标数据,和前(k-1)个四边形边框对应的前(k-1)个顶点坐标数据;其中,k为大于1、且小于或等于i的整数;Obtain the kth vertex coordinate data corresponding to the kth quadrilateral frame, and the first (k-1) vertex coordinate data corresponding to the first (k-1) quadrilateral frame; wherein, k is greater than 1 and less than or an integer equal to i;
    按照预设相似度函数计算所述第k个顶点坐标数据与所述前(k-1)个顶点坐标数据对应的前(k-1)个距离差值;Calculate the first (k-1) distance differences corresponding to the kth vertex coordinate data and the first (k-1) vertex coordinate data according to the preset similarity function;
    从所述前(k-1)个距离差值中确定最小距离差值;determining a minimum distance difference from the first (k-1) distance differences;
    基于所述最小距离差值和所述前(k-1)个四边形边框对应的第一历史边框组构建所述至少一个边框组。The at least one border group is constructed based on the minimum distance difference and the first historical border group corresponding to the first (k-1) quadrilateral borders.
  6. 根据权利要求5所述的方法,其特征在于,所述基于所述最小距离差值和所述前(k-1)个四边形边框对应的第一历史边框组构建所述至少一个边框组,包括:The method according to claim 5, wherein the constructing 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 borders, comprising: :
    若所述最小距离差值大于或者等于预设距离阈值,则建立所述第k个四边形边框对应的新增边框组,并基于所述新增边框组和所述第一历史边框组构建所述至少一个边框组;If the minimum distance difference is greater than or equal to the preset distance threshold, a new frame group corresponding to the kth quadrilateral frame is established, and the new frame group and the first historical frame group are constructed based on the new frame group and the first historical frame group at least one border group;
    若所述最小距离差值小于预设距离阈值,则将所述第k个四边形边框归类于所述第一历史边框组,并基于所述第一历史边框组构建所述至少一个边框组。If the minimum distance difference is smaller than a preset distance threshold, classify the k-th quadrilateral frame into the first historical frame group, and construct the at least one frame group based on the first historical frame group.
  7. 根据权利要求4所述的方法,其特征在于,所述基于所述第(i-N+1)个四边形边框至所述第i个四边形边框进行所述相似度聚类处理,获得所述至少一个边框组,包括;The method according to claim 4, wherein the similarity clustering process is performed based on the (i-N+1)th quadrilateral frame to the i-th quadrilateral frame, and the at least A border group consisting of;
    获取所述第(i-N+k)个四边形边框对应的第(i-N+k)个顶点坐标数据,和前(i-N+k-1)个四边形边框对应的前(i-N+k-1)个顶点坐标数据;其中,k为大于1、且小于或等于N的整数;Obtain the (i-N+k)th vertex coordinate data corresponding to the (i-N+k)th quadrilateral frame, and the first (i-N+k-1) quadrilateral frame corresponding to the previous (i-N). +k-1) vertex coordinate data; wherein, k is an integer greater than 1 and less than or equal to N;
    按照预设相似度函数计算所述第(i-N+k)个顶点坐标数据与所述前(i-N+k-1)个顶点坐标数据对应的前(i-N+k-1)个距离差值;Calculate the first (i-N+k-1) corresponding to the (i-N+k)th vertex coordinate data and the first (i-N+k-1) vertex coordinate data according to the preset similarity function distance difference;
    从所述前(i-N+k-1)个距离差值中确定最小距离差值;determining a minimum distance difference from the first (i-N+k-1) distance differences;
    基于所述最小距离差值和所述前(i-N+k-1)个四边形边框对应的第二历史边框组构建所述至少一个边框组。The at least one border group is constructed based on the minimum distance difference and the second historical border group corresponding to the first (i-N+k-1) quadrilateral borders.
  8. 根据权利要求1所述的方法,其中,所述基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组,包括:The method according to claim 1, wherein, performing similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group, comprising:
    获取所述第i个四边形边框对应的第i个顶点坐标数据,和历史已分组的前(i-1)个四边形边框对应的前(i-1)个顶点坐标数据;Obtain the i-th vertex coordinate data corresponding to the i-th quadrilateral frame, and the first (i-1) vertex coordinate data corresponding to the previous (i-1) quadrilateral frames that have been grouped in history;
    按照预设相似度函数分别计算所述第i个顶点坐标数据与所述历史前(i-1)个顶点坐标数据对应的(i-1)个距离差值;Calculate the (i-1) distance differences corresponding to the i-th vertex coordinate data and the previous (i-1) vertex coordinate data in the history according to the preset similarity function;
    从所述(i-1)个距离差值中确定最小距离差值;determining a minimum distance difference from the (i-1) distance differences;
    基于所述最小距离差值和所述前(i-1)个四边形边框对应的第三历史边框组构建所述至少一个边框组。The at least one border group is constructed based on the minimum distance difference and a third historical border group corresponding to the first (i-1) quadrilateral borders.
  9. 根据权利要求1所述的方法,其特征在于,所述从所述至少一个边框组中选取目标边框组,包括:The method according to claim 1, wherein the selecting a target frame group from the at least one frame group comprises:
    获取所述至少一个边框组中、每个边框组包含的四边形边框个数;obtaining the number of quadrilateral borders included in each border group in the at least one border group;
    将最大四边形边框个数对应的边框组确定为所述目标边框组。The frame group corresponding to the maximum number of quadrilateral frames is determined as the target frame group.
  10. 根据权利要求1所述的方法,其中,所述从所述目标边框组中确定初始稳定边框,包括:The method of claim 1, wherein the determining an initial stable frame from the target frame group comprises:
    对所述目标边框组中的四边形边框按照时间先后的顺序进行排列处理,获得边框列表;Arranging and processing the quadrilateral frames in the target frame group in a chronological order to obtain a frame list;
    将所述边框列表中、最后一个四边形边框确定为初始稳定边框。The last quadrilateral frame in the frame list is determined as the initial stable frame.
  11. 根据权利要求1所述的方法,其中,所述从所述目标边框组中选取初始稳定边框,包括:The method according to claim 1, wherein the selecting an initial stable frame from the target frame group comprises:
    对所述目标边框组中的四边形边框进行均值滤波处理,获得初始稳定边框。Perform mean filter processing on the quadrilateral frames in the target frame group to obtain an initial stable frame.
  12. 根据权利要求1所述的方法,其中,所述基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框,包括:The method according to claim 1, wherein the determining the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame comprises:
    获取所述初始稳定边框对应的第一顶点坐标数据和所述第(i-1)个稳定边框对应的第二顶点坐标数据;Obtain the first vertex coordinate data corresponding to the initial stable frame and the second vertex coordinate data corresponding to the (i-1)th stable frame;
    按照预设相似度函数计算所述第一顶点坐标数据与所述第二顶点坐标数据的距离差值;Calculate the distance difference between the first vertex coordinate data and the second vertex coordinate data according to a preset similarity function;
    若所述距离差值小于预设距离阈值,则将所述第(i-1)个稳定边框确定为所述第i个稳定边框;If the distance difference is less than a preset distance threshold, determining the (i-1)th stable frame as the i-th stable frame;
    若所述距离差值大于或者等于所述预设距离阈值,则将所述初始稳定边框确定为所述第i个稳定边框。If the distance difference is greater than or equal to the preset distance threshold, the initial stable frame is determined as the i-th stable frame.
  13. 根据权利要求1所述的方法,其中,所述按照所述第i个稳定边框对所述第i帧预览图像进行显示处理,包括:The method according to claim 1, wherein the displaying the i-th frame preview image according to the i-th stable frame comprises:
    对所述第i个稳定边框进行渲染处理,获得渲染后稳定边框;Perform rendering processing on the i-th stable frame to obtain a post-render stable frame;
    基于所述渲染后稳定边框和所述第i帧预览图像生成渲染后预览图像;generating a post-rendering preview image based on the post-rendering stabilized frame and the i-th frame preview image;
    显示所述渲染后预览图象。The rendered preview image is displayed.
  14. 一种终端,所述终端包括:获取部分,检测部分,聚类部分,选取部分、确定部分以及显示部分,A terminal comprising: an acquisition part, a detection part, a clustering part, a selection part, a determination part and a display part,
    所述获取部分,配置为获取目标对象对应的第i帧预览图像;The acquisition part is configured to acquire the i-th frame preview image corresponding to the target object;
    所述检测部分,配置为对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;The detection part is configured to perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; wherein, the i is an integer greater than 0;
    所述聚类部分,配置为基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;The clustering part is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group;
    所述选取部分,配置为从所述至少一个边框组中选取目标边框组;The selection part is configured to select a target frame group from the at least one frame group;
    所述确定部分,配置为从所述目标边框组中确定初始稳定边框;以及基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;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;
    所述显示部分,配置为按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。The display part is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
  15. 一种终端,所述终端包括:四边形检测模块、时序稳定模块、去噪稳定模块以及预览模块,A terminal comprising: a quadrilateral detection module, a timing stabilization module, a denoising stabilization module and a preview module,
    所述四边形检测模块,配置为获取目标对象对应的第i帧预览图像;并对对所述第i帧预览图像进行边框检测处理,获得所述目标对象对应的第i个四边形边框;其中,所述i为大于0的整数;The quadrilateral detection module is configured to obtain the i-th frame preview image corresponding to the target object; and perform frame detection processing on the i-th frame preview image to obtain the i-th quadrilateral frame corresponding to the target object; The i is an integer greater than 0;
    所述时序稳定模块,配置为基于所述目标对象对应的第一个四边形边框至所述第i个四边形边框进行相似度聚类处理,获得至少一个边框组;以及从所述至少一个边框组中选取目标边框组;以及从所述目标边框组中确定初始稳定边框;The timing stabilization module is configured to perform similarity clustering processing based on the first quadrilateral frame corresponding to the target object to the i-th quadrilateral frame to obtain at least one frame group; and from the at least one frame group Selecting a target frame group; and determining an initial stable frame from the target frame group;
    所述去噪稳定模块,配置为基于所述初始稳定边框和第(i-1)个稳定边框确定第i个稳定边框;The denoising stabilization module is configured to determine the i-th stable frame based on the initial stable frame and the (i-1)-th stable frame;
    所述预览模块,配置为按照所述第i个稳定边框对所述第i帧预览图像进行显示处理。The preview module is configured to perform display processing on the i-th frame preview image according to the i-th stable frame.
  16. 一种终端,所述终端包括四边形检测模块、时序稳定模块、去噪稳定模块、预览模块、处理器、存储有所述处理器可执行指令的存储器,当所述指令被所述处理器执行时,实现如权利要求1-13任一项所述的方法。A terminal comprising a quadrilateral detection module, a timing stabilization module, a denoising stabilization module, a preview module, a processor, and a memory storing executable instructions of the processor, when the instructions are executed by the processor , implementing the method according to any one of claims 1-13.
  17. 一种芯片,其特征在于,所述芯片包括处理器和接口,所述处理器通过所述接口获取程序指令,所述处理器用于运行所述程序指令,以执行如权利要求1-13任一项所述的方法。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 configured to execute the program instructions to execute any one of claims 1-13 method described in item.
  18. 一种计算机可读存储介质,其上存储有程序,应用于终端中,所述程序被处理器执行时,实现如权利要求1-13任一项所述的方法。A computer-readable storage medium having a program stored thereon and applied in a terminal, when the program is executed by a processor, the method according to any one of claims 1-13 is implemented.
PCT/CN2021/076494 2021-02-10 2021-02-10 Image display method, terminal, chip and storage medium WO2022170554A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2021/076494 WO2022170554A1 (en) 2021-02-10 2021-02-10 Image display method, terminal, chip and storage medium
CN202180084568.4A CN116686281A (en) 2021-02-10 2021-02-10 Image display method, terminal, chip and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/076494 WO2022170554A1 (en) 2021-02-10 2021-02-10 Image display method, terminal, chip and storage medium

Publications (1)

Publication Number Publication Date
WO2022170554A1 true WO2022170554A1 (en) 2022-08-18

Family

ID=82837433

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/076494 WO2022170554A1 (en) 2021-02-10 2021-02-10 Image display method, terminal, chip and storage medium

Country Status (2)

Country Link
CN (1) CN116686281A (en)
WO (1) WO2022170554A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10115031B1 (en) * 2015-02-27 2018-10-30 Evernote Corporation Detecting rectangular page and content boundaries from smartphone video stream
CN111445566A (en) * 2020-03-27 2020-07-24 腾讯科技(深圳)有限公司 Information processing method and device and computer readable storage medium
CN111464716A (en) * 2020-04-09 2020-07-28 腾讯科技(深圳)有限公司 Certificate scanning method, device, equipment and storage medium
CN112183529A (en) * 2020-09-23 2021-01-05 创新奇智(北京)科技有限公司 Quadrilateral object detection method, quadrilateral object model training method, quadrilateral object detection device, quadrilateral object model training device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10115031B1 (en) * 2015-02-27 2018-10-30 Evernote Corporation Detecting rectangular page and content boundaries from smartphone video stream
CN111445566A (en) * 2020-03-27 2020-07-24 腾讯科技(深圳)有限公司 Information processing method and device and computer readable storage medium
CN111464716A (en) * 2020-04-09 2020-07-28 腾讯科技(深圳)有限公司 Certificate scanning method, device, equipment and storage medium
CN112183529A (en) * 2020-09-23 2021-01-05 创新奇智(北京)科技有限公司 Quadrilateral object detection method, quadrilateral object model training method, quadrilateral object detection device, quadrilateral object model training device and storage medium

Also Published As

Publication number Publication date
CN116686281A (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN110532984B (en) Key point detection method, gesture recognition method, device and system
CN108920580B (en) Image matching method, device, storage medium and terminal
CN108805170B (en) Forming data sets for fully supervised learning
CN107403424B (en) Vehicle loss assessment method and device based on image and electronic equipment
TWI684922B (en) Image-based vehicle damage determination method, device, electronic equipment and system
US11176415B2 (en) Assisted image annotation
RU2711029C2 (en) Touch classification
JP6188400B2 (en) Image processing apparatus, program, and image processing method
US8917935B2 (en) Detecting text using stroke width based text detection
EP2767930A2 (en) Method, apparatus and computer readable recording medium for managing a reference face database to improve face recognition performance under a restricted memory environment
WO2019080411A1 (en) Electrical apparatus, facial image clustering search method, and computer readable storage medium
US11288307B2 (en) Method, electronic device, and computer readable medium for photo organization
US9779292B2 (en) System and method for interactive sketch recognition based on geometric contraints
JP6245880B2 (en) Information processing apparatus, information processing method, and program
JP6997369B2 (en) Programs, ranging methods, and ranging devices
CN112597837A (en) Image detection method, apparatus, device, storage medium and computer program product
WO2022126914A1 (en) Living body detection method and apparatus, electronic device, and storage medium
US11526708B2 (en) Information processing device, information processing method, and recording medium
WO2022247403A1 (en) Keypoint detection method, electronic device, program, and storage medium
JP2020154773A (en) Image processor, image processing method, and image processing system
CN114255223A (en) Deep learning-based method and equipment for detecting surface defects of two-stage bathroom ceramics
CN113780116A (en) Invoice classification method and device, computer equipment and storage medium
WO2022170554A1 (en) Image display method, terminal, chip and storage medium
WO2020244076A1 (en) Face recognition method and apparatus, and electronic device and storage medium
CN114494751A (en) License information identification method, device, equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21925217

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180084568.4

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21925217

Country of ref document: EP

Kind code of ref document: A1