CN111405182B - Video editing method for adjusting lens proportion - Google Patents

Video editing method for adjusting lens proportion Download PDF

Info

Publication number
CN111405182B
CN111405182B CN202010222240.1A CN202010222240A CN111405182B CN 111405182 B CN111405182 B CN 111405182B CN 202010222240 A CN202010222240 A CN 202010222240A CN 111405182 B CN111405182 B CN 111405182B
Authority
CN
China
Prior art keywords
ratio
proportion
lens
shots
proportional
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.)
Active
Application number
CN202010222240.1A
Other languages
Chinese (zh)
Other versions
CN111405182A (en
Inventor
王洁明
顾湘余
韩晟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Xiaoying Innovation Technology Co ltd
Original Assignee
Hangzhou Xiaoying Innovation Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Xiaoying Innovation Technology Co ltd filed Critical Hangzhou Xiaoying Innovation Technology Co ltd
Priority to CN202010222240.1A priority Critical patent/CN111405182B/en
Publication of CN111405182A publication Critical patent/CN111405182A/en
Application granted granted Critical
Publication of CN111405182B publication Critical patent/CN111405182B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical 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

Video editing method for adjusting lens proportion
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 (2)

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; the proportional scheme comprises an original proportional lens, a square lens, a vertical screen lens and a transverse screen lens, wherein the original proportional lens, the vertical screen lens and the transverse screen lens all comprise a plurality of proportional 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 lens ratio to 1 is the maximum, the proportion of other lenses 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, a vertical screen shot is preselected, the ratio values corresponding to all the proportional sizes in the vertical screen shot are obtained, the situation with the maximum shot number 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 length in an editing preview frame with the maximum width of n and the maximum height of n by using a long-edge zooming-in and zooming-out mode, and placing videos which accord with the proportion in the preview frame in an equal proportion, wherein if ratio is 1, w is n, and h is n/ratio; if ratio is less than 1, h is n, w is 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 ratio1 is not in accordance with the ratio video of w1/h1, if the ratio is > ratio1, h1 is w, w1 is h1 is ratio 1; if ratio is less than ratio1, w1 ═ w, h1 ═ w1/ratio 1;
(43) at this time, the preview width and height of all the 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.
2. The video editing method for adjusting the shot size according to claim 1, 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 is h, w1 is h1 ratio1, w1 is more than w, and then a picture with the width of 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 more than h, and a picture with the height h is cut in the middle;
(433) the formula for the fitCenter method: filling in a mode of using a supplementary background, namely the formula of the step (42).
CN202010222240.1A 2020-03-26 2020-03-26 Video editing method for adjusting lens proportion Active CN111405182B (en)

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 CN111405182A (en) 2020-07-10
CN111405182B true 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 (7)

* Cited by examiner, † Cited by third party
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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016204481A1 (en) * 2015-06-16 2016-12-22 엘지전자 주식회사 Media data transmission device, media data reception device, media data transmission method, and media data rececption method

Patent Citations (7)

* Cited by examiner, † Cited by third party
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
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
CN111405182A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
TWI520598B (en) Image processing apparatus and image processing method
CN104954769B (en) A kind of immersion ultra high-definition processing system for video and method
JP4864835B2 (en) Color correction apparatus, method and program
US5459477A (en) Display control device
CN101057259B (en) Film grain simulation method based on pre-computed transform coefficients
US7760967B2 (en) Image processing apparatus capable of carrying out magnification change process of image
EP1190388A2 (en) System and method for improving the sharpness of a video image
WO2009082990A1 (en) Method and device for real-time multi-view production
CN105872311A (en) High-dynamic-range picture switching method and device
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
CN102611856A (en) Image converter, image conversion method, program and electronic equipment
US11393064B2 (en) Image processing device and image processing method
CN100594735C (en) Image process device and method for selecting image color graded
CN105741300B (en) A kind of region segmentation screenshot method
GB2483351A (en) Image division for improved memory access and processing
JPH08181984A (en) Image compressor and image compression method
JP3962536B2 (en) Convergence adjustment method using spline interpolation
CN102905077A (en) Image vignetting brightness regulating method and device
US20070035784A1 (en) Image processing method and apparatus
US20050063603A1 (en) Video data enhancement method
JPS60192460A (en) Picture signal processing unit
CN110381259A (en) Mural painting image collecting method, device, computer equipment and storage medium
US7199833B2 (en) Method of using three-dimensional image interpolation algorithm to achieve frame rate conversions

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