Automatic view finding method and device of image acquisition device, equipment and medium
By cropping and moving the original image of the image acquisition device in batches, combined with the two-stage nonlinear acceleration and deceleration curve, the problem of the abrupt speed of the existing automatic viewing function when starting and stopping is solved, the smoothness and softness of image movement are achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202311761290.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-06-20
AI Technical Summary
The existing automatic viewing function suddenly changes in speed during startup and stop, resulting in poor image movement and poor user experience.
By cropping and moving the original image in batches, the preset two-stage nonlinear acceleration and deceleration curve is used to gradually adjust the crop distance and speed to ensure the smoothness of the image movement process.
It realizes smoothness and softness of image movement and improves the user experience of automatic viewing function.
Smart Images

Figure CN120182289A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to an automatic framing method, device, equipment and medium for an image acquisition device. Background Art
[0002] The automatic framing function is very important in current intelligent cameras. Especially when remote meetings are very common, without manual focusing, it can automatically pull the participants in the field of view to the center of the field of view, lock the participants, and can also automatically adjust the coordinates of the people in the video according to the movement of the participants' positions and the increase or decrease in the number of participants, and perform operations such as translation and zoom after framing to ensure that the participants are always located in the center of the field of view and have a reasonable zoom ratio.
[0003] To achieve the above functions, currently, a non-optical zoom lens can be used, but this lens cannot expand or shrink the field of view. Therefore, it is necessary to perform cropping, scaling, and translation based on the coordinates of the participants in the fixed field of view to achieve the locking of the participants.
[0004] In related solutions, the automatic framing function of the non-optical zoom lens is achieved based on a uniform speed planning method. However, in this solution, the speed will immediately plan from 0 to Vm (the maximum value) at startup, and the speed will immediately drop from Vm to 0 at stop. Therefore, it is rather abrupt at the startup and stop moments and has poor flexibility. Summary of the Invention
[0005] The present invention provides an automatic framing method, device, equipment and medium for an image acquisition device. By performing sub-cropping and moving on the original image, on the basis of realizing the automatic framing function of the image acquisition device, the smoothness during the image movement can be ensured, making the image movement softer.
[0006] According to one aspect of the present invention, an automatic framing method for an image acquisition device is provided, and the method includes:
[0007] Obtain the original image collected by the image acquisition device, and determine the position information of the cropping area according to the original image;
[0008] Determine the total horizontal cropping distance and the total vertical cropping distance according to the position information of the cropping area;
[0009] Determine the single horizontal cropping distance and the single vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance and the size parameters of the original image;
[0010] Perform sub-cropping on the original image according to the single horizontal cropping distance and the single vertical cropping distance, and perform enlarged movement display on the cropped image based on the original image until the cropping is completed after each cropping.
[0011] According to another aspect of the present invention, an automatic framing device for an image acquisition device is provided, including:
[0012] A cropping area position determination module, configured to obtain an original image acquired by the image acquisition device and determine position information of a cropping area according to the original image;
[0013] A total cropping distance determination module, configured to determine a total horizontal cropping distance and a total vertical cropping distance according to the position information of the cropping area;
[0014] A single - time cropping distance determination module, configured to determine a single - time horizontal cropping distance and a single - time vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and size parameters of the original image;
[0015] An image cropping and display module, configured to perform sub - cropping on the original image according to the single - time horizontal cropping distance and the single - time vertical cropping distance, and perform enlarged movement display on the cropped image based on the original image after each cropping until the cropping is completed.
[0016] According to another aspect of the present invention, an electronic device is provided, and the electronic device includes:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the automatic framing method of the image acquisition device according to any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer - readable storage medium is provided, and the computer - readable storage medium stores computer instructions, and when the computer instructions are used by a processor, the automatic framing method of the image acquisition device according to any embodiment of the present invention is implemented.
[0021] In the technical solution of the embodiment of the present invention, the original image collected by the image acquisition device is obtained, and the position information of the cropping area is determined according to the original image; the total horizontal cropping distance and the total vertical cropping distance are determined according to the position information of the cropping area; the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping are determined according to the total horizontal cropping distance, the total vertical cropping distance and the size parameters of the original image; the original image is cropped in multiple times according to the single - time horizontal cropping distance and the single - time vertical cropping distance, and after each cropping is completed, the cropped image is enlarged and moved for display based on the original image until the cropping is completed. In this technical solution, by cropping and moving the original image in multiple times, on the basis of realizing the automatic framing function of the image acquisition device, the smoothness during the image movement can be ensured, making the image movement more gentle.
[0022] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0024] Figure 1 is a flowchart of an automatic framing method for an image acquisition device provided in Embodiment 1 of the present invention;
[0025] Figure 2A is a schematic diagram of a human - shaped area provided in Embodiment 1 of the present invention;
[0026] Figure 2B is another schematic diagram of a human - shaped area provided in Embodiment 1 of the present invention;
[0027] Figure 3 is a schematic diagram of a cropping area provided in Embodiment 1 of the present invention;
[0028] Figure 4 is a schematic diagram of determining the total cropping distance provided in Embodiment 1 of the present invention;
[0029] Figure 5 is a schematic diagram of a preset cropping speed curve provided in Embodiment 1 of the present invention;
[0030] Figure 6 is a schematic diagram of cropping the original image in multiple times provided in Embodiment 1 of the present invention;
[0031] Figure 7 is a schematic diagram of the process of translating an original image according to Embodiment 1 of the present invention;
[0032] Figure 8 is a flowchart of an automatic framing method for an image acquisition device according to Embodiment 2 of the present invention;
[0033] Figure 9 is a schematic structural diagram of an automatic framing device for an image acquisition device according to Embodiment 3 of the present invention;
[0034] Figure 10 is a schematic structural diagram of an electronic device for implementing the automatic framing method of an image acquisition device according to an embodiment of the present invention. Detailed implementation manners
[0035] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0036] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0037] Embodiment 1
[0038] Figure 1 is a flowchart of an automatic framing method for an image acquisition device provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of performing sub - cropping and moving on an original image to implement the automatic framing function. This method can be executed by the automatic framing device of the image acquisition device. The automatic framing device of the image acquisition device can be implemented in the form of hardware and / or software, and the automatic framing device of the image acquisition device can be configured in an electronic device with data - processing capabilities. AsFigure 1 As shown, the method includes:
[0039] S110, obtaining the original image collected by the image acquisition device, and determining the position information of the cropping area according to the original image.
[0040] Among them, the image acquisition device may refer to a device capable of collecting images, such as an intelligent camera or a video camera, etc. The original image may refer to the image collected by the image acquisition device. The cropping area may refer to the image area in the original image that contains the region of interest. Among them, the region of interest may be a human-shaped area (including a person's shoulders and head) or other areas of objects of interest, which can be specifically set according to actual application requirements.
[0041] In this embodiment, first, the original image collected by the image acquisition device is obtained, and then the position information of the cropping area is determined according to the original image. Optionally, determining the position information of the cropping area according to the original image includes: determining the position information of the region of interest in the original image according to the region of interest feature information; determining the position information of the cropping area according to the size parameters of the original image and the position information of the region of interest.
[0042] In this embodiment, when determining the position information of the cropping area, the position information of the region of interest in the original image can be first determined according to the region of interest feature information, that is, determining where the region of interest is located in the original image. Exemplarily, taking the region of interest as a human-shaped area as an example, human detection can be performed on the original image according to human features (such as contour features and part features, etc.) to obtain the human-shaped area. Among them, the human-shaped area can be divided into a single-person area and a multi-person area. If it is a single-person area (as Figure 2A shown), the area framed by the top-left coordinates Top(x, y) and the bottom-right coordinates Bot(x, y) of the attendee 1 can be used as the human-shaped area; if it is a multi-person area (as Figure 2B shown), the area framed by the outer coordinates Top1(x, y) and Bot1(x, y) of multiple attendees (attendee 1 and attendee 2) can be used as the human-shaped area. Thus, the position information of the human-shaped area in the original image can be determined according to the coordinate information.
[0043] After determining the position information of the region of interest in the original image, the position information of the cropping region can be determined according to the size parameters of the original image and the position information of the region of interest. Among them, the size parameters may include the width and height of the image, the image resolution, etc. Exemplarily, the cropping region needs to meet the following two conditions: 1. The aspect ratio of the cropping region is equal to the aspect ratio of the original image; 2. The center of the cropping region coincides with the center of the region of interest. If the center cannot coincide due to the region of interest being located at the edge of the original image, the center distance between the two can be maintained within a preset distance threshold (such as half of the width of the cropping region). After determining the cropping region according to the above two conditions, the position information of the cropping region in the original image can be determined based on the position coordinates of the cropping region. Figure 3 is a schematic diagram of a cropping region provided in Embodiment 1 of the present invention. As Figure 3 shown, taking the face detection region as the region of interest, the aspect ratio of the cropping region is the same as that of the original image, and the center of the cropping region coincides with the center of the face detection region.
[0044] S120, determine the total horizontal cropping distance and the total vertical cropping distance according to the position information of the cropping region.
[0045] Among them, the total horizontal cropping distance and the total vertical cropping distance can respectively refer to the total distances that need to be cropped in the horizontal direction and the vertical direction. Specifically, the total horizontal cropping distance is equal to the sum of the left horizontal cropping margin and the right horizontal cropping margin, and the total vertical cropping distance is equal to the sum of the upper vertical cropping margin and the lower vertical cropping margin. Among them, the left horizontal cropping margin and the right horizontal cropping margin can respectively refer to the distance between the left boundary of the cropping region and the left boundary of the original image and the distance between the right boundary of the cropping region and the right boundary of the original image. The upper vertical cropping margin and the lower vertical cropping margin can respectively refer to the distance between the upper boundary of the cropping region and the upper boundary of the original image and the distance between the lower boundary of the cropping region and the lower boundary of the original image.
[0046] Figure 4 is a schematic diagram of determining the total cropping distance provided in Embodiment 1 of the present invention. As Figure 4 shown, L and R respectively represent the left horizontal cropping margin and the right horizontal cropping margin, and T and B respectively represent the upper vertical cropping margin and the lower vertical cropping margin. Therefore, the total horizontal cropping distance can be expressed as L + R, and the total vertical cropping distance can be expressed as T + B.
[0047] In this embodiment, after determining the position information of the cropping area, the total horizontal cropping distance and the total vertical cropping distance can be determined according to the position information of the cropping area. Optionally, determining the total horizontal cropping distance and the total vertical cropping distance according to the position information of the cropping area includes: determining the left horizontal cropping margin, the right horizontal cropping margin, the upper vertical cropping margin, and the lower vertical cropping margin according to the position information of the cropping area; determining the total horizontal cropping distance according to the left horizontal cropping margin and the right horizontal cropping margin, and determining the total vertical cropping distance according to the upper vertical cropping margin and the lower vertical cropping margin.
[0048] In this embodiment, the total horizontal cropping distance and the total vertical cropping distance can be determined based on the vertex coordinate differences between the original image and the cropping area. Exemplarily, first, determine the diagonal vertex coordinates of the cropping area according to the position information of the cropping area, such as the upper left corner vertex coordinates and the lower right corner vertex coordinates, and determine the vertex coordinate differences between the original image and the upper left corner vertex coordinates and the lower right corner vertex coordinates of the cropping area. Among them, the vertex coordinate differences can include the horizontal and vertical vertex coordinate differences. Then, determine the left horizontal cropping margin and the upper vertical cropping margin respectively according to the horizontal and vertical vertex coordinate differences in the upper left corner vertex coordinate differences, and determine the right horizontal cropping margin and the lower vertical cropping margin respectively according to the horizontal and vertical vertex coordinate differences in the lower right corner vertex coordinate differences. Furthermore, the total horizontal cropping distance can be determined according to the sum of the left horizontal cropping margin and the right horizontal cropping margin, and the total vertical cropping distance can be determined according to the sum of the upper vertical cropping margin and the lower vertical cropping margin.
[0049] In addition, the total horizontal cropping distance and the total vertical cropping distance can also be determined according to the vertex coordinate differences between the upper right corner of the original image and the lower left corner of the cropping area. Specifically, the above implementation process can be referred to. The difference is that the right horizontal cropping margin and the upper vertical cropping margin are determined respectively according to the horizontal and vertical vertex coordinate differences in the upper right corner vertex coordinate differences, and the left horizontal cropping margin and the lower vertical cropping margin are determined respectively according to the horizontal and vertical vertex coordinate differences in the lower left corner vertex coordinate differences.
[0050] Through such settings in this solution, the total horizontal cropping distance and the total vertical cropping distance can be quickly determined based on the position information of the cropping area.
[0051] S130. Determine the single horizontal cropping distance and the single vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and the size parameters of the original image.
[0052] In this embodiment, after determining the total horizontal cropping distance and the total vertical cropping distance, the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping can be determined based on a preset single - time cropping distance parameter or a cropping speed curve, according to the total horizontal cropping distance, the total vertical cropping distance, and the size parameters of the original image. Among them, the single - time cropping distance parameter can be preset according to the actual application scenario combined with cropping experience, and specifically can include the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping. The cropping speed curve can be used to describe the changing trend of the cropping speed with the cropping time. Based on the preset cropping speed curve, the total horizontal cropping distance or the total vertical cropping distance is distributed according to the number of croppings, and according to the speed distribution result, the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping can be determined.
[0053] In this embodiment, optionally, determining the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and the size parameters of the original image includes: determining the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping based on the preset cropping speed curve, according to the total horizontal cropping distance, the total vertical cropping distance, and the size parameters of the original image.
[0054] Among them, the preset cropping speed curve can be a non - linear acceleration curve, a non - linear deceleration curve, or a two - stage non - linear acceleration - deceleration curve. Determining the horizontal and vertical distances of each cropping according to the non - linear speed curve is beneficial to improving the smoothness of the image movement process and avoiding the abrupt feeling brought to the user's vision by uniform cropping. In the embodiments of the present invention, the preset cropping speed curve is described by taking the two - stage non - linear acceleration - deceleration curve as an example.
[0055] Figure 5 FIG. is a schematic diagram of a preset cropping speed curve provided in Embodiment 1 of the present invention. As Figure 5 shown, the abscissa of the preset cropping speed curve is time (each time unit can be set to 10 ms), and the ordinate is the speed. Assuming that the entire translation and cropping process is completed in 10 times, L0 - L9 respectively represent the total pixel distances moved in the horizontal direction (i.e., the single - time horizontal cropping distance) or the total pixel distances moved in the vertical direction (i.e., the single - time vertical cropping distance) during the first to the tenth cropping. Among them, the preset cropping speed curve is a non - linear curve and includes two segments of acceleration and deceleration curves (i.e., two - stage).
[0056] In this embodiment, optionally, based on a preset cropping speed curve, the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping are determined according to the total horizontal cropping distance, the total vertical cropping distance, and the size parameters of the original image, including: determining the aspect ratio according to the size parameters of the original image, and determining the width ratio parameter and the height ratio parameter according to the aspect ratio; determining the comparison result of the ratio between the horizontal ratio of the total horizontal cropping distance and the width ratio parameter and the vertical ratio of the total vertical cropping distance and the height ratio parameter; if the horizontal ratio is greater than or equal to the vertical ratio, determining the single - time horizontal cropping distance corresponding to each cropping according to the preset cropping speed curve and the total horizontal cropping distance, and determining the single - time vertical cropping distance corresponding to each cropping according to the single - time horizontal cropping distance corresponding to each cropping and the aspect ratio; otherwise, determining the single - time vertical cropping distance corresponding to each cropping according to the preset cropping speed curve and the total vertical cropping distance, and determining the single - time horizontal cropping distance corresponding to each cropping according to the single - time vertical cropping distance corresponding to each cropping and the aspect ratio.
[0057] Specifically, first, determine the aspect ratio according to the resolution information of the original image, and determine the width ratio parameter and the height ratio parameter according to the aspect ratio. Exemplarily, assume that the resolution of the original image is 1920*1080, then the aspect ratio can be determined to be 16:9, and the width ratio parameter is determined to be 16 and the height ratio parameter is determined to be 9. Then determine the horizontal ratio of the total horizontal cropping distance and the width ratio parameter, and the vertical ratio of the total vertical cropping distance and the height ratio parameter. Exemplarily, assume that the total horizontal cropping distance and the total vertical cropping distance are respectively represented as L + R and T + B, and the width ratio parameter and the height ratio parameter are respectively represented as w and h, then the horizontal ratio can be determined to be (L + R) / w, and the vertical ratio is (T + B) / h. Furthermore, the horizontal ratio and the vertical ratio can be compared in size, and the single - time horizontal cropping distance corresponding to each cropping is determined according to the comparison result.
[0058] Based on the above example, if (L + R) / w≥(T + B) / h, then the speed of L + R can be distributed according to the number of croppings according to the preset cropping speed curve, so as to determine the single - time horizontal cropping distance corresponding to each cropping, and determine the single - time vertical cropping distance corresponding to each cropping according to the single - time horizontal cropping distance corresponding to each cropping and the aspect ratio. Optionally, the single - time vertical cropping distance corresponding to each cropping is determined based on the following formula: Y i =(X i *h) / w; where, Y i represents the single - time vertical cropping distance corresponding to the i - th cropping, X i represents the single - time horizontal cropping distance corresponding to the i - th cropping, w represents the width ratio parameter, and h represents the height ratio parameter.
[0059] Based on the above example, if (L + R) / w < (T + B) / h, the speed of T + B can be allocated according to the preset cropping speed curve according to the number of cropping times, so as to determine the single vertical cropping distance corresponding to each cropping, and determine the single horizontal cropping distance corresponding to each cropping according to the single vertical cropping distance and aspect ratio corresponding to each cropping. Optionally, the single horizontal cropping distance corresponding to each cropping is determined based on the following formula: X i = (Y i * w) / h; where Y i represents the single vertical cropping distance corresponding to the i-th cropping, and X i represents the single horizontal cropping distance corresponding to the i-th cropping, w represents the width ratio parameter, and h represents the height ratio parameter.
[0060] This solution uses a two-segment non-linear acceleration and deceleration curve to perform sub-cropping and moving on the original image. On the basis of realizing the automatic framing function of the image acquisition device, it can ensure the smoothness of the image movement process and make the image movement softer.
[0061] S140. Perform sub-cropping on the original image according to the single horizontal cropping distance and the single vertical cropping distance, and perform enlarged movement display on the cropped image based on the original image until the cropping is completed after each cropping.
[0062] Among them, the single horizontal cropping distance is equal to the sum of the single horizontal cropping left margin and the single horizontal cropping right margin, and the single vertical cropping distance is equal to the sum of the single vertical cropping upper margin and the single vertical cropping lower margin.
[0063] In this embodiment, after determining the single horizontal cropping distance and the single vertical cropping distance, the original image can be sub-cropped according to the single horizontal cropping distance and the single vertical cropping distance. Optionally, sub-cropping the original image according to the single horizontal cropping distance and the single vertical cropping distance includes: determining the single horizontal cropping left margin, the single horizontal cropping right margin, the single vertical cropping upper margin, and the single vertical cropping lower margin according to the horizontal cropping left margin, the horizontal cropping right margin, the vertical cropping upper margin, the vertical cropping lower margin, the single horizontal cropping distance, and the single vertical cropping distance; performing sub-cropping on the original image according to the single horizontal cropping left margin, the single horizontal cropping right margin, the single vertical cropping upper margin, and the single vertical cropping lower margin.
[0064] Exemplarily, the single horizontal cropping distance can be proportionally allocated according to the proportional relationship between the left horizontal cropping margin and the right horizontal cropping margin, and the single left horizontal cropping margin and the single right horizontal cropping margin can be determined according to the proportional allocation result. Similarly, the single vertical cropping distance can be proportionally allocated according to the proportional relationship between the top vertical cropping margin and the bottom vertical cropping margin, and the single top vertical cropping margin and the single bottom vertical cropping margin can be determined according to the proportional allocation result.
[0065] Figure 6 FIG. 4 is a schematic diagram of performing multiple croppings on an original image provided in the first embodiment of the present invention.
[0066] Among them, the cropping area is finally obtained after 10 croppings on the original image. As Figure 6 shown, assuming that the horizontal margins are planned, in the first cropping, taking the original image as a reference, the single horizontal cropping distance is X0, the single vertical cropping distance is Y0 = (X0*h) / w, the single left horizontal cropping margin is X00 = (X0*L) / (L+R), the single right horizontal cropping margin is X01 = (X0*R) / (L+R), the single top vertical cropping margin is Y00 = (Y0*T) / (T+B), and the single bottom vertical cropping margin is Y01 = (Y0*B) / (T+B). In the second cropping, taking the image after the first cropping as a reference, the single horizontal cropping distance is X1, the single vertical cropping distance is Y1 = (X1*h) / w, the single left horizontal cropping margin is X10 = (X1*L) / (L+R), the single right horizontal cropping margin is X11 = (X1*R) / (L+R), the single top vertical cropping margin is Y10 = (Y1*T) / (T+B), and the single bottom vertical cropping margin is Y11 = (Y1*B) / (T+B). Taking the image after the second cropping as the reference for the third cropping, the third cropping is performed based on the single left horizontal cropping margin X20, the single right horizontal cropping margin X21, the single top vertical cropping margin Y20, and the single bottom vertical cropping margin Y21, and so on until the tenth cropping is completed and the entire cropping process ends. Among them, X90 represents the single left horizontal cropping margin corresponding to the tenth cropping.
[0067] After each cropping is completed, the cropped image is enlarged and moved for display based on the original image until the cropping is completed. Optionally, after each cropping is completed, enlarging and moving the cropped image for display based on the original image includes: after each cropping is completed, enlarging and moving the cropped image for display based on the original image, and performing the next image cropping based on the current cropped image position information and the single horizontal cropping distance and the single vertical cropping distance corresponding to the next cropping.
[0068] In this embodiment, after each cropping is completed, the cropped image needs to be enlarged proportionally according to the size of the original image, and the proportionally enlarged cropped image is moved to the center of the field of view of the image acquisition device for display. It should be noted that image display and image cropping are independent of each other. Among them, the next image cropping is performed based on the current cropped image position information and the single horizontal cropping distance and single vertical cropping distance corresponding to the next cropping. Figure 7 It is a schematic diagram of the translation process of the original image provided in Embodiment 1 of the present invention. As Figure 7 shown, through three croppings and movements, the region of interest (the humanoid region of Participant 1) can finally be moved from the right side of the original image to the center of the field of view of the image acquisition device for enlarged display. Among them, the size of the cropped image for display is the same as that of the original image.
[0069] The technical solution of the embodiment of the present invention is to obtain the original image collected by the image acquisition device, determine the position information of the cropping area according to the original image; determine the total horizontal cropping distance and the total vertical cropping distance according to the position information of the cropping area; determine the single horizontal cropping distance and the single vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance and the size parameters of the original image; perform sub - cropping on the original image according to the single horizontal cropping distance and the single vertical cropping distance, and perform enlarged movement display on the cropped image based on the original image after each cropping until the cropping is completed. This technical solution can ensure the smoothness of the image movement during the image movement process and make the image movement softer while realizing the automatic framing function of the image acquisition device by performing sub - cropping and movement on the original image.
[0070] Embodiment 2
[0071] Figure 8 It is a flowchart of an automatic framing method for an image acquisition device provided in Embodiment 2 of the present invention. This embodiment is optimized based on the above - mentioned embodiment.
[0072] As Figure 8 shown, the method of this embodiment specifically includes the following steps:
[0073] S210, obtain the original image collected by the image acquisition device, and determine the position information of the region of interest in the original image according to the region - of - interest feature information.
[0074] S220, determine the position information of the cropping area according to the size parameters of the original image and the position information of the region of interest.
[0075] S230, determine the left horizontal cropping margin, the right horizontal cropping margin, the upper vertical cropping margin and the lower vertical cropping margin according to the position information of the cropping area.
[0076] S240. Determine the total horizontal cropping distance according to the left horizontal cropping margin and the right horizontal cropping margin, and determine the total vertical cropping distance according to the upper vertical cropping margin and the lower vertical cropping margin.
[0077] S250. Based on a preset cropping speed curve, determine the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and the size parameters of the original image.
[0078] Among them, the preset cropping speed curve is a two - stage non - linear acceleration - deceleration curve.
[0079] S260. Determine the single - time left horizontal cropping margin, the single - time right horizontal cropping margin, the single - time upper vertical cropping margin, and the single - time lower vertical cropping margin according to the left horizontal cropping margin, the right horizontal cropping margin, the upper vertical cropping margin, the lower vertical cropping margin, the single - time horizontal cropping distance, and the single - time vertical cropping distance.
[0080] S270. Crop the original image in multiple times according to the single - time left horizontal cropping margin, the single - time right horizontal cropping margin, the single - time upper vertical cropping margin, and the single - time lower vertical cropping margin.
[0081] S280. After each cropping is completed, perform enlarged movement display on the cropped image based on the original image, and perform the next image cropping until the cropping is completed based on the current cropped image position information and the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to the next cropping.
[0082] The technical solution of the embodiment of the present invention performs multiple - time cropping and movement on the original image based on a two - stage non - linear acceleration - deceleration curve. On the basis of realizing the automatic framing function of the image acquisition device, it can ensure the smoothness of the image movement process and make the image movement softer. In addition, by adopting a combined method of multiple - time cropping, enlargement, and movement for the original image, it can achieve the centering and approaching of the region of interest in automatic framing, thus simulating the optical zoom process.
[0083] Embodiment III
[0084] Figure 9 It is a schematic structural diagram of an automatic framing device of an image acquisition device provided in Embodiment III of the present invention. This device can execute the automatic framing method of the image acquisition device provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. As Figure 9 shown, the device includes:
[0085] A cropping area position determination module 310, configured to obtain the original image collected by the image acquisition device and determine the position information of the cropping area according to the original image;
[0086] A cropping total distance determination module 320, configured to determine a horizontal cropping total distance and a vertical cropping total distance according to the position information of the cropping area;
[0087] A single - cropping distance determination module 330, configured to determine a single - horizontal cropping distance and a single - vertical cropping distance corresponding to each cropping according to the horizontal cropping total distance, the vertical cropping total distance, and the size parameters of the original image;
[0088] An image cropping and display module 340, configured to perform sub - cropping on the original image according to the single - horizontal cropping distance and the single - vertical cropping distance, and perform enlarged movement display on the cropped image based on the original image after each cropping until the cropping is completed.
[0089] Optionally, the single - cropping distance determination module 330 includes:
[0090] A single - cropping distance determination unit, configured to determine a single - horizontal cropping distance and a single - vertical cropping distance corresponding to each cropping based on a preset cropping speed curve according to the horizontal cropping total distance, the vertical cropping total distance, and the size parameters of the original image;
[0091] Wherein, the preset cropping speed curve is a two - segment non - linear acceleration - deceleration curve.
[0092] Optionally, the single - cropping distance determination unit includes:
[0093] An aspect - ratio parameter determination sub - unit, configured to determine an aspect ratio according to the size parameters of the original image, and determine a width - ratio parameter and a height - ratio parameter according to the aspect ratio;
[0094] A ratio - size comparison sub - unit, configured to determine a comparison result of the ratio of the horizontal ratio of the horizontal cropping total distance and the width - ratio parameter to the vertical ratio of the vertical cropping total distance and the height - ratio parameter;
[0095] A first single - cropping distance determination sub - unit, configured to, if the horizontal ratio is greater than or equal to the vertical ratio, determine a single - horizontal cropping distance corresponding to each cropping according to the preset cropping speed curve and the horizontal cropping total distance, and determine a single - vertical cropping distance corresponding to each cropping according to the single - horizontal cropping distance corresponding to each cropping and the aspect ratio;
[0096] A second single - cropping distance determination sub - unit, configured to, otherwise, determine a single - vertical cropping distance corresponding to each cropping according to the preset cropping speed curve and the vertical cropping total distance, and determine a single - horizontal cropping distance corresponding to each cropping according to the single - vertical cropping distance corresponding to each cropping and the aspect ratio.
[0097] Optionally, the first single - cut distance determination subunit and the second single - cut distance determination subunit are specifically configured to:
[0098] If the horizontal ratio is greater than or equal to the vertical ratio, determine the single - vertical cut distance corresponding to each cut based on the following formula:
[0099] Y i =(X i *h) / w;
[0100] Otherwise, determine the single - horizontal cut distance corresponding to each cut based on the following formula:
[0101] X i =(Y i *w) / h;
[0102] Wherein, Y i represents the single - vertical cut distance corresponding to the i - th cut, X i represents the single - horizontal cut distance corresponding to the i - th cut, w represents the width ratio parameter, and h represents the height ratio parameter.
[0103] Optionally, the total cut distance determination module 320 is configured to:
[0104] Determine the horizontal cut left margin, horizontal cut right margin, vertical cut upper margin, and vertical cut lower margin according to the position information of the cut area;
[0105] Determine the total horizontal cut distance according to the horizontal cut left margin and the horizontal cut right margin, and determine the total vertical cut distance according to the vertical cut upper margin and the vertical cut lower margin;
[0106] Correspondingly, the image cut - display module 340 is configured to:
[0107] Before performing multiple - cut on the original image according to the single - horizontal cut distance and single - vertical cut distance, determine the single - horizontal cut left margin, single - horizontal cut right margin, single - vertical cut upper margin, and single - vertical cut lower margin according to the horizontal cut left margin, horizontal cut right margin, vertical cut upper margin, vertical cut lower margin, as well as the single - horizontal cut distance and single - vertical cut distance;
[0108] Perform multiple - cut on the original image according to the single - horizontal cut left margin, single - horizontal cut right margin, single - vertical cut upper margin, and single - vertical cut lower margin.
[0109] Optionally, the image cut - display module 340 is further configured to:
[0110] After each cropping is completed, the cropped image is enlarged and moved for display based on the original image, and the next image cropping is performed based on the current cropped image position information and the single - time horizontal cropping distance and single - time vertical cropping distance corresponding to the next cropping.
[0111] Optionally, the cropping area position determination module 310 is configured to:
[0112] Determine the position information of the region of interest in the original image according to the region - of - interest feature information;
[0113] Determine the position information of the cropping area according to the size parameters of the original image and the position information of the region of interest.
[0114] The automatic framing device of an image acquisition device provided by an embodiment of the present invention can execute the automatic framing method of an image acquisition device provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0115] Embodiment Four
[0116] Figure 10 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0117] As Figure 10 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to at least one processor 11, such as a read - only memory (ROM) 12, a random - access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read - only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random - access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0118] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0119] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the automatic framing method of the image acquisition device.
[0120] In some embodiments, the automatic framing method of the image acquisition device can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the automatic framing method of the image acquisition device described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the automatic framing method of the image acquisition device in any other suitable manner (e.g., by means of firmware).
[0121] The various embodiments of the systems and technologies described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, and the programmable processor can be a special or general programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0122] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0123] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0125] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0126] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact via a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0127] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0128] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An automatic framing method for an image acquisition device, characterized in that, The method includes: Obtaining an original image collected by an image acquisition device, and determining position information of a cropping area according to the original image; Determining a total horizontal cropping distance and a total vertical cropping distance according to the position information of the cropping area; Determining a single horizontal cropping distance and a single vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and size parameters of the original image; Performing sub - cropping on the original image according to the single horizontal cropping distance and the single vertical cropping distance, and performing enlarged movement display on the cropped image based on the original image after each cropping until the cropping is completed.
2. The method according to claim 1, characterized in that, Determining a single horizontal cropping distance and a single vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and size parameters of the original image, includes: Based on a preset cropping speed curve, determining a single horizontal cropping distance and a single vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and size parameters of the original image; Wherein, the preset cropping speed curve is a two - stage non - linear acceleration - deceleration curve.
3. The method according to claim 2, characterized in that, Based on a preset cropping speed curve, determining a single horizontal cropping distance and a single vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and size parameters of the original image, includes: Determining an aspect ratio according to the size parameters of the original image, and determining a width ratio parameter and a height ratio parameter according to the aspect ratio; Determining a comparison result of the ratio between the horizontal ratio of the total horizontal cropping distance and the width ratio parameter and the vertical ratio of the total vertical cropping distance and the height ratio parameter; If the horizontal ratio is greater than or equal to the vertical ratio, determining a single horizontal cropping distance corresponding to each cropping according to the preset cropping speed curve and the total horizontal cropping distance, and determining a single vertical cropping distance corresponding to each cropping according to the single horizontal cropping distance corresponding to each cropping and the aspect ratio; Otherwise, determining a single vertical cropping distance corresponding to each cropping according to the preset cropping speed curve and the total vertical cropping distance, and determining a single horizontal cropping distance corresponding to each cropping according to the single vertical cropping distance corresponding to each cropping and the aspect ratio.
4. The method according to claim 3, characterized in that, If the horizontal ratio is greater than or equal to the vertical ratio, determining a single vertical cropping distance corresponding to each cropping according to the single horizontal cropping distance corresponding to each cropping and the aspect ratio; Otherwise, determining a single horizontal cropping distance corresponding to each cropping according to the single vertical cropping distance corresponding to each cropping and the aspect ratio, includes: If the horizontal ratio is greater than or equal to the vertical ratio, then determining a single vertical cropping distance corresponding to each cropping based on the following formula: Y i = (X i * h) / w; Otherwise, determining a single horizontal cropping distance corresponding to each cropping based on the following formula: X i = (Y i * w) / h; Among them, Y i represents the single vertical cutting distance corresponding to the i-th cutting, and X i represents the single horizontal cutting distance corresponding to the i-th cutting, w represents the width ratio parameter, and h represents the height ratio parameter.
5. The method according to claim 1, characterized in that, Determining a total horizontal cropping distance and a total vertical cropping distance according to the position information of the cropping area, includes: Determining a left horizontal cropping margin, a right horizontal cropping margin, an upper vertical cropping margin, and a lower vertical cropping margin according to the position information of the cropping area; Determine the total horizontal cropping distance based on the left horizontal cropping margin and the right horizontal cropping margin, and determine the total vertical cropping distance based on the top vertical cropping margin and the bottom vertical cropping margin; Correspondingly, perform sub - cropping on the original image according to the single - time horizontal cropping distance and the single - time vertical cropping distance, including: Determine the single - time left horizontal cropping margin, the single - time right horizontal cropping margin, the single - time top vertical cropping margin, and the single - time bottom vertical cropping margin according to the left horizontal cropping margin, the right horizontal cropping margin, the top vertical cropping margin, the bottom vertical cropping margin, the single - time horizontal cropping distance, and the single - time vertical cropping distance; Perform sub - cropping on the original image according to the single - time left horizontal cropping margin, the single - time right horizontal cropping margin, the single - time top vertical cropping margin, and the single - time bottom vertical cropping margin.
6. The method according to claim 1, characterized in that, After each cropping, perform enlarged and shifted display on the cropped image based on the original image, including: After each cropping, perform enlarged and shifted display on the cropped image based on the original image, and perform the next image cropping based on the position information of the currently cropped image and the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to the next cropping.
7. The method according to claim 1, characterized in that, Determine the position information of the cropping area according to the original image, including: Determine the position information of the region of interest in the original image according to the region - of - interest feature information; Determine the position information of the cropping area according to the size parameters of the original image and the position information of the region of interest.
8. An automatic framing device for an image acquisition device, characterized in that, The device includes: A cropping area position determination module, configured to obtain the original image collected by an image acquisition device and determine the position information of the cropping area according to the original image; A total cropping distance determination module, configured to determine the total horizontal cropping distance and the total vertical cropping distance according to the position information of the cropping area; A single - time cropping distance determination module, configured to determine the single - time horizontal cropping distance and the single - time vertical cropping distance corresponding to each cropping according to the total horizontal cropping distance, the total vertical cropping distance, and the size parameters of the original image; An image cropping and display module, configured to perform sub - cropping on the original image according to the single - time horizontal cropping distance and the single - time vertical cropping distance, and perform enlarged and shifted display on the cropped image based on the original image after each cropping until the cropping is completed.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the automatic framing method of the image acquisition device according to any one of claims 1 - 7.
10. A computer-readable storage medium, characterized in that, The computer - readable storage medium stores computer instructions, and the computer instructions are used to enable the processor to implement the automatic framing method of the image acquisition device according to any one of claims 1 - 7 when executed.