Image display method and device, electronic equipment and storage medium
By controlling the dynamic movement of the image in the display area by acquiring the tempo of the music, the problem of the lack of correlation between the image and the music tempo is solved, realizing the synchronous dynamic display of the image and the music, and improving the user experience.
Patent Information
- Application Number
- CN202310895932.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2043-07-20
AI Technical Summary
In existing technologies, the images displayed on the music playback interface lack correlation with the music's tempo, resulting in low responsiveness.
By acquiring the tempo of the music, the dynamic movement of the image in the display area is controlled, so that the image is synchronized with the music tempo. The tempo is used to control the movement distance, slope and direction of the image, so as to realize the dynamic video display of the image.
It enhances the interaction between images and music, enabling synchronized dynamic display of images and music, thus improving the user experience.
Smart Images

Figure CN117041411B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to image display methods, apparatus, electronic devices and storage media. Background Technology
[0002] With the increasing popularity of mobile phones and other mobile devices, many users enjoy listening to music on their phones. Users can view lyrics, comment on songs, or share them on the music playback interface.
[0003] In related technologies, music playback interfaces typically display song information, lyrics, and images corresponding to a song. However, the images are usually displayed in a static or simple page-turning animation manner, which is not related to the music being played, resulting in a low correlation between the images and the music. Summary of the Invention
[0004] This disclosure provides an image display method, apparatus, electronic device, and storage medium.
[0005] According to a first aspect of this disclosure, an image display method is provided, the method comprising:
[0006] During the playback of the target music, the tempo of the target music is obtained;
[0007] Obtain the target image corresponding to the target music;
[0008] The target image is moved based on the beat speed, and the target image is dynamically displayed in the target display area.
[0009] Optionally, the target music includes multiple different beat cycles, each beat cycle corresponding to a beat tempo;
[0010] The control of the target image motion based on the beat speed includes:
[0011] The motion distance of the target image in the current motion cycle is determined based on the beat speed corresponding to the current beat cycle; the current motion cycle is within the current beat cycle.
[0012] Based on the motion distance and motion slope of the target image in the current motion cycle, determine the position offset of the target image in the current motion cycle;
[0013] Based on the position offset, the motion direction parameters of the target image in the current motion cycle, and the first position of the target image in the target display area in the previous motion cycle, the second position of the target image in the target display area in the current motion cycle is determined.
[0014] Control the target image to move from the first position to the second position.
[0015] Optionally, determining the motion distance of the target image in the current motion cycle based on the beat speed of the current beat cycle includes:
[0016] Obtain the movement distance adjustment coefficient corresponding to the current movement cycle;
[0017] Based on the beat speed corresponding to the current beat cycle and the motion distance adjustment coefficient, the motion distance of the target image in the current motion cycle is calculated.
[0018] Optionally, determining the motion distance of the target image in the current motion cycle based on the beat speed corresponding to the current beat cycle includes:
[0019] Compare the beat speed corresponding to the current beat cycle with the beat speed corresponding to the previous movement cycle;
[0020] If the beat speed corresponding to the current beat cycle changes relative to the beat speed corresponding to the previous movement cycle, obtain the preset image acceleration / deceleration step size;
[0021] The beat speed corresponding to the previous motion cycle is adjusted by the acceleration / deceleration step size of the image to obtain the adjusted beat speed;
[0022] The movement distance of the target image in the current motion cycle is determined based on the adjusted beat speed.
[0023] Optionally, adjusting the beat speed corresponding to the previous motion cycle based on the image acceleration / deceleration step size to obtain the adjusted beat speed includes:
[0024] If the beat speed corresponding to the previous movement cycle is less than the beat speed corresponding to the current beat cycle, the beat speed corresponding to the previous movement cycle is increased by the acceleration / deceleration step size of the image to obtain the adjusted beat speed; the resulting adjusted beat speed is not greater than the beat speed corresponding to the current beat cycle.
[0025] Alternatively, if the beat speed corresponding to the previous movement cycle is greater than the beat speed corresponding to the current beat cycle, the beat speed corresponding to the previous movement cycle is reduced by the image acceleration / deceleration step size to obtain the adjusted beat speed; the resulting adjusted beat speed is not less than the beat speed corresponding to the current beat cycle.
[0026] Optionally, the method further includes:
[0027] Monitor whether the target image exceeds the boundary of the image motion strategy;
[0028] If the target image exceeds the boundary of the image motion strategy, change the motion direction parameters of the target image in the current motion cycle;
[0029] The motion slope of the target image in the current motion cycle is redefined, and the process returns to the step of determining the position offset of the target image in the current motion cycle based on the motion distance and the motion slope of the target image in the current motion cycle.
[0030] Optionally, monitoring whether the target image exceeds the boundary of the image motion strategy includes:
[0031] If the area of the target display area is smaller than the area of the target image, monitor whether the boundary of the target image is located within the target display area;
[0032] If the boundary of the target image is located within the target display area, it is determined that the target image exceeds the boundary of the image motion strategy.
[0033] Optionally, monitoring whether the target image exceeds the boundary of the image motion strategy includes:
[0034] When the area of the target display area is equal to the area of the target image, monitor whether the positional offset between the boundary of the target image and the boundary of the target display area exceeds a preset offset.
[0035] If the position offset exceeds the preset offset, it is determined that the target image exceeds the image motion strategy boundary.
[0036] According to a second aspect of this disclosure, an image display apparatus is provided, the apparatus comprising:
[0037] A beat speed acquisition module is used to acquire the beat speed of the target music during playback.
[0038] The target image acquisition module is used to acquire the target image corresponding to the target music;
[0039] The target image control module is used to control the movement of the target image based on the beat speed and dynamically display the target image in the target display area.
[0040] Optionally, the target music includes multiple different beat cycles, each beat cycle corresponding to a beat tempo;
[0041] The target image control module is specifically used for:
[0042] The motion distance of the target image in the current motion cycle is determined based on the beat speed corresponding to the current beat cycle; the current motion cycle is within the current beat cycle.
[0043] Based on the motion distance and motion slope of the target image in the current motion cycle, determine the position offset of the target image in the current motion cycle;
[0044] Based on the position offset, the motion direction parameters of the target image in the current motion cycle, and the first position of the target image in the target display area in the previous motion cycle, the second position of the target image in the target display area in the current motion cycle is determined.
[0045] Control the target image to move from the first position to the second position.
[0046] Optionally, the target image control module is specifically used for:
[0047] Obtain the movement distance adjustment coefficient corresponding to the current movement cycle;
[0048] Based on the beat speed corresponding to the current beat cycle and the motion distance adjustment coefficient, the motion distance of the target image in the current motion cycle is calculated.
[0049] Optionally, the target image control module is specifically used for:
[0050] Compare the beat speed corresponding to the current beat cycle with the beat speed corresponding to the previous movement cycle;
[0051] If the beat speed corresponding to the current beat cycle changes relative to the beat speed corresponding to the previous movement cycle, obtain the preset image acceleration / deceleration step size;
[0052] The beat speed corresponding to the previous motion cycle is adjusted by the acceleration / deceleration step size of the image to obtain the adjusted beat speed;
[0053] The movement distance of the target image in the current motion cycle is determined based on the adjusted beat speed.
[0054] Optionally, the target image control module is specifically used for:
[0055] If the beat speed corresponding to the previous movement cycle is less than the beat speed corresponding to the current beat cycle, the beat speed corresponding to the previous movement cycle is increased by the acceleration / deceleration step size of the image to obtain the adjusted beat speed; the resulting adjusted beat speed is not greater than the beat speed corresponding to the current beat cycle.
[0056] Alternatively, if the beat speed corresponding to the previous movement cycle is greater than the beat speed corresponding to the current beat cycle, the beat speed corresponding to the previous movement cycle is reduced by the image acceleration / deceleration step size to obtain the adjusted beat speed; the resulting adjusted beat speed is not less than the beat speed corresponding to the current beat cycle.
[0057] Optionally, the device further includes:
[0058] The boundary monitoring module is used to monitor whether the target image exceeds the boundary of the image motion strategy;
[0059] The parameter changing module is used to change the motion direction parameters of the target image in the current motion cycle when the target image exceeds the boundary of the image motion strategy.
[0060] The slope determination module is used to redetermine the motion slope of the target image in the current motion cycle, and return to the step of determining the position offset of the target image in the current motion cycle based on the motion distance and the motion slope of the target image in the current motion cycle.
[0061] Optionally, the boundary monitoring module is specifically used for:
[0062] If the area of the target display area is smaller than the area of the target image, monitor whether the boundary of the target image is located within the target display area;
[0063] If the boundary of the target image is located within the target display area, it is determined that the target image exceeds the boundary of the image motion strategy.
[0064] Optionally, the boundary monitoring module is specifically used for:
[0065] When the area of the target display area is equal to the area of the target image, monitor whether the positional offset between the boundary of the target image and the boundary of the target display area exceeds a preset offset.
[0066] If the position offset exceeds the preset offset, it is determined that the target image exceeds the image motion strategy boundary.
[0067] According to a third aspect of this disclosure, an electronic device is provided. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method described above.
[0068] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the methods described above.
[0069] The technical solution provided in this disclosure acquires the beat speed of the target music and a target image during the playback of the target music; controls the movement of the target image based on the beat speed, and dynamically displays the target image in the target display area. Therefore, in this disclosure, controlling the movement of the target image by the beat speed allows for the association of the image with the beat speed of the playing music, enhancing the linkage between the image and the playing music. Furthermore, it enables dynamic video playback and display of the target image. Attached Figure Description
[0070] Further details, features, and advantages of this disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0071] Figure 1 A flowchart illustrating an exemplary embodiment of this disclosure;
[0072] Figure 2 for Figure 1 A flowchart illustrating the specific implementation of S130;
[0073] Figure 3 It is a schematic diagram of the movement position of the target image within the target display area;
[0074] Figure 4 It is a schematic diagram showing the position of the target image in the target display area;
[0075] Figure 5 for Figure 2 A flowchart illustrating the specific implementation of S131;
[0076] Figure 6 This is a schematic diagram of the boundary of the first image motion strategy;
[0077] Figure 7 This is a schematic diagram of the boundary of the second type of image motion strategy;
[0078] Figure 8 A schematic block diagram of the functional modules of an image display device provided in an exemplary embodiment of this disclosure;
[0079] Figure 9 A structural block diagram of an electronic device provided as an exemplary embodiment of this disclosure;
[0080] Figure 10 A block diagram of a computer system provided for an exemplary embodiment of this disclosure. Detailed Implementation
[0081] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0082] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0083] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0084] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0085] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0086] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0087] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0088] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understood that the above notification and user authorization process is merely illustrative and does not constitute a limitation on the implementation of this disclosure; other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0089] In related technologies, music players mainly display song information, lyrics, static images, or image set page-turning animations while playing music audio content. The displayed images are usually not related to the tempo of the music, resulting in low linkage between the images and the music playback.
[0090] To address the aforementioned technical problems in related technologies, this disclosure provides a method for dynamically displaying images in sync with the tempo of music during audio playback. If the tempo of the music changes, the image movement can be dynamically and smoothly controlled according to the tempo changes, thereby providing users with a dynamic video playback display interface that is synchronized with the music tempo.
[0091] The image display method, apparatus, electronic device, and storage medium provided in the embodiments of this disclosure will be explained in detail below.
[0092] Firstly, the present disclosure provides an image display method, such as... Figure 1 As shown, the method may include the following steps:
[0093] In step S110, the tempo of the target music is acquired during the playback of the target music.
[0094] The target music can be any music that is currently playing, and this embodiment of the disclosure does not specifically limit it.
[0095] To ensure that the displayed image is synchronized with the tempo of the target music in subsequent steps, it is first necessary to obtain the tempo (rhythm) of the target music. The tempo (rhythm) can be understood as the number of beats per minute, or the number of beats per minute.
[0096] In practical applications, the tempo of a target piece of music is usually not fixed. The target music consists of multiple different tempo cycles, each corresponding to a specific tempo. The tempo of each tempo cycle may be the same or different. Therefore, it is possible to obtain the tempo of each tempo cycle.
[0097] Assumption Given the tempo of this segment relative to the start and end times of the music, the obtained tempo can be:
[0098]
[0099] in, bpm1 represents the number of beats per minute corresponding to the first beat speed cycle. bpm2 is the number of beats per minute corresponding to the second beat speed cycle. For the i-th beat speed period, bpm i This represents the number of beats per minute corresponding to the i-th beat speed cycle.
[0100] In step S120, the target image corresponding to the target music is obtained.
[0101] Specifically, the target object can be any image related to the audio content of the target music. Furthermore, the target object corresponding to the target music can be pre-defined or determined in real-time when the target music is played; both are reasonable, and this disclosure does not impose specific limitations on this.
[0102] In step S130, the target image is controlled to move based on the beat speed, and the target image is dynamically displayed in the target display area.
[0103] As described in step S110, the target music can include multiple tempo cycles, each corresponding to a specific tempo. Therefore, for each tempo cycle, the movement of the target image can be controlled based on the tempo corresponding to that tempo cycle. In practical applications, to ensure good synchronization between the movement of the target image and the tempo of the target music, a larger tempo corresponding to a tempo cycle allows for a greater movement distance of the target image within the target display area, and a larger step size, resulting in faster movement of the target image when the music tempo is fast. Conversely, a smaller tempo corresponding to a tempo cycle allows for a smaller movement distance of the target image within the target display area, and a smaller step size, resulting in slower movement of the target image when the music tempo is slow.
[0104] During the process of controlling the movement of the target image, the target image can be dynamically displayed in the target display area. The target display area can be an area in the music playback interface of the target music. In practical applications, the size of the target display area can be the same as or smaller than the size of the target image.
[0105] The technical solution provided in this disclosure acquires the beat speed of the target music and a target image during the playback of the target music; controls the movement of the target image based on the beat speed, and dynamically displays the target image in the target display area. Therefore, in this disclosure, controlling the movement of the target image by the beat speed allows for the association of the image with the beat speed of the playing music, enhancing the linkage between the image and the playing music. Furthermore, it enables dynamic video playback and display of the target image.
[0106] exist Figure 1 Based on the illustrated embodiment, in one implementation, S130, the target image motion is controlled based on the beat speed, such as... Figure 2 As shown, it may include the following steps:
[0107] S131, determine the motion distance of the target image in the current motion cycle based on the beat speed corresponding to the current beat cycle.
[0108] The current motion cycle is within the current beat cycle.
[0109] The target music usually includes multiple beat speed cycles. In order to accurately control the motion of the target image, it can be refreshed once at a preset time. Each refresh corresponds to a current motion cycle, which is within the current beat cycle. That is, the current motion cycle can be a part of the current beat cycle or the entire current beat cycle, which is reasonable.
[0110] In practical applications, it is assumed that the refresh occurs every 1 / 60th of a second, that is, a motion cycle is defined as 1 / 60th of a second. The current motion cycle is the beat speed cycle to which the current 1 / 60th of a second belongs. Of course, this is just an explanation using 1 / 60th of a second as a motion cycle. The duration of each motion cycle can be determined according to the actual situation. This embodiment does not impose any specific limitations on this.
[0111] The following section will elaborate on the specific implementation methods for determining the motion distance of a target image.
[0112] In one embodiment, determining the motion distance of the target image in the current motion cycle based on the beat speed of the current beat cycle may include the following steps, namely steps a1 and a2:
[0113] Step a1: Obtain the movement distance adjustment coefficient corresponding to the current movement cycle.
[0114] Step a2: Calculate the motion distance of the target image in the current motion cycle based on the beat speed and motion distance adjustment coefficient corresponding to the current beat cycle.
[0115] The technical solution in this application is a general solution. Differences in the perceived motion of images can arise from variations in the drawing frequency of the implementing program or the screen size of the display device. Therefore, different motion distance adjustment coefficients are set according to different conditions to ensure consistent display effects and visual experience.
[0116] Therefore, in order to make the target image move uniformly and periodically in the direction of motion, a refresh rate of r times per second can be set, with the target image moving a distance z each time it is refreshed.
[0117]
[0118] Among them, bpm t This represents the number of beats per minute in the current beat rate cycle. Speed represents the number of beats within each refresh cycle. rate This is the motion distance adjustment coefficient. In practical applications, speed... rate The larger the value, the faster the target image moves.
[0119] S132, Based on the motion distance and motion slope of the target image in the current motion cycle, determine the position offset of the target image in the current motion cycle.
[0120] The method for determining the motion slope of the target image in the current motion cycle can be as follows:
[0121] Specifically, the target image moves in a straight line within the target display area, with a slope of a positive number k. Its maximum and minimum values are set [k]. min ,k max The initial value of the motion slope of the target image in the target display area can be [k]. min ,k max Randomly selected from within the range.
[0122] like Figure 3 As shown, after obtaining the motion distance z of the target image in the target display area during the current motion cycle and the motion slope of the target image in the target display area, it is possible to...
[0123]
[0124] Calculate the position offset (x, y) of the target image during the current motion cycle.
[0125]
[0126] S133, based on the position offset, the motion direction parameters of the target image in the current motion cycle, and the first position of the target image in the target display area in the previous motion cycle, determine the second position of the target image in the target display area in the current motion cycle.
[0127] The motion direction parameters of the target image in the current motion cycle can be obtained in the following ways:
[0128] A Cartesian coordinate system can be established within the target display area, with the x-coordinate increasing from left to right and the y-coordinate increasing from top to bottom. The position of the target image within the target display area can be determined by the position of the top-left corner of the target image in the coordinate system (x, y). t ,y t ) Determined, such as Figure 4 As shown.
[0129] Furthermore, the motion direction parameter of the target image on the x-axis can be preset to -1 or 1, where -1 represents negative motion on the x-axis and 1 represents positive motion on the x-axis; similarly, the motion direction parameter of the target image on the y-axis can also be preset to -1 or 1, where -1 represents negative motion on the y-axis and 1 represents positive motion on the y-axis. The initial motion direction parameters of the target image on the x-axis and y-axis of the target display area can be randomly selected, meaning the initial motion direction parameters on the x-axis and y-axis can be -1 or 1.
[0130] Based on the target image's motion along the x and y axes, the target image is currently at the second position (x) of the target display area during the motion cycle. t ,y t ) and the first position (x) of the target image in the target display area during the previous motion cycle. t-1 ,y t-1 The relationship is:
[0131]
[0132] Combining this with the formula in step S142, we can finally obtain:
[0133]
[0134] S134, control the target image to move from the first position to the second position.
[0135] Specifically, the second position (x) of the target image in the target display area during the current motion cycle is obtained. t ,y t After that, the target image can be controlled to move from the first position (x). t-1 ,y t-1 ) Move to the second position (x) t ,y t Furthermore, the step size of the target image can be determined based on the beat speed corresponding to the current beat cycle of the current motion cycle. The larger the beat speed, the larger the step size can be; the smaller the beat speed, the smaller the step size can be.
[0136] As can be seen, the technical solution provided in this embodiment determines the movement distance of the target image in the current motion cycle by measuring the beat speed. It then determines the second position of the target image in the target display area by determining the movement distance, slope, and direction parameters of the target image in the current motion cycle, as well as the first position of the target image in the target display area in the previous motion cycle. Finally, it controls the target image to move from the first position to the second position, thereby correlating image movement with the beat speed of the playing music, enhancing the linkage between the image and the music, and accurately controlling the movement of the target image within the target display area. Furthermore, it enables dynamic video playback and display of the target image.
[0137] Based on the above embodiments, in order to enable smooth movement of the target image within the target display area, in one implementation, such as... Figure 5 As shown, S131, determining the motion distance of the target image in the current motion cycle based on the beat speed corresponding to the current beat cycle includes:
[0138] S1311, compare the beat speed corresponding to the current beat cycle with the beat speed corresponding to the previous movement cycle.
[0139] S1312, if the beat speed corresponding to the current beat cycle changes relative to the beat speed corresponding to the previous movement cycle, obtain the preset image acceleration / deceleration step size.
[0140] Specifically, the tempo (bpm) corresponding to the current beat cycle is obtained from the rhythm based on the current playback time (t). i Then, in order to accurately determine the beat speed corresponding to the current movement cycle, it is necessary to set the beat speed (bpm) corresponding to the current beat cycle. i The beat speed (bpm) corresponding to the previous exercise cycle t-1 Compare, if bpm i Compared to bpm t-1 The situation has changed. To ensure smooth motion of the target image in subsequent steps, a preset image acceleration / deceleration step size needs to be obtained. This step size can be expressed in bpm. step To represent bpm step It can be determined based on the actual situation, and can be a positive number, bpm. step The size is proportional to the rate of change of the target image, bpm step The smaller the value of , the smoother the speed change of the target image.
[0141] S1313, adjusts the beat speed corresponding to the previous motion cycle by the image acceleration / deceleration step size, and obtains the adjusted beat speed.
[0142] S1314, determine the motion distance of the target image in the current motion cycle based on the adjusted beat speed.
[0143] Specifically, after obtaining the beat speed (bpm) corresponding to the previous movement cycle before the first stride length, t-1 Image acceleration / deceleration step size (bpm) step The beat rate (bpm) corresponding to the current beat cycle i After that, if bpm t-1 Less than bpm i Increase bpm by adjusting the acceleration / deceleration step size in the image. t-1 The increased beat speed is obtained and used as the beat speed corresponding to the current movement cycle, denoted as bpm. t-1 Similarly, if bpm t-1 Greater than bpm i Reduce bpm by increasing the step size of acceleration / deceleration based on the image. t-1 The reduced beat speed is obtained and used as the beat speed corresponding to the current movement cycle, which can also be denoted as bpm. t-1 .
[0144] For example, if bpm t-1 <bpm i bpm t =MIN(bpm) t-1 +bpm step bpm i )
[0145] Thus, bpm t It can be bpm t-1 +pm step with bpm i The minimum of the two.
[0146] For example, if bpm t-1 >bpm i bpm t =MIN(bpm) t-1 -bpm step ,bpm i )
[0147] Thus, bpm t It can be bpm t-1 -pm step With bpm i The maximum of the two.
[0148] If bpm t-1 =bpm i So, bpm t =bpm i .
[0149] As can be seen, the technical solution provided in this embodiment can adjust the beat speed corresponding to the previous motion cycle by adjusting the image acceleration and deceleration step size, obtain the beat speed corresponding to the current motion cycle, and calculate the motion distance of the target image in the current motion cycle, thereby realizing the smooth motion of the target image in the target display area.
[0150] Optionally, in this embodiment, when the current movement cycle is within the first beat cycle and is the first movement cycle, the beat speed of the current movement cycle can be the beat speed of the first beat cycle; when the current movement cycle is in the second beat cycle or in a beat cycle after the second beat cycle, the beat speed corresponding to the previous movement cycle can be the beat speed used to calculate the movement distance of the previous movement cycle, or it can be the beat speed of the beat cycle to which the previous cycle belongs.
[0151] Based on the above embodiments, in one implementation, the image display method may further include the following steps, namely step b1 and step b2:
[0152] Step b1: Monitor whether the target image exceeds the boundary of the image motion strategy.
[0153] To prevent the target image from exceeding the boundaries of the image motion strategy, it is possible to monitor whether the target image exceeds the boundaries of the image motion strategy during the target image's motion process, or when the target image moves to a second position.
[0154] In practical applications, the boundaries of the image motion strategy can be predefined and can be divided into two cases:
[0155] In the first case, assuming the target image has a width and height of (image...) w ,image h To prevent blank areas from appearing in the target display area during target image movement, the motion control parameter offset can be set. w and offset h ,like Figure 6 As shown, a protected area is set around the target image, with the width of each side of the protected area being offset. w Both sides have an offset height. h The initial display area of the target image is the region excluding the surrounding protected area, with a width and height of (image). w -offset w *2,image h -offset h *2). The target image moves within the boundary of the protected area, ensuring no blank areas appear in the target display area. The initial display position of the target image is centered, with coordinates (-offset). w,-offset h The target image's movement range is:
[0156]
[0157] In the first scenario described above, monitoring whether the target image exceeds the boundary of the image motion strategy when it moves to the second position can include the following steps, namely steps c1 and c2:
[0158] Step c1: If the area of the target display area is smaller than the area of the target image, monitor whether the boundary of the target image is located within the target display area.
[0159] Step c2: If the boundary of the target image is located inside the target display area, determine that the target image exceeds the boundary of the image motion strategy.
[0160] Specifically, in the first case mentioned above, during the motion of the target image, the boundary of the target image is within the protected area and cannot be within the target display area. If the boundary of the target image is within the target display area, a blank area will appear in the target display area. Therefore, the way to monitor whether the target image exceeds the boundary of the image motion strategy can be to monitor whether the boundary of the target image is within the target display area. If the boundary of the target image is within the target display area, it is determined that the target image exceeds the boundary of the image motion strategy.
[0161] In the second case, the target display area is the same size as the target image, with a width and height of (image). w ,image h The absolute value of the horizontal coordinate shift of the target image does not exceed offset. w The absolute value of the ordinate does not exceed the offset. h The blank areas created by the movement of the target image can be copied by copying rows or columns from the target image's edges to the areas that extend beyond the original target image, forming a border around the original target image. The four corner areas are copied using the corresponding pixels from the target image's corners. This is equivalent to stretching or similar processing the image within the target display area. Figure 7 As shown. The initial display position of the image completely coincides with the display area, with coordinates (0,0). The motion range of the target image is:
[0162]
[0163] As can be seen, in the second case, monitoring whether the target image exceeds the boundary of the image motion strategy can include the following steps, namely step d1 and step d2:
[0164] Step d1: When the area of the target display area is equal to the area of the target image, monitor whether the positional offset between the boundary of the target image and the boundary of the target display area exceeds a preset offset.
[0165] Step d2: If the position offset exceeds the preset offset, determine that the target image exceeds the boundary of the image motion strategy.
[0166] Specifically, in the second case, the width and height are (image) w ,image h The absolute value of the horizontal coordinate shift of the target image does not exceed offset. w The absolute value of the ordinate does not exceed the offset. h Therefore, the method to determine whether the target image exceeds the boundary of the image motion strategy when it moves to the second position can be: monitoring whether the positional offset between the boundary of the target image and the boundary of the target display area exceeds a preset offset. That is, whether it exceeds the offset. w and / or offset h If the offset exceeds the preset amount, the target image is determined to be outside the boundary of the image motion strategy.
[0167] Step b2: If the target image exceeds the boundary of the image motion strategy, change the motion direction parameters of the target image in the current motion cycle.
[0168] Step b3: Redetermine the motion slope of the target image in the current motion cycle, and return to the step of determining the position offset of the target image in the current motion cycle based on the motion distance and the motion slope of the target image in the current motion cycle.
[0169] Specifically, if the target image is determined to exceed the boundaries of the image motion strategy, the motion direction parameters of the corresponding coordinate axes need to be changed if either the horizontal or vertical coordinates exceed the boundaries. If both the horizontal and vertical coordinates exceed the boundaries, the motion direction parameters of both coordinate axes need to be changed.
[0170]
[0171] Furthermore, if the motion direction parameters change, it is necessary to adjust the slope range [k] accordingly. min ,k max If a new slope k is randomly selected, and the direction of motion or slope parameter changes, then the coordinates of the second position need to be recalculated, i.e., the coordinates (x, k) need to be recalculated. t ,y t ).
[0172] After recalculating the second position, the position of the target image when it exceeds the boundary of the image motion strategy can be determined as the first position, and the target image can be controlled to move from the first position to the second position.
[0173] Finally, by periodically acquiring the beat speed and calculating the second position (x) t ,y t This allows the target image to move continuously within a set target display area, with a continuous trajectory and a rebound effect, and the movement speed of the target image can be dynamically and smoothly changed according to the music beat.
[0174] By dividing the functions into modules corresponding to each function, this disclosure provides an image display device. Figure 8 This is a schematic block diagram of the functional modules of an image display device provided for an exemplary embodiment of the present disclosure. Figure 8 As shown, the image display device includes:
[0175] The beat speed acquisition module 810 is used to acquire the beat speed of the target music during the playback of the target music;
[0176] Target image acquisition module 820 is used to acquire the target image corresponding to the target music;
[0177] The target image control module 830 is used to control the movement of the target image based on the beat speed and dynamically display the target image in the target display area.
[0178] The technical solution provided in this disclosure acquires the beat speed of the target music and a target image during the playback of the target music; controls the movement of the target image based on the beat speed, and dynamically displays the target image in the target display area. Therefore, in this disclosure, controlling the movement of the target image by the beat speed allows for the association of the image with the beat speed of the playing music, enhancing the linkage between the image and the playing music. Furthermore, it enables dynamic video playback and display of the target image.
[0179] Optionally, the target music includes multiple different beat cycles, each beat cycle corresponding to a beat tempo;
[0180] The target image control module is specifically used for:
[0181] The motion distance of the target image in the current motion cycle is determined based on the beat speed corresponding to the current beat cycle; the current motion cycle is within the current beat cycle.
[0182] Based on the motion distance and motion slope of the target image in the current motion cycle, determine the position offset of the target image in the current motion cycle;
[0183] Based on the position offset, the motion direction parameters of the target image in the current motion cycle, and the first position of the target image in the target display area in the previous motion cycle, the second position of the target image in the target display area in the current motion cycle is determined.
[0184] Control the target image to move from the first position to the second position.
[0185] Optionally, the target image control module is specifically used for:
[0186] Obtain the movement distance adjustment coefficient corresponding to the current movement cycle;
[0187] Based on the beat speed corresponding to the current beat cycle and the motion distance adjustment coefficient, the motion distance of the target image in the current motion cycle is calculated.
[0188] Optionally, the target image control module is specifically used for:
[0189] Compare the beat speed corresponding to the current beat cycle with the beat speed corresponding to the previous movement cycle;
[0190] If the beat speed corresponding to the current beat cycle changes relative to the beat speed corresponding to the previous movement cycle, obtain the preset image acceleration / deceleration step size;
[0191] The beat speed corresponding to the previous motion cycle is adjusted by the acceleration / deceleration step size of the image to obtain the adjusted beat speed;
[0192] The movement distance of the target image in the current motion cycle is determined based on the adjusted beat speed.
[0193] Optionally, the target image control module is specifically used for:
[0194] If the beat speed corresponding to the previous movement cycle is less than the beat speed corresponding to the current beat cycle, the beat speed corresponding to the previous movement cycle is increased by the acceleration / deceleration step size of the image to obtain the adjusted beat speed; the resulting adjusted beat speed is not greater than the beat speed corresponding to the current beat cycle.
[0195] Alternatively, if the beat speed corresponding to the previous movement cycle is greater than the beat speed corresponding to the current beat cycle, the beat speed corresponding to the previous movement cycle is reduced by the image acceleration / deceleration step size to obtain the adjusted beat speed; the resulting adjusted beat speed is not less than the beat speed corresponding to the current beat cycle.
[0196] Optionally, the device further includes:
[0197] The boundary monitoring module is used to monitor whether the target image exceeds the boundary of the image motion strategy;
[0198] The parameter changing module is used to change the motion direction parameters of the target image in the current motion cycle when the target image exceeds the boundary of the image motion strategy.
[0199] The slope determination module is used to redetermine the motion slope of the target image in the current motion cycle, and return to the step of determining the position offset of the target image in the current motion cycle based on the motion distance and the motion slope of the target image in the current motion cycle.
[0200] Optionally, the boundary monitoring module is specifically used for:
[0201] If the area of the target display area is smaller than the area of the target image, monitor whether the boundary of the target image is located within the target display area;
[0202] If the boundary of the target image is located within the target display area, it is determined that the target image exceeds the boundary of the image motion strategy.
[0203] Optionally, the boundary monitoring module is specifically used for:
[0204] When the area of the target display area is equal to the area of the target image, monitor whether the positional offset between the boundary of the target image and the boundary of the target display area exceeds a preset offset.
[0205] If the position offset exceeds the preset offset, it is determined that the target image exceeds the image motion strategy boundary.
[0206] This disclosure also provides an electronic device, including: at least one processor; a memory for storing processor-executable instructions; wherein the at least one processor is configured to execute the instructions to implement the methods disclosed in this disclosure.
[0207] The technical solution provided in this disclosure acquires the beat speed of the target music and a target image during the playback of the target music; controls the movement of the target image based on the beat speed, and dynamically displays the target image in the target display area. Therefore, in this disclosure, controlling the movement of the target image by the beat speed allows for the association of the image with the beat speed of the playing music, enhancing the linkage between the image and the playing music. Furthermore, it enables dynamic video playback and display of the target image.
[0208] Figure 9 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this disclosure. For example... Figure 9 As shown, the electronic device 1800 includes at least one processor 1801 and a memory 1802 coupled to the processor 1801. The processor 1801 can perform the corresponding steps in the methods disclosed in the embodiments of this disclosure.
[0209] The processor 1801 described above can also be called a central processing unit (CPU), which can be an integrated circuit chip with signal processing capabilities. Each step in the method disclosed in this embodiment can be implemented by the integrated logic circuitry in the processor 1801 or by software instructions. The processor 1801 can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this embodiment can be directly implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can be located in the memory 1802, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor 1801 reads information from the memory 1802 and, in conjunction with its hardware, completes the steps of the method described above.
[0210] Furthermore, various operations / processes according to this disclosure, implemented via software and / or firmware, can be transmitted from a storage medium or network to a computer system with a dedicated hardware architecture, such as... Figure 10 The computer system 1900 shown is equipped with the programs that constitute the software. When various programs are installed, the computer system is able to perform various functions, including those described above. Figure 10 A block diagram of a computer system provided for an exemplary embodiment of this disclosure.
[0211] Computer System 1900 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0212] like Figure 10 As shown, the computer system 1900 includes a computing unit 1901, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 into a random access memory (RAM) 1903. The RAM 1903 may also store various programs and data required for the operation of the computer system 1900. The computing unit 1901, ROM 1902, and RAM 1903 are interconnected via a bus 1904. An input / output (I / O) interface 1905 is also connected to the bus 1904.
[0213] Multiple components in computer system 1900 are connected to I / O interface 1905, including: input unit 1906, output unit 1907, storage unit 1908, and communication unit 1909. Input unit 1906 can be any type of device capable of inputting information into computer system 1900. Input unit 1906 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 1907 can be any type of device capable of presenting information and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 1908 may include, but is not limited to, hard disks and optical disks. Communication unit 1909 allows computer system 1900 to exchange information / data with other devices via a network such as the Internet, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0214] The computing unit 1901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the methods disclosed in this disclosure can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1908. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 1900 via ROM 1902 and / or communication unit 1909. In some embodiments, the computing unit 1901 can be configured to perform the methods disclosed in this disclosure by any other suitable means (e.g., by means of firmware).
[0215] This disclosure also provides a computer-readable storage medium, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform the methods disclosed in this disclosure.
[0216] The computer-readable storage medium in this disclosure can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. The aforementioned computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specifically, the aforementioned computer-readable storage medium may include electrical connections based on one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0217] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0218] This disclosure also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor, implements the methods disclosed in the embodiments of this disclosure.
[0219] In embodiments of this disclosure, computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof. These programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or it can be connected to an external computer.
[0220] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0221] The modules, components, or units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules, components, or units do not necessarily limit the module, component, or unit itself.
[0222] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that can be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0223] The above description is merely an embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0224] While specific embodiments of this disclosure have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.
Claims
1. An image display method, characterized in that, The method includes: During the playback of the target music, the tempo of the target music is obtained; Obtain the target image corresponding to the target music; The target image is moved based on the beat speed, and the target image is dynamically displayed in the target display area; The target music includes multiple different beat cycles, each beat cycle corresponding to a beat tempo; The control of the target image motion based on the beat speed includes: The motion distance of the target image in the current motion cycle is determined based on the beat speed corresponding to the current beat cycle; the current motion cycle is within the current beat cycle. Based on the motion distance and motion slope of the target image in the current motion cycle, determine the position offset of the target image in the current motion cycle; Based on the position offset, the motion direction parameters of the target image in the current motion cycle, and the first position of the target image in the target display area in the previous motion cycle, the second position of the target image in the target display area in the current motion cycle is determined. Control the target image to move from the first position to the second position.
2. The method according to claim 1, characterized in that, Determining the motion distance of the target image in the current motion cycle based on the beat speed corresponding to the current beat cycle includes: Obtain the movement distance adjustment coefficient corresponding to the current movement cycle; Based on the beat speed corresponding to the current beat cycle and the motion distance adjustment coefficient, the motion distance of the target image in the current motion cycle is calculated.
3. The method according to claim 1, characterized in that, Determining the motion distance of the target image in the current motion cycle based on the beat speed corresponding to the current beat cycle includes: Compare the beat speed corresponding to the current beat cycle with the beat speed corresponding to the previous movement cycle; If the beat speed corresponding to the current beat cycle changes relative to the beat speed corresponding to the previous movement cycle, obtain the preset image acceleration / deceleration step size; The beat speed corresponding to the previous motion cycle is adjusted by the acceleration / deceleration step size of the image to obtain the adjusted beat speed; The movement distance of the target image in the current motion cycle is determined based on the adjusted beat speed.
4. The method according to claim 3, characterized in that, The step of adjusting the beat speed corresponding to the previous motion cycle by using the acceleration / deceleration step size of the image to obtain the adjusted beat speed includes: If the beat speed corresponding to the previous movement cycle is less than the beat speed corresponding to the current beat cycle, the beat speed corresponding to the previous movement cycle is increased by the acceleration / deceleration step size of the image to obtain the adjusted beat speed; the resulting adjusted beat speed is not greater than the beat speed corresponding to the current beat cycle. Alternatively, if the beat speed corresponding to the previous movement cycle is greater than the beat speed corresponding to the current beat cycle, the beat speed corresponding to the previous movement cycle is reduced by the image acceleration / deceleration step size to obtain the adjusted beat speed; the resulting adjusted beat speed is not less than the beat speed corresponding to the current beat cycle.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Monitor whether the target image exceeds the boundary of the image motion strategy; If the target image exceeds the boundary of the image motion strategy, the motion direction parameters of the target image in the current motion cycle are changed; The motion slope of the target image in the current motion cycle is redefined, and the process returns to the step of determining the position offset of the target image in the current motion cycle based on the motion distance and the motion slope of the target image in the current motion cycle.
6. The method according to claim 5, characterized in that, The monitoring of whether the target image exceeds the boundary of the image motion strategy includes: If the area of the target display area is smaller than the area of the target image, monitor whether the boundary of the target image is located within the target display area; If the boundary of the target image is located within the target display area, it is determined that the target image exceeds the boundary of the image motion strategy.
7. An image display device, characterized in that, The device includes: A beat speed acquisition module is used to acquire the beat speed of the target music during playback. The target image acquisition module is used to acquire the target image corresponding to the target music; The target image control module is used to control the movement of the target image based on the beat speed and dynamically display the target image in the target display area; The target music includes multiple different beat cycles, each beat cycle corresponding to a beat tempo; The target image control module is specifically used for: The motion distance of the target image in the current motion cycle is determined based on the beat speed corresponding to the current beat cycle; the current motion cycle is within the current beat cycle. Based on the motion distance and motion slope of the target image in the current motion cycle, determine the position offset of the target image in the current motion cycle; Based on the position offset, the motion direction parameters of the target image in the current motion cycle, and the first position of the target image in the target display area in the previous motion cycle, the second position of the target image in the target display area in the current motion cycle is determined. Control the target image to move from the first position to the second position.
8. An electronic device, characterized in that, include: At least one processor; Memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Video special effect processing method and device
CN113055738A
Image processing method and device, electronic equipment and storage medium
CN115619897A