Video output processing method, device, equipment and medium
Dynamically adjust the resolution of the video output through target detection, crop and enlarge the monitoring target area, solve the problem of excessive resource consumption in video surveillance, and achieve efficient use of resources.
Patent Information
- Application Number
- CN202410888804.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-07-03
AI Technical Summary
In video surveillance, the increase in sensor output resolution leads to an increase in data volume, resulting in excessive bit rates and excessive consumption of bandwidth, storage space and data processing performance.
Dynamically adjust the resolution of the output image through target detection, crop unnecessary areas, output only the image area where the monitoring target is located, determine the matching output resolution based on the cropped area, and enlarge it to a relatively small resolution to save resources .
While meeting the needs of video surveillance, it saves the consumption of bandwidth, storage space and data processing performance, and avoids excessive waste of resources.
Smart Images

Figure CN118413611B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image technology, and in particular to a video output processing method, device, equipment and medium. Background Art
[0002] Due to the advancement of imaging technology, the output resolution of sensors has been continuously improved. While meeting the user's demand for high resolution, the increase in data volume has caused the bit rate to be too large, resulting in the consumption of bandwidth, storage space, data processing performance, etc. Summary of the invention
[0003] The embodiments of the present application provide a video output processing method, apparatus, device and medium for dynamically adjusting the resolution of the output image based on target detection, thereby saving resources and avoiding excessive consumption of bandwidth, storage space, data processing performance, etc. while meeting video surveillance requirements.
[0004] An embodiment of the present application provides a video output processing method, including:
[0005] Acquire a video image captured for a target scene, and perform target recognition on the video image;
[0006] When it is determined through the target recognition that a monitoring target exists in at least one frame of the video image, for each of the at least one frame of the video image in which the monitoring target exists:
[0007] Determine the coordinates of the monitoring target in the image, and determine a cropping area of the image according to the coordinates of the monitoring target in the image; wherein the cropping area includes the monitoring target in the image;
[0008] Determining, according to the cropping area, an output resolution matching the cropping area;
[0009] The image in the cropping area is output according to an output resolution matching the cropping area.
[0010] It can be seen that the embodiment of the present application obtains a video image captured for a target scene and performs target recognition on the video image. Therefore, when it is determined that a surveillance target exists in at least one frame of the video image, the following operations can be performed for each of the at least one frame of the image in which the surveillance target exists: determine the coordinates of the surveillance target in the image, and determine a cropping area of the image based on the coordinates of the surveillance target in the image; wherein the cropping area includes the surveillance target in the image; and then the image area where the video surveillance target is located can be locked, and the area where the surveillance target does not exist can be cropped, so that the cropped area does not participate in the video image transmission, thereby saving resources such as bit rate, storage space, and data processing. Furthermore, subsequently, an output resolution matching the cropped area can be determined based on the cropped area; and the image within the cropped area can be output according to the output resolution matching the cropped area, thereby ensuring that the image within the cropped area that needs to be transmitted can be transmitted with the preset output resolution matching the cropped area. Therefore, not only can the cropped area be dynamically determined based on the target area to ensure the video surveillance needs, but the image within the cropped area can also be enlarged and adjusted to a relatively small output resolution, thereby achieving the purpose of saving bit rate, storage space, and data processing complexity, and avoiding excessive consumption of bandwidth, storage space, and data processing performance.
[0011] In some embodiments, determining, according to the cropping area, an output resolution matching the cropping area includes:
[0012] When the image resolution within the cropped area is less than or equal to a preset first output resolution and greater than a preset second output resolution, the first output resolution is used as an output resolution matching the cropped area, wherein the first output resolution and the second output resolution are two preset output resolutions that are closest to the image resolution within the cropped area.
[0013] In some embodiments, outputting the image within the cropping area according to an output resolution matching the cropping area includes:
[0014] The image in the cropping area is enlarged to an output resolution matching the cropping area and then outputted.
[0015] In some embodiments, before enlarging the image in the cropped area, the method further includes:
[0016] When the aspect ratio of the cropping area is different from the aspect ratio of the output resolution matching the cropping area, the cropping area is re-determined according to the aspect ratio of the output resolution matching the cropping area.
[0017] In some embodiments, determining a cropping area of the image according to coordinates of a surveillance target in the image includes:
[0018] When the image includes multiple monitoring targets, the coordinates of each monitoring target in the image are traversed to determine the minimum coordinate value and the maximum coordinate value;
[0019] A cropping area of the image is determined according to the minimum coordinate value and the maximum coordinate value.
[0020] In some embodiments, performing target recognition on the video image includes:
[0021] According to the user's configuration information, the video image is subjected to target recognition of one or a combination of the following targets: a person, a vehicle, and a non-motor vehicle.
[0022] In some embodiments, the method further comprises:
[0023] When it is determined through the target recognition that there is no monitoring target in the video image, the video image is output according to a preset minimum output resolution.
[0024] An embodiment of the present application provides a video output processing device, comprising:
[0025] The first unit is used to obtain a video image collected for a target scene and perform target recognition on the video image;
[0026] The second unit is configured to, when it is determined through the target recognition that a monitoring target exists in at least one frame of the video image, for each of the at least one frame of the video image in which the monitoring target exists:
[0027] Determine the coordinates of the monitoring target in the image, and determine a cropping area of the image according to the coordinates of the monitoring target in the image; wherein the cropping area includes the monitoring target in the image;
[0028] Determining, according to the cropping area, an output resolution matching the cropping area;
[0029] The image in the cropping area is output according to an output resolution matching the cropping area.
[0030] Another embodiment of the present application provides an electronic device, which includes a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory and execute any of the above methods according to the obtained program.
[0031] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments 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 these drawings without paying creative work.
[0033] Figure 1 A schematic diagram of the overall flow of a video output processing method provided in an embodiment of the present application;
[0034] Figure 2 A schematic diagram of the structure of a video output processing system provided in an embodiment of the present application;
[0035] Figure 3 A schematic diagram of the matching principle of a cropping area and an output resolution provided in an embodiment of the present application;
[0036] Figure 4 A schematic diagram of cropping area adjustment provided in an embodiment of the present application;
[0037] Figure 5 A schematic diagram of a specific flow chart of a video output processing method provided in an embodiment of the present application;
[0038] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0039] Figure 7 A schematic diagram of the structure of a video output processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] The embodiments of the present application provide a video output processing method, apparatus, device and medium for dynamically adjusting the resolution of the output image based on target detection, thereby saving resources and avoiding excessive consumption of bandwidth, storage space, data processing performance, etc. while meeting video surveillance requirements.
[0042] Among them, the method and the device, equipment, and medium are based on the same application concept. Since the principles of solving problems by the method and the device, equipment, and medium are similar, the implementation of the device, equipment, medium, and method can refer to each other, and the repeated parts will not be repeated.
[0043] The terms "first", "second", etc. (if any) in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in a sequence other than the content illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0044] The following examples and embodiments are to be understood as illustrative examples only. Although this specification may refer to "one", "an" or "some" examples or embodiments in several places, this does not mean that each such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide other embodiments. In addition, terms such as "including" and "comprising" should be understood as not limiting the described embodiments to consist only of those features that have been mentioned; such examples and embodiments may also include features, structures, units, modules, etc. that are not specifically mentioned.
[0045] The following is a detailed description of each embodiment of the present application in conjunction with the accompanying drawings. It should be noted that the display order of the embodiments of the present application only represents the order of the embodiments, and does not represent the advantages and disadvantages of the technical solutions provided by the embodiments.
[0046] In some application scenarios in the security field, users do not need a very high image resolution because the supporting hardware conditions are not very good, such as network, back-end storage space, etc., and require the equipment to run at a low bit rate, just to ensure that basic monitoring needs are met.
[0047] Therefore, the embodiment of the present application proposes a method for dynamically cropping images based on target detection and adjusting the output resolution, so as to save resources and avoid excessive consumption of bandwidth, storage space, data processing performance, etc. while meeting the requirements of video surveillance. Embodiment 1:
[0048] See also Figure 1, a video output processing method provided by an embodiment of the present application includes:
[0049] S101, acquiring a video image captured for a target scene, and performing target recognition on the video image;
[0050] The target scene is, for example, a railway station, a crossroads, or other scene that requires video surveillance.
[0051] The object of target recognition may be, for example, a person, a motor vehicle, a non-motor vehicle, etc., and may be determined according to user needs, and may include one or more targets among persons, motor vehicles, non-motor vehicles, etc., and the embodiments of the present application are not limited thereto.
[0052] In addition, no matter what kind of identification target the user sets, there are many ways to implement specific target identification, which is not limited in the embodiments of the present application.
[0053] S102: When it is determined through the target recognition that a monitoring target exists in at least one frame of the video image, for each of the at least one frame of the video image in which the monitoring target exists:
[0054] Determine the coordinates of the monitoring target in the image, and determine a cropping area of the image according to the coordinates of the monitoring target in the image; wherein the cropping area includes the monitoring target in the image;
[0055] Determining, according to the cropping area, an output resolution matching the cropping area;
[0056] The image in the cropping area is output according to an output resolution matching the cropping area.
[0057] In some embodiments, the cropping area includes the monitoring targets in the image, for example, the cropping area is the smallest circumscribed rectangular frame on the image that includes all the monitoring targets.
[0058] In some embodiments, multiple output resolutions can be pre-set, and different cropping area sizes are suitable for output resolutions of different sizes, for example, matching the cropping area with a preset output resolution that is closest to and larger than the resolution of the cropping area.
[0059] In some embodiments, determining, according to the cropping area, an output resolution matching the cropping area includes:
[0060] When the image resolution in the cropping area is less than or equal to the preset first output resolution and greater than the preset second output resolution, the first output resolution is used as the output resolution matched with the cropping area, wherein the first output resolution and the second output resolution are two preset output resolutions closest to the image resolution in the cropping area. In other words, the preset output resolution that is closest to the resolution of the cropping area and greater than the resolution of the cropping area can be matched to the cropping area.
[0061] In some embodiments, outputting the image within the cropping area according to an output resolution matching the cropping area includes:
[0062] The image in the cropping area is enlarged to an output resolution matching the cropping area and then outputted.
[0063] In some embodiments, in order to avoid deformation of objects in the image due to image magnification, before magnifying the image in the cropping area, the method further includes:
[0064] When the aspect ratio of the cropping area is different from the aspect ratio of the output resolution matching the cropping area, the cropping area is re-determined according to the aspect ratio of the output resolution matching the cropping area.
[0065] That is to say, if the aspect ratio of the currently determined cropping area is different from the aspect ratio of the output resolution matching the cropping area, the cropping area can be re-determined so that the aspect ratio of the re-determined cropping area is the same as the aspect ratio of the output resolution matching the re-determined cropping area, and the re-determined cropping area also includes the monitoring target in the image, for example, the re-determined cropping area is the smallest rectangular frame area on the image that meets the following two conditions:
[0066] Condition 1: The re-determined cropping area includes all monitoring targets in the image;
[0067] Condition 2: The aspect ratio of the re-determined cropping area is the same as the aspect ratio of the output resolution matching the re-determined cropping area.
[0068] In some embodiments, determining a cropping area of the image according to coordinates of a surveillance target in the image includes:
[0069] When the image includes multiple monitoring targets, the coordinates of each monitoring target in the image are traversed to determine the minimum coordinate value and the maximum coordinate value;
[0070] A cropping area of the image is determined according to the minimum coordinate value and the maximum coordinate value.
[0071] In some embodiments, performing target recognition on the video image includes:
[0072] According to the user's configuration information, the video image is subjected to target recognition of one or a combination of the following targets: a person, a vehicle, and a non-motor vehicle.
[0073] In some embodiments, the method further comprises:
[0074] When it is determined through the target recognition that there is no monitoring target in the video image, the video image is output according to a preset minimum output resolution.
[0075] In other words, if there is no monitoring target at present, the monitoring video currently acquired does not need to have a very high resolution, and only needs to be output to the receiving end with the preset minimum resolution, thereby further reducing the occupation of resources such as bandwidth and storage space. Embodiment 2:
[0076] See also Figure 2 , a video image transmission system provided in an embodiment of the present application includes:
[0077] Visual sensor 201, target detection module 202, cropping calculation module 203, scaling processing module 204, and code stream output module 205. Among them:
[0078] After the visual sensor 201 collects the image data, it sends the image data to the target detection module 202 for target recognition;
[0079] The target detection module 202 performs target recognition according to the detection target type set by the user to determine the monitoring target in the picture. The detection target type set by the user includes but is not limited to people, cars, non-motor vehicles, etc. The user can set a combination of various detection targets;
[0080] The clipping calculation module 203 calculates the final clipping area coordinates according to the monitoring target in the picture;
[0081] That is to say, the image data collected by the visual sensor 201 is sent to the target detection module 202, and the target detection module 202 uses a preset target recognition algorithm to calculate the coordinates of each target of interest to the user in the picture. The cropping calculation module 203 calculates the coordinates of the cropping area that can include all targets of interest to the user and the size of the cropping area frame based on the coordinates of each target.
[0082] For example, if multiple targets are detected in the picture, the target detection module 202 will calculate the coordinates of each target, and the cropping calculation module 203 will traverse the coordinates of each target in turn to calculate the minimum x, y coordinate value (Xmin, Ymin), and the maximum x, y coordinate value (Xmax, Ymax), so as to obtain the cropping area based on the minimum x, y coordinate value (Xmin, Ymin), and the maximum x, y coordinate value (Xmax, Ymax), and this cropping area will inevitably include all targets.
[0083] The target recognition algorithm module determines which output resolution to choose by clipping coordinates;
[0084] The user pre-sets the detection target type and turns on the adaptive resolution to save bitrate function. The user can configure and select multiple small output resolutions. In actual applications, the corresponding resolution output image can be adaptively selected based on the target captured by the device.
[0085] The cropping calculation module 203 determines the cropping area and the image resolution of the cropping area according to the monitoring target in the picture, and compares the size with the preset output resolution to determine the output resolution size of the current cropping area. For example, if the image resolution of the current cropping area is smaller than the first resolution and larger than the second resolution, the first resolution is selected as the output resolution of the current cropping area; or if it is smaller than the second resolution and larger than the third resolution, the second resolution is selected as the output resolution of the current cropping area.
[0086] For example, see Figure 3 , the original resolution of the visual sensor 201 input is R1. After the user turns on the bitrate saving function, the system can automatically adjust the output resolution of the video image to adaptively select between the preset output resolution R1 and the preset output resolutions R2, R3, R4, etc. that are smaller than the preset output resolution R1. For example, see Figure 3 , the image resolution of cropping area 3 is less than the output resolution R3 and greater than the output resolution R4, then the output resolution of cropping area 3 is selected as R3; the image resolution of cropping area 2 is less than the output resolution R2 and greater than the output resolution R3, then the output resolution of cropping area 2 is selected as R2, and so on.
[0087] After the cropping calculation module 203 determines the output resolution of the current cropping area, if the aspect ratio of the current cropping area is different from the aspect ratio of the output resolution matched by the current cropping area, the cropping coordinates can be readjusted according to the aspect ratio of the output resolution matched by the current cropping area, that is, the cropping area is redetermined, and the scaling processing module 204 is notified of the finally determined cropping area, wherein the aspect ratio of the redetermined cropping area is the same as the aspect ratio of the output resolution matched by the redetermined cropping area, and the redetermined cropping area also includes the monitoring target in the image, for example, the redetermined cropping area is the smallest rectangular frame area on the image that satisfies the following two conditions:
[0088] Condition 1: The re-determined cropping area includes all monitoring targets in the image;
[0089] Condition 2: The aspect ratio of the re-determined cropping area is the same as the aspect ratio of the output resolution matching the re-determined cropping area.
[0090] Thus, the zoom processing module 204 can enlarge the image of the cropped area to an output resolution that matches the cropped area, which can not only reduce the bit rate but also ensure the clarity of the monitored target and avoid distortion caused by image stretching after subsequent enlargement to the output resolution.
[0091] For example, see Figure 4 , the aspect ratio of the current cropping area is 4:3 or 4:1, and the image resolution of the current cropping area is greater than the output resolution R3 set by the user and less than the output resolution R2 set by the user, then the output resolution R2 is finally selected as the output resolution matched by the current cropping area. For example, if the aspect ratio of the output resolution R2 is 2:1, the aspect ratio of the current cropping area is different from the aspect ratio of the output resolution R2 matched by the current cropping area. The coordinates of the cropping frame need to be adjusted, that is, the cropping area is re-determined, and the aspect ratio of the cropping area finally determined is 2:1. Figure 4 As shown, for example, if the aspect ratio of the current cropping area is 4:3, then a portion of the area is expanded from both ends of the current cropping area of the image (i.e., in the width direction) as the cropping area, so that the aspect ratio of the final cropping area is 2:1; or, if the aspect ratio of the current cropping area is 4:1, then a portion of the area can be expanded downward from the current cropping area of the image in the height direction as the cropping area, so that the aspect ratio of the final cropping area is 2:1, and so on.
[0092] The cropping calculation module 203 finally obtains the cropping area that meets the output resolution aspect ratio, and after cropping the image in the cropping area, the cropping area image is enlarged by the scaling processing module 204, that is, enlarged to the matching output resolution, for example, see Figure 3If the cropping area finally determined is the cropping area 3, it is enlarged to the output resolution R3 and finally output through the code stream output module 205.
[0093] It can be seen that the embodiment of the present application dynamically crops the target frame according to the target that the user is concerned about. Since the cropping is performed on the original image captured by the visual sensor and then enlarged to a resolution smaller than the original image resolution, if the target that the user is concerned about does not appear in the picture continuously, the lowest output resolution is adaptively selected, thereby reducing the bit rate, saving backend storage space, and saving user costs. It has a wide range of applications in scenarios with limited hardware resources such as network bandwidth and storage space. Since there is no loss of clarity such as shrinking the target image area that the user is concerned about, the monitoring quality can be guaranteed at the same time. Embodiment three:
[0094] See also Figure 5 , a video image transmission processing method provided by an embodiment of the present application specifically includes:
[0095] S501, obtaining the current frame image;
[0096] S502, performing target detection on the current frame image;
[0097] S503, determine whether the monitoring target is detected, if yes, execute step S505; otherwise, execute step S504.
[0098] That is to say, this step determines whether there is a monitoring target preset by the user on the current frame image. The monitoring targets preset by the user include, for example, pedestrians and motor vehicles.
[0099] S504: Output the current frame image at the minimum resolution.
[0100] That is, the current frame image is output to the receiving end at the minimum output resolution preset by the user.
[0101] S505, calculating the clipping area;
[0102] The determined cropping area needs to include all the monitoring targets that the user is concerned about, for example, the minimum bounding rectangle of all monitoring targets on the current frame image.
[0103] S506, matching output resolution;
[0104] For example, the output resolution matched by the current cropping area is a minimum preset output resolution that is greater than the image resolution of the current cropping area.
[0105] S507, adjusting the cropping area;
[0106] Generally, the cropping area preliminarily determined in step S505 above only needs to be determined based on the coordinates of the monitored target, so the aspect ratio of its resolution will be different from the aspect ratio of the matching preset output resolution. It is necessary to redefine the cropping area based on the preliminarily determined cropping area, for example Figure 4 shown.
[0107] S508, image cropping;
[0108] The current frame image is cropped according to the finally determined cropping area to obtain a cropping area image.
[0109] S509, enlarging the cropped area image to the output resolution;
[0110] That is, the image in the cropped area is enlarged to the preset output resolution matched in step S506.
[0111] S510: Output an image.
[0112] That is, the image in the cropped area obtained by the enlargement process in step S509 is output to the receiving end.
[0113] It can be seen that the embodiment of the present application does not reduce the resolution of the image in the cropped area, and the adjustment of the image in the cropped area will not cause image splitting and other phenomena that affect the image quality. Moreover, the output resolution size can be adjusted according to dynamic cropping of the target area, thereby minimizing the bit rate and saving storage space while ensuring the monitoring quality, thereby meeting user monitoring needs.
[0114] The following is an introduction to the equipment or device provided in the embodiments of the present application, in which the explanations or examples of technical features that are the same or corresponding to those described in the above method will not be repeated later. Embodiment 4:
[0115] An electronic device provided in an embodiment of the present application may be any monitoring device such as a camera, for example. Figure 6 , the electronic device includes, for example:
[0116] The processor 600 is used to read the program in the memory 620 and execute the following process:
[0117] Acquire a video image captured for a target scene, and perform target recognition on the video image;
[0118] When it is determined through the target recognition that a monitoring target exists in at least one frame of the video image, for each of the at least one frame of the video image in which the monitoring target exists:
[0119] Determine the coordinates of the monitoring target in the image, and determine a cropping area of the image according to the coordinates of the monitoring target in the image; wherein the cropping area includes the monitoring target in the image;
[0120] Determining, according to the cropping area, an output resolution matching the cropping area;
[0121] The image in the cropping area is output according to an output resolution matching the cropping area.
[0122] In some embodiments, determining, according to the cropping area, an output resolution matching the cropping area includes:
[0123] When the image resolution within the cropped area is less than or equal to a preset first output resolution and greater than a preset second output resolution, the first output resolution is used as an output resolution matching the cropped area, wherein the first output resolution and the second output resolution are two preset output resolutions that are closest to the image resolution within the cropped area.
[0124] In some embodiments, outputting the image within the cropping area according to an output resolution matching the cropping area includes:
[0125] The image in the cropping area is enlarged to an output resolution matching the cropping area and then outputted.
[0126] In some embodiments, before enlarging the image in the cropped area, the processor 600 is further configured to read a program in the memory 620 and perform the following process:
[0127] When the aspect ratio of the cropping area is different from the aspect ratio of the output resolution matching the cropping area, the cropping area is re-determined according to the aspect ratio of the output resolution matching the cropping area.
[0128] In some embodiments, determining a cropping area of the image according to coordinates of a surveillance target in the image includes:
[0129] When the image includes multiple monitoring targets, the coordinates of each monitoring target in the image are traversed to determine the minimum coordinate value and the maximum coordinate value;
[0130] A cropping area of the image is determined according to the minimum coordinate value and the maximum coordinate value.
[0131] In some embodiments, performing target recognition on the video image includes:
[0132] According to the user's configuration information, the video image is subjected to target recognition of one or a combination of the following targets: a person, a vehicle, and a non-motor vehicle.
[0133] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:
[0134] When it is determined through the target recognition that there is no monitoring target in the video image, the video image is output according to a preset minimum output resolution.
[0135] The transceiver 610 is configured to receive and send data under the control of the processor 600 .
[0136] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 600 and various circuits of memory represented by memory 620 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium, including wireless channels, wired channels, optical cables, and other transmission media. For different user devices, the user interface 630 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0137] The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 can store data used by the processor 600 when performing operations.
[0138] In some embodiments, the processor 600 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or a CPLD (Complex Programmable Logic Device), and the processor may also adopt a multi-core architecture.
[0139] The processor calls the computer program stored in the memory to execute any of the methods provided in the embodiments of the present application according to the obtained executable instructions. The processor and the memory can also be arranged physically separately.
[0140] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here. Embodiment five:
[0141] See also Figure 7 The embodiment of the present application provides a video output processing device, which may be any monitoring device such as a camera, or a partial device thereof, and the video output processing device includes:
[0142] The first unit 11 is used to obtain a video image collected for a target scene and perform target recognition on the video image;
[0143] The second unit 12 is configured to, when it is determined through the target recognition that a monitoring target exists in at least one frame of the video image, for each of the at least one frame of the video image containing the monitoring target:
[0144] Determine the coordinates of the monitoring target in the image, and determine a cropping area of the image according to the coordinates of the monitoring target in the image; wherein the cropping area includes the monitoring target in the image;
[0145] Determining, according to the cropping area, an output resolution matching the cropping area;
[0146] The image in the cropping area is output according to an output resolution matching the cropping area.
[0147] In some embodiments, determining, according to the cropping area, an output resolution matching the cropping area includes:
[0148] When the image resolution within the cropped area is less than or equal to a preset first output resolution and greater than a preset second output resolution, the first output resolution is used as an output resolution matching the cropped area, wherein the first output resolution and the second output resolution are two preset output resolutions that are closest to the image resolution within the cropped area.
[0149] In some embodiments, outputting the image within the cropping area according to an output resolution matching the cropping area includes:
[0150] The image in the cropping area is enlarged to an output resolution matching the cropping area and then outputted.
[0151] In some embodiments, before enlarging the image in the cropping area, the second unit 12 is further configured to:
[0152] When the aspect ratio of the cropping area is different from the aspect ratio of the output resolution matching the cropping area, the cropping area is re-determined according to the aspect ratio of the output resolution matching the cropping area.
[0153] In some embodiments, determining a cropping area of the image according to coordinates of a surveillance target in the image includes:
[0154] When the image includes multiple monitoring targets, the coordinates of each monitoring target in the image are traversed to determine the minimum coordinate value and the maximum coordinate value;
[0155] A cropping area of the image is determined according to the minimum coordinate value and the maximum coordinate value.
[0156] In some embodiments, performing target recognition on the video image includes:
[0157] According to the user's configuration information, the video image is subjected to target recognition of one or a combination of the following targets: a person, a vehicle, and a non-motor vehicle.
[0158] In some embodiments, the second unit 12 is further configured to:
[0159] When it is determined through the target recognition that there is no monitoring target in the video image, the video image is output according to a preset minimum output resolution.
[0160] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0161] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0162] Any of the devices or apparatuses provided in the embodiments of the present application may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. It may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.
[0163] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In the embodiment of the present application, the memory may be used to store the program of any of the methods provided in the embodiment of the present application.
[0164] The processor calls the program instructions stored in the memory, and the processor is used to execute any of the methods provided in the embodiments of the present application according to the obtained program instructions.
[0165] The present application embodiment also provides a computer program product or computer program, which includes a computer instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction so that the computer device performs any of the methods described in the above embodiments. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable 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.
[0166] The embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the apparatus provided in the embodiment of the present application, which includes a program for executing any of the methods provided in the embodiment of the present application. The computer-readable storage medium may be a non-transitory computer-readable medium.
[0167] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0168] It should be understood that:
[0169] The access technology through which entities in the communication network transmit traffic can be any suitable current or future technology, such as WLAN (Wireless Local Access Network), WiMAX (Worldwide Interoperability for Microwave Access), LTE, LTE-A, 5G, Bluetooth, infrared, etc.; in addition, the embodiments can also apply wired technology, for example, IP-based access technology, such as a wired network or a fixed line.
[0170] Embodiments suitable for being implemented as software code or a portion thereof and running using a processor or processing functionality are independent of the software code and may be specified using any known or future developed programming language, such as a high-level programming language such as objective-C, C, C++, C#, Java, Python, Javascript, other scripting languages, etc., or a low-level programming language such as machine language or assembler.
[0171] The implementation of the embodiments is hardware independent and may be implemented using any known or future developed hardware technology or any mixture thereof, such as a microprocessor or CPU (central processing unit), MOS (metal oxide semiconductor), CMOS (complementary MOS), BiMOS (bipolar MOS), BiCMOS (bipolar CMOS), ECL (emitter coupled logic) and / or TTL (transistor-transistor logic).
[0172] Embodiments may be implemented as separate devices, apparatuses, units, components, or functions, or in a distributed manner, for example, one or more processors or processing functions may be used or shared in a process, or one or more processing segments or processing portions may be used and shared in a process, wherein one physical processor or more than one physical processor may be used to implement one or more processing portions dedicated to a specific process as described.
[0173] The device may be implemented by a semiconductor chip, a chipset, or a (hardware) module including such a chip or chipset.
[0174] The embodiments may also be implemented as any combination of hardware and software, such as ASIC (Application Specific IC (Integrated Circuit)) components, FPGA (Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device) components or DSP (Digital Signal Processor) components.
[0175] The embodiments may also be implemented as a computer program product including a computer usable medium having computer readable program code embodied therein, the computer readable program code being adapted to perform the processes as described in the embodiments, wherein the computer usable medium may be a non-transitory medium.
[0176] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.
[0177] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0178] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0179] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0180] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A video output processing method, characterized in that: The video output processing method comprises: Acquire a video image captured for a target scene, and perform target recognition on the video image; When it is determined through the target recognition that a monitoring target exists in at least one frame of the video image, for each of the at least one frame of the video image in which the monitoring target exists: Determine the coordinates of the monitoring target in the image, and determine a cropping area of the image according to the coordinates of the monitoring target in the image; wherein the cropping area includes the monitoring target in the image; According to the cropping area, determining an output resolution matching the cropping area from a plurality of preset output resolutions; When the aspect ratio of the cropping area is different from the aspect ratio of the output resolution matching the cropping area, the cropping area is re-determined according to the aspect ratio of the output resolution matching the cropping area; and the image is cropped according to the finally determined cropping area to obtain a cropping area image; Enlarging the cropped area image to the output resolution; Outputting the enlarged cropped area image according to the output resolution; Wherein, according to the cropping area, determining an output resolution matching the cropping area from a plurality of preset output resolutions includes: When the image resolution within the cropped area is less than or equal to a preset first output resolution and greater than a preset second output resolution, the first output resolution is used as an output resolution matching the cropped area, wherein the first output resolution and the second output resolution are two preset output resolutions that are closest to the image resolution within the cropped area.
2. The video output processing method according to claim 1, characterized in that: According to the coordinates of the monitoring target in the image, the cropping area of the image is determined, including: When the image includes multiple monitoring targets, the coordinates of each monitoring target in the image are traversed to determine the minimum coordinate value and the maximum coordinate value; A cropping area of the image is determined according to the minimum coordinate value and the maximum coordinate value.
3. The video output processing method according to claim 1, characterized in that: Performing target recognition on the video image includes: According to the user's configuration information, the video image is subjected to target recognition of one or a combination of the following targets: a person, a vehicle, and a non-motor vehicle.
4. The video output processing method according to claim 1, characterized in that: The method further comprises: When it is determined through the target recognition that there is no monitoring target in the video image, the video image is output according to a preset minimum output resolution.
5. A video output processing device, characterized in that: The video output processing device comprises: The first unit is used to obtain a video image collected for a target scene and perform target recognition on the video image; The second unit is configured to, when it is determined through the target recognition that a monitoring target exists in at least one frame of the video image, for each of the at least one frame of the video image in which the monitoring target exists: Determine the coordinates of the monitoring target in the image, and determine a cropping area of the image according to the coordinates of the monitoring target in the image; wherein the cropping area includes the monitoring target in the image; According to the cropping area, determining an output resolution matching the cropping area from a plurality of preset output resolutions; When the aspect ratio of the cropping area is different from the aspect ratio of the output resolution matching the cropping area, the cropping area is re-determined according to the aspect ratio of the output resolution matching the cropping area; and the image is cropped according to the finally determined cropping area to obtain a cropping area image; Enlarging the cropped area image to the output resolution; Outputting the enlarged cropped area image according to the output resolution; Wherein, according to the cropping area, determining an output resolution matching the cropping area from a plurality of preset output resolutions includes: When the image resolution within the cropped area is less than or equal to a preset first output resolution and greater than a preset second output resolution, the first output resolution is used as an output resolution matching the cropped area, wherein the first output resolution and the second output resolution are two preset output resolutions that are closest to the image resolution within the cropped area.
6. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory and execute the video output processing method according to any one of claims 1 to 4 according to the obtained program.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the video output processing method according to any one of claims 1 to 4.
