CN107240105A - A kind of image cropping method and device - Google Patents
A kind of image cropping method and device Download PDFInfo
- Publication number
- CN107240105A CN107240105A CN201710415113.1A CN201710415113A CN107240105A CN 107240105 A CN107240105 A CN 107240105A CN 201710415113 A CN201710415113 A CN 201710415113A CN 107240105 A CN107240105 A CN 107240105A
- Authority
- CN
- China
- Prior art keywords
- picture
- cut out
- face
- image cropping
- demand
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
- G06T2207/30201—Face
Abstract
The present invention provides a kind of image cropping method and device, and the picture cut out by treating is acquired;Face datection is carried out to the picture to be cut out again, human face region is obtained;Then using the human face region as predeterminable area, the picture to be cut out is cut out according to the demand size of reception, the automatic cutting of picture is realized on the basis for ensureing face information completely, it is to avoid the problems of the prior art.
Description
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of image cropping method and device.
Background technology
In the information medias such as news, video, information even music, it is often necessary to choose a pictures as poster,
To one guiding of user and first impression;These contents can be appeared in mobile phone, flat board, computer and TV, and different
Occur in terminal, if obviously improper using a kind of poster of size, be at this moment accomplished by being cut into various sizes and apply
Different terminals.
It is a kind of simple image processing techniques that poster, which is cut, carries out cutting processing to poster according to certain rule, makes
Arrival user needed for requirement.Current poster tailoring technique is that alignment is cut, and the ratio of cutting, Ran Houbao are calculated first
Artwork is stayed to meet ratio most long a line, then be scaled to target size after being cut from centre.
But the method cut according to above-mentioned alignment is cut out, the poster content come is cut out in most cases endless
Whole, such as the place for having face to occur may be shredded or be cut, and cause the face information on picture incomplete.
The content of the invention
The present invention provides a kind of image cropping method and device, and to solve in the prior art, easily generation face information is incomplete
The problem of.
To achieve the above object, the technical scheme that the application is provided is as follows:
A kind of image cropping method, including:
The picture cut out is treated to be acquired;
Face datection is carried out to the picture to be cut out, human face region is obtained;
Using the human face region as the predeterminable area of demand size picture, size is to the picture to be cut out as desired
It is cut out.
It is preferred that, treated described before the picture cut out is acquired, in addition to:
Real-time snap shot is carried out to video image, the picture to be cut out is obtained.
It is preferred that, described to carry out Face datection to the picture to be cut out, obtaining human face region includes:
Face datection is carried out to the picture to be cut out, according to the area and position for detecting face, the people is generated
Face region.
It is preferred that, the predeterminable area is:In the demand size picture, midpoint is in the demand size picture
Point preset direction and with the region of one preset length of midpoint distance of the demand size picture.
A kind of image cropping device, including:Processor and memory;Wherein, the processor is used to load and perform institute
State a plurality of instruction stored in memory;
At least it is stored with the memory:
The picture cut out is treated to be acquired;
Face datection is carried out to the picture to be cut out, human face region is obtained;
Using the human face region as the predeterminable area of demand size picture, size is to the picture to be cut out as desired
It is cut out.
It is preferred that, also it is stored with the memory:Treated described before the picture cut out is acquired, to video figure
As carrying out real-time snap shot, the picture to be cut out is obtained.
It is preferred that, what is stored in the memory carries out Face datection to the picture to be cut out, and obtains human face region,
Including:
Face datection is carried out to the picture to be cut out, according to the area and position for detecting face, the people is generated
Face region.
It is preferred that, the predeterminable area is:In the demand size picture, midpoint is in the demand size picture
Point preset direction and with the region of one preset length of midpoint distance of the demand size picture.
The image cropping method that the present invention is provided, the picture cut out by treating is acquired;Wait to cut to described again
The picture of sanction carries out Face datection, obtains human face region;Then using the human face region as predeterminable area, according to the demand of reception
Size is cut out to the picture to be cut out, and the automatic cutting of picture is realized on the basis for ensureing face information completely
Cut, it is to avoid the problems of the prior art.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly or in prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, the accompanying drawing in description is only this below
Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the flow chart of image cropping method provided in an embodiment of the present invention;
Fig. 2 is the schematic diagram for the picture to be cut out that another embodiment of the present invention is provided;
Fig. 3 is the Face datection result schematic diagram for the picture to be cut out that another embodiment of the present invention is provided;
Fig. 4 be another embodiment of the present invention provide cut out after demand size picture schematic diagram;
Fig. 5 is another flow chart for the image cropping method that another embodiment of the present invention is provided;
Fig. 6 is the structural representation for the image cropping device that another embodiment of the present invention is provided.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only some embodiments of the present application, rather than whole embodiments.It is based on
Embodiment in the application, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of the application protection.
The present invention provides a kind of image cropping method, and to solve easily to occur in the prior art, face information is incomplete to ask
Topic.
Specifically, the image cropping method, referring to Fig. 1, including:
S101, treat the picture cut out and be acquired;
Original poster as shown in Figure 2, is if desired cut out to it, then the original poster is picture to be cut out.
S102, treat the picture cut out and carry out Face datection, obtain human face region;
It is preferred that, step S102 is specifically included:
Treat the picture cut out and carry out Face datection, according to the area and position for detecting face, generate human face region.
Pass through Face datection, it may be determined that the position of face and area, as shown in the square frame in Fig. 3, the people as obtained
Face region.
S103, using human face region as the predeterminable area of demand size picture, size is treated the picture cut out and entered as desired
Row is cut out.
It is determined that face will treat what is cut out after the predeterminable area of demand size picture according still further to demand size
Picture is cut out, it can be ensured that face information it is complete;And by the setting of predeterminable area, it may also be ensured that face is located at
Cut out the better position of rear picture (i.e. demand size picture);The demand size picture obtained after cutting out is as shown in Figure 4.
Face recognition technology has just occurred early in 1960s, with computer technology and optical image technology not
Disconnected development, the application walked in the early 1990s;The successful key of face identification system is the core algorithm for whether possessing tip, and
Make recognition result that there is practical discrimination and recognition speed;Face identification system is integrated with artificial intelligence, machine recognition, machine
A variety of professional techniques such as device study, model theory, expert system, Computer Vision, while the reason that median is handled need to be combined
By with realization, be the more recent application of living things feature recognition, the realization of its core technology presents weak artificial intelligence to strong man's work intelligence
Transformation of energy.
Face recognition technology develops for a long time, and all kinds of algorithms are increasingly ripe.Under commercial scene, though it is not reaching to laboratory level
Other discrimination, can still meet most of demand without spending high equipment, technology and the expense of maintenance.
Due to current full-automatic cutting poster technology, often there is the problem of face information is incomplete, can not meet
Application demand, therefore, the present embodiment propose a kind of poster tailoring technique based on recognition of face, enter treating the picture cut out
After row collection, by carrying out Face datection to poster, determine a border, i.e. predeterminable area, then cut to picture,
That is, the automatic cutting of picture is realized on the basis for ensureing face information completely, whole person's shape of face can be retained as making cutting
Poster face information out is no longer incomplete, and the integrality and accuracy of poster cutting are improved compared with prior art.
What deserves to be explained is, in the prior art, face recognition process mainly includes:Man face image acquiring and detection, face
Image preprocessing, facial image feature extraction and matching and identification.The present embodiment need to only use the collection and inspection of facial image
Survey, without follow-up complicated computing and processing, realize that difficulty is substantially reduced.
It is preferred that, in step S103, the predeterminable area is:In demand size picture, midpoint is in demand size picture
The preset direction at midpoint and with the region of one preset length of midpoint distance of demand size picture.
The automatic cutting of picture is realized on the basis for ensureing face information completely, it is necessary to before cutting out i.e. really to realize
Determine in the picture that face is located at after cutting out, and for highlighting beneficial to face information, face can be arranged at after cutting out
Picture middle position, or according to specific personage's posture, to realize maximization that people information retains, determine face
Particular location;It is not specifically limited herein, can be depending on its concrete application environment, in the protection domain of the application.
Another embodiment of the present invention additionally provides another image cropping method, on the basis of above-described embodiment,
In the application scenarios for being applied to live real-time poster, then the image cropping method is referring to Fig. 5, including:
S201, to video image carry out real-time snap shot, obtain picture to be cut out;
S202, treat the picture cut out and be acquired;
S203, treat the picture cut out and carry out Face datection, obtain human face region;
S204, using human face region as the predeterminable area of demand size picture, size is treated the picture cut out and entered as desired
Row is cut out.
When in the application scenarios that the image cropping method is applied to live real-time poster, in addition it is also necessary to an interception generation poster
Process, then the original poster being truncated to by IMAQ, Face datection and face location i.e. as shown in Fig. 2 set it
Afterwards, you can size is cut out as desired, the demand size picture finally wanted.
Remaining operation principle is same as the previously described embodiments, no longer repeats one by one herein.
Another embodiment of the present invention additionally provides a kind of image cropping device, referring to Fig. 6, including:Processor 101 and storage
Device 102;Wherein, processor 101 is used to load and perform a plurality of instruction stored in memory 102;
At least it is stored with memory 102:
The picture cut out is treated to be acquired;
Treat the picture cut out and carry out Face datection, obtain human face region;
Using human face region as the predeterminable area of demand size picture, size is treated the picture cut out and cut as desired
Cut out.
It is preferred that, also it is stored with memory 102:Treating before the picture cut out is acquired, video image is being entered
Row real-time snap shot, obtains picture to be cut out.
It is preferred that, the picture cut out for the treatment of stored in memory 102 carries out Face datection, obtains human face region, including:
Face datection is carried out to the picture to be cut out, according to the area and position for detecting face, the people is generated
Face region.
It is preferred that, the predeterminable area is:In demand size picture, default side of the midpoint at the midpoint of demand size picture
To and with demand size picture one preset length of midpoint distance region.
Remaining operation principle is same as the previously described embodiments, no longer repeats one by one herein.
The embodiment of each in the present invention is described by the way of progressive, and what each embodiment was stressed is and other realities
Apply the difference of example, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
Speech, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is referring to method part illustration
.
The above described is only a preferred embodiment of the present invention, not making any formal limitation to the present invention.Though
So the present invention is disclosed above with preferred embodiment, but is not limited to the present invention.It is any to be familiar with those skilled in the art
Member, without departing from the scope of the technical proposal of the invention, all using the methods and techniques content of the disclosure above to the present invention
Technical scheme makes many possible variations and modification, or is revised as the equivalent embodiment of equivalent variations.Therefore, it is every without departing from
The content of technical solution of the present invention, the technical spirit according to the present invention is to any simple modification made for any of the above embodiments, equivalent
Change and modify, still fall within technical solution of the present invention protection in the range of.
Claims (8)
1. a kind of image cropping method, it is characterised in that including:
The picture cut out is treated to be acquired;
Face datection is carried out to the picture to be cut out, human face region is obtained;
Using the human face region as the predeterminable area of demand size picture, size is carried out to the picture to be cut out as desired
Cut out.
2. image cropping method according to claim 1, it is characterised in that be acquired in the picture cut out treated
Before, in addition to:
Real-time snap shot is carried out to video image, the picture to be cut out is obtained.
3. image cropping method according to claim 1 or 2, it is characterised in that described to enter to the picture to be cut out
Row Face datection, obtaining human face region includes:
Face datection is carried out to the picture to be cut out, according to the area and position for detecting face, the face area is generated
Domain.
4. image cropping method according to claim 1 or 2, it is characterised in that the predeterminable area is:In the demand
In size picture, midpoint the midpoint of the demand size picture preset direction and with the midpoint of the demand size picture
The region of one preset length of distance.
5. a kind of image cropping device, it is characterised in that including:Processor and memory;Wherein, the processor is used to load
And perform a plurality of instruction stored in the memory;
At least it is stored with the memory:
The picture cut out is treated to be acquired;
Face datection is carried out to the picture to be cut out, human face region is obtained;
Using the human face region as the predeterminable area of demand size picture, size is carried out to the picture to be cut out as desired
Cut out.
6. image cropping device according to claim 5, it is characterised in that be also stored with the memory:Described
Treat before the picture cut out is acquired, real-time snap shot is carried out to video image, the picture to be cut out is obtained.
7. the image cropping device according to claim 5 or 6, it is characterised in that stored in the memory to described
Picture to be cut out carries out Face datection, obtains human face region, including:
Face datection is carried out to the picture to be cut out, according to the area and position for detecting face, the face area is generated
Domain.
8. the image cropping device according to claim 5 or 6, it is characterised in that the predeterminable area is:In the demand
In size picture, midpoint the midpoint of the demand size picture preset direction and with the midpoint of the demand size picture
The region of one preset length of distance.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710415113.1A CN107240105A (en) | 2017-06-05 | 2017-06-05 | A kind of image cropping method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710415113.1A CN107240105A (en) | 2017-06-05 | 2017-06-05 | A kind of image cropping method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107240105A true CN107240105A (en) | 2017-10-10 |
Family
ID=59984962
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710415113.1A Pending CN107240105A (en) | 2017-06-05 | 2017-06-05 | A kind of image cropping method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107240105A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109151322A (en) * | 2018-09-30 | 2019-01-04 | 联想(北京)有限公司 | A kind of image processing method and electronic equipment |
CN109448001A (en) * | 2018-10-26 | 2019-03-08 | 山东世纪开元电子商务集团有限公司 | A kind of picture automatic cutting method |
CN111028251A (en) * | 2019-12-27 | 2020-04-17 | 四川大学 | Dental picture cutting method, system, equipment and storage medium |
CN111914811A (en) * | 2020-08-20 | 2020-11-10 | 腾讯科技(深圳)有限公司 | Image data processing method, image data processing device, computer equipment and storage medium |
CN114071244A (en) * | 2021-11-10 | 2022-02-18 | 广州博冠信息科技有限公司 | Method and device for generating live cover, computer storage medium and electronic equipment |
CN115050086A (en) * | 2022-08-15 | 2022-09-13 | 北京百度网讯科技有限公司 | Sample image generation method, model training method, image processing method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103914689A (en) * | 2014-04-09 | 2014-07-09 | 百度在线网络技术(北京)有限公司 | Picture cropping method and device based on face recognition |
CN104392202A (en) * | 2014-10-11 | 2015-03-04 | 北京中搜网络技术股份有限公司 | Image-identification-based automatic cutting method |
CN104484854A (en) * | 2014-12-24 | 2015-04-01 | 北京奇虎科技有限公司 | Cropping method and device for people pictures |
CN104484855A (en) * | 2014-12-24 | 2015-04-01 | 北京奇虎科技有限公司 | Method and device for cropping pictures |
-
2017
- 2017-06-05 CN CN201710415113.1A patent/CN107240105A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103914689A (en) * | 2014-04-09 | 2014-07-09 | 百度在线网络技术(北京)有限公司 | Picture cropping method and device based on face recognition |
CN104392202A (en) * | 2014-10-11 | 2015-03-04 | 北京中搜网络技术股份有限公司 | Image-identification-based automatic cutting method |
CN104484854A (en) * | 2014-12-24 | 2015-04-01 | 北京奇虎科技有限公司 | Cropping method and device for people pictures |
CN104484855A (en) * | 2014-12-24 | 2015-04-01 | 北京奇虎科技有限公司 | Method and device for cropping pictures |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109151322A (en) * | 2018-09-30 | 2019-01-04 | 联想(北京)有限公司 | A kind of image processing method and electronic equipment |
CN109448001A (en) * | 2018-10-26 | 2019-03-08 | 山东世纪开元电子商务集团有限公司 | A kind of picture automatic cutting method |
CN109448001B (en) * | 2018-10-26 | 2021-08-27 | 世纪开元智印互联科技集团股份有限公司 | Automatic picture clipping method |
CN111028251A (en) * | 2019-12-27 | 2020-04-17 | 四川大学 | Dental picture cutting method, system, equipment and storage medium |
CN111914811A (en) * | 2020-08-20 | 2020-11-10 | 腾讯科技(深圳)有限公司 | Image data processing method, image data processing device, computer equipment and storage medium |
CN114071244A (en) * | 2021-11-10 | 2022-02-18 | 广州博冠信息科技有限公司 | Method and device for generating live cover, computer storage medium and electronic equipment |
CN114071244B (en) * | 2021-11-10 | 2022-11-04 | 广州博冠信息科技有限公司 | Method and device for generating live cover, computer storage medium and electronic equipment |
CN115050086A (en) * | 2022-08-15 | 2022-09-13 | 北京百度网讯科技有限公司 | Sample image generation method, model training method, image processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107240105A (en) | A kind of image cropping method and device | |
CN111368685B (en) | Method and device for identifying key points, readable medium and electronic equipment | |
CN108304839B (en) | Image data processing method and device | |
CN113254491A (en) | Information recommendation method and device, computer equipment and storage medium | |
CN109919096A (en) | A kind of method of video real-time face detection | |
CN111881740B (en) | Face recognition method, device, electronic equipment and medium | |
CN106067167A (en) | Image processing method and device | |
CN110619656A (en) | Face detection tracking method and device based on binocular camera and electronic equipment | |
CN112396050A (en) | Image processing method, device and storage medium | |
KR102316165B1 (en) | Apparatus and method for generating attack image of deep learning based face recognition system | |
CN111652795A (en) | Face shape adjusting method, face shape adjusting device, live broadcast method, live broadcast device, electronic equipment and storage medium | |
CN113221767A (en) | Method for training living body face recognition model and method for recognizing living body face and related device | |
CN110321821B (en) | Human face alignment initialization method and device based on three-dimensional projection and storage medium | |
CN112528978A (en) | Face key point detection method and device, electronic equipment and storage medium | |
CN115546221B (en) | Reinforcing steel bar counting method, device, equipment and storage medium | |
CN111783677A (en) | Face recognition method, face recognition device, server and computer readable medium | |
CN111722717A (en) | Gesture recognition method and device and computer readable storage medium | |
CN113392820B (en) | Dynamic gesture recognition method and device, electronic equipment and readable storage medium | |
CN113850238B (en) | Document detection method and device, electronic equipment and storage medium | |
CN111507139A (en) | Image effect generation method and device and electronic equipment | |
CN111967436B (en) | Image processing method and device | |
CN111582143A (en) | Student classroom attendance method and device based on image recognition and storage medium | |
CN112149463A (en) | Image processing method and device | |
CN113392821B (en) | Dynamic gesture recognition method and device, electronic equipment and readable storage medium | |
CN115601793B (en) | Human body bone point detection method and device, electronic equipment and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171010 |
|
RJ01 | Rejection of invention patent application after publication |