Video processing method, device, computer equipment and storage medium
By identifying target objects in the video stream and determining the magnification factor based on their size information, the problem of inconsistent video monitoring effects on different display screens is solved, enabling effective display and monitoring on multiple screens.
Patent Information
- Application Number
- CN202111120702.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-24
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-09-24
AI Technical Summary
Differences in the display quality of video surveillance footage on different display screens can affect the effectiveness of video surveillance.
By identifying target objects in the video stream, the magnification factor is determined based on the size information of the target area, the video stream image, and the currently displayable area. The target area is then displayed in the currently displayable area, adapting to different screen differences.
It improves the display effect of video on different display screens, ensuring the effectiveness of video surveillance.
Smart Images

Figure CN113891040B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a video processing method, apparatus, computer equipment and storage medium. Background Art
[0002] With the development of video surveillance technology, the application of video surveillance systems is becoming more and more extensive. Users can set up a video surveillance system in a surveillance area to monitor the surveillance area. In the current technical solution, users set up a display screen to display the pictures taken by the video surveillance system. However, there are various display screens on the market, and there are certain differences between different display screens, and the display effects of the pictures are also different. Therefore, how to improve the display effect of the captured video on different display screens, and then ensure the effectiveness of video surveillance, has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] Based on this, it is necessary to provide a video processing method, device, computer equipment and storage medium that can provide the display effect of the captured video on different display screens, thereby ensuring the effectiveness of video surveillance, in response to the above technical problems.
[0004] A video processing method, the method comprising:
[0005] Get the video stream to be processed;
[0006] According to the video stream, identifying a target object contained in the video stream;
[0007] Determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area;
[0008] The video stream is displayed in the current displayable area with the target area as the center according to the magnification factor.
[0009] Optionally, identifying a target object contained in the video stream according to the video stream includes: inputting the video stream into a pre-trained target recognition model so that the target recognition model recognizes the target object contained in the video stream.
[0010] Optionally, the size information includes width and length; the magnification factor for the target area is determined according to the size information of the target area where the target object is located, the size information of the image screen of the video stream, and the size information of the currently displayable area, including: determining a first ratio of the width of the target area to the width of the image screen according to the width of the target area where the target object is located and the width of the image screen of the video stream; determining a second ratio of the length of the target area to the length of the image screen according to the length of the target area where the target object is located and the length of the image screen; and determining the magnification factor for the target area based on the first ratio, the second ratio, and the size information of the currently displayable area.
[0011] Optionally, based on the first proportion, the second proportion and the size information of the current displayable area, the magnification factor for the target area is determined, including: obtaining a first weight corresponding to the first proportion, a second weight corresponding to the second proportion and a third weight corresponding to the size information of the current displayable area; weighted and processed according to the first proportion, the second proportion, the size information of the current displayable area, the first weight, the second weight and the third weight to determine the magnification factor for the target area.
[0012] Optionally, the number of the target objects is at least two; and the magnification factor for the target area is determined based on the size information of the target area where the target objects are located, the size information of the image screen of the video stream, and the size information of the currently displayable area, including: determining a target area containing at least two of the target objects; and determining the magnification factor for the target area based on the size information of the target area, the size information of the image screen of the video stream, and the size information of the currently displayable area.
[0013] Optionally, displaying the video stream in the current displayable area with the target area as the center according to the magnification factor includes: enlarging the target area according to the magnification factor; and displaying the video stream in the current displayable area with the enlarged target area as the center.
[0014] Optionally, the video stream is displayed in the current displayable area with the target area as the center according to the magnification factor, including: zooming the image acquisition device used to acquire the video stream according to the magnification factor to enlarge the target area; receiving the zoomed video stream sent by the image acquisition device, and displaying the zoomed video stream in the current displayable area with the target area as the center.
[0015] A video processing device, comprising:
[0016] An acquisition module, used to acquire the video stream to be processed;
[0017] An identification module, used to identify a target object contained in the video stream according to the video stream;
[0018] A determination module, configured to determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area;
[0019] The display module is used to display the video stream in the current displayable area with the target area as the center according to the magnification.
[0020] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0021] Get the video stream to be processed;
[0022] According to the video stream, identifying a target object contained in the video stream;
[0023] Determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area;
[0024] The video stream is displayed in the current displayable area with the target area as the center according to the magnification factor.
[0025] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0026] Get the video stream to be processed;
[0027] According to the video stream, identifying a target object contained in the video stream;
[0028] Determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area;
[0029] The video stream is displayed in the current displayable area with the target area as the center according to the magnification factor.
[0030] One of the above technical solutions has the following advantages and beneficial effects:
[0031] The above-mentioned video processing method, device, computer equipment and storage medium obtain a video stream to be processed, identify the target object contained in the video stream, and determine the magnification factor for the target area according to the size information of the target area where the target object is located, the size information of the image screen of the video stream and the size information of the current displayable area, and display the video stream in the current displayable area with the target area as the center according to the magnification factor. Therefore, the target area can be adjusted to a certain extent according to the differences between different display screens, so that the target area can be adapted to the current displayable area, thereby improving the display effect of the video and ensuring the effectiveness of video monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is an application environment diagram of the video processing method in an embodiment of the present application.
[0033] Figure 2 Schematic diagram of the video processing method in the embodiment of the present application.
[0034] Figure 3 In the embodiment of this application Figure 2 FIG. 1 is a flow chart of step S230 in the video processing method.
[0035] Figure 4 In the embodiment of this application Figure 3 FIG. 1 is a flow chart of step S330 in the video processing method.
[0036] Figure 5 In the embodiment of this application Figure 2 FIG. 1 is a flow chart of step S230 in the video processing method.
[0037] Figure 6 In the embodiment of this application Figure 2 FIG. 1 is a flow chart of step S240 in the video processing method.
[0038] Figure 7 In the embodiment of this application Figure 2 FIG. 1 is a flow chart of step S240 in the video processing method.
[0039] Figure 8 is a structural block diagram of a video processing device in an embodiment of the present application.
[0040] Fig. 9 Schematic diagram of the internal structure of a computer device in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] The video processing method provided in this application can be applied to Figure 1 In the application environment shown. The image acquisition device 110 communicates with the processing terminal 120 through the network. The image acquisition device 110 may be a camera set at a target location that needs video surveillance, such as a school, a farm, a shopping mall or a store. In addition, the image acquisition device may also be a terminal device with an image acquisition function, such as a driving recorder, a wearable device (smart watch, smart glasses, etc.) or a smart phone.
[0043] The processing terminal 120 may be a terminal device with a video display function. For example, the processing terminal 120 may include but is not limited to a personal computer, a laptop computer, a smart phone, a tablet computer, a portable wearable device, and the like.
[0044] In a specific application scenario of the present application, the image acquisition device 110 can monitor the target location and send the video stream obtained by monitoring to the processing terminal 120 through the network. The processing terminal 120 can obtain the video stream to be processed, identify the target object contained in the video stream based on the video stream, and determine the magnification factor for the target area based on the size information of the target area where the target object is located, the size information of the image screen of the video stream, and the size information of the current displayable area. Then, based on the magnification factor, the video stream is displayed in the current displayable area with the target area as the center.
[0045] In one embodiment, Figure 2 As shown, a video processing method is provided, which is applied to Figure 1 The processing terminal 120 in the example is used as an example to illustrate, and the following steps are included:
[0046] In step S210, a video stream to be processed is obtained.
[0047] The video stream may be surveillance video data obtained by an image acquisition device performing video surveillance on a target location.
[0048] In an exemplary embodiment of the present application, the processing terminal can receive the video stream sent by the image acquisition device in real time and display it in the display interface of the processing terminal. In another example, the processing terminal can also store the received video stream to be processed locally, and when the user needs to view it, the processing terminal can obtain the video stream locally and display it. This application does not make any special restrictions on this.
[0049] In step S220, a target object contained in the video stream is identified based on the video stream.
[0050] The target object may be an object in the video stream that the user is interested in, such as a person, vehicle, animal or object contained in the video stream.
[0051] In an exemplary embodiment of the present application, after receiving the video stream, the processing terminal can identify the target object contained in the video stream according to the screen content of the video stream. In one example, when the processing terminal displays the video stream, the user can determine the object of interest, i.e., the target object, in the screen content corresponding to the video stream through the input device configured by the processing terminal (e.g., a mouse, a touch screen, etc.), for example, the user can determine it by clicking or box selection. The processing terminal can receive the user's selection information to determine the target object.
[0052] In another example, the processing terminal may also perform image recognition on the screen content of the video stream to determine the target object contained in the video stream. Specifically, the user may pre-set the type of object of interest, such as a person, a vehicle, or an animal. The processing terminal may then identify from the screen content of the video stream whether there is an object of interest to the user, and if so, the object is determined as the target object. For example, if the user sets the type of object of interest to be a vehicle, the processing terminal may identify whether the screen content of the video stream contains a vehicle, and if so, it is identified as the target object.
[0053] It should be noted that the target object contained in the picture content of the video stream can be one or more. The multiple mentioned in this application means two or more arbitrary numbers, and this application does not make any special limitation on this.
[0054] In step S230, the magnification factor for the target area is determined according to the size information of the target area where the target object is located, the size information of the image frame of the video stream, and the size information of the current displayable area.
[0055] The target area may be the location of the target object in the video stream. In one example, the size of the target area may be an area that fits the target object itself. For example, if the target object is a vehicle, the shape of the target area is the shape of the vehicle. In another example, the target area may be an area that includes the target object and has a certain size margin relative to the target object. For example, if the target object is a vehicle, the target area may be a rectangular area that includes the vehicle. The size of the rectangular area may be slightly larger than the vehicle, so that the vehicle is completely included in the target area.
[0056] It should be understood that those skilled in the art can pre-set the corresponding margin value size based on prior experience, for example, the margin value can be 1 pixel, 5 pixels, etc. The above numbers are only illustrative examples, and this application does not specifically limit this. When determining the target area where the target object is located, the processing terminal can make a determination based on the position information of the target object and the pre-set margin value. For example, if the margin value is 5 pixels, the processing terminal can use the positions that are 5 pixels away from the leftmost, rightmost, topmost and bottommost edges of the target object as the boundaries of the target area, thereby obtaining a target area with a rectangular shape.
[0057] In an exemplary embodiment of the present application, after the processing terminal determines the target area where the target object is located, the size information of the target area and the size information of the image screen of the video stream can be obtained accordingly. In one example, the size information may include width and length, and the processing terminal can determine the width and length of the target area, and the width and length of the image screen of the video stream. For example, taking the unit as a pixel, the processing terminal can determine how many pixels the width and length of the target area are, how many pixels the width and length of the image screen of the video stream are, and so on.
[0058] In addition, the magnification factor can be the magnification that needs to be adjusted when displaying the target area. It should be understood that by enlarging the target area, the target area can be highlighted, thereby effectively displaying the target object, avoiding the situation where the display screen is large but the target object in the image content is small and difficult to observe.
[0059] In an exemplary embodiment of the present application, the processing terminal may obtain the size information of the current displayable area. It should be understood that the current displayable area may be a display area for playing the video stream, for example, if the video stream is played in a partial area of the display screen of the processing terminal, the size information of the current displayable area is the size information of the partial area, and if the video stream is played in full screen on the display screen of the processing terminal, the size information of the current displayable area is the size information of the display screen.
[0060] After obtaining the size information of the target area, the size information of the image screen of the video stream, and the size information of the current displayable area, the processing terminal can determine the magnification factor for the target area based on the pre-set magnification determination rule and the above size information. It should be understood that if the size information of the target area accounts for a smaller proportion of the size information of the image screen of the video stream or the size information of the current displayable area, the magnification factor should increase accordingly, and vice versa. Those skilled in the art can set the corresponding magnification determination rule based on prior experience, and this application does not make any special limitation on this.
[0061] Please continue to refer to Figure 2 In step S240, the video stream is displayed in the current displayable area with the target area as the center according to the magnification factor.
[0062] In an exemplary embodiment of the present application, the processing terminal can magnify the screen content of the target area accordingly based on the magnification factor. For example, if the magnification factor is 2, the processing terminal magnifies the screen content of the target area to twice, etc. The video stream is played and displayed with the magnified target area as the center in the current displayable area.
[0063] exist Figure 2 In the illustrated embodiment, the magnification factor for the target area is determined based on the size information of the target area, the size information of the image screen of the video stream, and the size information of the current displayable area, so that the enlarged target area can be adapted to the current displayable area. Even if displayed on screens of different sizes, the display effect of the target area can be guaranteed. In addition, the video stream is played and displayed with the enlarged target area as the center in the current displayable area, so that the target area can be highlighted, thereby facilitating the user to observe the target object and improving the effectiveness of video monitoring.
[0064] based on Figure 2 In the embodiment shown, in an exemplary embodiment of the present application, according to the video stream, identifying the target object contained in the video stream includes:
[0065] The video stream is input into a pre-trained target recognition model so that the target recognition model can recognize the target object contained in the video stream.
[0066] In this embodiment, the processing terminal can obtain a pre-trained target recognition model by pre-storing or calling, and the target recognition model can be a machine learning model for identifying the target object contained in the video stream. The processing terminal can use the video stream as the input of the target recognition model so that the target recognition model outputs the target object contained in the video stream. In one example, the target recognition model can select a frame in the picture content of the video stream to determine the target object. In another example, the target recognition model can also output the position information of the target object relative to the picture content of the video stream to determine the target object, which is not specifically limited in this application.
[0067] Those skilled in the art can train the target recognition model in advance, and train the target recognition model through a large amount of training data, so that the target recognition model can accurately output the target object contained in each training data. It should be noted that for different types of target objects, training data corresponding to the type can be set respectively. For example, if the target object is a person, the training data can be video stream data containing the person. If the target object is a vehicle, the training data can be video stream data containing the vehicle, and so on. In this way, targeted training of the target recognition model can ensure the accuracy of the output result of the target recognition model.
[0068] In this embodiment, the target object is identified by using a pre-trained target recognition model, which can improve the accuracy and efficiency of target object identification, thereby ensuring the effectiveness of monitoring.
[0069] based on Figure 2 The embodiment shown, Figure 3 For the embodiments of this application Figure 2 Schematic diagram of the process of step S230 in the video processing method. Figure 3 As shown, the size information includes width and length, and step S230 at least includes steps S310 to S320, which are described in detail as follows:
[0070] In step S310, a first ratio of the width of the target area where the target object is located to the width of the image screen is determined according to the width of the target area where the target object is located and the width of the image screen of the video stream.
[0071] In this embodiment, the processing terminal can divide the width of the target area by the width of the image screen of the video stream to obtain the first proportion. For example, if the width of the target area is 5 pixels and the width of the image screen of the video stream is 50, then the first proportion is 5 / 50, i.e., 1 / 10, and so on.
[0072] In step S320, a second ratio of the length of the target area to the length of the image frame is determined according to the length of the target area where the target object is located and the length of the image frame.
[0073] In this embodiment, according to the method for determining the first ratio described above, the processing terminal may correspondingly determine the second ratio of the length of the target area to the length of the image screen, which will not be described in detail in this application.
[0074] In step S330, based on the first proportion, the second proportion and the size information of the current displayable area, the magnification factor for the target area is determined.
[0075] In this embodiment, the processing terminal can determine the magnification factor for the target area based on the first proportion, the second proportion, and the size information of the current displayable area, based on a pre-set magnification determination rule. Thus, by determining the magnification factor of the target area based on the first proportion, the second proportion, and the size information of the current displayable area, the accuracy of the determined magnification factor can be ensured, thereby ensuring the display effect of the target area.
[0076] based on Figure 2 and Figure 3 The embodiment shown, Figure 4 In the embodiment of this application Figure 3 The flowchart of step S330 in the video processing method is shown in FIG. Figure 4 As shown, step S330 at least includes steps S410 to S420, which are described in detail as follows:
[0077] In step S410, a first weight corresponding to the first proportion, a second weight corresponding to the second proportion, and a third weight corresponding to the size information of the current displayable area are obtained.
[0078] In an exemplary embodiment of the present application, those skilled in the art can set a first weight corresponding to the first proportion, a second weight corresponding to the second proportion, and a third weight corresponding to the size information of the current displayable area based on prior experience, and pre-store the above weight information in the processing terminal for subsequent acquisition.
[0079] It should be noted that technical personnel in this field can determine the first weight, second weight and third weight corresponding to different types of target objects, respectively, for different types of target objects, thereby ensuring the effectiveness of the weight information setting and avoiding all types of target objects using the same weight information, thereby affecting subsequent display effects.
[0080] In step S420, weighted sum processing is performed according to the first proportion, the second proportion, the size information of the current displayable area, the first weight, the second weight, and the third weight to determine the magnification factor for the target area.
[0081] In an exemplary embodiment of the present application, after obtaining the above-mentioned weight information, the processing terminal can perform weighted sum calculation based on the first proportion, the second proportion and the size information of the current displayable area, as well as the corresponding first weight value, the second weight value and the third weight value, so as to determine the magnification factor for the target area.
[0082] It should be understood that, in this embodiment, by setting corresponding weight value information and performing weighted sum calculation based on the above information, various factors that affect the display effect of the target area can be fully considered, thereby ensuring the effectiveness of the determined magnification factor.
[0083] based on Figure 2 The embodiment shown, Figure 5 In the embodiment of this application Figure 2 Schematic diagram of the process of step S230 in the video processing method. Figure 5 As shown, the number of target objects is at least two, then step S230 at least includes steps S510 to S520, which are described in detail as follows:
[0084] In step S510, a target area including at least two target objects is determined.
[0085] In an exemplary embodiment of the present application, if the number of target objects is at least two, that is, any number of two or more than two, the processing terminal determines the target area in the picture content of the video stream based on the fact that the determined target area can simultaneously contain the at least two target objects.
[0086] In step S520, the magnification factor for the target area is determined according to the size information of the target area, the size information of the image frame of the video stream, and the size information of the current displayable area.
[0087] Therefore, in Figure 5 In the illustrated embodiment, when the number of target objects is at least two, the processing terminal can identify the area containing the at least two target objects as the target area. Thus, in subsequent display, the at least two target objects can be highlighted at the same time to avoid missing target objects, thereby ensuring the effectiveness of video monitoring.
[0088] based on Figure 2 The embodiment shown, Figure 6 In the embodiment of this application Figure 2Schematic diagram of the flow chart of step S240 in the video processing method. Figure 6 As shown, step S240 at least includes steps S610 to S620, which are described in detail as follows:
[0089] In step S610, the target area is magnified according to the magnification factor.
[0090] In an exemplary embodiment of the present application, after determining the magnification factor for the target area, the processing terminal may magnify the target area according to the magnification factor, so as to highlight the target object contained in the target area.
[0091] In step S620, the video stream is displayed in the current displayable area with the enlarged target area as the center.
[0092] In an exemplary embodiment of the present application, after the processing terminal enlarges the target area, it can move the enlarged target area to the center of the current displayable area and play the video stream, thereby ensuring the display effect of the target area and further ensuring the effectiveness of video monitoring.
[0093] based on Figure 2 The embodiment shown, Figure 7 In the embodiment of this application Figure 2 Schematic diagram of the flow chart of step S240 in the video processing method. Figure 7 As shown, step S240 at least includes steps S710 to S720, which are described in detail as follows:
[0094] In step S710, the image acquisition device for acquiring the video stream is zoomed according to the magnification factor to magnify the target area.
[0095] In an exemplary embodiment of the present application, after determining the magnification factor, the processing terminal can send a zoom instruction to the image acquisition device that acquires the video stream. After receiving the zoom instruction, the image acquisition device can adjust its own shooting parameters accordingly to enlarge the target area.
[0096] In another example, the processing terminal may also send a shooting angle adjustment instruction to the image acquisition device based on the position information of the target area in the image frame of the video stream, thereby adjusting the shooting angle of the image acquisition device accordingly so that the image acquisition device faces the target area.
[0097] In step S720, the zoomed video stream sent by the image acquisition device is received, and the zoomed video stream is displayed in the current displayable area with the target area as the center.
[0098] In an exemplary embodiment of the present application, after zooming, the image acquisition device can continue to send the captured video stream data to the processing terminal. After receiving the zoomed video stream data, the processing terminal does not need to process the zoomed video stream, that is, the zoomed video stream can be displayed with the target area as the center in the current displayable area, thereby ensuring the effectiveness of video monitoring.
[0099] It should be understood that although Figure 2-7 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-7 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0100] In one embodiment, Figure 8 As shown, a video processing device is provided, comprising:
[0101] An acquisition module 810 is used to acquire a video stream to be processed;
[0102] The identification module 820 is used to identify the target object contained in the video stream according to the video stream;
[0103] A determination module 830, configured to determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area;
[0104] The display module 840 is configured to display the video stream in the current displayable area with the target area as the center according to the magnification factor.
[0105] In one embodiment, the recognition module 820 is configured to: input the video stream into a pre-trained target recognition model, so that the target recognition model recognizes the target object contained in the video stream.
[0106] In one embodiment, the size information includes width and length; the determination module 830 is configured to: determine a first ratio of the width of the target area to the width of the image screen according to the width of the target area where the target object is located and the width of the image screen of the video stream; determine a second ratio of the length of the target area to the length of the image screen according to the length of the target area where the target object is located and the length of the image screen; determine the magnification factor for the target area based on the first ratio, the second ratio and the size information of the currently displayable area.
[0107] In one embodiment, the determination module 830 is configured to: obtain a first weight corresponding to the first proportion, a second weight corresponding to the second proportion, and a third weight corresponding to the size information of the current displayable area; perform weighted and processing according to the first proportion, the second proportion, the size information of the current displayable area, the first weight, the second weight, and the third weight to determine the magnification factor for the target area.
[0108] In one embodiment, the number of the target objects is at least two, and the determination module 830 is configured to: determine a target area containing at least two of the target objects; and determine a magnification factor for the target area based on size information of the target area, size information of the image screen of the video stream, and size information of the currently displayable area.
[0109] In one embodiment, the display module 840 is configured to: enlarge the target area according to the magnification factor; and display the video stream in the current displayable area with the enlarged target area as the center.
[0110] In one embodiment, the display module 840 is configured to: zoom the image acquisition device used to acquire the video stream according to the magnification factor to enlarge the target area; receive the zoomed video stream sent by the image acquisition device, and display the zoomed video stream in the current displayable area with the target area as the center.
[0111] For the specific definition of the video processing device, please refer to the definition of the video processing method above, which will not be repeated here. Each module in the above video processing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0112] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a video processing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0113] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0114] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0115] Get the video stream to be processed;
[0116] According to the video stream, identifying a target object contained in the video stream;
[0117] Determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area;
[0118] The video stream is displayed in the current displayable area with the target area as the center according to the magnification factor.
[0119] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0120] The video stream is input into a pre-trained target recognition model so that the target recognition model can recognize the target object contained in the video stream.
[0121] In one embodiment, the size information includes width and length, and the processor further implements the following steps when executing the computer program:
[0122] According to the width of the target area where the target object is located and the width of the image screen of the video stream, a first ratio of the width of the target area relative to the width of the image screen is determined; according to the length of the target area where the target object is located and the length of the image screen, a second ratio of the length of the target area relative to the length of the image screen is determined; based on the first ratio, the second ratio and the size information of the currently displayable area, a magnification factor for the target area is determined.
[0123] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0124] Obtain a first weight corresponding to the first proportion, a second weight corresponding to the second proportion, and a third weight corresponding to the size information of the current displayable area; perform weighted and processing according to the first proportion, the second proportion, the size information of the current displayable area, the first weight, the second weight, and the third weight to determine the magnification factor for the target area.
[0125] In one embodiment, the number of the target objects is at least two, and the processor further implements the following steps when executing the computer program:
[0126] Determine a target area containing at least two of the target objects; and determine a magnification factor for the target area according to size information of the target area, size information of the image screen of the video stream, and size information of the current displayable area.
[0127] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0128] The target area is enlarged according to the magnification factor; and the video stream is displayed in the current displayable area with the enlarged target area as the center.
[0129] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0130] According to the magnification factor, the image acquisition device used to acquire the video stream is zoomed to enlarge the target area; the zoomed video stream sent by the image acquisition device is received, and the zoomed video stream is displayed in the current displayable area with the target area as the center.
[0131] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0132] Get the video stream to be processed;
[0133] According to the video stream, identifying a target object contained in the video stream;
[0134] Determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area;
[0135] The video stream is displayed in the current displayable area with the target area as the center according to the magnification factor.
[0136] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0137] The video stream is input into a pre-trained target recognition model so that the target recognition model can recognize the target object contained in the video stream.
[0138] In one embodiment, the size information includes width and length, and when the computer program is executed by the processor, the following steps are further implemented:
[0139] According to the width of the target area where the target object is located and the width of the image screen of the video stream, a first ratio of the width of the target area relative to the width of the image screen is determined; according to the length of the target area where the target object is located and the length of the image screen, a second ratio of the length of the target area relative to the length of the image screen is determined; based on the first ratio, the second ratio and the size information of the currently displayable area, a magnification factor for the target area is determined.
[0140] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0141] Obtain a first weight corresponding to the first proportion, a second weight corresponding to the second proportion, and a third weight corresponding to the size information of the current displayable area; perform weighted and processing according to the first proportion, the second proportion, the size information of the current displayable area, the first weight, the second weight, and the third weight to determine the magnification factor for the target area.
[0142] In one embodiment, the number of the target objects is at least two, and when the computer program is executed by the processor, the following steps are further implemented:
[0143] Determine a target area containing at least two of the target objects; and determine a magnification factor for the target area according to size information of the target area, size information of the image screen of the video stream, and size information of the current displayable area.
[0144] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0145] The target area is enlarged according to the magnification factor; and the video stream is displayed in the current displayable area with the enlarged target area as the center.
[0146] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0147] According to the magnification factor, the image acquisition device used to acquire the video stream is zoomed to enlarge the target area; the zoomed video stream sent by the image acquisition device is received, and the zoomed video stream is displayed in the current displayable area with the target area as the center.
[0148] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0149] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0150] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A video processing method, characterized in that: The following steps are involved: Get the video stream to be processed; According to the video stream, identifying a target object contained in the video stream; the target object is an object in the video stream that a user is interested in; Determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area; According to the magnification factor, display the video stream in the current displayable area with the target area as the center; The size information includes width and length; The determining the magnification factor for the target area according to the size information of the target area where the target object is located, the size information of the image screen of the video stream, and the size information of the current displayable area includes: Determining a first ratio of the width of the target area to the width of the image screen according to the width of the target area where the target object is located and the width of the image screen of the video stream; Determining a second ratio of the length of the target area to the length of the image screen according to the length of the target area where the target object is located and the length of the image screen; Determine a magnification factor for the target area based on the first proportion, the second proportion, and size information of a current displayable area; The determining the magnification factor for the target area based on the first proportion, the second proportion, and the size information of the current displayable area includes: Obtaining a first weight corresponding to the first proportion, a second weight corresponding to the second proportion, and a third weight corresponding to the size information of the current displayable area; the first weight, the second weight, and the third weight are determined based on the type of the target object; A magnification factor for the target area is determined by weighting and processing the first proportion, the second proportion, the size information of the current displayable area, the first weight, the second weight, and the third weight.
2. The video processing method according to claim 1, characterized in that: According to the video stream, identifying a target object contained in the video stream includes: The video stream is input into a pre-trained target recognition model so that the target recognition model can recognize the target object contained in the video stream.
3. The video processing method according to claim 1, characterized in that: The number of the target objects is at least two; Determining a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area includes: determining a target area including at least two of the target objects; The magnification factor for the target area is determined according to the size information of the target area, the size information of the image frame of the video stream, and the size information of the current displayable area.
4. The video processing method according to claim 1, characterized in that: Displaying the video stream in the current displayable area with the target area as the center according to the magnification factor includes: Enlarging the target area according to the magnification factor; The video stream is displayed in the current displayable area with the enlarged target area as the center.
5. The video processing method according to claim 1, characterized in that: Displaying the video stream in the current displayable area based on the magnification factor and centering on the target area includes: According to the magnification factor, zooming an image acquisition device for acquiring the video stream to magnify the target area; The zoomed video stream sent by the image acquisition device is received, and the zoomed video stream is displayed in the current displayable area with the target area as the center.
6. A video processing device, characterized in that: include: An acquisition module, used to acquire the video stream to be processed; An identification module, used to identify a target object contained in the video stream according to the video stream; The target object is an object in the video stream that the user is interested in; A determination module, configured to determine a magnification factor for the target area according to size information of the target area where the target object is located, size information of the image screen of the video stream, and size information of the current displayable area; A display module, configured to display the video stream in the current displayable area with the target area as the center according to the magnification; The size information includes width and length, and the determination module is configured to: determine a first ratio of the width of the target area to the width of the image screen according to the width of the target area where the target object is located and the width of the image screen of the video stream; Determine, according to the length of the target area where the target object is located and the length of the image, a second ratio of the length of the target area relative to the length of the image; and determine, based on the first ratio, the second ratio and size information of the current displayable area, a magnification factor for the target area; The determination module is further configured to: obtain a first weight corresponding to the first proportion, a second weight corresponding to the second proportion, and a third weight corresponding to the size information of the current displayable area; the first weight, the second weight, and the third weight are determined based on the type of the target object; A magnification factor for the target area is determined by weighting and processing the first proportion, the second proportion, the size information of the current displayable area, the first weight, the second weight, and the third weight.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
