CN111405182A - Video editing method for adjusting lens proportion - Google Patents
Video editing method for adjusting lens proportion Download PDFInfo
- Publication number
- CN111405182A CN111405182A CN202010222240.1A CN202010222240A CN111405182A CN 111405182 A CN111405182 A CN 111405182A CN 202010222240 A CN202010222240 A CN 202010222240A CN 111405182 A CN111405182 A CN 111405182A
- Authority
- CN
- China
- Prior art keywords
- ratio
- proportion
- shots
- lens
- video
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/64—Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
Abstract
The invention discloses a video editing method for adjusting the proportion of a lens. The method specifically comprises the following steps: (1) after a user selects N pictures or video shots from a media library, acquiring the width w and the height h of all the shots, wherein the ratio of width to height is w/h; (2) prefabricating N proportion schemes; (3) acquiring a plurality of shots and classifying according to ratio values of the shots, wherein the condition with the largest number of shots is closer to which proportion to regard which shot as the optimal solution, and the condition with the largest optimal solution is used as the final proportion selection scheme of all shots; (4) and processing the non-selected proportion shots in a proper mode, and adding the non-selected proportion shots into the video editing. The invention has the beneficial effects that: the method helps a user to optimize the selection process, can quickly and efficiently select a proportion scheme, and helps the user to automatically and quickly process the lens proportion problem.
Description
Technical Field
The invention relates to the technical field related to video processing, in particular to a video editing method for adjusting the proportion of a lens.
Background
Under the situation that video shooting and video production are rapidly developed, the proportion of shot videos is different due to different sizes of video shooting equipment. In the later-stage video production process, a video producer needs to produce a video with a uniform proportion, so that the proportion of a lens needs to be adjusted to achieve a better effect. Lens: the picture or video taken by the user is called a shot in the video composition process. And (3) proportion adjustment: the aspect ratio of a video or picture shot is mainly referred to herein, and common ratios are 4:3, 1:1, 16:9 and the like.
The existing video compositing technology needs to adjust the video shots one by one to the same scale. For a general user, knowing the scale of each shot and what scale of video to synthesize in the end becomes a difficult problem for the user to handle.
Disclosure of Invention
The invention provides a video editing method for adjusting the proportion of a lens, which can quickly and efficiently select the proportion, in order to overcome the defects in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
A video editing method for adjusting the proportion of a lens specifically comprises the following steps:
(1) After a user selects N pictures or video shots from a media library, acquiring the width w and the height h of all the shots, wherein the ratio of width to height is w/h;
(2) Prefabricating N proportion schemes;
(3) Acquiring a plurality of shots and classifying according to ratio values of the shots, wherein the condition with the largest number of shots is closer to which proportion to regard which shot as the optimal solution, and the condition with the largest optimal solution is used as the final proportion selection scheme of all shots;
(4) And processing the non-selected proportion shots in a proper mode, and adding the non-selected proportion shots into the video editing.
The method helps a user to optimize the selection process, can quickly and efficiently select the proportion scheme, and helps the user to automatically and quickly process the lens proportion problem.
Preferably, in the step (2), the proportional scheme includes an original proportional lens, a square lens, a vertical screen lens and a horizontal screen lens, wherein the original proportional lens, the vertical screen lens and the horizontal screen lens all include a plurality of proportional sizes.
Preferably, in step (3), the specific operation method is as follows:
(31) If the ratio of the lens ratio values which are completely equal is the largest, the ratio value is determined as the original ratio, the video editing ratio is adjusted to the ratio, and other lenses are adjusted to the ratio value;
(32) If the ratio of the shot ratio to 1 is the maximum, the proportion of other shots is adjusted to 1: 1;
(33) If the ratio of the lens ratio is more than 1, a landscape lens is preselected, the ratio values corresponding to all the proportional sizes in the landscape lens are obtained, the condition with the largest lens number is closer to which proportional size, which is considered as the optimal solution, and the condition with the largest optimal solution is used as the final proportional selection scheme of all the lenses;
(34) If the ratio of the shots to the ratio of less than 1 is the maximum ratio, the vertical screen shots are pre-selected, the ratio values corresponding to all the proportional sizes in the vertical screen shots are obtained, the situation with the maximum number of the shots is closer to which proportional size, and then which is considered as the optimal solution, and the situation with the maximum optimal solution is used as the final proportional selection scheme of all the shots.
Preferably, in the step (4), the specific operation method is as follows:
(41) According to the selected proportion, presetting the long edge in a mode of enlarging and reducing the length in an editing preview frame with the maximum width of n and the maximum height of n, placing videos which accord with the proportion in the preview frame in an equal proportion, and if ratio > is 1, w is n, h is n/ratio; if ratio is <1, h ═ n, w ═ n ═ ratio;
(42) At this time, the width of the real preview frame is w, the height is h, the video which is not in the current proportion is taken into w and h by the same formula, if the ratio > is 1, the ratio video ratio1 is w1/h1, if the ratio > is ratio1, h1 is w, and w1 is h1 is ratio 1; if ratio < ratio1, w1 ═ w, h1 ═ w1/ratio 1;
(43) At this time, preview widths and heights of all videos which do not conform to the proportion are obtained, (w1 × h1)/(w × h) > (0.9), and the adjustment is carried out by using a fitXY method; 0.8 ═ (w1 × h1)/(w × h) <0.9, adjusted using the centerCrop mode; (w1 × h1)/(w × h) < ═ 0.8, adjusted using the fitCenter approach.
Preferably, in step (43), the specific adjustment method is as follows:
(431) The calculation formula of the fitXY system: w1 ═ w, h1 ═ h;
(432) Formula for the centerCrop mode: when ratio1> is ratio, h1 ═ h, w1 ═ h1 ═ ratio1, at this time w1> w, a picture with width w is cut in the middle; when the ratio1 is less than the ratio, w1 is w, h1 is w1/ratio1, and then h1 is h, and a picture with the height h is cut in the center;
(433) The formula for the fitCenter method: filling in a mode of using a supplementary background, namely the formula of the step (42).
The invention has the beneficial effects that: the method helps a user to optimize the selection process, can quickly and efficiently select a proportion scheme, and helps the user to automatically and quickly process the lens proportion problem.
Drawings
FIG. 1 is a schematic view of the centerCrop mode of the present invention;
FIG. 2 is a schematic diagram of the fitXY pattern of the present invention;
Fig. 3 is a schematic diagram of the fitCenter mode of the present invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
A video editing method for adjusting the proportion of a lens specifically comprises the following steps:
(1) After a user selects N pictures or video shots from a media library, acquiring the width w and the height h of all the shots, wherein the ratio of width to height is w/h;
(2) Prefabricating N proportion schemes; the proportion scheme comprises an original proportion lens, a square lens, a vertical screen lens and a transverse screen lens, wherein the original proportion lens, the vertical screen lens and the transverse screen lens all comprise a plurality of proportion sizes.
(3) Acquiring a plurality of shots and classifying according to ratio values of the shots, wherein the condition with the largest number of shots is closer to which proportion to regard which shot as the optimal solution, and the condition with the largest optimal solution is used as the final proportion selection scheme of all shots; the specific operation method comprises the following steps:
(31) If the ratio of the lens ratio values which are completely equal is the largest, the ratio value is determined as the original ratio, the video editing ratio is adjusted to the ratio, and other lenses are adjusted to the ratio value;
(32) If the ratio of the shot ratio to 1 is the maximum, the proportion of other shots is adjusted to 1: 1;
(33) If the ratio of the lens ratio is more than 1, a landscape lens is preselected, the ratio values corresponding to all the proportional sizes in the landscape lens are obtained, the condition with the largest lens number is closer to which proportional size, which is considered as the optimal solution, and the condition with the largest optimal solution is used as the final proportional selection scheme of all the lenses;
(34) If the ratio of the shots to the ratio of less than 1 is the maximum ratio, the vertical screen shots are pre-selected, the ratio values corresponding to all the proportional sizes in the vertical screen shots are obtained, the situation with the maximum number of the shots is closer to which proportional size, and then which is considered as the optimal solution, and the situation with the maximum optimal solution is used as the final proportional selection scheme of all the shots.
(4) Processing the non-selected proportion lens in a proper mode, and adding the non-selected proportion lens into video editing; the specific operation method comprises the following steps:
(41) According to the selected proportion, presetting the long edge in a mode of enlarging and reducing the length in an editing preview frame with the maximum width of n and the maximum height of n, placing videos which accord with the proportion in the preview frame in an equal proportion, and if ratio > is 1, w is n, h is n/ratio; if ratio is <1, h ═ n, w ═ n ═ ratio;
(42) At this time, the width of the real preview frame is w, the height is h, the video which is not in the current proportion is taken into w and h by the same formula, if the ratio > is 1, the ratio video ratio1 is w1/h1, if the ratio > is ratio1, h1 is w, and w1 is h1 is ratio 1; if ratio < ratio1, w1 ═ w, h1 ═ w1/ratio 1;
(43) At this time, preview widths and heights of all videos which do not conform to the proportion are obtained, (w1 × h1)/(w × h) > (0.9), and the adjustment is carried out by using a fitXY method; 0.8 ═ (w1 × h1)/(w × h) <0.9, adjusted using the centerCrop mode; (w1 × h1)/(w × h) < ═ 0.8, adjusted using the fitCenter approach; the specific adjustment method is as follows:
(431) The calculation formula of the fitXY system: w1 ═ w, h1 ═ h; the videos are not in equal proportion, but the area difference value is below 0.1, so that the visual influence on a user is avoided, and the completeness of the picture can be ensured.
(432) Formula for the centerCrop mode: when ratio1> is ratio, h1 ═ h, w1 ═ h1 ═ ratio1, at this time w1> w, a picture with width w is cut in the middle; when the ratio1 is less than the ratio, w1 is w, h1 is w1/ratio1, and then h1 is h, and a picture with the height h is cut in the center; it can be ensured that the video is in equal proportion, and a part of the picture is slightly cut off and is in an acceptable range.
(433) The formula for the fitCenter method: filling in a mode of using a supplementary background, namely the formula of the step (42). The area difference is too large, so the method of complementing the background is used for filling.
The specific embodiment is as follows:
Step 1) the user selects 7 shots from the media library, the shot width and height, and the ratio (width/height) as shown in the table below.
Name (R) | Lens (Wide X high) | Ratio |
Lens 1 | 1080*720 | 1.5 |
Lens 2 | 1080*720 | 1.5 |
Lens 3 | 720*1080 | 0.66 |
Lens 4 | 1080*1080 | 1 |
Lens 5 | 720*720 | 1 |
Lens 6 | 1088*720 | 1.51 |
Lens 7 | 1280*960 | 1.33 |
Step 2) the method performs proportional prefabrication (later expansion as required)
Original proportion (original lens proportion)
1: 1 (Square lens)
9: 16, 4: 5, 3: 4 (vertical screen lens),
4: 3, 16: 9, 2.39: 1 (horizontal screen lens)
Step 3) 2 of the same original proportion. And classifying according to the aspect ratio, wherein 4 shots with the ratio of > 1, 2 shots with the ratio of 1 and 1 shot with the ratio of < 1.
a) The ratio of shots with ratio > 1 is the largest, and the final ratio is selected from (4: 3, 16: 9, 2.39: 1).
b) The ratio values of the three lenses are 4: 3 ≈ 1.333, 16: 9 ≈ 1.777 and 2.39: 1 ≈ 2.39. At this time, the ratio of 1.5 to 4: 3 is 4: 3, and so on, the ratio of 2 to 6 to 7 is 4: 3. The final selection scheme is 4: 3. And placing the horizontal screen.
And 4) carrying out formula calculation on the shots with the non-selected proportion, selecting the most appropriate mode for processing, and adding the shots into video editing. As shown in fig. 1, CenterCrop: cutting off the excess part after the cutting; FitXY: enlarging a single side to fill the entire preview box; FitCenter: after which the background is supplemented.
Claims (5)
1. A video editing method for adjusting the proportion of a lens is characterized by comprising the following steps:
(1) After a user selects N pictures or video shots from a media library, acquiring the width w and the height h of all the shots, wherein the ratio of width to height is w/h;
(2) Prefabricating N proportion schemes;
(3) Acquiring a plurality of shots and classifying according to ratio values of the shots, wherein the condition with the largest number of shots is closer to which proportion to regard which shot as the optimal solution, and the condition with the largest optimal solution is used as the final proportion selection scheme of all shots;
(4) And processing the non-selected proportion shots in a proper mode, and adding the non-selected proportion shots into the video editing.
2. The method for video editing with lens proportion adjustment according to claim 1, wherein in the step (2), the proportion scheme comprises an original proportion lens, a square lens, a vertical screen lens and a horizontal screen lens, wherein the original proportion lens, the vertical screen lens and the horizontal screen lens all comprise a plurality of proportion sizes.
3. The method for editing video with shot scale adjustment as claimed in claim 2, wherein in step (3), the specific operation method is as follows:
(31) If the ratio of the lens ratio values which are completely equal is the largest, the ratio value is determined as the original ratio, the video editing ratio is adjusted to the ratio, and other lenses are adjusted to the ratio value;
(32) If the ratio of the shot ratio to 1 is the maximum, the proportion of other shots is adjusted to 1: 1;
(33) If the ratio of the lens ratio is more than 1, a landscape lens is preselected, the ratio values corresponding to all the proportional sizes in the landscape lens are obtained, the condition with the largest lens number is closer to which proportional size, which is considered as the optimal solution, and the condition with the largest optimal solution is used as the final proportional selection scheme of all the lenses;
(34) If the ratio of the shots to the ratio of less than 1 is the maximum ratio, the vertical screen shots are pre-selected, the ratio values corresponding to all the proportional sizes in the vertical screen shots are obtained, the situation with the maximum number of the shots is closer to which proportional size, and then which is considered as the optimal solution, and the situation with the maximum optimal solution is used as the final proportional selection scheme of all the shots.
4. The method for editing video with shot scale adjustment as claimed in claim 3, wherein in step (4), the specific operation method is as follows:
(41) According to the selected proportion, presetting the long edge in a mode of enlarging and reducing the length in an editing preview frame with the maximum width of n and the maximum height of n, placing videos which accord with the proportion in the preview frame in an equal proportion, and if ratio > is 1, w is n, h is n/ratio; if ratio is <1, h ═ n, w ═ n ═ ratio;
(42) At this time, the width of the real preview frame is w, the height is h, the video which is not in the current proportion is taken into w and h by the same formula, if the ratio > is 1, the ratio video ratio1 is w1/h1, if the ratio > is ratio1, h1 is w, and w1 is h1 is ratio 1; if ratio < ratio1, w1 ═ w, h1 ═ w1/ratio 1;
(43) At this time, preview widths and heights of all videos which do not conform to the proportion are obtained, (w1 × h1)/(w × h) > (0.9), and the adjustment is carried out by using a fitXY method; 0.8 ═ (w1 × h1)/(w × h) <0.9, adjusted using the centerCrop mode; (w1 × h1)/(w × h) < ═ 0.8, adjusted using the fitCenter approach.
5. The video editing method for adjusting the shot size according to claim 4, wherein in step (43), the specific adjusting method is as follows:
(431) The calculation formula of the fitXY system: w1 ═ w, h1 ═ h;
(432) Formula for the centerCrop mode: when ratio1> is ratio, h1 ═ h, w1 ═ h1 ═ ratio1, at this time w1> w, a picture with width w is cut in the middle; when the ratio1 is less than the ratio, w1 is w, h1 is w1/ratio1, and then h1 is h, and a picture with the height h is cut in the center;
(433) The formula for the fitCenter method: filling in a mode of using a supplementary background, namely the formula of the step (42).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010222240.1A CN111405182B (en) | 2020-03-26 | 2020-03-26 | Video editing method for adjusting lens proportion |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010222240.1A CN111405182B (en) | 2020-03-26 | 2020-03-26 | Video editing method for adjusting lens proportion |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111405182A true CN111405182A (en) | 2020-07-10 |
CN111405182B CN111405182B (en) | 2021-07-23 |
Family
ID=71414015
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010222240.1A Active CN111405182B (en) | 2020-03-26 | 2020-03-26 | Video editing method for adjusting lens proportion |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111405182B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1424854A1 (en) * | 2002-11-29 | 2004-06-02 | Kabushiki Kaisha Toshiba | Video data conversion apparatus and video data conversion method |
CN101420576A (en) * | 2007-10-24 | 2009-04-29 | 船井电机株式会社 | Image data server |
CN104349200A (en) * | 2013-08-09 | 2015-02-11 | 晨星半导体股份有限公司 | Television control device and correlation method |
US20180213216A1 (en) * | 2015-06-16 | 2018-07-26 | Lg Electronics Inc. | Media data transmission device, media data reception device, media data transmission method, and media data rececption method |
CN109120997A (en) * | 2018-09-30 | 2019-01-01 | 北京微播视界科技有限公司 | Method for processing video frequency, device, terminal and medium |
CN109151504A (en) * | 2018-09-28 | 2019-01-04 | 上海哔哩哔哩科技有限公司 | A kind of video adaptive identifying method, apparatus and storage medium |
CN110162286A (en) * | 2019-05-17 | 2019-08-23 | 维沃移动通信有限公司 | A kind of image display method and terminal |
CN110572722A (en) * | 2019-09-26 | 2019-12-13 | 腾讯科技(深圳)有限公司 | Video clipping method, device, equipment and readable storage medium |
-
2020
- 2020-03-26 CN CN202010222240.1A patent/CN111405182B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1424854A1 (en) * | 2002-11-29 | 2004-06-02 | Kabushiki Kaisha Toshiba | Video data conversion apparatus and video data conversion method |
CN101420576A (en) * | 2007-10-24 | 2009-04-29 | 船井电机株式会社 | Image data server |
CN104349200A (en) * | 2013-08-09 | 2015-02-11 | 晨星半导体股份有限公司 | Television control device and correlation method |
US20180213216A1 (en) * | 2015-06-16 | 2018-07-26 | Lg Electronics Inc. | Media data transmission device, media data reception device, media data transmission method, and media data rececption method |
CN109151504A (en) * | 2018-09-28 | 2019-01-04 | 上海哔哩哔哩科技有限公司 | A kind of video adaptive identifying method, apparatus and storage medium |
CN109120997A (en) * | 2018-09-30 | 2019-01-01 | 北京微播视界科技有限公司 | Method for processing video frequency, device, terminal and medium |
CN110162286A (en) * | 2019-05-17 | 2019-08-23 | 维沃移动通信有限公司 | A kind of image display method and terminal |
CN110572722A (en) * | 2019-09-26 | 2019-12-13 | 腾讯科技(深圳)有限公司 | Video clipping method, device, equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111405182B (en) | 2021-07-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI520598B (en) | Image processing apparatus and image processing method | |
JP4864835B2 (en) | Color correction apparatus, method and program | |
US8009898B2 (en) | Apparatus and method for aligning images obtained by stereo camera apparatus | |
CN101057259B (en) | Film grain simulation method based on pre-computed transform coefficients | |
CN105072314A (en) | Virtual studio implementation method capable of automatically tracking objects | |
CN101340523A (en) | Method and apparatus for exposure compensating digital image | |
US7760967B2 (en) | Image processing apparatus capable of carrying out magnification change process of image | |
CN105872311A (en) | High-dynamic-range picture switching method and device | |
KR102166106B1 (en) | Method and system for generating multifaceted images using virtual camera | |
CN102780869A (en) | Video recording device and method | |
WO2009082990A1 (en) | Method and device for real-time multi-view production | |
CN111405182B (en) | Video editing method for adjusting lens proportion | |
CN104574491A (en) | Multi-lattice special effect rendering method and system based on mobile terminal platform | |
CN107087163A (en) | A kind of coding method of lifting HDR Subjective video qualities | |
CN105282622A (en) | Scene switching method and device | |
CN102611856A (en) | Image converter, image conversion method, program and electronic equipment | |
CN105741300B (en) | A kind of region segmentation screenshot method | |
JP2002112289A (en) | Stereoscopic camera with means to facilitate adjustment of photomechanical parameter | |
GB2483351A (en) | Image division for improved memory access and processing | |
JP3962536B2 (en) | Convergence adjustment method using spline interpolation | |
CN116761017A (en) | High availability method and system for video real-time rendering | |
US20140003706A1 (en) | Method and system for ensuring stereo alignment during pipeline processing | |
CN102905077A (en) | Image vignetting brightness regulating method and device | |
CN110381259A (en) | Mural painting image collecting method, device, computer equipment and storage medium | |
US20050063603A1 (en) | Video data enhancement method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 22nd floor, block a, Huaxing Times Square, 478 Wensan Road, Xihu District, Hangzhou, Zhejiang 310000 Applicant after: Hangzhou Xiaoying Innovation Technology Co.,Ltd. Address before: 16 / F, HANGGANG Metallurgical Science and technology building, 294 Tianmushan Road, Xihu District, Hangzhou City, Zhejiang Province, 310012 Applicant before: HANGZHOU QUWEI SCIENCE & TECHNOLOGY Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |