Image display method, device, electronic equipment and machine readable storage medium
By overlaying new cards onto the display screen of the target recognition system and using animation effects to handle card entry, removal, and position updates, the problem of limited display area is solved, and the viewability and interactivity of the cards are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2026-03-17
AI Technical Summary
In existing target recognition systems, the display area of the screen is limited, making it impossible to effectively display images of newly identified targets, and the update process lacks interactivity.
The card display effect is optimized by overlaying new cards on the target image on the display screen and using preset animation effects to handle the entry, removal and position update of cards.
It improves card visibility, reduces the requirements for display area, and enhances card interactivity and optimizes display effects through animation.
Smart Images

Figure CN114282030B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of target recognition technology, and in particular to an image display method, apparatus, electronic device and machine-readable storage medium. Background Technology
[0002] A target recognition system is a management system that relies on target recognition technology (such as facial recognition technology or vehicle recognition technology). The target recognition system collects the identification information of the target to be identified (such as name and ID number in a facial recognition scenario, license plate number in a vehicle recognition scenario), images (such as facial images or vehicle images including license plate information), etc. After the target is successfully identified, the record is transmitted to the management system, and then the system performs information statistics.
[0003] Currently, in one target recognition system, the video footage captured by the camera can be previewed on a display screen, and images of no more than a preset number of recognized targets are displayed below the preview on the display screen in a left-to-right order.
[0004] When a new identified target is added, if the number of images displayed at the bottom of the preview screen is less than the preset number, the images displayed at the bottom of the preview screen can be directly updated from the original displayed image to the image of the original displayed image plus the image of the newly identified target. If the number of images displayed at the bottom of the preview screen reaches the preset number, the rightmost image in the original displayed image will be selected as the image to be deleted, and the remaining images in the original displayed image, excluding the image to be deleted, will replace the original displayed image with the image of the newly identified target by overwriting the original displayed image. Summary of the Invention
[0005] In view of the above, this application provides an image display method, apparatus, electronic device, and machine-readable storage medium.
[0006] According to a first aspect of the embodiments of this application, an image display method is provided, comprising:
[0007] Get the first card to be stacked;
[0008] When the number of second cards in the second card sequence currently displayed on the target image of the display screen reaches N1, the first card and the second card are controlled to refresh with a preset animation effect so that the last N2 second cards in the second card sequence are removed from the target image, and the first card is displayed as the first N3 second cards in the second card sequence, superimposed on the target image; N1≥2, N3 is the number of the first card, N1+N3>N4, N2=N1+N3-N4, N4 is the maximum number of cards allowed to be superimposed on the target image of the display screen, and N2<N1.
[0009] According to a second aspect of the embodiments of this application, an image display device is provided, comprising:
[0010] The acquisition unit is used to acquire the first card to be stacked.
[0011] The display unit is configured to control the first card and the second card to refresh with a preset animation effect when the number of second cards in the second card sequence currently displayed on the target image of the display screen reaches N1, so that the last N2 second cards in the second card sequence are removed from the target image, and the first card is displayed as the first N3 second cards in the second card sequence, superimposed on the target image; N1≥2, N3 is the number of the first cards, N1+N3>N4, N2=N1+N3-N4, N4 is the maximum number of cards allowed to be superimposed on the target image of the display screen, and N2<N1;
[0012] According to a third aspect of the present application, an electronic device is provided, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being configured to execute the machine-executable instructions to implement the method provided in the first aspect.
[0013] According to a fourth aspect of the embodiments of this application, a machine-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the method provided in the first aspect.
[0014] According to a fifth aspect of the embodiments of this application, a computer program is provided, which is stored in a machine-readable storage medium, and when a processor executes the computer program, causes the processor to perform the method provided in the first aspect.
[0015] The image display method of this application embodiment no longer displays the cards to be displayed in a separate area on the display screen, but instead overlays them onto the target image displayed on the display screen. This ensures that the displayed cards are easier to view and reduces the requirements of the display area for card display. In addition, when the number of newly acquired cards and the number of cards already overlaid exceeds the maximum number of cards allowed to be overlaid, the process of the newly overlaid cards and the cards that need to be removed are displayed with preset animation effects, which increases the interactivity of the card display process and optimizes the card display effect. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating an image display method provided in an embodiment of this application;
[0017] Figure 2This is a schematic diagram illustrating the processing of a special effects foreground layer and a basic background layer during image display, provided in an embodiment of this application.
[0018] Figure 3 This is a schematic diagram of special effects processing in an image display process provided in an embodiment of this application;
[0019] Figure 4 This is a schematic diagram of the structure of an image display device provided in an embodiment of this application;
[0020] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0022] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0023] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0024] Please see Figure 1 This is a flowchart illustrating an image display method provided in an embodiment of this application, as shown below. Figure 1 As shown, the image display method may include:
[0025] Step S100: Obtain the first card to be stacked.
[0026] Step S110: When the number of second cards in the second card sequence currently displayed on the target image of the display screen reaches N1, control the first card and the second card to refresh with a preset animation effect so that the last N2 second cards in the second card sequence are removed from the target image, and the first card is displayed as the first N3 second cards in the second card sequence in the target image.
[0027] In this embodiment of the application, the card to be superimposed (which may be referred to as the first card) may include one or more images of the identified target captured by the image acquisition device, such as a face image of the identified person.
[0028] For example, the number of the first cards to be stacked can be denoted as N3, where N3≥1.
[0029] In this embodiment of the application, the image currently displayed on the display screen (which may be called the target image) may include a preview of the recognition area in the target recognition scene or a preset background image.
[0030] For example, the preset background image may include a static single-frame image, or a multi-frame image that is dynamically updated according to a preset update frequency, that is, the image currently displayed on the screen can be updated over time.
[0031] In this embodiment of the application, the first card to be displayed is no longer displayed in a separate area on the display screen, such as a separate area below or to the side of the target image, but is superimposed on the target image to reduce the display area size requirement for the display of the first card.
[0032] In addition, in order to optimize the display effect of the first card, when it is necessary to overlay a new card (i.e. the first card mentioned above) on the target image currently displayed on the screen, the overlay display process of the first card can be displayed with special effects animation.
[0033] Meanwhile, when the sum of the number of the first cards (i.e., N3) and the number of the second cards in the sequence of cards already superimposed on the target image currently displayed on the screen (referred to as the second cards in this article) (which can be denoted as N1, N1≥2) exceeds the maximum number of cards allowed to be superimposed on the target image of the screen (which can be denoted as N4), i.e. N1+N3>N4, the last N2 second cards in the second card sequence need to be removed from the target image (N2=N1+N3-N4).
[0034] When N2 < N1, some of the second cards in the second card sequence need to be removed from the target image, while another part of the second cards do not need to be removed, but their positions need to be updated.
[0035] In this scenario, which includes the entry of a new card (i.e., the first card mentioned above) into the target image, the removal of some second cards from the target image, and the position update of another portion of the second cards in the target image, the special effects operations to be performed include animation effects for the first card, animation effects for removing the second card from the target image, and animation effects for updating the position of the second card in the target image.
[0036] To optimize the display, the removal process of the N2 second cards can be shown with special effects animation.
[0037] For example, the positions of the last N2 second cards in the second card sequence can be determined according to the order in which the newly stacked cards are added.
[0038] For example, assuming the newly stacked cards enter the display screen in order from left to right, the last N2 second cards in the second card sequence can be the rightmost N2 second cards.
[0039] Assuming the newly stacked cards enter the display screen from right to left, the last N2 second cards in the second card sequence can be the leftmost N2 second cards.
[0040] Assuming the newly stacked cards enter the display screen in a top-to-bottom order, the last N2 second cards in the second card sequence can be the bottom N2 second cards.
[0041] Assuming the newly stacked cards enter the display screen in a bottom-up order, the last N2 second cards in the second card sequence can be the top N2 second cards.
[0042] In this embodiment, when the number of second cards in the second card sequence currently displayed on the target image of the display screen reaches N1, that is, when the number of first cards and the number of second cards exceed the maximum number of cards allowed to be displayed on the target image, on the one hand, the first cards can be controlled to refresh in the target image with preset animation effects, and the process of the first cards entering can be displayed with special effects animation effects; on the other hand, the second cards can be controlled to refresh in the target image with preset animation effects, and the process of the second cards that need to be removed being removed from the target image and the second cards that do not need to be removed being updated in position in the target image can be displayed with special effects animation effects, thereby optimizing the card display effect.
[0043] For example, refreshing a card (including a first card or a second card) may include updating the card's position and / or size.
[0044] For example, the card position can refer to the location of the card's center point in the target image, such as its coordinates in the image coordinate system of the target image.
[0045] For example, card size may include the width and height of the card.
[0046] For example, preset animation effects may include, but are not limited to, translation, fade-in, push-in, pull-out, fade-out, push-pull, appearing from a point and shrinking to disappear from a point, rotation, etc.
[0047] For example, newly superimposed cards (such as the first card mentioned above) can appear through animation effects such as fade-in, push-in, or zoom-in from a point.
[0048] For cards that need to be removed, they can disappear using animation effects such as fade-out, pull-out, or shrink to a point.
[0049] For cards that are not newly stacked but do not need to be removed, their positions can be updated using animation effects such as translation, push-pull, or rotation.
[0050] It should be noted that in this embodiment of the application, when the first card to be superimposed is obtained, but the target image currently displayed on the display screen does not have a second card sequence superimposed, it is not necessary to perform special effects operation for the second card, but only to perform special effects operation for the first card to enter the target image to display the corresponding animation effect.
[0051] When the first card to be superimposed is obtained, and the target image currently displayed on the screen already has the second card sequence superimposed, but the number of the first card and the number of the second card do not exceed the maximum number of cards, then it is not necessary to perform the special effect operation of removing the second card. Instead, the special effect operation of the first card entering the target image and the special effect operation of the second card position refresh can be performed to display the corresponding animation effects.
[0052] It can be seen that, in Figure 1 In the method flow shown, the cards that need to be displayed are no longer displayed in a separate area on the display screen, but are superimposed on the target image displayed on the display screen. This ensures that the displayed cards are easier to view and reduces the requirements of the display area for card display. In addition, when the number of newly acquired cards and the number of cards already superimposed exceeds the maximum number of cards allowed to be superimposed, the entry or removal process of the newly superimposed cards and the cards that need to be removed are displayed with preset animation effects, which increases the interactivity of the card display process and optimizes the card display effect.
[0053] It should be noted that in this embodiment of the application, when the first card to be superimposed is obtained and the second card sequence is not currently superimposed on the target image, it is not necessary to perform the animation effect operation for the second card in the above process.
[0054] If the first card to be overlaid is obtained, and the second card sequence is currently overlaid on the target image, but the sum of the number of the first card and the number of the second card in the second card sequence does not exceed the maximum number of cards, the animation effect operation of removing the second card from the target image in the above process is not required.
[0055] If the first card to be overlaid is obtained, and the second card sequence is already overlaid on the target image, and the number of the first card is the maximum number of cards, it is not necessary to perform the animation effect operation to update the position of the second card in the target image in the above process.
[0056] In some embodiments, the display screen includes a basic background layer and a special effects foreground layer.
[0057] In step S110, controlling the first card and the second card to refresh with a preset animation effect may include:
[0058] The second card sequence is moved from the target image, which serves as the base background layer, into the special effects foreground layer, and the original image data corresponding to the position of the second card sequence in the target image is restored.
[0059] In the foreground layer of special effects, control the first card and the second card to refresh them with preset animation effects;
[0060] When the refresh is complete, based on the position of the refreshed second card sequence in the foreground layer of the special effects, the original image data at the corresponding position in the target image is cleared, and the refreshed second card sequence is moved from the foreground layer of the special effects into the target image;
[0061] When the second card sequence is transferred between the special effects foreground layer and the target image, the position and size of the second card sequence in the special effects foreground layer are consistent with its position and size in the target image.
[0062] For example, in order to optimize the display of dynamic effects during the card refresh process, the display screen can be divided into a basic background layer and a special effects foreground layer. The animation effect during the card refresh process can be achieved by alternating between the basic background layer and the special effects foreground layer, instead of simply overlaying the card and card dynamic effects onto the image.
[0063] For example, when the first card is obtained, and the number of the first card and the number of the second card already superimposed on the target image exceed the maximum number of cards allowed to be superimposed on the target image, the second card sequence can be moved from the target image, which serves as the base background layer, into the special effects foreground layer.
[0064] For example, the second card sequence is transferred between the special effects foreground layer and the target image, such as moving the second card sequence from the target image into the special effects foreground layer, or moving the updated second card sequence from the special effects foreground layer back to the target image in a subsequent process, the position and size of the second card sequence in the special effects foreground layer are consistent with its position and size in the target image.
[0065] For example, when a card is overlaid on a target image, the card can be used to cover the original image data at the corresponding position in the target image.
[0066] Accordingly, when the second card sequence is moved from the target image into the special effects foreground layer, the original image data at the corresponding position in the target image can be recovered.
[0067] For example, taking the target image as the preview screen, the original image data at the corresponding position in the target image is the image data at that position in the preview screen when the second card sequence moves from the target image into the foreground layer of the special effects.
[0068] For example, if the target image is a static background image, the original image data of the corresponding position in the target image is the image data of the corresponding position in the static background image.
[0069] For example, when the second card sequence is moved into the effects foreground layer, the first and second cards can be controlled in the effects foreground layer to refresh with preset animation effects.
[0070] Once the refresh is complete, i.e., the first card is displayed on the screen at the specified position and size, and the second card is also shifted or removed as required, the original image data (i.e., the current image data at the corresponding position in the target image) can be cleared based on the position of the refreshed second card sequence in the foreground layer of the special effects. The refreshed second card sequence can then be moved from the foreground layer of the special effects into the target image and superimposed onto the corresponding position of the cleared image data.
[0071] In one example, controlling the first and second cards in the foreground layer of the special effects to refresh with preset animation effects can include:
[0072] In the foreground layer of special effects, the first card and the second card are controlled in parallel and refreshed with preset animation effects.
[0073] For example, in order to improve card refresh efficiency, when the first card and the second card need to be refreshed in the manner described above, the first card and the second card can be controlled in parallel in the foreground layer of special effects to refresh with preset animation effects.
[0074] In one example, the parallel control of the first card and the second card in the foreground layer of the special effects, refreshing them with preset animation effects, can include:
[0075] According to the preset card spacing requirements, the last N2 second cards in the second card sequence are removed from the special effects foreground layer with the first animation effect, the remaining second cards in the second card sequence are moved backward in the special effects foreground layer with the second animation effect, and the first card enters the special effects foreground layer with the third animation effect, becoming the first N3 second cards in the second card sequence.
[0076] For example, when N1 > N2, that is, when some of the second cards in the second card sequence need to be removed, the following control operations can be performed in parallel according to the preset card interval requirements:
[0077] Control the last N2 cards in the second card sequence to remove them from the foreground layer of special effects with a preset animation effect (referred to as the first animation effect in this article);
[0078] Control the remaining second cards in the second card sequence (excluding the last N2nd second card) to move backward in the foreground layer of the special effects with a preset animation effect (referred to as the second animation effect in this article);
[0079] Control the first card to enter the foreground layer of special effects with a preset animation effect (referred to as the third animation effect in this article), and become the first N3 second cards in the second card sequence.
[0080] As an example, the aforementioned preset card spacing requirements may include:
[0081] The spacing between adjacent cards remains at a preset interval; or,
[0082] The interval between adjacent cards is greater than or equal to 0; or,
[0083] Some or all of the adjacent cards in the second card sequence may overlap.
[0084] In some embodiments, the image display method provided in this application may further include:
[0085] When a viewing command for the target image is detected, the second card sequence that is currently overlaid on the target image is switched to the underlying display, and the original image data corresponding to the position of the second card sequence in the target image is restored.
[0086] For example, in the embodiments of this application, when a second card sequence is superimposed on the target image, viewing of the target image can also be supported.
[0087] Accordingly, when a viewing instruction for the target image is detected, such as a click instruction for the target image, the second card sequence that is already overlaid on the target image can be switched to the bottom layer. That is, after the switch, the target image is on the top layer and the second card sequence is on the bottom layer, and the original image data corresponding to the position of the second card sequence in the target image is restored, so that the complete target image data can be viewed.
[0088] For example, assuming the target image is a preview screen, by clicking on the preview screen, you can switch the second card sequence displayed on top of the preview screen to the bottom layer and switch the preview screen to the top layer, thus allowing you to view the complete preview screen.
[0089] In some embodiments, the image display method provided in this application may further include:
[0090] When a switching command for the target image is detected, the image data after the switch is obtained, the original image data corresponding to the position of the second card sequence in the image data after the switch is cleared, and the second card sequence is superimposed on the image data after the switch for display.
[0091] For example, in the embodiments of this application, when the second card sequence is superimposed on the target image, the switching of the target image is also supported. For example, the target image can be switched from the preview screen to the configuration interface or the function menu interface, or the target image can be switched from the function menu interface to the video playback interface, etc.
[0092] Accordingly, when a switching instruction for the target image is detected, the image data after the switch can be obtained. For example, the image data of the configuration interface can be obtained, the original image data corresponding to the position of the second card sequence in the image data after the switch can be cleared, and the second card sequence can be superimposed on the image data after the switch for display.
[0093] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the technical solutions provided in the embodiments of this application are described below with reference to specific examples.
[0094] In this embodiment, taking a target recognition scenario as an example, for any recognized target, the face image of the target can be overlaid and displayed on the preview screen played on the display screen, that is, taking the card as the face image and the target image as the preview screen as an example.
[0095] Assuming the face images displayed in the preview are arranged from right to left in order of entry time from morning to night, the face image on the right was entered earlier than the face image on the left.
[0096] When a new target is identified, the face image of the target (i.e., the first card mentioned above, which can be called the first face image in this embodiment, taking N3=1 as an example) can be obtained, and it can be determined whether the number of face images superimposed on the preview screen has reached the maximum number of face images (i.e., the maximum number of cards mentioned above, taking N1=N4 as an example).
[0097] If the number of face images already displayed in the preview (i.e., the second card mentioned above, which can be referred to as the second face image in this embodiment) reaches the maximum number of face images, then the rightmost second face image needs to be removed from the preview and the first face image needs to be moved into the preview as the latest leftmost second face image.
[0098] In this embodiment, the display screen may include a basic background layer and a special effects foreground layer.
[0099] When a new target is identified and its face image (i.e., the first face image mentioned above) is obtained, the second face image sequence that has been superimposed in the preview screen can be moved from the preview screen, which is the base background layer, into the special effects foreground layer, and the original image data corresponding to the position of the second face image sequence in the preview screen can be restored. That is, the preview video data corresponding to the position of the second face image sequence is backfilled in the preview screen.
[0100] like Figure 2 As shown, assuming a maximum of 5 face images, the following controls can be applied in the foreground layer of the effects:
[0101] 1. Control the second face image on the far right (i.e. Figure 2 Card 1 in the image is removed from the foreground layer of the effects with a preset animation effect (such as the first animation effect mentioned above).
[0102] For example, control the second face image on the far right to reduce the animation effect and remove it from the foreground layer of the effects.
[0103] 2. Control the second face image that is not the far right (i.e., Figure 2 Cards 2-5 in the image move backward in the foreground layer of the special effects with preset animation effects (such as the second animation effect mentioned above).
[0104] For example, control the second face image (not the rightmost one) to move to the right in the foreground layer of the special effects with a translation animation effect, where cards 5-2 are translated to the positions of the original cards 4-1 respectively.
[0105] 3. Control the first face image (i.e. Figure 2 Card 6 in the image enters the foreground layer of the special effects with a preset animation effect (such as the third animation effect mentioned above).
[0106] For example, control the first face image to enlarge the animation effect and enter the special effects foreground layer.
[0107] It should be noted that the above control operations 1 to 3 can be executed in parallel. For example, while controlling card 1 is removed from the foreground layer of the special effects, control cards 5 to 2 are moved backward and control card 6 is moved into the special effects layer.
[0108] Alternatively, control operations 1 and 2 can be executed in parallel, and control operation 3 can be executed after control operations 1 and 2 have been completed.
[0109] Alternatively, control operation 1 can be executed first, and control operations 2 and 3 can be executed in parallel after control operation 1 is completed.
[0110] Alternatively, control operations 1 through 3 can be executed sequentially.
[0111] in, Figure 2 In the example of executing control operations 1 and 2 in parallel, and then executing control operation 3 after control operations 1 and 2 have been completed.
[0112] In this embodiment, when the above control operations 1 to 3 are completed, the preview video data (i.e., the original image data) corresponding to the positions of cards 2 to 6 in the preview screen can be cleared, and cards 2 to 6 can be moved from the special effects foreground layer into the preview screen.
[0113] In this embodiment, to ensure efficient animation display, multiple textures (one texture corresponding to one face image) can be rendered in parallel. The number of textures created is equal to the number of images (i.e., face images) to be displayed. The background image can be a user-defined image or video, or an image or video from a real-time camera.
[0114] The following is combined Figure 3 The example shown illustrates this.
[0115] like Figure 3 As shown, assuming the maximum number of face images that can be overlaid in the preview screen is 3, the maximum number of face images that can be processed is 4: that is, the rightmost second face image disappears, the leftmost two second face images shift to the right, and a new face image (i.e., the first face image) appears from the leftmost side. Therefore, four shared effects menu buffers (one buffer for processing one face image) are requested, and four textures are generated for animation effects processing.
[0116] In this example, to ensure that the special effects processing speed does not affect the target recognition speed, four face images (including three second face images and one first face image) are used. Figure 3 The different special effects corresponding to cards 1-4 in the image can be drawn simultaneously, and the drawing process can be as follows: Figure 3 As shown.
[0117] Assuming each face image has a width of W, and the final three cards are tiled, the distance between the center points of two adjacent cards is X, the distance between the edges of two adjacent cards is Z (related to screen resolution), the speed at which the leftmost card 4 appears from the center point is V4, the speed at which cards 2 and 3 move to the right is V23, and the speed at which the rightmost card 1 shrinks until it disappears from the center point is V1, then the time required for card 4 to appear from the center point is:
[0118] T4 = W / V4
[0119] Time required for cards 2 and 3 to be moved to the target position to the right:
[0120] T23 = X / V23
[0121] Time required for card 1 to shrink until it disappears from the center:
[0122] T1 = W / V1
[0123] To ensure that the special effects quickly and completely display the identified target's face image and that the display effect is neat and uniform, the center point of card 1 before the special effects coincides with the center point of card 2 after the special effects, and so on.
[0124] During the special effect, the center point of card 1, which gradually shrinks until its center point disappears, remains fixed. The center point of card 4, which enlarges, coincides with the center point of card 3 before the special effect. The gradual enlargement process must begin after card 3 has been translated by the horizontal variable W / 2+Z, and the center point position remains fixed throughout the enlargement process. If, after time T of the enlargement effect, card 4 has already enlarged by the horizontal variable w during the enlargement process, and card 3 has been translated by the horizontal variable x, then the following must be satisfied:
[0125] x = w / 2
[0126] x = V23 * T
[0127] w = V4 * T
[0128] Then the velocity V4 of card 4 and the velocity V23 of cards 2 and 3 must satisfy:
[0129] V23*T=V4*T / 2
[0130] Right now
[0131] V4 = V23 * 2
[0132] Furthermore, the process of card 4 gradually enlarging ends when card 3 is shifted by the horizontal variable W / 2, that is:
[0133] W / 2 / V23=W / V4
[0134] For example, considering that the horizontal translation variable of card 2 is consistent with that of card 3, card 1 may overlap with the translated card 2 during the shrinking process. The following solutions can be selected to optimize the processing effect according to the requirements:
[0135] Option 1: In a scenario where the integrity of the face attendance comparison results is maximized, the distance between card 1 and the edge of card 2 is kept at Z during the shrinking process, and the shrinking process should end before card 2 is translated by the horizontal variable W / 2.
[0136] Assuming that after the shrinking effect is applied for time Q, card 1 has already shrunk the horizontal variable u during the shrinking process, and card 2 has shifted the horizontal variable y, the following conditions must be met to achieve the above effect:
[0137] y = u / 2
[0138] y = V23 * Q
[0139] u=V1*Q
[0140] Then the velocity V1 of card 1 and the velocities V23 of cards 2 and 3 must satisfy:
[0141] V23*Q=V1*Q / 2
[0142] Right now
[0143] V1 = V23 * 2
[0144] Furthermore, the process of card 1 gradually shrinking ends when card 2 is shifted by the horizontal variable W / 2, that is:
[0145] W / 2 / V23=W / V1
[0146] Option 1: Time consumed for each set of special effects (card 1 shrinks and disappears + cards 2 and 3 translate + card 4 enlarges and appears):
[0147] W / V1+Z / V23+W / V4
[0148] Right now
[0149] (W+Z) / V23
[0150] In other words, the width of the card, the edge distance between two adjacent cards, and the speed of the special effects will affect the speed at which the special effects are displayed.
[0151] Option 2: In scenarios where the display speed of facial recognition attendance comparison results needs to be improved, this can be achieved by increasing the speed of special effects, such as the dual-effect buffer ping-pong operation. That is, for 4 cards to be processed, 8 buffers can be applied for, with 2 buffers corresponding to one card. One buffer is used for data writing, and the other buffer is used for data processing. The processing in the two buffers corresponding to the same card can be carried out in parallel.
[0152] In this scheme, to ensure that the cards do not overlap, the following conditions must be met:
[0153] V4≤V23*2
[0154] V1≥V23*2
[0155] In this scheme, card 1 disappears the fastest, cards 2 and 3 disappear at a moderate speed, and card 4 disappears the slowest, thus improving processing speed while ensuring that cards do not overlap.
[0156] It should be noted that in the solution, when the speed of the special effects is too high, such as when the update speed is increased to a level that is imperceptible to the human eye, the display effect of the special effects will be affected.
[0157] Option 3: In scenarios where the display of facial recognition attendance results is required to be both complete and fast, the edge distance between two adjacent cards can be disregarded during the execution of special effects, or even overlap between two adjacent cards can be allowed.
[0158] In this scheme, if the edge distance between two adjacent cards is allowed to be 0, the time required for each set of special effects is:
[0159] W / V1+W / V4
[0160] That is, Z=0. In this case, the time required for each set of special effects can be reduced by increasing V1 and / or V4.
[0161] If card 1 and card 2 are allowed to overlap, the time required for each set of effects is:
[0162] W / 2 / V23+W / V4
[0163] In this case, the time required for each set of special effects can be reduced by increasing V23 and / or V4.
[0164] The method provided in this application has been described above. The apparatus provided in this application is described below:
[0165] Please see Figure 4 This is a schematic diagram of the structure of an image display device provided in an embodiment of this application, as shown below. Figure 4 As shown, the image display device may include:
[0166] Acquisition unit 410 is used to acquire the first card to be stacked;
[0167] Display unit 420 is configured to control the first card and the second card to refresh with a preset animation effect when the number of second cards in the second card sequence currently displayed on the target image of the display screen reaches N1, so that the last N2 second cards in the second card sequence are removed from the target image, and the first card is displayed as the first N3 second cards in the second card sequence, superimposed on the target image; N1≥2, N3 is the number of the first cards, N1+N3>N4, N2=N1+N3-N4, N4 is the maximum number of cards allowed to be superimposed on the target image of the display screen, and N2<N1.
[0168] In some embodiments, the display screen includes a basic background layer and a special effects foreground layer.
[0169] The display unit 420 controls the first card and the second card to refresh with preset animation effects, including:
[0170] The second card sequence is moved from the target image, which serves as the base background layer, into the special effects foreground layer, and the original image data corresponding to the position of the second card sequence in the target image is restored.
[0171] In the foreground layer of special effects, the first card and the second card are controlled to refresh with preset animation effects;
[0172] When the refresh is complete, based on the position of the refreshed second card sequence in the special effects foreground layer, the original image data at the corresponding position in the target image is cleared, and the refreshed second card sequence is moved from the special effects foreground layer into the target image;
[0173] When the second card sequence is transferred between the special effects foreground layer and the target image, the position and size of the second card sequence in the special effects foreground layer are consistent with the position and size in the target image.
[0174] In some embodiments, the display unit 420, within the special effects foreground layer, controls the first card and the second card to refresh with preset animation effects, including:
[0175] In the foreground layer of special effects, the first card and the second card are controlled in parallel to refresh with preset animation effects.
[0176] In some embodiments, the step of controlling the first card and the second card in parallel within the special effects foreground layer to refresh them with a preset animation effect includes:
[0177] According to the preset card spacing requirements, the last N2 second cards in the second card sequence are removed from the special effects foreground layer with a first animation effect, the remaining second cards in the second card sequence move backward in the special effects foreground layer with a second animation effect, and the first card enters the special effects foreground layer with a third animation effect, becoming the first N3 second cards in the second card sequence.
[0178] In some embodiments, the preset card spacing requirement includes:
[0179] The spacing between adjacent cards remains at a preset interval; or,
[0180] The interval between adjacent cards is greater than or equal to 0; or,
[0181] Overlap between some or all of the adjacent cards in the second card sequence is permitted.
[0182] In some embodiments, the preset animation effects include:
[0183] Translation, fade-in, fade-out, push-in, pull-out, push-pull, appearing from a point and shrinking to disappear from a point, or rotation;
[0184] And / or,
[0185] The first animation effect includes fade-in, push-in, or appearing by zooming in from a point;
[0186] And / or,
[0187] The second animation effect includes translation, push / pull, or rotation;
[0188] And / or,
[0189] The third animation effect includes fade-out, pull-out, or shrinking to the point and disappearing.
[0190] In some embodiments, the display unit 420 is further configured to, when a viewing instruction for the target image is detected, switch the second card sequence that has been overlaid on the target image to the underlying display and restore the original image data of the position corresponding to the second card sequence in the target image.
[0191] In some embodiments, the display unit 420 is further configured to, when a switching instruction for the target image is detected, acquire the switched image data, clear the original image data corresponding to the position of the second card sequence in the switched image data, and overlay the second card sequence on the switched image data for display.
[0192] This application provides an electronic device including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the image display method described above.
[0193] Please see Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device may include a processor 501 and a memory 502 storing machine-executable instructions. The processor 501 and the memory 502 can communicate via a system bus 503. Furthermore, by reading and executing the machine-executable instructions corresponding to the image display logic in the memory 502, the processor 501 can execute the image display method described above.
[0194] The memory 502 mentioned in this document can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0195] In some embodiments, a machine-readable storage medium, such as Figure 5 The memory 502 in the memory, which is a machine-readable storage medium, stores machine-executable instructions that, when executed by a processor, implement the image display method described above. For example, the storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0196] This application also provides a computer program stored in a read storage medium, such as... Figure 5 The memory 502 is used, and when the processor executes the computer program, it causes the processor 501 to execute the image display method described above.
[0197] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0198] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. An image display method characterized by, The method comprises the following steps: acquiring a first card to be superimposed; when the number of second cards in a second card sequence that have been superimposed on a target image currently displayed by a display screen reaches N1, controlling the first card and the second cards to refresh with a preset animation effect, so that the last N2 second cards in the second card sequence are removed from the target image, and the first card enters the target image as the first N3 second cards in the second card sequence; N1≥2, N3 is the number of the first card, N1+N3>N4, N2=N1+N3-N4, N4 is the maximum number of cards allowed to be superimposed on the target image of the display screen, and N2 The method comprises the following steps: moving the second card sequence from the target image as the base background layer to the special effect foreground layer, and restoring the original image data of the positions corresponding to the second card sequence in the target image; controlling the first card and the second cards in the special effect foreground layer to refresh with a preset animation effect; when the refreshing is completed, clearing the original image data of the corresponding positions in the target image according to the positions of the refreshed second card sequence in the special effect foreground layer, and moving the refreshed second card sequence from the special effect foreground layer to the target image; wherein when the second card sequence is transferred between the special effect foreground layer and the target image, the position and size of the second card sequence in the special effect foreground layer are consistent with the position and size in the target image.
2. The method of claim 1, wherein, The method comprises the following steps: controlling the first card and the second cards in the special effect foreground layer to refresh with a preset animation effect in parallel.
3. The method of claim 2, wherein, The method comprises the following steps: controlling the first card and the second cards in the special effect foreground layer to refresh with a preset animation effect in parallel.
4. The method of claim 3, wherein, The method comprises the following steps: controlling the last N2 second cards in the second card sequence to be removed from the special effect foreground layer with a first animation effect, the remaining second cards in the second card sequence to move backward in the special effect foreground layer with a second animation effect, and the first card to enter the special effect foreground layer as the first N3 second cards in the second card sequence with a third animation effect, according to a preset card spacing requirement. The preset card spacing requirement comprises: the spacing between adjacent cards is kept at a preset spacing; or 5. The method of claim 3, wherein, the spacing between adjacent cards is greater than or equal to 0; or partial or all adjacent cards in the second card sequence are allowed to overlap. The preset animation effect comprises: translation, fade-in, fade-out, push-in, pull-out, push-pull, appearing from a point by zooming in, disappearing to a point by zooming out, or rotation; and / or the first animation effect comprises fade-in, push-in, or appearing from a point by zooming in; and / or The second animation effect includes translation, push-pull, or rotation; and / or, The third animation effect includes fade-out, pull-out, or shrink to point disappearance.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: When a viewing instruction for the target image is detected, switching a second card sequence that has been superimposed on the target image to underlayer display, and restoring original image data of a position in the target image corresponding to the second card sequence.
7. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: When a switching instruction for the target image is detected, acquiring switched image data, clearing original image data of a position in the switched image data corresponding to the second card sequence, and superimposing the second card sequence on the switched image data for display.
8. An image display device, characterized by comprising: Comprise: An acquisition unit configured to acquire a first card to be superimposed; A display unit configured to, when a number of second cards in a second card sequence that has been superimposed on a target image currently displayed by a display screen reaches N1, control the first card and the second cards to refresh with preset animation effects, so that last N2 second cards in the second card sequence are removed from the target image, and the first card is superimposed in the target image as first N3 second cards in the second card sequence; N1≥2, N3 is a number of the first cards, N1+N3>N4, N2=N1+N3-N4, N4 is a maximum number of cards allowed to be superimposed on the target image of the display screen, and N2 The display unit is specifically configured to: Move the second card sequence from the target image as a base background layer to the special effect foreground layer, and restore original image data of a position in the target image corresponding to the second card sequence; In the special effect foreground layer, control the first card and the second cards to refresh with preset animation effects; When the refreshing is completed, clear original image data of a corresponding position in the target image according to a position of the refreshed second card sequence in the special effect foreground layer, and move the refreshed second card sequence from the special effect foreground layer to the target image. When the second card sequence is transferred between the special effect foreground layer and the target image, a position and size of the second card sequence in the special effect foreground layer are consistent with a position and size in the target image.
9. The apparatus of claim 8, wherein, The display unit controls the first card and the second cards to refresh with preset animation effects in the special effect foreground layer, including: In the special effect foreground layer, control the first card and the second cards to refresh with preset animation effects in parallel; The display unit controls the first card and the second cards to refresh with preset animation effects in the special effect foreground layer, including: In the special effect foreground layer, control the first card and the second cards to refresh with preset animation effects in parallel; According to a preset card interval requirement, the last N2 second cards in the second card sequence are controlled in parallel to be removed from the special effect foreground layer with a first animation effect, the remaining second cards in the second card sequence are controlled to move backward in the special effect foreground layer with a second animation effect, and the first cards are controlled to enter the special effect foreground layer as the first N3 second cards in the second card sequence with a third animation effect; The preset card interval requirement includes: The interval between adjacent cards is kept as a preset interval; or, The interval between adjacent cards is greater than or equal to 0; or, Overlapping is allowed between part or all of adjacent cards in the second card sequence; The preset animation effect includes: Translation, fade-in, fade-out, push-in, pull-out, push-pull, appearing from a point by zooming in, disappearing to a point by zooming out, or rotation; And / or, The first animation effect includes fade-in, push-in, or appearing from a point by zooming in; And / or, The second animation effect includes translation, push-pull, or rotation; And / or, The third animation effect includes fade-out, pull-out, or disappearing to a point by zooming out; And / or, The display unit is further configured to, when detecting a viewing instruction for the target image, switch the second card sequence that has been superimposed and displayed on the target image to bottom layer display, and restore original image data of a position in the target image corresponding to the second card sequence; And / or, The display unit is further configured to, when detecting a switching instruction for the target image, acquire switched image data, clear original image data of a position in the switched image data corresponding to the second card sequence, and superimpose and display the second card sequence in the switched image data.
10. An electronic device, comprising: A processor and a memory are included, the memory stores machine executable instructions that can be executed by the processor, and the processor is configured to execute the machine executable instructions to implement the method in any one of claims 1-7.
11. A machine-readable storage medium, characterized in that, The machine readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method in any one of claims 1-7.
Citation Information
Patent Citations
Mobile terminal and method of controlling same
CN108600605A
OSD superposition method based on video detection
CN110636259A