CN114527948B - Method and device for calculating clipping region, intelligent device and storage medium - Google Patents
Method and device for calculating clipping region, intelligent device and storage medium Download PDFInfo
- Publication number
- CN114527948B CN114527948B CN202011321701.7A CN202011321701A CN114527948B CN 114527948 B CN114527948 B CN 114527948B CN 202011321701 A CN202011321701 A CN 202011321701A CN 114527948 B CN114527948 B CN 114527948B
- Authority
- CN
- China
- Prior art keywords
- shearing
- boundary line
- ith
- initial
- brightness
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000010008 shearing Methods 0.000 claims abstract description 148
- 238000004364 calculation method Methods 0.000 claims abstract description 7
- 238000004590 computer program Methods 0.000 claims description 8
- 230000000694 effects Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000009966 trimming Methods 0.000 description 4
- 238000005266 casting Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
- G06F3/1407—General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Image Analysis (AREA)
Abstract
The application discloses a calculation method, a device, intelligent equipment and a storage medium of a shearing area, wherein the method comprises the following steps: determining an initial shearing boundary line of the shearing area; calculating an initial brightness average value corresponding to the pixels in the frame where the initial shearing boundary line is located; if the initial brightness average value is larger than a preset first threshold value, moving the initial shearing boundary line towards a direction far away from the central line of the shearing area by i columns to obtain an ith shearing boundary line; if the distance between the ith shear boundary line and the centerline of the shear zone is greater than or equal to the first shear distance, then no shear is required. The method aims at judging whether the current datum line is a graphic boundary or not through the gradient of two adjacent frames and the specific brightness of the current frame, and particularly, the common screen ratio of a mobile phone is used as an initial datum line to accelerate boundary searching, so that an effective video area is calculated rapidly, sheared, stretched to the largest display area of a television, viewing quality is improved, and viewing effect is improved.
Description
Technical Field
The application relates to the technical field of web pages, in particular to a calculation method and device of a cut area, intelligent equipment and a storage medium.
Background
The current television can directly receive the mobile phone screen, display the same or different content as the mobile phone screen, and serve as an extension of the mobile phone screen. The television is usually a horizontal screen (the television also has a vertical screen mode at present), and the mobile phone has two modes of horizontal and vertical screens. The television receives the content to be displayed by the mobile phone, and presents the content to a user (screen casting for short later) on a television screen, and the television generally keeps the aspect ratio of the content of the screen casting of the mobile phone end unchanged, so that the deformation of the displayed content can be avoided. The mobile phone end can send the video to the television with the television resolution, for example, the television resolution is 1920x1080, the mobile phone can always encode the content into 1920x1080 wide and high, when the television and the mobile phone are in the horizontal screen mode, the display is perfectly matched, but if the mode is not the mode, the display effect is poor.
Accordingly, there is a need for improvement and development in the art.
Disclosure of Invention
Based on this, it is necessary to provide a method, a device, an intelligent device and a storage medium for calculating a cut area, aiming at the technical problem that the display effect of the existing television and the end point is poor in the non-horizontal screen mode when the end point is on screen.
In order to achieve the above purpose, the present application adopts the following technical scheme:
in a first aspect, the present application provides a method for calculating a clipping region, including:
determining an initial shearing boundary line of the shearing area;
calculating an initial brightness average value corresponding to the pixels in the frame where the initial shearing boundary line is located;
if the initial brightness average value is larger than a preset first threshold value, moving the initial shearing boundary line towards a direction far away from the central line of the shearing area by i columns to obtain an ith shearing boundary line; wherein, the initial value of i is 1, i is a positive integer;
if the distance between the ith shearing boundary line and the central line of the shearing area is greater than or equal to the first shearing distance, shearing is not needed;
if the distance between the ith shearing boundary line and the central line of the shearing area is smaller than the first shearing distance, calculating an ith brightness average value corresponding to a pixel in the frame where the ith shearing boundary line is positioned;
if the average value of the ith brightness corresponding to the pixel in the frame where the ith cutting boundary line is located is greater than a preset first threshold value, making i=i+1, and returning to execute the movement of the initial cutting boundary line in the direction away from the central line of the cutting area by i columns;
and if the ith brightness average value corresponding to the pixel in the frame where the ith cutting boundary line is positioned is smaller than a preset first threshold value, taking the ith cutting boundary line as a target cutting boundary line.
In a second aspect, the present application further provides a computing device for clipping regions, including:
an initial brightness calculation unit, configured to determine an initial clipping boundary line of the clipping region, and calculate an initial brightness average value corresponding to a pixel in a frame where the initial clipping boundary line is located;
the shearing boundary line determining unit is used for moving the initial shearing boundary line towards the direction far away from the central line of the shearing area by i columns if the initial brightness average value is larger than a preset first threshold value to obtain an ith shearing boundary line; wherein, the initial value of i is 1, i is a positive integer;
a shearing judgment unit, configured to eliminate shearing if the distance between the ith shearing boundary line and the center line of the shearing area is greater than or equal to the first shearing distance;
a cutting boundary line moving unit, configured to calculate an ith luminance average value corresponding to a pixel in a frame where the ith cutting boundary line is located if a distance between the ith cutting boundary line and a center line of the cutting area is smaller than a first cutting distance; or if the ith brightness average value is greater than the preset first threshold value, making i=i+1, and returning to execute the movement of the initial shearing boundary line in the direction away from the central line of the shearing area by i columns;
and the target shearing boundary line determining unit is used for taking the ith shearing boundary line as the target shearing boundary line if the ith brightness average value is smaller than a preset first threshold value.
In a third aspect, the present application further provides an intelligent device, where the intelligent device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements steps in a method for calculating a clipping region when executing the computer program.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs steps in a method of computing a cut area.
The beneficial effects are that:
compared with the prior art, the method, the device, the intelligent equipment and the storage medium for calculating the cut area are provided, and aim to judge whether the current datum line is a graphic boundary or not through the average brightness gradient of two adjacent frames and the brightness average value of the current frame, and especially, the common screen ratio of a mobile phone is used as an initial datum line to accelerate boundary search, so that an effective video area is calculated rapidly, cut is conducted on the effective video area, and then the effective video area is stretched to the largest display area of a television, viewing quality is improved, and viewing effect is improved.
Drawings
FIG. 1 is a flow chart of a method for computing a clipping region provided in the present application;
FIG. 2 is a graphical schematic of a cutout region provided herein;
FIG. 3 is a functional block diagram of a computing device for clipping regions provided herein;
fig. 4 is a block diagram of an intelligent terminal provided in the present application.
Detailed Description
The application provides a method, a device, an intelligent device and a storage medium for calculating a clipping region, and for making the purposes, technical schemes and effects of the application clearer and more definite, the application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The technical scheme of the application is described below with reference to the accompanying drawings and specific embodiments, as follows:
referring to fig. 1, fig. 1 is a flowchart of a method for calculating a clipping region. It should be noted that the method for calculating the clipping region according to the embodiment of the present invention is not limited to the steps and the sequence in the flowchart shown in fig. 1, and the steps in the flowchart may be added, removed or changed according to different requirements. As shown in fig. 1, the method for calculating the clipping region includes:
s10, the intelligent equipment determines an initial shearing boundary line of the shearing area.
Specifically, the cut-out region refers to a video region in which the television receives the mobile phone. Typically, the cutout region is symmetrically rectangular. Therefore, when the size and position of the cutout region are checked, the cutout boundary line can be checked by the left or right region only by dividing the cutout region by the center line of the cutout region, and the cutout boundary line corresponding to the other region can be checked by symmetry.
The initial shearing boundary line is the boundary line of the shearing area and the reference line. Which randomly selects an arbitrary position from the cut area as an initial cut boundary line.
As shown in fig. 2, M is the centerline of the sheared area. The position is W/2, W is the width of the video received by the television, H is the height of the video received by the television, and L0 is the initial cutting boundary line, namely the initial datum line. Ls is a second shearing boundary line which is a second shearing distance from the center line, the second shearing distance is a minimum threshold value of the initial reference line, le is a first shearing boundary line which is a first shearing distance from the center line, the first shearing distance is a maximum threshold value of the initial reference line, and it should be understood that the first shearing distance is greater than the second shearing distance. X is the distance of the sheared area from the centerline M. In this embodiment, ls can be selected as the center distance at 21:9, and Le can be selected as W/2
In this embodiment, L0 is H/2. Typically, the cell phone has a screen ratio of 21:9,21:10,16:9,4:3, etc.
S20, the intelligent equipment calculates an initial brightness average value corresponding to the pixels in the frame where the initial shearing boundary line is located.
Specifically, step S20 includes:
acquiring third brightness values and second total numbers of all pixels in the vertical direction of a frame where the initial shearing boundary line is located;
summing all third brightness values to obtain third total brightness;
and (3) the third total brightness is subjected to quotient with the second total number to obtain an initial brightness average value.
If the pixel format is RGB format, the RGB format is converted into a value including Y format. In this embodiment, the format of each pixel is YUV format, and conversion is not required, so as to directly obtain the Y value, i.e. the luminance value, in the YUV format of the pixel.
The sum of the brightness values of all pixels in the L0 vertical direction is calculated and divided by the number of pixels H (i.e. the screen height H) to obtain an initial brightness average value.
It is expressed as:
Y=Lumin(Lx)
(one)
S30, if the initial brightness average value is larger than a preset first threshold value, the intelligent equipment moves the initial shearing boundary line in the direction away from the central line of the shearing area by i columns to obtain an ith shearing boundary line; wherein, the initial value of i is 1, and i is a positive integer.
In this embodiment, a preset first threshold is defined as Y0
If Y > Y0, the reference line L0 is moved to the edge of the picture, and if Le is reached, clipping is not needed (explaining the possibility of the mobile phone being in the horizontal screen mode)
When Y < Y0, the reference line L0 is moved toward the center of the picture until Y > =y0 or Ls is reached.
S40, if the distance between the ith shearing boundary line and the central line of the shearing area is greater than or equal to the first shearing distance, the intelligent equipment does not need shearing;
s50, if the distance between the ith shearing boundary line and the central line of the shearing area is smaller than the first shearing distance, the intelligent equipment calculates an ith brightness average value corresponding to a pixel in the frame where the ith shearing boundary line is positioned;
s60, if the ith brightness average value is larger than a preset first threshold value, the intelligent equipment enables i=i+1, and returns to execute moving the initial shearing boundary line in a direction away from the central line of the shearing area by i columns;
and S70, if the ith brightness average value is smaller than a preset first threshold value, the intelligent equipment takes the ith cutting boundary line as a target cutting boundary line.
If the initial brightness average value is smaller than a preset first threshold value, the intelligent equipment moves the initial shearing boundary line towards the direction close to the central line of the shearing area by i columns to obtain an ith shearing boundary line; wherein, the initial value of i is 1, i is a positive integer;
if the distance between the ith shearing boundary line and the central line of the shearing area is smaller than or equal to the second shearing distance, the intelligent equipment takes the second shearing boundary line corresponding to the second shearing distance as a target shearing boundary line; wherein the first shearing distance is greater than the second shearing distance;
if the distance between the ith cutting edge boundary line and the central line of the cutting area is larger than the second cutting distance, the intelligent equipment calculates an ith brightness average value corresponding to a pixel in the frame where the ith cutting edge boundary line is positioned;
if the ith brightness average value is greater than a preset first threshold value, the intelligent equipment enables i=i+1 to return to execute the movement of the initial shearing boundary line to the direction close to the central line of the shearing area by i columns;
and if the ith brightness average value is smaller than a preset first threshold value, the intelligent equipment takes the ith cutting boundary line as a target cutting boundary line.
The target cut boundary line is confirmed through the first or the second, and whether the target cut boundary line is correctly calculated or not needs to be verified through two adjacent video frames, so that whether the mobile phone is switched from the landscape screen or the portrait screen is confirmed.
Specifically, the intelligent device determines whether a frame in which a target shearing boundary line is located is a first frame of a shearing area;
1. if the frame where the target cutting boundary line is located is the first frame of the cutting area, the intelligent device directly ends without cutting.
2. If the frame where the target shearing boundary line is located is not the first frame of the shearing area, the intelligent equipment calculates an average brightness gradient difference value between the frame where the i shearing boundary line is located and the frame where the i-1 shearing boundary line is located;
3. if the average brightness gradient difference value is larger than a preset second threshold value, the intelligent equipment determines that the target shearing boundary line is incorrect, and reconfirms the target shearing boundary line;
4. if the average brightness gradient difference value is smaller than or equal to a preset second threshold value, the intelligent device determines the size of the shearing area according to the target shearing boundary line.
Wherein, step 2 includes:
acquiring first brightness values of all pixels in the vertical direction of a frame where an ith shear boundary line is located;
summing all the first brightness values to obtain first total brightness;
acquiring second brightness values of all pixels in the vertical direction of a frame where the i-1 th shear boundary line is located;
summing all the second brightness values to obtain second total brightness;
the first total brightness and the second total brightness are subjected to difference to obtain a brightness difference value;
acquiring a first total number of all pixels in the vertical direction of an ith frame;
and (3) taking the absolute value of the brightness difference value and the first total number as a quotient to obtain an average brightness gradient difference value.
Specifically, the intelligent device calculates an average gradient threshold value D of the inter-frame datum line L, and the second threshold value is a fixed judgment threshold value constant D0:
d= (sum of absolute brightness values of pixel values corresponding to the previous frame reference line L-the next frame reference line L)/(number of pixels H)
When D < =d0, the reference line is determined to be correct. Otherwise the reference line L should be recalculated, moving towards the edge.
Reference line pixel brightness of previous frame: yb= { y0, y1, y2, total H number of..yh }
Reference line pixel brightness for the next frame: ya= { y0, y1, y2, total H number of..yh }
Can be expressed as:
D=Abs(Yb-Ya)/H
abs is a function of vector calculated magnitude.
Further, the smart device determines a size of the clipping region according to the target clipping boundary line, including:
acquiring the distance x between a target shearing boundary line and the central line of the shearing area; since the position of the center line is one half of the screen width and the cutout region is an axisymmetric region with the center line as an axis, it was confirmed that the width of the cutout region is 2x and the height of the cutout region is the screen height.
In this way, based on steps S10-S70, the present application aims to determine whether the current reference line is a graphic boundary through the gradient of two adjacent frames and the specific brightness of the current frame, and particularly, to speed up boundary searching by using the normal screen ratio of the mobile phone as the initial reference line, so as to quickly calculate an effective video area, cut the effective video area, and then stretch the effective video area to the maximum display area of the television, thereby improving the viewing quality and the viewing effect.
Based on the above method for calculating the clipping region, the present application further provides a device for calculating the clipping region, please refer to fig. 3, fig. 3 illustrates a schematic functional block diagram of the device for calculating the clipping region in the present application. The device comprises:
an initial brightness calculation unit 101, configured to determine an initial clipping boundary line of the clipping region, and calculate an initial brightness average value corresponding to a pixel in a frame where the initial clipping boundary line is located;
a trimming boundary determining unit 102, configured to, if the initial brightness average value is greater than a preset first threshold value, move the initial trimming boundary line by i columns in a direction away from the center line of the trimming area, to obtain an i-th trimming boundary; wherein, the initial value of i is 1, i is a positive integer;
a shearing judgment unit 103 for eliminating the need for shearing if the distance between the ith shearing boundary line and the center line of the shearing area is greater than or equal to the first shearing distance;
a clipping boundary line moving unit 104, configured to calculate an ith luminance average value corresponding to a pixel in a frame where the ith clipping boundary line is located if a distance between the ith clipping boundary line and a center line of the clipping region is smaller than the first clipping distance; or if the ith brightness average value is greater than the preset first threshold value, making i=i+1, and returning to execute the movement of the initial shearing boundary line in the direction away from the central line of the shearing area by i columns;
a target cut boundary line determining unit 105, configured to take the i-th cut boundary line as a target cut boundary line if the i-th brightness average value is smaller than a preset first threshold value; the calculation method for realizing the shearing area is specifically the method.
Based on the above calculation method of the clipping region, the application further provides an intelligent device. Referring to fig. 4, fig. 4 illustrates a schematic structural diagram of the smart device 1 in the present application. The smart device 1 may include a processor 20 and a memory 22, only some of the components of the smart device 1 are shown in fig. 4, but it should be understood that not all of the illustrated components are required to be implemented, and more or fewer components may alternatively be implemented. The intelligent device 1 can be any device capable of networking, such as a mobile phone, an ipad, a desktop computer and the like.
The memory 22 may in some embodiments be an internal storage unit of the smart device 1, such as a memory of the smart device 1. The memory 22 may in other embodiments also be an external storage device of the Smart device 1, such as a plug-in type usb Flash drive, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the Smart device 1. Further, the memory 22 may also include both an internal storage unit and an external storage device of the smart device 1. The memory 22 is used for storing application software installed on the smart device 1 and various data, such as display program codes of web pages. The memory 22 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 22 stores a web page display program that is executable by the processor 20 to perform the method described above.
The processor 20 may in some embodiments be a central processing unit (Central Processing Unit, CPU), microprocessor, mobile phone baseband processor or other data processing chip for running program code or processing data stored in the memory 22, for example performing the method of computing the cut-out region.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by the processor 20, performs steps in a method of computing a cut-out region, in particular a method as described above.
Of course, those skilled in the art will appreciate that all or part of the above-described methods may be implemented by a computer program for instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and the program may include the above-described methods when executed. Wherein the storage medium may be a memory, magnetic disk, optical disk, etc.
It is to be understood that the application of the present application is not limited to the examples described above, but that modifications and variations can be made by a person skilled in the art from the above description, all of which modifications and variations are intended to fall within the scope of the claims appended hereto.
Claims (9)
1. A method of computing a clipping region, comprising:
determining an initial shearing boundary line of the shearing area;
calculating an initial brightness average value corresponding to pixels in a frame where the initial shearing boundary line is located;
if the initial brightness average value is larger than a preset first threshold value, moving the initial shearing boundary line by i columns in a direction away from the central line of the shearing area to obtain an ith shearing boundary line; wherein, the initial value of i is 1, i is a positive integer;
if the distance between the ith shearing boundary line and the central line of the shearing area is greater than or equal to the first shearing distance, shearing is not needed;
if the distance between the ith cutting boundary line and the central line of the cutting area is smaller than the first cutting distance, calculating an ith brightness average value corresponding to a pixel in a frame where the ith cutting boundary line is positioned;
if the ith brightness average value is greater than the preset first threshold value, making i=i+1, and returning to perform moving the initial shearing boundary line by i columns in a direction away from the central line of the shearing area;
if the ith brightness average value is smaller than the preset first threshold value, taking the ith cutting boundary line as a target cutting boundary line;
after the ith shear boundary line is taken as the target shear boundary line, the method further comprises:
determining whether the frame where the target shearing boundary line is located is a first frame of the shearing area;
if yes, no shearing is needed;
if not, calculating the average brightness gradient difference value of the frame where the ith cutting boundary line is positioned and the frame where the ith-1 cutting boundary line is positioned;
if the average brightness gradient difference value is larger than a preset second threshold value, determining that the target shearing boundary line is incorrect, and reconfirming the target shearing boundary line;
and if the average brightness gradient difference value is smaller than or equal to a preset second threshold value, determining the size of the shearing area according to the target shearing boundary line.
2. The method according to claim 1, wherein the method further comprises:
if the initial brightness average value is smaller than a preset first threshold value, moving the initial shearing boundary line towards the direction close to the central line of the shearing area by i columns to obtain an ith shearing boundary line; wherein, the initial value of i is 1, i is a positive integer;
if the distance between the ith shearing boundary line and the central line of the shearing area is smaller than or equal to a second shearing distance, taking the second shearing boundary line corresponding to the second shearing distance as a target shearing boundary line; wherein the first shearing distance is greater than the second shearing distance;
if the distance between the ith shearing boundary line and the central line of the shearing area is larger than a second shearing distance, calculating an ith brightness average value corresponding to a pixel in the frame where the ith shearing boundary line is located;
if the ith brightness average value is greater than the preset first threshold value, making i=i+1, and returning to perform shifting the initial shearing boundary line by i columns in a direction approaching to the central line of the shearing area;
and if the ith brightness average value is smaller than the preset first threshold value, taking the ith cutting boundary line as a target cutting boundary line.
3. The method of claim 1, wherein calculating the average luminance gradient difference between the frame where the i-th clipping boundary line is located and the frame where the i-1 th clipping boundary line is located comprises:
acquiring first brightness values of all pixels in the vertical direction of a frame where the ith shear boundary line is located;
summing all the first brightness values to obtain first total brightness;
acquiring second brightness values of all pixels in the vertical direction of a frame where the i-1 th shear boundary line is located;
summing all the second brightness values to obtain second total brightness;
the first total brightness and the second total brightness are subjected to difference to obtain a brightness difference value;
acquiring a first total number of all pixels in the vertical direction of an ith frame;
and the absolute value of the brightness difference value is used as a quotient with the first total number to obtain an average brightness gradient difference value.
4. The method of claim 1, wherein said determining the size of the sheared area from the target sheared boundary line comprises:
acquiring the distance x between the target shearing boundary line and the central line of the shearing area;
and confirming that the width of the shearing area is 2x, and the height of the shearing area is the screen height.
5. The method of claim 1, wherein calculating an initial luminance average value corresponding to the pixel in the frame where the initial clipping boundary line is located comprises:
acquiring third brightness values and second total numbers of all pixels in the vertical direction of a frame where the initial shearing boundary line is located;
summing all third brightness values to obtain third total brightness;
and the third total brightness and the second total number are used as a quotient to obtain the initial brightness average value.
6. The method of claim 1, wherein the centerline is located at one-half of the screen width and the cutout region is an axisymmetric region about the centerline.
7. A computing device for clipping regions, comprising:
an initial brightness calculation unit, configured to determine an initial clipping boundary line of a clipping region, and calculate an initial brightness average value corresponding to a pixel in a frame where the initial clipping boundary line is located;
a clipping boundary line determining unit, configured to, if the initial brightness average value is greater than a preset first threshold value, move the initial clipping boundary line toward a direction away from a center line of the clipping region by an i column, to obtain an i-th clipping boundary line; wherein, the initial value of i is 1, i is a positive integer;
a shearing judgment unit, configured to eliminate shearing if the distance between the ith shearing boundary line and the center line of the shearing area is greater than or equal to a first shearing distance;
a cutting boundary line moving unit, configured to calculate an ith luminance average value corresponding to a pixel in a frame where the ith cutting boundary line is located if a distance between the ith cutting boundary line and a center line of the cutting area is smaller than a first cutting distance; or if the ith brightness average value is greater than the preset first threshold value, making i=i+1, and returning to perform moving the initial shearing boundary line by i columns in a direction away from the central line of the shearing area;
the target cutting boundary line determining unit is used for taking the ith cutting boundary line as a target cutting boundary line if the ith brightness average value is smaller than the preset first threshold value; if yes, no shearing is needed; if not, calculating the average brightness gradient difference value of the frame where the ith cutting boundary line is positioned and the frame where the ith-1 cutting boundary line is positioned; if the average brightness gradient difference value is larger than a preset second threshold value, determining that the target shearing boundary line is incorrect, and reconfirming the target shearing boundary line; and if the average brightness gradient difference value is smaller than or equal to a preset second threshold value, determining the size of the shearing area according to the target shearing boundary line.
8. A smart device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps in the method of calculating a cut area according to any one of claims 1-6 when the computer program is executed.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps in the method of calculating a clipping region according to any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011321701.7A CN114527948B (en) | 2020-11-23 | 2020-11-23 | Method and device for calculating clipping region, intelligent device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011321701.7A CN114527948B (en) | 2020-11-23 | 2020-11-23 | Method and device for calculating clipping region, intelligent device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114527948A CN114527948A (en) | 2022-05-24 |
CN114527948B true CN114527948B (en) | 2024-03-12 |
Family
ID=81619906
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011321701.7A Active CN114527948B (en) | 2020-11-23 | 2020-11-23 | Method and device for calculating clipping region, intelligent device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114527948B (en) |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08214210A (en) * | 1993-12-17 | 1996-08-20 | Nippon Telegr & Teleph Corp <Ntt> | Method and device for detecting cutting point of video |
WO2002005547A2 (en) * | 2000-07-07 | 2002-01-17 | Koninklijke Philips Electronics N.V. | Window detection |
TW200917829A (en) * | 2007-10-05 | 2009-04-16 | Himax Tech Ltd | Method for detecting borders of active region in frame |
CN103079028A (en) * | 2011-10-25 | 2013-05-01 | 联咏科技股份有限公司 | Black edge detection method for image picture and image processing device |
JP2013210887A (en) * | 2012-03-30 | 2013-10-10 | Canon Inc | Image processing apparatus and control method therefor |
JP2014127026A (en) * | 2012-12-26 | 2014-07-07 | Nippon Soken Inc | Branch road determination device, boundary line recognition device |
US9060106B1 (en) * | 2012-06-19 | 2015-06-16 | Google Inc. | Border detection in videos |
KR101733028B1 (en) * | 2016-05-30 | 2017-05-08 | 경북대학교 산학협력단 | Method For Estimating Edge Displacement Againt Brightness |
CN107105184A (en) * | 2017-04-01 | 2017-08-29 | 深圳市蓝莓派科技有限公司 | A kind of same screen projective techniques of mobile terminal in portrait layout advertisement machine |
CN107464251A (en) * | 2016-06-03 | 2017-12-12 | 上海顺久电子科技有限公司 | The black edge detection method and device of a kind of image |
KR20180072517A (en) * | 2017-07-19 | 2018-06-29 | 주식회사 쓰리이 | Method for detecting borderline between iris and sclera |
CN111401165A (en) * | 2020-03-06 | 2020-07-10 | Tcl华星光电技术有限公司 | Station caption extraction method, display device and computer-readable storage medium |
CN111479162A (en) * | 2020-04-07 | 2020-07-31 | 广州酷狗计算机科技有限公司 | Live data transmission method and device and computer readable storage medium |
CN111695540A (en) * | 2020-06-17 | 2020-09-22 | 北京字节跳动网络技术有限公司 | Video frame identification method, video frame cutting device, electronic equipment and medium |
-
2020
- 2020-11-23 CN CN202011321701.7A patent/CN114527948B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08214210A (en) * | 1993-12-17 | 1996-08-20 | Nippon Telegr & Teleph Corp <Ntt> | Method and device for detecting cutting point of video |
WO2002005547A2 (en) * | 2000-07-07 | 2002-01-17 | Koninklijke Philips Electronics N.V. | Window detection |
TW200917829A (en) * | 2007-10-05 | 2009-04-16 | Himax Tech Ltd | Method for detecting borders of active region in frame |
CN103079028A (en) * | 2011-10-25 | 2013-05-01 | 联咏科技股份有限公司 | Black edge detection method for image picture and image processing device |
JP2013210887A (en) * | 2012-03-30 | 2013-10-10 | Canon Inc | Image processing apparatus and control method therefor |
US9060106B1 (en) * | 2012-06-19 | 2015-06-16 | Google Inc. | Border detection in videos |
JP2014127026A (en) * | 2012-12-26 | 2014-07-07 | Nippon Soken Inc | Branch road determination device, boundary line recognition device |
KR101733028B1 (en) * | 2016-05-30 | 2017-05-08 | 경북대학교 산학협력단 | Method For Estimating Edge Displacement Againt Brightness |
CN107464251A (en) * | 2016-06-03 | 2017-12-12 | 上海顺久电子科技有限公司 | The black edge detection method and device of a kind of image |
CN107105184A (en) * | 2017-04-01 | 2017-08-29 | 深圳市蓝莓派科技有限公司 | A kind of same screen projective techniques of mobile terminal in portrait layout advertisement machine |
KR20180072517A (en) * | 2017-07-19 | 2018-06-29 | 주식회사 쓰리이 | Method for detecting borderline between iris and sclera |
CN111401165A (en) * | 2020-03-06 | 2020-07-10 | Tcl华星光电技术有限公司 | Station caption extraction method, display device and computer-readable storage medium |
CN111479162A (en) * | 2020-04-07 | 2020-07-31 | 广州酷狗计算机科技有限公司 | Live data transmission method and device and computer readable storage medium |
CN111695540A (en) * | 2020-06-17 | 2020-09-22 | 北京字节跳动网络技术有限公司 | Video frame identification method, video frame cutting device, electronic equipment and medium |
Non-Patent Citations (1)
Title |
---|
基于图像分割和对象跟踪的新闻视频镜头边界检测方法;徐新文;李国辉;朱为;;中国图象图形学报(第08期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114527948A (en) | 2022-05-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3893513A1 (en) | Video stitching method and apparatus, electronic device, and computer storage medium | |
US10834424B2 (en) | Method and device for compressing image, and electronic device | |
CN113079379A (en) | Video compression method, device, equipment and computer readable storage medium | |
CN105279006B (en) | Screen capture method and terminal based on Android system | |
US20230362328A1 (en) | Video frame insertion method and apparatus, and electronic device | |
CN108495054B (en) | Method and device for processing high dynamic range signal and computer storage medium | |
US20120308147A1 (en) | Image processing device, image processing method, and program | |
CN107646131B (en) | Dithering for image data to be displayed | |
CN110858388B (en) | Method and device for enhancing video image quality | |
US10079981B2 (en) | Image dynamic range adjustment method, terminal, and storage medium | |
CN114527948B (en) | Method and device for calculating clipping region, intelligent device and storage medium | |
CN110572713B (en) | Transcoding method and processing terminal for adaptive video bandwidth ratio | |
US8934733B2 (en) | Method, apparatus, and non-transitory computer readable medium for enhancing image contrast | |
US10791307B2 (en) | Image details processing method, apparatus, terminal, and storage medium | |
US9659383B2 (en) | Image compression device, image compression method, and image compression program | |
US20230086245A1 (en) | Image processing method, electronic device, and image display system | |
CN107256137B (en) | Picture processing method and device | |
JP2005241677A (en) | Display apparatus and display method | |
CN110941413A (en) | Display screen generation method and related device | |
CN110533628B (en) | Method and device for determining screen direction and readable storage medium | |
CN114756190B (en) | Method and device for adjusting scaling based on resolution and computing equipment | |
CN112073686B (en) | Image display method and device and electronic equipment | |
CN115705614B (en) | Image processing method, device, electronic equipment and storage medium | |
CN110930292B (en) | Image processing method, device, computer storage medium and terminal | |
JP2002016796A (en) | Mobile communication terminal |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |