CN104881888B - Picture clipping method and device - Google Patents

Picture clipping method and device Download PDF

Info

Publication number
CN104881888B
CN104881888B CN201510338319.XA CN201510338319A CN104881888B CN 104881888 B CN104881888 B CN 104881888B CN 201510338319 A CN201510338319 A CN 201510338319A CN 104881888 B CN104881888 B CN 104881888B
Authority
CN
China
Prior art keywords
picture
cut
crop box
region
linear equation
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
CN201510338319.XA
Other languages
Chinese (zh)
Other versions
CN104881888A (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.)
Beijing Jupiter Technology Co ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201510338319.XA priority Critical patent/CN104881888B/en
Publication of CN104881888A publication Critical patent/CN104881888A/en
Application granted granted Critical
Publication of CN104881888B publication Critical patent/CN104881888B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses a picture clipping method and device. A picture cropping method is used for cropping a picture subjected to angle rotation and comprises the following steps: receiving a picture clipping instruction input by a user; the picture clipping instruction carries position information of a clipping frame; judging whether the coverage area of the cutting frame is completely positioned in the picture area of the picture to be cut according to the position information of the cutting frame, if so, cutting the picture to be cut by using the cutting frame; otherwise, adjusting the coverage area of the cutting frame to the picture area to be cut, and cutting the picture to be cut by using the adjusted cutting frame. The invention can determine which cutting mode is specifically adopted by comparing whether the covering area of the cutting frame falls into the picture area of the picture to be cut aiming at the picture with the angle rotation, thereby ensuring that the cutting frame does not exceed the picture area of the picture to be cut when a user cuts the picture with the angle rotation.

Description

A kind of picture method of cutting out and device
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of picture method of cutting out and device.
Background technology
With the type for the image processing software that the fast development of image processing techniques, image processing software developer provide More and more, function is increasingly abundanter.The image processing software of mainstream is respectively provided with image cropping function at present.Image processing software When being cut to picture, realized by crop box, user can come by adjusting modes such as crop box size, positions Obtain the image-region for it is expected content.
However, due to use crop box to occur angle rotation picture carry out cut make when, it is difficult to ensure that crop box The picture region of picture to be cut is fallen completely within, therefore there is an urgent need for propose a kind of picture method of cutting out to solve the above problems.
Invention content
To solve the above-mentioned problems, the embodiment of the invention discloses a kind of picture method of cutting out and device, particular technique sides Case is as follows:
A kind of picture method of cutting out provided by the invention, this method are used to cut the picture that angle rotation occurs, Including:
It receives picture input by user and cuts instruction;Wherein, the picture cuts the position that crop box is carried in instruction Information;
According to the location information of crop box, judge whether the overlay area of the crop box is fully located at picture to be cut In picture region, if so, being cut using the crop box to the picture to be cut;
Otherwise, the overlay area of the crop box is adjusted to the picture region to be cut, after adjustment Crop box cuts the picture to be cut.
According in a kind of specific embodiment provided by the invention, the location information according to crop box, described in judgement Whether the overlay area of crop box is fully located in the picture region of picture to be cut, including:
Two-dimensional Cartesian coordinate system is established using a point in the picture region of the picture to be cut as origin, described in calculating The linear equation of the four edges of picture to be cut;
According to the location information of crop box, four endpoints of the crop box under same two-dimensional Cartesian coordinate system are determined Coordinate value;
According to the linear equation and coordinate value, judge whether four endpoints of the crop box are located at the linear equation In the region of composition, if it is, the overlay area of the crop box is fully located in the picture region of picture to be cut, otherwise Not exclusively it is located at.
According in a kind of specific embodiment provided by the invention, a point in the picture region of the picture to be cut Endpoint for the picture to be cut.
According in a kind of specific embodiment provided by the invention, the four edges of picture to be cut described in the calculating it is straight Line equation, including:
According to the rotation angle of the picture length of the picture to be cut, width and picture, picture to be cut described in calculating Four edges linear equation;
Or
According to four extreme coordinates values of the picture to be cut, the straight line side of the four edges of picture to be cut described in calculating Journey.
It is described according to the linear equation and coordinate value according in a kind of specific embodiment provided by the invention, judge Whether four endpoints of the crop box are located in the region that the linear equation is formed, including:
According to the linear equation, generation corresponds to four functions of the four edges of the picture to be cut;
Four endpoints of the crop box are substituted into four letters corresponding to the four edges of the picture to be cut respectively In number;
For each function, judge the crop box four endpoints substitute into the function result whether jack per line;
If equal jack per line, further directed to two functions corresponding to every group each other side of opposite side, the crop box is judged Four endpoints substitute into two functions result whether contrary sign, if equal contrary sign, four endpoints of the crop box are located at In the region that the linear equation is formed.
According in a kind of specific embodiment provided by the invention, adjusted in the overlay area by the crop box to Before in the picture region to be cut, further include:
It shows to user and is prompted for the first message of picture region that crop box is prompted to exceed picture to be cut.
According in a kind of specific embodiment provided by the invention, adjusted in the overlay area by the crop box to Before in the picture region to be cut, further include:
It shows to user and disappears for asking whether to receive that overlay area is adjusted second to picture region by system automatically Breath prompting;
After the affirmative operation that user makes for second message prompting is received, perform described by the crop box Overlay area adjust to the step in the picture region to be cut.
A kind of picture Scissoring device provided by the invention, the device are used to cut the picture that angle rotation occurs, Including:
Command reception module cuts instruction for receiving picture input by user;Wherein, the picture cuts in instruction and takes Location information with crop box;
Judgment module according to the location information of crop box, judges whether the overlay area of the crop box is fully located at and treats In the picture region for cutting picture;
First cuts module, in the case where the judging result of the judgment module is to be, using the crop box The picture to be cut is cut;
Second cuts module, in the case of being no in the judging result of the judgment module, by the crop box Overlay area is adjusted to the picture region to be cut, and the picture to be cut is carried out using the crop box after adjustment It cuts.
According in a kind of specific embodiment provided by the invention, the judgment module, including:
Linear equation computational submodule, for being established by origin of a point in the picture region of the picture to be cut Two-dimensional Cartesian coordinate system, the linear equation of the four edges of picture to be cut described in calculating;
Coordinate value determination sub-module for the location information according to crop box, is determined under same two-dimensional Cartesian coordinate system The coordinate value of four endpoints of the crop box;
Judging submodule, for whether according to the linear equation and coordinate value, judging four endpoints of the crop box In the region that the linear equation is formed, if it is, the overlay area of the crop box is fully located at picture to be cut Picture region in, be otherwise not exclusively located at.
According in a kind of specific embodiment provided by the invention, a point in the picture region of the picture to be cut Endpoint for the picture to be cut.
According in a kind of specific embodiment provided by the invention, the linear equation computational submodule is specifically used for:
Two-dimensional Cartesian coordinate system is established as origin using a point in the picture region of the picture to be cut, according to described The rotation angle of the picture length of picture to be cut, width and picture, the straight line side of the four edges of picture to be cut described in calculating Journey;
Or
Two-dimensional Cartesian coordinate system is established as origin using a point in the picture region of the picture to be cut, according to described Four extreme coordinates values of picture to be cut, the linear equation of the four edges of picture to be cut described in calculating.
According in a kind of specific embodiment provided by the invention, the judging submodule is specifically used for:
According to the linear equation, generation corresponds to four functions of the four edges of the picture to be cut;
Four endpoints of the crop box are substituted into four letters corresponding to the four edges of the picture to be cut respectively In number;
For each function, judge the crop box four endpoints substitute into the function result whether jack per line;
If equal jack per line, further directed to two functions corresponding to every group each other side of opposite side, the crop box is judged Four endpoints substitute into two functions result whether contrary sign, if equal contrary sign, four endpoints of the crop box are located at In the region that the linear equation is formed.
According in a kind of specific embodiment provided by the invention, described device further includes:
First message prompts display module, for showing that crop box is prompted to exceed the figure of picture to be cut to user The first message prompting of panel region.
According in a kind of specific embodiment provided by the invention, described device further includes:
Second message prompts display module, for showing to ask whether to receive system automatically by overlay area to user Adjust the second message prompting to picture region;
Execution module is triggered, for after the affirmative operation that user makes for second message prompting is received, touching Send out described second cutting module execution the overlay area of the crop box is adjusted to the behaviour in the picture region to be cut Make.
Using above-mentioned technical proposal, picture method of cutting out and device provided in an embodiment of the present invention can receive use After the picture of family input cuts instruction, the location information of crop box that carries in instruction is cut according to the picture, described in judgement Whether the overlay area of crop box is fully located in the picture region of picture to be cut, if so, using the crop box to institute Picture to be cut is stated to be cut;Otherwise, the overlay area of the crop box is adjusted to the picture region to be cut It is interior, the picture to be cut is cut using the crop box after adjustment.
Compared with prior art, the present invention can be directed to the picture that angle rotation occurs, by comparing the covering of crop box Whether region falls into the mode in the picture region of picture to be cut, and determines specifically using which kind of cutting method, so as to ensure When user cuts the picture that angle rotation occurs, crop box is without departing from the picture region of picture to be cut.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of flow chart of picture method of cutting out provided in an embodiment of the present invention;
Fig. 1 (a) is a kind of flow chart of specific embodiment of S102 provided in an embodiment of the present invention;
Fig. 1 (b) is the exemplary plot of the picture provided in an embodiment of the present invention that angle rotation does not occur;
Fig. 1 (c) is the exemplary plot of the picture of generation angle rotation provided in an embodiment of the present invention;
Fig. 2 is a kind of structure diagram of picture Scissoring device provided in an embodiment of the present invention.
Specific embodiment
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below in conjunction with of the invention real The attached drawing in example is applied, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described implementation Example is only part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field is common Technical staff's all other embodiments obtained without making creative work belong to the model that the present invention protects It encloses.
With the type for the image processing software that the fast development of image processing techniques, image processing software developer provide More and more, function is increasingly abundanter.The image processing software of mainstream is respectively provided with image cropping function at present.Image processing software When being cut to picture, realized by crop box, user can come by adjusting modes such as crop box size, positions Obtain the image-region for it is expected content.
However, due to use crop box to occur angle rotation picture carry out cut make when, it is difficult to ensure that crop box The picture region of picture to be cut is fallen completely within, therefore there is an urgent need for propose a kind of picture method of cutting out to solve the above problems.In order to It solves the above problems, an embodiment of the present invention provides a kind of picture method of cutting out and devices.
A kind of picture method of cutting out provided in an embodiment of the present invention is introduced first below.
It should be noted that method provided in an embodiment of the present invention is suitable for electronic equipment, in practical applications, the electronics Equipment can include:The electronic equipments such as smart mobile phone, tablet computer, notebook/desktop computer.
As shown in Figure 1, a kind of picture method of cutting out provided in an embodiment of the present invention, this method is used for angle rotation occurs Picture cut, can include:
S101 receives picture input by user and cuts instruction;Wherein, the picture cuts in instruction and carries crop box Location information.
The present invention can provide the interface that input picture cuts instruction, in practical applications, the form of the interface to the user It can include:The size value input interface of crop box can receive touch screen or operate size of the equipment such as mouse to crop box Or position is adjusted interface.It is not limited in the embodiment of the present invention.
S102 according to the location information of crop box, judges whether the overlay area of the crop box is fully located at and waits to cut In the picture region of picture.
Optionally, as shown in Fig. 1 (a), above-mentioned S102 can include:
S102a establishes two-dimensional Cartesian coordinate system using a point in the picture region of the picture to be cut as origin, meter The linear equation of the four edges of picture to be cut described in calculation.
Preferably, a point in the picture region of the picture to be cut is that the endpoint of the picture to be cut for example is treated Cut the upper left endpoint of picture.
Specifically, in the specific embodiment of the present invention, the four edges of picture to be cut described in the calculating Linear equation can include:
According to the rotation angle of the picture length of the picture to be cut, width and picture, picture to be cut described in calculating Four edges linear equation.
Such as Fig. 1 (b) show the picture to be cut when angle rotation not occurring, Fig. 1 (c), which is shown, occurs angle rotation When picture to be cut, wherein A, B, C, D be picture four endpoints, coordinate system, X are established as origin using the A points in Fig. 1 (b) It is axial right just, under Y-axis to be just, to establish coordinate system, for the picture that angle rotation occurs, following information can be obtained:
1. width W, the height V of the picture of angle rotation occurs;
2. the rotation angle of picture is represented with letter α;
First, the AB, BC, CD of the picture before being rotated according to condition 1 in the hope of angle, the linear equation point of DA four edges It Wei not x=0, y=0, x=W, y=V;
Later, according to picture rotation angle [alpha] can in the hope of the AB of the postrotational picture of angle, BC, CD, DA four edges it is straight Line equation.
It is appreciated that the coordinate of two points known in two-dimensional Cartesian coordinate system, it can be aforementioned 2 points in the hope of a process Linear equation, in the another embodiment of the present invention, the four edges of picture to be cut described in the calculating it is straight Line equation can include:
According to four extreme coordinates values of the picture to be cut, the straight line side of the four edges of picture to be cut described in calculating Journey.
S102b according to the location information of crop box, determines four of the crop box under same two-dimensional Cartesian coordinate system The coordinate value of endpoint.
Four endpoints and coordinate value of crop box as shown in Fig. 1 (c):A1 points (ax1, ay1), B1 points (bx1, by1), C1 Point (cx1, cy1) and D1 points (dx1, dy1).
Whether S102c according to the linear equation and coordinate value, judges four endpoints of the crop box positioned at described straight In the region that line equation is formed, if it is, the overlay area of the crop box is fully located at the picture region of picture to be cut It is interior, otherwise not exclusively it is located at.
Specifically, above-mentioned S102c, can include:
According to the linear equation, generation corresponds to four functions of the four edges of the picture to be cut;
Illustratively, it is assumed that the corresponding linear equations of AB are:Ex+Fy+G=0 (E, F, G are a certain constant), then AB is corresponded to Function for f (x, y)=Ex+Fy+G, similarly can be in the hope of other corresponding functions in three sides.
Four endpoints of the crop box are substituted into four letters corresponding to the four edges of the picture to be cut respectively In number;
For each function, judge the crop box four endpoints substitute into the function result whether jack per line;
If equal jack per line, further directed to two functions corresponding to every group each other side of opposite side, the crop box is judged Four endpoints substitute into two functions result whether contrary sign, if equal contrary sign, four endpoints of the crop box are located at In the region that the linear equation is formed.
Example illustratively is connected, the coordinate value A1 points (ax1, ay1) of above-mentioned four endpoints of crop box, B1 points (bx1, By1), C1 points (cx1, cy1) and D1 points (dx1, dy1) are brought into the corresponding functions of AB, are obtained:
E*ax1+F*ay1+G<=0 and E*bx1+F*by1+G<=0 and E*cx1+F*cy1+G<=0 and E*dx1+ F*dy1+G<=0 sets up --- --- condition 1 simultaneously
E*ax1+F*ay1+G>=0 and E*bx1+F*by1+G>=0 and E*cx1+F*cy1+G>=0 and E*dx1+ F*dy1+G>=0 sets up --- --- condition 2 simultaneously
Pay attention to:Condition 1 set up represent four terminal As 1 of crop box, B1, C1 and D1 straight line AB homonymy, condition 2 into Vertical four terminal As 1 for representing crop box, B1, C1 and D1 straight line AB homonymy.
Assuming that the corresponding linear equations of CD are:Hx+Jy+K=0 (H, J, K are a certain constant), then the corresponding functions of CD are f (x, y)=Hx+Jy+K;The coordinate value A1 points (ax1, ay1) of above-mentioned four endpoints of crop box, B1 points (bx1, by1), C1 points (cx1, cy1) and D1 points (dx1, dy1) are brought into the corresponding functions of CD, are obtained:
H*ax1+J*ay1+K>=0 and H*bx1+J*by1+K>=0 and H*cx1+J*cy1+K>=0 and H*dx1+ J*dy1+K>=0 sets up --- --- condition 3 simultaneously
H*ax1+J*ay1+K<=0 and H*bx1+J*by1+K<=0 and H*cx1+J*cy1+K<=0 and H*dx1+ J*dy1+K<=0 sets up --- --- condition 4 simultaneously
Pay attention to:Condition 3 set up represent four terminal As 1 of crop box, B1, C1 and D1 straight line CD homonymy, condition 4 into Vertical four terminal As 1 for representing crop box, B1, C1 and D1 straight line CD homonymy.
Ensuring the condition that four terminal As 1 of crop box, B1, C1 and D1 are located at the edge detection in picture region is:Condition 1 and condition 3 need to set up simultaneously or condition 2 and condition 4 at the same set up (ensure here be cut out frame AB and CD it Between).The edge testing conditions that this group of opposite side needs of BC and DA meet can similarly be obtained.
S103 cuts the picture to be cut using the crop box.
S104 adjusts the overlay area of the crop box to the picture region to be cut, after adjustment Crop box cuts the picture to be cut.
The adjustment of the overlay area to crop box in step of the present invention, can include:To the overlay area of crop box The adjustment of position or the adjustment of size to the overlay area of crop box.
It can be seen that picture method of cutting out provided in an embodiment of the present invention, can cut out receiving picture input by user After cutting instruction, the location information of crop box carried in instruction is cut according to the picture, judges the area of coverage of the crop box Whether domain is fully located in the picture region of picture to be cut, if so, using the crop box to the picture to be cut It is cut;Otherwise, the overlay area of the crop box is adjusted to the picture region to be cut, after adjustment Crop box cuts the picture to be cut.
Compared with prior art, the present invention can be directed to the picture that angle rotation occurs, by comparing the covering of crop box Whether region falls into the mode in the picture region of picture to be cut, and determines specifically using which kind of cutting method, so as to ensure When user cuts the picture that angle rotation occurs, crop box is without departing from the picture region of picture to be cut.
Optionally, in another embodiment of the present invention, picture method of cutting out provided in an embodiment of the present invention, is judging Go out the crop box overlay area not exclusively positioned at picture to be cut picture region in the case of, can also general described in The overlay area of crop box is adjusted before to the picture region to be cut, and is included the following steps:
It shows to user and is prompted for the first message of picture region that crop box is prompted to exceed picture to be cut.
Optionally, in another embodiment of the present invention, picture method of cutting out provided in an embodiment of the present invention, is judging Go out the crop box overlay area not exclusively positioned at picture to be cut picture region in the case of, can also general described in The overlay area of crop box is adjusted before to the picture region to be cut, and is included the following steps:
It shows to user and disappears for asking whether to receive that overlay area is adjusted second to picture region by system automatically Breath prompting;
After the affirmative operation that user makes for second message prompting is received, perform described by the crop box Overlay area adjust to the step in the picture region to be cut.
The present embodiment step can be adjusted the overlay area of crop box after obtaining user and agreeing to, so as to cut Image out is full of crop box and with rotation angle.
Corresponding to approach presented above embodiment, the embodiment of the present invention additionally provides a kind of picture Scissoring device.
As shown in Fig. 2, a kind of picture Scissoring device provided in an embodiment of the present invention, which is used for angle rotation occurs Picture cut, can include:
Command reception module 201 cuts instruction for receiving picture input by user;Wherein, the picture cuts instruction In carry the location information of crop box;
Judgment module 202 according to the location information of crop box, judges whether the overlay area of the crop box is fully located at In the picture region of picture to be cut;
First cuts module 203, in the judging result of the judgment module 202 in the case of being, using described Crop box cuts the picture to be cut;
Second cuts module 204, in the case of being no in the judging result of the judgment module 202, by the sanction The overlay area for cutting frame is adjusted to the picture region to be cut, using the crop box after adjustment to the figure to be cut Piece is cut.
It can be seen that picture Scissoring device provided in an embodiment of the present invention, can cut out receiving picture input by user After cutting instruction, the location information of crop box carried in instruction is cut according to the picture, judges the area of coverage of the crop box Whether domain is fully located in the picture region of picture to be cut, if so, using the crop box to the picture to be cut It is cut;Otherwise, the overlay area of the crop box is adjusted to the picture region to be cut, after adjustment Crop box cuts the picture to be cut.
Compared with prior art, the present invention can be directed to the picture that angle rotation occurs, by comparing the covering of crop box Whether region falls into the mode in the picture region of picture to be cut, and determines specifically using which kind of cutting method, so as to ensure When user cuts the picture that angle rotation occurs, crop box is without departing from the picture region of picture to be cut.
Optionally, in one embodiment of the invention, the judgment module 202, can include:
Linear equation computational submodule, for being established by origin of a point in the picture region of the picture to be cut Two-dimensional Cartesian coordinate system, the linear equation of the four edges of picture to be cut described in calculating;
Coordinate value determination sub-module for the location information according to crop box, is determined under same two-dimensional Cartesian coordinate system The coordinate value of four endpoints of the crop box;
Judging submodule, for whether according to the linear equation and coordinate value, judging four endpoints of the crop box In the region that the linear equation is formed, if it is, the overlay area of the crop box is fully located at picture to be cut Picture region in, be otherwise not exclusively located at.
Optionally, in one embodiment of the invention, a point in the picture region of the picture to be cut can be with Endpoint for the picture to be cut.
Optionally, in one embodiment of the invention, the linear equation computational submodule, specifically can be used for:
Two-dimensional Cartesian coordinate system is established as origin using a point in the picture region of the picture to be cut, according to described The rotation angle of the picture length of picture to be cut, width and picture, the straight line side of the four edges of picture to be cut described in calculating Journey;
Or
Two-dimensional Cartesian coordinate system is established as origin using a point in the picture region of the picture to be cut, according to described Four extreme coordinates values of picture to be cut, the linear equation of the four edges of picture to be cut described in calculating.
Optionally, in one embodiment of the invention, the judging submodule 202, specifically can be used for:
According to the linear equation, generation corresponds to four functions of the four edges of the picture to be cut;
Four endpoints of the crop box are substituted into four letters corresponding to the four edges of the picture to be cut respectively In number;
For each function, judge the crop box four endpoints substitute into the function result whether jack per line;
If equal jack per line, further directed to two functions corresponding to every group each other side of opposite side, the crop box is judged Four endpoints substitute into two functions result whether contrary sign, if equal contrary sign, four endpoints of the crop box are located at In the region that the linear equation is formed.
Optionally, in one embodiment of the invention, described device can also include:
First message prompts display module, for showing that crop box is prompted to exceed the figure of picture to be cut to user The first message prompting of panel region.
Optionally, in one embodiment of the invention, described device can also include:
Second message prompts display module, for showing to ask whether to receive system automatically by overlay area to user Adjust the second message prompting to picture region;
Execution module is triggered, for after the affirmative operation that user makes for second message prompting is received, touching Send out described second cutting module execution the overlay area of the crop box is adjusted to the behaviour in the picture region to be cut Make.
For device embodiment, since it is substantially similar to embodiment of the method, so description is fairly simple, it is related Part illustrates referring to the part of embodiment of the method.
For convenience of description, it is divided into various modules during description apparatus above with function to describe respectively.Certainly, implementing this The function of each module is realized can in the same or multiple software and or hardware during invention.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any this practical relationship or sequence.Moreover, term " comprising ", "comprising" or its any other variant are intended to Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those Element, but also including other elements that are not explicitly listed or further include as this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that Also there are other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is described using relevant mode, identical similar portion between each embodiment Point just to refer each other, and the highlights of each of the examples are difference from other examples.Especially for device reality For applying example, since it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method Part explanation.
One of ordinary skill in the art will appreciate that all or part of step in realization above method embodiment is can It is completed with instructing relevant hardware by program, the program can be stored in computer read/write memory medium, The storage medium designated herein obtained, such as:ROM/RAM, magnetic disc, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (12)

1. a kind of picture method of cutting out, which is characterized in that this method is used to cut the picture that angle rotation occurs, and wraps It includes:
It receives picture input by user and cuts instruction;Wherein, the picture cuts the location information that crop box is carried in instruction;
Two-dimensional Cartesian coordinate system is established as origin using a point in the picture region of picture to be cut, cutting figure is treated described in calculating The linear equation of the four edges of piece;
According to the location information of crop box, the coordinate of four endpoints of the crop box under same two-dimensional Cartesian coordinate system is determined Value;
According to the linear equation and coordinate value, judge whether four endpoints of the crop box are located at the linear equation and form Region in,
If it is, the overlay area of the crop box is fully located in the picture region of picture to be cut, the cutting is used Frame cuts the picture to be cut;
Otherwise not exclusively it is located at, the overlay area of the crop box is adjusted to the picture region to be cut, uses tune Crop box after whole cuts the picture to be cut.
2. according to the method described in claim 1, it is characterized in that, a point in the picture region of the picture to be cut is The endpoint of the picture to be cut.
3. method according to claim 1 or 2, which is characterized in that the four edges of picture to be cut described in the calculating Linear equation, including:
According to the rotation angle of the picture length of the picture to be cut, width and picture, the four of picture to be cut described in calculating The linear equation on side;
Or
According to four extreme coordinates values of the picture to be cut, the linear equation of the four edges of picture to be cut described in calculating.
4. according to the method described in claim 3, it is characterized in that, described according to the linear equation and coordinate value, institute is judged Whether four endpoints for stating crop box are located in the region that the linear equation is formed, including:
According to the linear equation, generation corresponds to four functions of the four edges of the picture to be cut;
Four endpoints of the crop box are substituted into respectively in four functions corresponding to the four edges of the picture to be cut;
For each function, judge the crop box four endpoints substitute into the function result whether jack per line;
If equal jack per line, further directed to two functions corresponding to every group each other side of opposite side, the four of the crop box is judged A endpoint substitute into two functions result whether contrary sign, if equal contrary sign, four endpoints of the crop box are located at described In the region that linear equation is formed.
5. it according to the method described in claim 1, it is characterized in that, is adjusted in the overlay area by the crop box to institute Before stating in picture region to be cut, further include:
It shows to user and is prompted for the first message of picture region that crop box is prompted to exceed picture to be cut.
6. it according to the method described in claim 1, it is characterized in that, is adjusted in the overlay area by the crop box to institute Before stating in picture region to be cut, further include:
It shows to user and is carried for asking whether to receive that overlay area is adjusted the second message to picture region by system automatically Show;
After the affirmative operation that user makes for second message prompting is received, the covering the crop box is performed Cover area is adjusted to the step in the picture region to be cut.
7. a kind of picture Scissoring device, which is characterized in that the device is used to cut the picture that angle rotation occurs, and wraps It includes:
Command reception module cuts instruction for receiving picture input by user;Wherein, the picture cuts in instruction and carries The location information of crop box;
Judgment module, including:
Linear equation computational submodule, for establishing two-dimentional right angle by origin of a point in the picture region of picture to be cut Coordinate system, the linear equation of the four edges of picture to be cut described in calculating;
Coordinate value determination sub-module for the location information according to crop box, determines described under same two-dimensional Cartesian coordinate system The coordinate value of four endpoints of crop box;
Judging submodule, for according to the linear equation and coordinate value, judging whether four endpoints of the crop box are located at In the region that the linear equation is formed, if it is, the overlay area of the crop box is fully located at the figure of picture to be cut In panel region, otherwise not exclusively it is located at;
First cuts module, in the judging result of the judgment module in the case of being, using the crop box to institute Picture to be cut is stated to be cut;
Second cuts module, in the case of being no in the judging result of the judgment module, by the covering of the crop box Region is adjusted to the picture region to be cut, and the picture to be cut is cut out using the crop box after adjustment It cuts.
8. device according to claim 7 a, which is characterized in that point in the picture region of the picture to be cut is The endpoint of the picture to be cut.
9. device according to claim 7 or 8, which is characterized in that the linear equation computational submodule is specifically used for:
Two-dimensional Cartesian coordinate system is established as origin using a point in the picture region of the picture to be cut, according to described to be cut Cut the rotation angle of the picture length of picture, width and picture, the linear equation of the four edges of picture to be cut described in calculating;
Or
Two-dimensional Cartesian coordinate system is established as origin using a point in the picture region of the picture to be cut, according to described to be cut Four extreme coordinates values of picture are cut, the linear equation of the four edges of picture to be cut described in calculating.
10. device according to claim 9, which is characterized in that the judging submodule is specifically used for:
According to the linear equation, generation corresponds to four functions of the four edges of the picture to be cut;
Four endpoints of the crop box are substituted into respectively in four functions corresponding to the four edges of the picture to be cut;
For each function, judge the crop box four endpoints substitute into the function result whether jack per line;
If equal jack per line, further directed to two functions corresponding to every group each other side of opposite side, the four of the crop box is judged A endpoint substitute into two functions result whether contrary sign, if equal contrary sign, four endpoints of the crop box are located at described In the region that linear equation is formed.
11. device according to claim 7, which is characterized in that described device further includes:
First message prompts display module, for showing that crop box is prompted to exceed the picture region of picture to be cut to user The first message prompting in domain.
12. device according to claim 7, which is characterized in that described device further includes:
Second message prompts display module, for automatically adjusting overlay area for asking whether to receive system to user's displaying Second message prompting in picture region;
Execution module is triggered, for after the affirmative operation that user makes for second message prompting is received, triggering institute The execution of the second cutting module is stated to adjust the overlay area of the crop box to the operation in the picture region to be cut.
CN201510338319.XA 2015-06-17 2015-06-17 Picture clipping method and device Active CN104881888B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510338319.XA CN104881888B (en) 2015-06-17 2015-06-17 Picture clipping method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510338319.XA CN104881888B (en) 2015-06-17 2015-06-17 Picture clipping method and device

Publications (2)

Publication Number Publication Date
CN104881888A CN104881888A (en) 2015-09-02
CN104881888B true CN104881888B (en) 2018-07-10

Family

ID=53949371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510338319.XA Active CN104881888B (en) 2015-06-17 2015-06-17 Picture clipping method and device

Country Status (1)

Country Link
CN (1) CN104881888B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105205780B (en) * 2015-10-19 2018-09-07 大唐网络有限公司 Picture method of cutting out and device
CN108154464B (en) * 2017-12-06 2020-09-22 中国科学院自动化研究所 Method and device for automatically clipping picture based on reinforcement learning
CN109447072A (en) * 2018-11-08 2019-03-08 北京金山安全软件有限公司 Thumbnail clipping method and device, electronic equipment and readable storage medium
CN109785402A (en) * 2018-12-12 2019-05-21 四川商通实业有限公司 A kind of H5 picture method of cutting out
CN110334653A (en) * 2019-07-08 2019-10-15 聚好看科技股份有限公司 Image processing method, device and equipment in video communication

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517951A (en) * 2003-01-23 2004-08-04 精工爱普生株式会社 Image editing device, image cutting method and program
CN102336069A (en) * 2010-07-16 2012-02-01 鸿富锦精密工业(深圳)有限公司 Printer with picture clipping function and picture clipping method
CN102520865A (en) * 2011-12-19 2012-06-27 深圳桑菲消费通信有限公司 Method for realizing self-adaption image cropping of mobile phone
CN102551748A (en) * 2010-09-29 2012-07-11 富士胶片株式会社 An image processing apparatus, a radiographic image system, and an image processing method and program
CN103268590A (en) * 2013-05-06 2013-08-28 西南大学 Method for shooting by rotating viewing frame

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646258B (en) * 2011-02-21 2016-01-06 腾讯科技(深圳)有限公司 Image cropping method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517951A (en) * 2003-01-23 2004-08-04 精工爱普生株式会社 Image editing device, image cutting method and program
CN102336069A (en) * 2010-07-16 2012-02-01 鸿富锦精密工业(深圳)有限公司 Printer with picture clipping function and picture clipping method
CN102551748A (en) * 2010-09-29 2012-07-11 富士胶片株式会社 An image processing apparatus, a radiographic image system, and an image processing method and program
CN102520865A (en) * 2011-12-19 2012-06-27 深圳桑菲消费通信有限公司 Method for realizing self-adaption image cropping of mobile phone
CN103268590A (en) * 2013-05-06 2013-08-28 西南大学 Method for shooting by rotating viewing frame

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Photoshop CS6全新的裁剪工具;曹升赓;《数码暗房》;20131231;68-70 *

Also Published As

Publication number Publication date
CN104881888A (en) 2015-09-02

Similar Documents

Publication Publication Date Title
CN104881888B (en) Picture clipping method and device
US11561680B2 (en) Method and apparatus for adding icon to interface of android system, and mobile terminal
US9851898B2 (en) Method for changing display range and electronic device thereof
CN107977141B (en) Interaction control method and device, electronic equipment and storage medium
US9285979B2 (en) Computer-implemented methods and systems for multi-touch duplication and swapping interactions
CN109669657B (en) Method and equipment for conducting remote document collaboration
CN106648581B (en) Page display method and device
CN106502573A (en) A kind of method and device of view interface movement
CN104571829A (en) Display control method of terminal and terminal
CN111625160A (en) Application icon adjusting method and device
KR20140120196A (en) Method and apparatus for transmitting message in an electronic device
CN106201175B (en) Location regulation method, device and the terminal of application icon
CN102833405A (en) Method and device for displaying static wallpaper and mobile terminal
CN108108078B (en) Electronic equipment, display control method and related product
CN111709894B (en) Image processing method, image processing device, electronic equipment and storage medium
CN105528333B (en) A kind of method and apparatus of document optimization display
CN111104077B (en) Multi-screen display control method, device and equipment and readable storage medium
US9354772B2 (en) Method and device for movement of image object
CN109144868B (en) Page judgment method and device
CN103780858A (en) Method and device for processing information, and electronic device
CN106569765B (en) Picture display process and device
CN103838501A (en) Information processing method and electronic device
CN104765564A (en) Screen-shooting method and device
CN112199753B (en) Shear wall generation method and device, electronic equipment and storage medium
CN112256378A (en) Display method, display device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201123

Address after: Room 115, area C, 1 / F, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing 100123

Patentee after: Beijing LEMI Technology Co.,Ltd.

Address before: 100085 Beijing City, Haidian District Road 33, two floor East Xiaoying

Patentee before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230811

Address after: 3870A, 3rd Floor, Building 4, Courtyard 49, Badachu Road, Shijingshan District, Beijing, 100144

Patentee after: Beijing Jupiter Technology Co.,Ltd.

Address before: 100123 room 115, area C, 1st floor, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing

Patentee before: Beijing LEMI Technology Co.,Ltd.

TR01 Transfer of patent right