Intelligent box selection method and device, electronic equipment and computer program product
Through the pre-trained character perception composition model and virtual lens control scheme generation model, intelligent frame selection of the panoramic picture of the target camera is solved, and the problem of stiff picture switching and unstable output in traditional technology is solved, achieving smoother and more natural lens image switching.
Patent Information
- Application Number
- CN202411716465.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-28
AI Technical Summary
When traditional smart box selection technology handles the movement of target characters, the screen switching is stiff and the output is unstable.
Through the pre-trained character perception composition model and virtual lens control scheme generation model, the character perception composition and virtual lens parameters are adjusted for the panoramic picture taken by the target camera to achieve intelligent box selection.
It realizes smooth switching of lens images, making the virtual lens images output by the target camera more smooth and natural, solving the problem of stiff screen switching and unstable output.
Smart Images

Figure CN119729189A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of camera technology, and in particular to intelligent frame selection methods, devices, electronic devices and computer program products. Background Art
[0002] With the rapid development of Internet technology, remote interaction methods such as video conferencing, online education, and live broadcasting are becoming more and more common. In these application scenarios, the camera's automatic tracking and picture adjustment technology are crucial to improving the user experience. Although traditional physical pan-tilt zoom cameras can achieve manual or automatic pan, tilt, and zoom functions, they are difficult to be widely used in small and medium-sized conference rooms or personal live broadcasting scenarios due to high equipment costs and complex operations.
[0003] In recent years, electronic pan-tilt zoom cameras have attracted widespread attention due to their low cost and easy operation. Electronic pan-tilt zoom cameras use digital means to achieve pan, tilt and zoom of the output image through intelligent frame selection, achieving an effect similar to that of physical cloud platform zoom cameras without the need for complex mechanical structures.
[0004] However, traditional intelligent frame selection technology generally adopts simple image cropping and resampling methods. When processing the movement of the target person, there are problems such as abrupt screen switching and unstable output. Summary of the invention
[0005] The main purpose of the present application is to provide an intelligent frame selection method, device, electronic device and computer program product, aiming to solve the technical problems of abrupt screen switching and unstable output when traditional intelligent frame selection technology processes the movement of the target person.
[0006] To achieve the above object, the present application provides an intelligent frame selection method, which includes:
[0007] Through the pre-trained character perception composition model, character perception composition is performed on the panoramic picture taken by the target camera to obtain the target character composition information;
[0008] Inputting the virtual lens parameters of the target camera and the composition information of the target person into a pre-trained virtual lens control solution generation model to obtain a virtual lens control solution output by the virtual lens control solution generation model, wherein the virtual lens control solution generation model is a neural network model trained based on a reinforcement learning algorithm;
[0009] According to the virtual lens control scheme, the virtual lens parameters are adjusted to perform intelligent frame selection on the panoramic picture.
[0010] In one embodiment, the method further comprises:
[0011] Acquire a pre-prepared character perception composition sample set, wherein the character perception composition samples in the character perception composition sample set are images with character composition information pre-labeled;
[0012] The basic neural network model based on the YOLO target detection algorithm is trained through the character perception composition sample set to obtain a pre-trained character perception composition model.
[0013] In one embodiment, the step of performing character perception composition on the panoramic picture captured by the target camera using the pre-trained character perception composition model to obtain the target character composition information includes:
[0014] The most recent N frames of panoramic images taken by the target camera are input into a pre-trained character perception composition model to obtain target character composition information output by the character perception composition model, wherein N is a positive integer.
[0015] In one embodiment, the target person composition information includes the image height, image width and center pixel coordinates of the target person composition, and the virtual lens parameters include the image height, image width and center pixel coordinates of the virtual lens picture.
[0016] In one embodiment, the virtual lens control scheme includes the virtual lens parameters of a target image height, a target image width, and a target center pixel coordinate at each time step within a target number of time steps;
[0017] The step of adjusting the virtual lens parameters according to the virtual lens control scheme to intelligently frame the panoramic picture includes:
[0018] According to the target image height, target image width and target center point pixel coordinates of the virtual lens parameters at each time step within the target number of time steps, the virtual lens parameters are adjusted to crop the virtual lens picture at each time step within the target number of time steps from the panoramic picture.
[0019] In one embodiment, the virtual lens control scheme includes image height change information, image width change information, and center point pixel coordinate change information of the virtual lens parameters at each time step within a target number of time steps;
[0020] The step of adjusting the virtual lens parameters according to the virtual lens control scheme to intelligently frame the panoramic picture includes:
[0021] According to image height change information, image width change information, and center point pixel coordinate change information of the virtual lens parameters at each time step within the target number of time steps, the virtual lens parameters are adjusted to crop a virtual lens picture at each time step within the target number of time steps from the panoramic picture.
[0022] In one embodiment, the method further comprises:
[0023] The virtual lens picture is resampled so that the resolution of the virtual lens picture is consistent with a preset output resolution.
[0024] In addition, to achieve the above-mentioned purpose, the present application also provides an intelligent frame selection device, which includes:
[0025] A character composition module is used to perform character perception composition on the panoramic picture taken by the target camera through a pre-trained character perception composition model to obtain the target character composition information;
[0026] A solution generation module, used for inputting the virtual lens parameters of the target camera and the composition information of the target person into a pre-trained virtual lens control solution generation model to obtain a virtual lens control solution output by the virtual lens control solution generation model, wherein the virtual lens control solution generation model is a neural network model trained based on a reinforcement learning algorithm;
[0027] The intelligent frame selection module is used to adjust the virtual lens parameters according to the virtual lens control solution to perform intelligent frame selection on the panoramic picture.
[0028] In addition, to achieve the above-mentioned purpose, the present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the above-mentioned smart box selection method are implemented.
[0029] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the above-mentioned intelligent box selection method.
[0030] The embodiment of the present application provides an intelligent frame selection method, device, electronic device and computer program product. The embodiment of the present application first uses a pre-trained character perception composition model to perform character perception composition on the panoramic picture taken by the target camera to obtain the target character composition information, and then inputs the virtual lens parameters of the target camera and the target character composition information into a pre-trained virtual lens control scheme generation model to obtain a virtual lens control scheme output by the virtual lens control scheme generation model, wherein the virtual lens control scheme generation model is a neural network model trained based on a reinforcement learning algorithm, and finally adjusts the virtual lens parameters according to the virtual lens control scheme to perform intelligent frame selection on the panoramic picture. Frame selection, so that the embodiment of the present application can simulate the character composition technique of professional photographers through a pre-trained character perception composition model, quickly perceive the composition of the characters in the panoramic picture, generate target character composition information, ensure that the proportion of characters in the output picture is reasonable, and simulate the camera movement operation of professional photographers through a pre-trained virtual lens control scheme generation model, generate a virtual lens control scheme, simulate the actual movement trajectory of the virtual lens under the operation of professional photographers, and achieve smooth switching of lens images, so that the virtual lens images output by the target camera are smoother and more natural, thereby solving the technical problems of stiff image switching and unstable output when processing the movement of target characters in traditional intelligent frame selection technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0033] Figure 1 A flowchart of the first embodiment of the intelligent selection method of the present application is provided;
[0034] Figure 2 This is a schematic diagram of the training process of the character perception composition model in the intelligent frame selection method of this application;
[0035] Figure 3 This is a schematic diagram of the specific process of character perception composition in the intelligent frame selection method of this application;
[0036] Figure 4 This is a schematic diagram of the module structure of the intelligent frame selection device according to an embodiment of the present application;
[0037] Figure 5 A schematic diagram of the device structure of the hardware operating environment involved in the intelligent box selection method in the embodiment of the present application.
[0038] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0039] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0040] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0041] Under the fixed-focus lens of the electronic cloud platform's zoom camera, people will move forward, backward, left, right, leave the screen, enter the screen, and so on. This will make the person target of concern in the direct output image of the camera screen not "reasonable" enough in the recorded picture.
[0042] At present, when processing the movement of a target person, traditional smart frame selection technology will first detect the position of the target person, and then simply crop and resample the image for output, thereby realizing the "smart frame selection" function. In the final image output, there are problems such as abrupt lens switching and unstable output images, which seriously affect the user experience.
[0043] In this regard, the main solution of the embodiment of the present application is: through a pre-trained character perception composition model, the panoramic picture taken by the target camera is subjected to character perception composition to obtain the target character composition information; the virtual lens parameters of the target camera and the target character composition information are input into a pre-trained virtual lens control scheme generation model to obtain the virtual lens control scheme output by the virtual lens control scheme generation model, wherein the virtual lens control scheme generation model is a neural network model trained based on a reinforcement learning algorithm; according to the virtual lens control scheme, the virtual lens parameters are adjusted to intelligently frame the panoramic picture.
[0044] The embodiments of the present application can simulate the character composition techniques of professional photographers through a pre-trained character perception composition model, quickly perceive the composition of characters in the panoramic picture, generate target character composition information, ensure that the proportion of characters in the output picture is reasonable, and simulate the camera movement operation of professional photographers through a pre-trained virtual lens control scheme generation model, generate a virtual lens control scheme, simulate the actual movement trajectory of the virtual lens under the operation of professional photographers, and achieve smooth switching of lens images, so that the virtual lens images output by the target camera are smoother and more natural, thereby solving the technical problems of stiff image switching and unstable output when processing the movement of target characters in traditional intelligent frame selection technology.
[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0046] This application proposes a first embodiment of the intelligent frame selection method, please refer to Figure 1 , Figure 1 A flowchart diagram of the first embodiment of the intelligent selection method of the present application.
[0047] In this embodiment, the intelligent frame selection method includes steps S100 to S300:
[0048] Step S100, using a pre-trained character perception composition model, performing character perception composition on the panoramic picture taken by the target camera to obtain target character composition information;
[0049] As those skilled in the art know, character-perceptual composition is a technique in photography and visual arts that aims to create more attractive and expressive images by considering the characters in the picture and their positions, postures, expressions, etc. This composition method not only focuses on static aesthetic principles, but also emphasizes the dynamic relationship and emotional expression of the characters in the scene, thereby enhancing the overall effect of the image.
[0050] In this embodiment, the panoramic picture refers to the picture actually captured by the target camera, the target person refers to the person in the panoramic picture whose position and proportion in the output picture of the target camera need to be ensured to be reasonable, the target person composition refers to the image of the target person occupying the ideal position obtained after the panoramic picture is composed by character perception, and the target person composition information refers to the image information of the target person composition, such as the position and size of the target person composition in the panoramic picture.
[0051] It is understandable that the target persons can be pre-specified, and the number of target persons can be flexibly set according to actual needs.
[0052] It should be noted that the character perception composition model in this embodiment is a pre-trained neural network model, which can recognize and understand characters in videos or images, and simulate the character composition skills of professional photographers based on the character's position, posture and other information in the video or image, and quickly perceive the composition of the character to ensure that the character occupies the most appropriate position in the composition.
[0053] It should also be noted that when the sample label in the sample set used to train the character perception composition model is character composition, the character perception composition model can be trained into a model that outputs character composition, and when the sample label is character composition information, the character perception composition model can also be trained into a model that outputs character composition information.
[0054] For example, in a feasible implementation, as Figure 2 As shown, the intelligent frame selection method also includes steps S400 to S500:
[0055] Step S400, obtaining a pre-prepared character perception composition sample set, wherein the character perception composition samples in the character perception composition sample set are images with character composition information pre-labeled;
[0056] Step S500, training a basic neural network model based on the YOLO target detection algorithm through a character perception composition sample set to obtain a pre-trained character perception composition model.
[0057] It should be noted that, in this embodiment, the character perception composition sample set is a data set specially prepared for training the character perception composition model, which contains a large number of images annotated with character composition information. These images and the corresponding character composition information provide learning materials for the model, helping the model understand how to reasonably compose characters in different scenes.
[0058] As those skilled in the art know, the YOLO (You Only Look Once) target detection algorithm is an efficient real-time target detection algorithm that can complete the task of locating and classifying objects in an image in one go. It is known for its fast speed and high accuracy, and is widely used in a variety of visual tasks.
[0059] The basic neural network model in this embodiment is a neural network architecture built based on the YOLO target detection algorithm, but is appropriately modified and expanded to meet the task requirements of character perception composition.
[0060] This implementation method prepares a large amount of image data in advance, and these image data include human images in various environments, such as indoors, outdoors, during the day, and at night. Then, a number of professional photographers perform human perception composition on these image data, and annotate the image information of the human composition into the image data as sample labels. The image data is then sorted and cleaned to ensure the accuracy of the annotation, and finally a high-quality human perception composition sample set is formed to train the basic neural network model based on the YOLO target detection algorithm, thereby obtaining a trained human perception composition model.
[0061] This implementation uses professional photographers to perform character perception composition on sample images, and annotates the corresponding character composition information into the sample images as sample labels, to ensure that the trained character perception composition model can be close to the aesthetic habits of human photographers, simulate the character composition skills of professional photographers, and output image information of character composition with characters occupying ideal positions.
[0062] This implementation uses an efficient target detection algorithm such as YOLO as a basis, which can ensure that the model still maintains a fast speed when processing high-resolution images and is suitable for real-time applications.
[0063] In addition, this embodiment can also appropriately modify and expand the network results of the model to adapt to the task requirements of character perception composition, enhance the model's ability to understand character composition, ensure that the model can accurately identify and understand the character information in the image, and compose according to professional standards, such as adding more shallow convolutional layers to extract more low-level features, using attention mechanisms to enhance the model's attention to important areas, especially in key parts of the character (such as head, hands, etc.), introducing multi-scale feature fusion technologies such as FPN (Feature Pyramid Network) or PANet (Path Aggregation Network), fusing feature maps at different levels, improving the richness and robustness of features, adding cross-layer connections (such as residual connections, jump connections), so that the network can better retain and utilize early feature information, introducing some prior knowledge, such as composition rules (rule of thirds, golden section, etc.), and performing random cropping, scaling, color transformation, rotation and flipping during training to improve the model's adaptability to different perspectives, distances, lighting conditions and postures.
[0064] It is worth mentioning that, in the present embodiment, when the character perception composition model is trained to be a model that directly outputs character composition, the corresponding character composition information can be determined based on the output character composition.
[0065] It should be noted that, when the present embodiment uses the character perception composition model to perform character perception composition and generate character composition information, it may only input the panoramic picture of the current frame, or may input multiple consecutive panoramic pictures, or may use the output results of the previous frames together with the panoramic picture of the current frame as the model input.
[0066] Among them, when only the panoramic picture of the current frame is input, the character perception composition model only needs the data of the current frame each time it processes, with fast processing speed and low latency, suitable for real-time application scenarios, relatively simple processing logic, and easy implementation and maintenance. When multiple frames of continuous panoramic pictures are input, more contextual information can be provided, and the multi-frame data complement each other, reducing noise interference in a single frame, improving the robustness of detection, and helping the character perception composition model to better understand the motion trajectory and posture changes of the character, improve the accuracy and stability of the composition, so as to better handle fast-moving characters and reduce false detection or missed detection caused by single-frame input. When the output results of the previous frames are used as model input together with the panoramic picture of the current frame, the output results of the previous frames can be directly reused, and the model can use historical information to make more accurate predictions and decisions, improve the coherence and stability of the composition, achieve smoother lens switching and composition adjustment, and reduce repeated calculations to improve processing efficiency. This embodiment can give full play to the potential of the character perception composition model by reasonably selecting the input method to achieve a higher quality intelligent frame selection effect.
[0067] For example, in a feasible implementation, as Figure 3 As shown, step S100 uses a pre-trained character perception composition model to perform character perception composition on the panoramic picture taken by the target camera to obtain target character composition information, which may include step S110:
[0068] Step S110, inputting the most recent N frames of panoramic images shot by the target camera into a pre-trained character perception composition model to obtain target character composition information output by the character perception composition model, wherein N is a positive integer.
[0069] It should be noted that, in this embodiment, the panoramic pictures of the latest N frames include the panoramic picture of the current frame.
[0070] This implementation method inputs multiple continuous panoramic images, and the multiple frames of data complement each other, reducing noise interference in a single frame, thereby reducing false detection or missed detection caused by single-frame input. Especially in the case of rapid movement of characters or large changes in posture, multiple inputs enable the character perception composition model to better understand the character's movement trajectory and posture changes, better handle dynamic scenes, achieve smoother lens switching and composition adjustments, and improve the accuracy and stability of the composition, thereby improving the overall intelligent frame selection effect.
[0071] Step S200, inputting the virtual lens parameters of the target camera and the composition information of the target person into a pre-trained virtual lens control solution generation model to obtain a virtual lens control solution output by the virtual lens control solution generation model, wherein the virtual lens control solution generation model is a neural network model trained based on a reinforcement learning algorithm;
[0072] It should be noted that the traditional physical pan-tilt zoom camera changes the viewing angle and zooms in and out of the picture by physically moving the camera, while the electronic pan-tilt zoom camera uses a high-resolution sensor to capture a wide-angle image, and then cuts and zooms a specific part of the large-scale image through software to simulate the effect of movement and zoom. In this embodiment, the target camera has similar functions to the electronic pan-tilt zoom camera, and can achieve the pan, tilt and zoom of the output picture by setting a virtual lens to simulate the control of a real lens.
[0073] In this embodiment, the virtual lens parameters refer to a set of parameters used to describe the state of the virtual lens, which may include but are not limited to the focal length, aperture size, shutter speed, ISO (International Organization for Standardization, indicating sensitivity) value, horizontal and vertical angles of the lens, zoom ratio, etc. These parameters jointly determine how the virtual lens captures and presents the picture, that is, how to cut out the required picture from the panoramic picture, and perform corresponding image processing, and finally output it to the user. The virtual lens control scheme is a set of control schemes that simulate the lens movement operation of professional photographers by adjusting the virtual lens parameters, and control the virtual lens to perform operations such as translation, tilt, and zoom to achieve smooth and natural output picture switching. The virtual lens control scheme specifies how the virtual lens parameters should be adjusted in order to achieve the target person composition information, that is, even if the output picture of the target camera is smoothly and naturally switched to the target person composition.
[0074] It is known to those skilled in the art that the reinforcement learning algorithm is a machine learning method that allows the agent to take actions in the environment and learn how to perform tasks based on the feedback (reward or punishment) of the environment. Its goal is to enable the agent to learn a strategy, that is, the rule of selecting actions in a given state to maximize a certain cumulative reward. The virtual lens control scheme generation model in this embodiment is a neural network model based on reinforcement learning, which is used to generate the best virtual lens control scheme according to the character composition information and virtual lens parameters. The model simulates the lens movement operation of professional photographers through continuous trial and error learning, finds the optimal virtual lens control strategy under different composition requirements (i.e., target character composition information) and initial conditions (i.e., current virtual lens parameters), imitates the process of professional photographers flexibly adjusting lens parameters according to changes in the subject, ensures that when the virtual lens parameters are adjusted by the virtual experience control strategy, the actual movement trajectory of the lens under the lens movement operation of the professional photographer can be simulated, and the movement of the target character is kept extremely sensitive, so that the movement of the virtual lens is more natural and smooth, thereby achieving smooth switching of lens images, avoiding stiff lens switching, making the output image more natural in the entire recording process, and the proportion of characters in the final output image is reasonable.
[0075] It is worth mentioning that, in a feasible implementation manner, the target person composition information includes the image height, image width and center point pixel coordinates of the target person composition, and the virtual lens parameters include the image height, image width and center point pixel coordinates of the virtual lens picture.
[0076] Those skilled in the art will appreciate that the image height refers to the number of pixels of the image in the vertical direction, and the image width refers to the number of pixels of the image in the horizontal direction.
[0077] In this embodiment, the center point pixel coordinates refer to the pixel coordinates of the center point of the image in the panoramic picture, the image height refers to the number of pixels occupied by the image in the vertical direction in the panoramic picture, and the image width refers to the number of pixels occupied by the image in the horizontal direction in the panoramic picture.
[0078] It is worth mentioning that the virtual lens parameters can also be the center pixel coordinates and focal length, and the focal length can be converted to image height and image width. For example, the focal length of the panoramic image is A, the resolution is 2B*2B, and the focal length of the virtual lens parameters is 2A, then the resolution of the virtual lens parameters is B*B, that is, the image height and image width of the virtual lens are both B. Correspondingly, the image height and image width of the target character composition can also be converted into focal length.
[0079] Step S300: adjusting virtual lens parameters according to the virtual lens control solution to intelligently frame the panoramic image.
[0080] Those skilled in the art will appreciate that smart frame selection refers to the operation of changing the output picture of the camera by using digital means (ie, adjusting virtual lens parameters) so that the target object occupies a reasonable position in the output picture.
[0081] It should be noted that the virtual lens parameters correspond to the virtual lens picture taken by the virtual lens, that is, the picture obtained by cutting the panoramic picture according to the virtual lens parameters. In this embodiment, the virtual lens parameters are adjusted according to the virtual lens control scheme, and virtual lens pictures of different positions and sizes can be cut from the panoramic picture to ensure that in the process of switching from the current virtual lens picture to the target person composition, the lens movement trajectory under the operation of a professional photographer can be imitated, so that the switching of the output picture is smooth and natural, and the transition to the target person composition is smooth and stable.
[0082] In this embodiment, the virtual lens control scheme generation model is a neural network model trained based on a reinforcement learning algorithm. After receiving the input virtual lens parameters and target character composition information, it can simulate the camera movement operation of a professional photographer to generate a virtual lens control scheme that guides how to adjust the virtual lens parameters step by step in the process of switching from the current virtual lens picture to the target character composition. Specifically, the virtual lens control scheme can be a plurality of operation instructions for adjusting the virtual lens parameters in the process of switching from the current virtual lens picture to the target character composition, or a plurality of state values of the virtual lens parameters in the process of switching from the current virtual lens picture to the target character composition, or a plurality of change information of the virtual lens parameters in the process of switching from the current virtual lens picture to the target character composition.
[0083] Exemplarily, in a feasible implementation, the virtual lens control scheme includes a target image height, a target image width, and a target center point pixel coordinate of the virtual lens parameters at each time step within a target number of time steps;
[0084] Step S300 may include step S310;
[0085] Step S310, adjusting the virtual lens parameters according to the target image height, target image width and target center point pixel coordinates at each time step within the target number of time steps, so as to crop the virtual lens picture of each time step within the target number of time steps from the panoramic picture.
[0086] In another feasible implementation, the virtual lens control scheme includes image height change information, image width change information, and center point pixel coordinate change information of the virtual lens parameters at each time step within a target number of time steps;
[0087] Step S300 may include step S320;
[0088] Step S320, adjusting the virtual lens parameters according to the image height change information, image width change information and center point pixel coordinate change information of the virtual lens parameters at each time step within the target number of time steps, so as to crop the virtual lens picture of each time step within the target number of time steps from the panoramic picture.
[0089] It should be noted that the target number is a preset value, and the user can flexibly set it according to actual needs, so as to adjust the virtual lens control solution generated by the virtual lens control solution generation model. The value of the target number can be used as a hyperparameter of the virtual lens control solution generation model, and can also be used as one of the inputs of the virtual lens control solution generation model.
[0090] In this embodiment, the process of switching from the current virtual lens picture to the target person composition is divided into a target number of time steps, and the virtual lens control solution generation model generates a control solution for each time step (i.e., the target image height, target image width and target center point pixel coordinates of the virtual lens parameters at each time step, or the image height change information, image width change information and center point pixel coordinate change information of the virtual lens parameters at each time step, or the operation instruction for adjusting the virtual lens parameters at each time step), and combines them to obtain the virtual lens control solution, so as to adjust the virtual lens parameters one by one according to the control solution of each time step, so as to crop the virtual lens pictures of each time step within the target number of time steps from the panoramic picture, realize the intelligent frame selection of the target person in the panoramic picture, and finally scale the virtual lens picture, adjust the size of the virtual lens picture to be consistent with the display area of the display screen, and then output it for viewing by the user.
[0091] Furthermore, in a feasible implementation manner, the intelligent frame selection method further includes step S330:
[0092] Step S330, resampling the virtual lens image to make the resolution of the virtual lens image consistent with the preset output resolution.
[0093] As known to those skilled in the art, resampling is a commonly used technique in digital signal processing and image processing, which is used to change the sampling rate or resolution of data. Resampling can be used to both increase and decrease the resolution.
[0094] It should be noted that the output resolution is a preset resolution used to guide the resolution of the output image of the target camera. The output resolution can be flexibly set by the user or the system according to actual needs.
[0095] In this embodiment, taking into account that the resolutions of the cropped virtual lens images at each time step are different, this embodiment presets an output resolution. After the virtual lens images at each time step are cropped, resampling is first performed to adjust the resolution of the virtual lens images at each time step to be consistent with the preset output resolution before output display.
[0096] In this embodiment, first, a pre-trained character perception composition model is used to perform character perception composition on the panoramic picture taken by the target camera to obtain the target character composition information, and then the virtual lens parameters of the target camera and the target character composition information are input into the pre-trained virtual lens control scheme generation model to obtain the virtual lens control scheme output by the virtual lens control scheme generation model, wherein the virtual lens control scheme generation model is a neural network model trained based on the reinforcement learning algorithm, and finally, the virtual lens parameters are adjusted according to the virtual lens control scheme to perform intelligent frame selection on the panoramic picture, so that this embodiment can simulate the character composition technique of professional photographers through the pre-trained character perception composition model, quickly perceive and compose the characters in the panoramic picture, generate the target character composition information, ensure that the proportion of characters in the output picture is reasonable, and simulate the lens movement operation of professional photographers through the pre-trained virtual lens control scheme generation model to generate a virtual lens control scheme, simulate the actual movement trajectory of the virtual lens under the operation of professional photographers, and realize smooth switching of lens pictures, so that the virtual lens pictures output by the target camera are smoother and more natural, thereby solving the technical problems of stiff picture switching and unstable output of traditional intelligent frame selection technology when processing the movement of target characters.
[0097] In addition, please refer to Figure 4 , Figure 4 This is a schematic diagram of the module structure of the intelligent frame selection device according to an embodiment of the present application.
[0098] The embodiment of the present application also provides an intelligent frame selection device, which includes:
[0099] The character composition module 10 is used to perform character perception composition on the panoramic picture taken by the target camera through a pre-trained character perception composition model to obtain the target character composition information;
[0100] A solution generation module 20 is used to input the virtual lens parameters of the target camera and the target character composition information into a pre-trained virtual lens control solution generation model to obtain a virtual lens control solution output by the virtual lens control solution generation model, wherein the virtual lens control solution generation model is a neural network model trained based on a reinforcement learning algorithm;
[0101] The intelligent frame selection module 30 is used to adjust the virtual lens parameters according to the virtual lens control solution to perform intelligent frame selection on the panoramic picture.
[0102] In one embodiment, the intelligent frame selection device also includes a character perception composition model training module (not shown), which is used to obtain a pre-prepared character perception composition sample set, where the character perception composition samples in the character perception composition sample set are images with pre-labeled character composition information; through the character perception composition sample set, a basic neural network model based on the YOLO target detection algorithm is trained to obtain a pre-trained character perception composition model.
[0103] In one embodiment, the character composition module 10 is further used for:
[0104] The most recent N frames of panoramic images taken by the target camera are input into a pre-trained character perception composition model to obtain the target character composition information output by the character perception composition model, where N is a positive integer.
[0105] In one embodiment, the target person composition information includes the image height, image width and center pixel coordinates of the target person composition, and the virtual lens parameters include the image height, image width and center pixel coordinates of the virtual lens picture.
[0106] In one embodiment, the virtual lens control scheme includes a target image height, a target image width, and a target center pixel coordinate of the virtual lens parameters at each time step within a target number of time steps;
[0107] The intelligent frame selection module 30 is also used for:
[0108] According to the target image height, target image width and target center point pixel coordinates of the virtual lens parameters at each time step within the target number of time steps, the virtual lens parameters are adjusted to crop the virtual lens images at each time step within the target number of time steps from the panoramic image.
[0109] In one embodiment, the virtual lens control scheme includes image height change information, image width change information, and center point pixel coordinate change information of the virtual lens parameters at each time step within a target number of time steps;
[0110] The intelligent frame selection module 30 is also used for:
[0111] According to the image height change information, image width change information and center point pixel coordinate change information of the virtual lens parameters at each time step within the target number of time steps, the virtual lens parameters are adjusted to crop the virtual lens images of each time step within the target number of time steps from the panoramic image.
[0112] In one embodiment, the intelligent frame selection module 30 is further used to:
[0113] The virtual lens image is resampled so that the resolution of the virtual lens image is consistent with the preset output resolution.
[0114] The intelligent frame selection device provided in the embodiment of the present application adopts the intelligent frame selection method in the above embodiment, which can solve the technical problems of the traditional intelligent frame selection technology in processing the movement of the target person, such as the abrupt switching of the screen and the unstable output. Compared with the prior art, the beneficial effects of the intelligent frame selection device provided in the embodiment of the present application are the same as the beneficial effects of the intelligent frame selection method provided in the above embodiment, and the other technical features in the intelligent frame selection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0115] In addition, please refer to Figure 5 , Figure 5 A schematic diagram of the device structure of the hardware operating environment involved in the intelligent box selection method in the embodiment of the present application.
[0116] The present application also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of the smart box selection method in the above-mentioned embodiment.
[0117] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present application. The electronic device in the embodiment of the present application is a control device for a camera, or includes a camera. Specifically, the electronic device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (Televisions), desktop computers, etc., or any electronic device that can implement the above functions. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0118] like Figure 5As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0119] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0120] The electronic device provided by the present application adopts the intelligent frame selection method in the above embodiment, which can solve the technical problems of the traditional intelligent frame selection technology in processing the movement of the target person, such as the abrupt screen switching and unstable output. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the intelligent frame selection method provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed by the intelligent frame selection method in the above embodiment, which will not be repeated here.
[0121] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0122] In addition, the present application also provides a computer storage medium, which has computer-readable program instructions (i.e., computer programs) stored thereon, and when the computer-readable program instructions are executed, they are used to implement the steps of the intelligent box selection method in the above-mentioned embodiment.
[0123] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0124] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0125] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device: performs character perception composition on the panoramic picture taken by the target camera through a pre-trained character perception composition model to obtain target character composition information; inputs the virtual lens parameters of the target camera and the target character composition information into a pre-trained virtual lens control scheme generation model to obtain a virtual lens control scheme output by the virtual lens control scheme generation model, wherein the virtual lens control scheme generation model is a neural network model trained based on a reinforcement learning algorithm; and adjusts the virtual lens parameters according to the virtual lens control scheme to intelligently frame the panoramic picture.
[0126] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0128] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0129] The computer-readable storage medium provided by the present application stores computer-readable program instructions (i.e., computer programs) for executing the steps of the intelligent frame selection method in the above-mentioned embodiment, which can solve the technical problems of the traditional intelligent frame selection technology in processing the movement of the target person, such as the abrupt switching of the screen and the unstable output. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as those of the intelligent frame selection method provided by the above-mentioned embodiment, and will not be elaborated here.
[0130] In addition, an embodiment of the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the intelligent box selection method in the above embodiment are implemented.
[0131] The computer program product provided by the present application can solve the technical problems of the traditional intelligent frame selection technology in processing the movement of the target person, such as the abrupt switching of the screen and the unstable output. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as the beneficial effects of the intelligent frame selection method provided by the above embodiment, which will not be repeated here.
[0132] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An intelligent frame selection method, characterized in that: The intelligent frame selection method includes: Through the pre-trained character perception composition model, character perception composition is performed on the panoramic picture taken by the target camera to obtain the target character composition information; Inputting the virtual lens parameters of the target camera and the composition information of the target person into a pre-trained virtual lens control solution generation model to obtain a virtual lens control solution output by the virtual lens control solution generation model, wherein the virtual lens control solution generation model is a neural network model trained based on a reinforcement learning algorithm; According to the virtual lens control scheme, the virtual lens parameters are adjusted to perform intelligent frame selection on the panoramic picture.
2. The intelligent frame selection method according to claim 1, characterized in that: The method further comprises: Acquire a pre-prepared character perception composition sample set, wherein the character perception composition samples in the character perception composition sample set are images with character composition information pre-labeled; The basic neural network model based on the YOLO target detection algorithm is trained through the character perception composition sample set to obtain a pre-trained character perception composition model.
3. The intelligent frame selection method according to claim 2, characterized in that: The step of performing character perception composition on the panoramic picture taken by the target camera through the pre-trained character perception composition model to obtain the target character composition information includes: The most recent N frames of panoramic images taken by the target camera are input into a pre-trained character perception composition model to obtain target character composition information output by the character perception composition model, where N is a positive integer.
4. The intelligent frame selection method according to claim 3, characterized in that: The target person composition information includes the image height, image width and center point pixel coordinates of the target person composition, and the virtual lens parameters include the image height, image width and center point pixel coordinates of the virtual lens picture.
5. The intelligent frame selection method according to claim 4, characterized in that: The virtual lens control scheme includes the target image height, target image width and target center pixel coordinates of the virtual lens parameters at each time step within the target number of time steps; The step of adjusting the virtual lens parameters according to the virtual lens control scheme to intelligently frame the panoramic picture includes: According to the target image height, target image width and target center point pixel coordinates of the virtual lens parameters at each time step within the target number of time steps, the virtual lens parameters are adjusted to crop the virtual lens picture at each time step within the target number of time steps from the panoramic picture.
6. The intelligent frame selection method according to claim 4, characterized in that: The virtual lens control scheme includes image height change information, image width change information and center point pixel coordinate change information of virtual lens parameters at each time step within a target number of time steps; The step of adjusting the virtual lens parameters according to the virtual lens control scheme to intelligently frame the panoramic picture includes: According to image height change information, image width change information, and center point pixel coordinate change information of the virtual lens parameters at each time step within the target number of time steps, the virtual lens parameters are adjusted to crop a virtual lens picture at each time step within the target number of time steps from the panoramic picture.
7. The intelligent frame selection method according to claim 5 or 6, characterized in that: The method further comprises: The virtual lens picture is resampled so that the resolution of the virtual lens picture is consistent with a preset output resolution.
8. An intelligent frame selection device, characterized in that: The intelligent frame selection device comprises: A character composition module is used to perform character perception composition on the panoramic picture taken by the target camera through a pre-trained character perception composition model to obtain the target character composition information; A solution generation module, used for inputting the virtual lens parameters of the target camera and the composition information of the target person into a pre-trained virtual lens control solution generation model to obtain a virtual lens control solution output by the virtual lens control solution generation model, wherein the virtual lens control solution generation model is a neural network model trained based on a reinforcement learning algorithm; The intelligent frame selection module is used to adjust the virtual lens parameters according to the virtual lens control solution to perform intelligent frame selection on the panoramic picture.
9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the intelligent box selection method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the intelligent box selection method according to any one of claims 1 to 7 are implemented.