CN110209266A - A kind of size fit method and device of image - Google Patents

A kind of size fit method and device of image Download PDF

Info

Publication number
CN110209266A
CN110209266A CN201910327401.0A CN201910327401A CN110209266A CN 110209266 A CN110209266 A CN 110209266A CN 201910327401 A CN201910327401 A CN 201910327401A CN 110209266 A CN110209266 A CN 110209266A
Authority
CN
China
Prior art keywords
width
screen
depth
resolution
surface view
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
Application number
CN201910327401.0A
Other languages
Chinese (zh)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910327401.0A priority Critical patent/CN110209266A/en
Publication of CN110209266A publication Critical patent/CN110209266A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/166Detection; Localisation; Normalisation using acquisition arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention provides a kind of size fit method and devices of image, and the present invention relates to pedestal O&M technical field, method includes: the screen resolution for obtaining mobile terminal, and screen resolution includes the first screen height and the first screen width;The interfacial level and interface width for the surface view control installed on initialization mobile terminal;The standard resolution of preset face identification system is read, standard resolution includes calibrated altitude and normal width;The interface dimensions of surface view control are adjusted according to the depth-width ratio of standard resolution, and the depth-width ratio of interface dimensions adjusted is consistent with the depth-width ratio of standard resolution;The facial image to be identified acquired using surface view control adjusted interception by the camera of mobile terminal, and it is sent to face identification system.Technical solution provided in an embodiment of the present invention is able to solve the problem that sensor performance testing efficiency is low in the prior art.

Description

A kind of size fit method and device of image
[technical field]
The present invention relates to pedestal O&M technical field more particularly to a kind of size fit method and devices of image.
[background technique]
Currently, the screen resolution size of the mobile terminal of various models is various, so that collected face picture Dimensions it is also very much, and in face identification system bottom compare the dimension of picture needed and require be usually it is unified, therefore, When the collected facial image of different mobile terminals is sent to face identification system, it is easy to appear image and squeezes distortion now As so that recognition of face efficiency reduces.
[summary of the invention]
In view of this, the embodiment of the invention provides a kind of size fit method and device of image, it is existing to solve There is the problem of squeezing distortion in output to face alignment system in image in technology.
To achieve the goals above, according to an aspect of the invention, there is provided a kind of size fit method of image, institute The method of stating includes:
The screen resolution of mobile terminal is obtained, the screen resolution includes that the first screen height and the first screen are wide Degree;The interfacial level and interface width of the surface view control installed on the mobile terminal are initialized, so that the interface Height is first screen height, and the interface width is first screen width;Read preset face identification system Standard resolution, the standard resolution includes calibrated altitude and normal width;According to the depth-width ratio of the standard resolution Adjust the interface dimensions of the surface view control so that at least one of interfacial level adjusted, interface width with First screen height or first screen width are consistent, and the depth-width ratio of interface dimensions adjusted and the standard The depth-width ratio of resolution ratio is consistent;Pass through the camera of the mobile terminal using the surface view control interception adjusted The facial image to be identified of acquisition, and it is sent to the face identification system.
Further, the depth-width ratio according to the standard resolution adjusts the interface ruler of the surface view control It is very little, comprising: when the screen resolution depth-width ratio be greater than the standard resolution depth-width ratio, adjust the surface view control The interface width of part adjusts the interfacial level to first screen width multiplied by the mark to first screen width The depth-width ratio of quasi- resolution ratio.
Further, the depth-width ratio according to the standard resolution adjusts the interface ruler of the surface view control It is very little, comprising: when the screen resolution depth-width ratio be less than the standard resolution depth-width ratio, adjust the surface view control The interfacial level of part adjusts the interface width to first screen height divided by the mark to first screen height The depth-width ratio of quasi- resolution ratio.
Further, the camera for passing through the mobile terminal using the surface view control interception adjusted The facial image to be identified of acquisition, and it is sent to the face identification system, comprising: when the camera shooting for detecting the mobile terminal The enabling signal of head intercepts the face figure to be identified acquired by the camera using the surface view control adjusted Picture;The resolution ratio equal proportion of the facial image to be identified is zoomed into the standard resolution;By the people to be identified after scaling Face image is sent to the face identification system.
Further, in the camera shooting for passing through the mobile terminal using the surface view control interception adjusted The facial image to be identified of head acquisition, and be sent to after the face identification system, the method also includes: obtain the people The facial image sample prestored in face identifying system;Target person is extracted from the facial image sample using edge detection algorithm The edge contour of face;Effective face acquisition zone signal is generated according to the edge contour, wherein effective face acquisition zone letter It number is presented in the form of virtual box on the interface of the surface view control.
To achieve the goals above, according to an aspect of the invention, there is provided a kind of size fit device of image, institute Stating device includes:
Acquiring unit, for obtaining the screen resolution of mobile terminal, the screen resolution includes the first screen height And first screen width;Initialization unit, the interface for initializing the surface view control installed on the mobile terminal are high Degree and interface width, so that the interfacial level is first screen height, the interface width is first screen Width;Reading unit, for reading the standard resolution of preset face identification system, the standard resolution includes standard height Degree and normal width;Adjustment unit, for adjusting the boundary of the surface view control according to the depth-width ratio of the standard resolution Face size, so that at least one of interfacial level adjusted, interface width and first screen height or described One screen width is consistent, and the depth-width ratio of interface dimensions adjusted is consistent with the depth-width ratio of the standard resolution;It cuts Take unit, for using surface view control interception adjusted by the camera of the mobile terminal acquire wait know Others' face image, and it is sent to the face identification system.
Further, the adjustment unit includes: the first adjustment subelement, for working as the depth-width ratio of the screen resolution Greater than the depth-width ratio of the standard resolution, the interface width of the surface view control is adjusted to first screen width, And adjust depth-width ratio of the interfacial level to first screen width multiplied by the standard resolution.
Further, the adjustment unit includes: second adjustment subelement, for working as the depth-width ratio of the screen resolution Less than the depth-width ratio of the standard resolution, the interfacial level of the surface view control is adjusted to first screen height, And adjust depth-width ratio of the interface width to first screen height divided by the standard resolution.
To achieve the goals above, according to an aspect of the invention, there is provided a kind of computer non-volatile memories are situated between Matter, the storage medium include the program of storage, control equipment where the storage medium in described program operation and execute The size fit method for the image stated.
To achieve the goals above, according to an aspect of the invention, there is provided a kind of computer equipment, including storage Device, processor and storage in the memory and the computer program that can run on the processor, the processor The step of size fit method of above-mentioned image is realized when executing the computer program.
In the present solution, standard resolution by obtaining face identification system, and adjusts table according to standard resolution The interface width and interface width of face view control enable and are accorded with by the facial image to be identified that surface view control intercepts The standard resolution for closing face identification system will not make facial image to be identified the phenomenon that distortion, stretch occur, to improve The recognition accuracy of face identification system.
[Detailed description of the invention]
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this field For those of ordinary skill, without any creative labor, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is a kind of flow chart of the size fit method of optional image provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of the size fit device of optional image provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of optional computer equipment provided in an embodiment of the present invention.
[specific embodiment]
For a better understanding of the technical solution of the present invention, being retouched in detail to the embodiment of the present invention with reference to the accompanying drawing It states.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its Its embodiment, shall fall within the protection scope of the present invention.
The term used in embodiments of the present invention is only to be not intended to be limiting merely for for the purpose of describing particular embodiments The present invention.In the embodiment of the present invention and the "an" of singular used in the attached claims, " described " and "the" It is also intended to including most forms, unless the context clearly indicates other meaning.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, indicate There may be three kinds of relationships, for example, A and/or B, can indicate: individualism A, exist simultaneously A and B, individualism B these three Situation.In addition, character "/" herein, typicallys represent the relationship that forward-backward correlation object is a kind of "or".
It will be appreciated that though terminal may be described using term first, second, third, etc. in embodiments of the present invention, But these terminals should not necessarily be limited by these terms.These terms are only used to for terminal being distinguished from each other out.For example, not departing from the present invention In the case where scope of embodiments, first terminal can also be referred to as second terminal, and similarly, second terminal can also be referred to as One terminal.
Depending on context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determination " or " in response to detection ".Similarly, depend on context, phrase " if it is determined that " or " if detection (condition or event of statement) " can be construed to " when determining " or " in response to determination " or " when the detection (condition of statement Or event) when " or " in response to detection (condition or event of statement) ".
Fig. 1 is a kind of flow chart of the size fit method of image according to an embodiment of the present invention, as shown in Figure 1, the party Method includes:
Step S101, obtains the screen resolution of mobile terminal, and screen resolution includes the first screen height and the first screen Curtain width.
Step S102 initializes the interfacial level and interface width of the surface view control installed on mobile terminal, so that Obtaining interfacial level is the first screen height, and interface width is the first screen width;
Step S103, reads the standard resolution of preset face identification system, standard resolution include calibrated altitude and Normal width.
Step S104 adjusts the interface dimensions of surface view control according to the depth-width ratio of standard resolution, so that adjustment At least one of interfacial level, interface width and the first screen height or the first screen width are consistent and adjusted afterwards The depth-width ratio of interface dimensions and the depth-width ratio of standard resolution are consistent.
Step S105 is acquired to be identified using the camera that surface view control adjusted interception passes through mobile terminal Facial image, and it is sent to face identification system.
In the present solution, standard resolution by obtaining face identification system, and adjusts table according to standard resolution The interface width and interface width of face view control enable and are accorded with by the facial image to be identified that surface view control intercepts The standard resolution for closing face identification system will not make facial image to be identified the phenomenon that distortion, stretch occur, to improve The recognition accuracy of face identification system.
In one embodiment, surface view control is the application program being used in combination with face identification system, example If face is registered APP, the camera that surface view control is able to use mobile terminal realizes camera function, and by calling movement The system API of terminal realizes customized take pictures.
It is to be appreciated that surface view (Surface View) control installed on mobile terminal can directly display camera shooting " Y " of the yuv data (image data) of head output, YUV indicates brightness (Luminance or Luma), that is, grayscale value, and That " U " and " V " is indicated is then coloration (Chrominance or Chroma), and effect is description colors of image and saturation degree, for referring to Determine the color of pixel.
In one embodiment, the first screen width that mobile terminal can be determined by Screen Width, passes through Screen Height determines the first screen height of mobile terminal.
Specifically, there are shooting button (entity button or virtual push button are strong) in mobile terminal, if button does not trigger, that The image data that camera obtains is displayed in real-time in the display screen of mobile terminal, so the resolution ratio of image data is general For screen resolution, such as iPhone6plus, its screen resolution is 736 × 414, then the preview image of camera Resolution ratio is also 736 × 414.And Surface View control be a customized creation can real-time display camera acquired Preview image, in camera application, the display area size of preview image is determined by the interface resolution ratio of Surface View It is fixed, then, if the standard resolution ratio set in Surface View interface resolution ratio and face identification system is inconsistent When, it will cause through Surface View truncated picture and occur the phenomenon that stretching distortion after uploading face identification system.
It is to be appreciated that mobile terminal can be mobile phone, smart phone, laptop, tablet computer, wearable Smart machine etc., it will be appreciated by those skilled in the art that the construction of embodiments of the present invention also can be used in fixed Terminal.
For example, iPhone6plus, its screen resolution is 736 × 414, i.e. 16:9, the surface view control after initialization Part Surface View interfacial level is 736, interface width 414.If however, the standard scores of preset face identification system Resolution is 640*480, and the depth-width ratio of screen resolution is greater than the depth-width ratio of standard resolution, then the face to be identified being truncated to Image will be stretched, it is therefore desirable to be adjusted to the interface dimensions of Surface View control, finally according to adjusted Surface View control intercepts the facial image to be identified acquired by the camera of mobile terminal, wherein people to be identified The format of face image includes JPEG, PNG.
Optionally, the interfacial level and interface width of the surface view control installed on mobile terminal are initialized, so that Interfacial level is the first screen height, and interface width is the first screen width, specifically includes: calling the camera in mobile terminal Camera is connected on surface view control by data-interface;The interfacial level and interface width of surface view control are initialized, Wherein, interfacial level is the first screen height, and interface width is the first screen width;Control camera starts real-time image acquisition Acquired image real-time data transmission to surface view control can be shown by data, camera.Such as IPhone6plus, its screen resolution are 736 × 414, then the surface view control in iPhone6plus installation is initial Interfacial level after change is 736, interface width 414.
Optionally, the interface dimensions of surface view control are adjusted according to the depth-width ratio of standard resolution, comprising:
When the depth-width ratio of screen resolution is greater than the depth-width ratio of standard resolution, the interface width of adjustment surface view control To the first screen width, and adjust depth-width ratio of the interfacial level to the first screen width multiplied by standard resolution.
When the depth-width ratio of screen resolution is greater than the depth-width ratio of standard resolution, then with the first screen in screen resolution On the basis of width, the interface width of surface view control is adjusted to the first screen width, the height of interfacial level to standard resolution Wide ratio is multiplied by the first screen width.
For example, when screen resolution is 736 × 414 (iPhone6plus);Standard resolution is 640*480;It can be calculated The depth-width ratio of screen resolution is 1.77, and the depth-width ratio of standard resolution is 1.33, then the depth-width ratio of screen resolution is greater than The depth-width ratio of standard resolution, the interfacial level of surface view control adjusted are 552, interface width 414.Surface view Control will not be displayed in full screen the preview image of camera, it is possible to understand that and ground covers the part of distinguishing up and down of preview image, that Distortion will not be stretched by the facial image to be identified that surface view control intercepts, can equal proportion zoom to standard resolution 640*480。
Optionally, the interface dimensions of surface view control are adjusted according to the depth-width ratio of standard resolution, comprising:
When the depth-width ratio of screen resolution is less than the depth-width ratio of standard resolution, the interfacial level of adjustment surface view control To the first screen height, and adjust depth-width ratio of the interface width to the first screen height divided by standard resolution.
For example, when screen resolution is 800*1280 (laptop);Standard resolution is 640*480;It can be calculated The depth-width ratio of screen resolution is 0.625, and the depth-width ratio of standard resolution is 1.33, then the depth-width ratio of screen resolution is less than The depth-width ratio of standard resolution, the interfacial level of surface view control adjusted are 800, interface width 600.Surface view Control will not be displayed in full screen the preview image of camera, it is possible to understand that and ground, the left and right of preview image, part is covered respectively, that Distortion will not be stretched by the facial image to be identified that surface view control intercepts, can equal proportion zoom to standard resolution 640*480。
Optionally, the people to be identified acquired using surface view control adjusted interception by the camera of mobile terminal Face image, and it is sent to face identification system, comprising:
When the enabling signal for the camera for detecting mobile terminal, using surface view control adjusted interception by taking the photograph The facial image to be identified acquired as head;The resolution ratio equal proportion of facial image to be identified is zoomed into standard resolution;It will contracting Facial image to be identified after putting is sent to face identification system.For example, the facial image to be identified of the 552*414 of interception is put Greatly to 640*480.The picture demand of face identification system can thus be met.
Optionally, it is acquired in the camera for passing through mobile terminal using surface view control adjusted interception to be identified Facial image, and be sent to after face identification system, method further include: obtain the facial image prestored in face identification system Sample;The edge contour of target face is extracted from facial image sample using edge detection algorithm;It is generated according to edge contour Effective face acquisition zone signal, wherein effective face acquisition zone signal is presented on surface view control in the form of virtual box On interface.Effective face acquisition zone signal is used to indicate user and adjusts posture so that camera shooting acquires effective facial image.
It is to be appreciated that facial image is easy to be cut into during interception half of face or the incomplete situation of part face. The cv2.findContours function in Open CV can be used in the method for edge detection.The shape of edge contour is people's shape of face Shape, and the edge contour of target image and the edge contour of standard picture match.
Specifically, the boundary in facial image sample is searched, character contour is detected, in particular, the face in character contour Contouring, according in Open CV cv2.findContours function return face mask multiple presets, length and width, Center point coordinate and rotation angle determine the edge contour of target face.It is presented in the form of virtual box on this basis again In the interface of surface view control.
It is to be appreciated that can be shown on the surface view control of mobile terminal when camera acquires facial image again Effective face acquisition zone signal, such as the surface view control of mobile terminal can be shown in by prompting frame mode of taking pictures.From And when user is reused, posture can be quickly adjusted, the position of camera and face is adjusted, so that face has been adjusted to It imitates in face acquisition zone, so that the facial image photographed can be used in recognition of face after interception, it is not in people The incomplete situation of face.
In the present solution, standard resolution by obtaining face identification system, and adjusts table according to standard resolution The interface width and interface width of face view control enable and are accorded with by the facial image to be identified that surface view control intercepts The standard resolution for closing face identification system will not make facial image to be identified the phenomenon that distortion, stretch occur, to improve The recognition accuracy of face identification system.
The embodiment of the invention provides a kind of size fit device of image, which is used to execute the size of above-mentioned image Adaptation method, as shown in Fig. 2, the device include: acquiring unit 10, initialization unit 20, reading unit 30, adjustment unit 40, Acquisition unit 50.
Acquiring unit 10, for obtaining the screen resolution of mobile terminal, screen resolution include the first screen height and First screen width;
Initialization unit 20, for initializing the interfacial level and interface width of the surface view control installed on mobile terminal Degree, so that interfacial level is the first screen height, interface width is the first screen width;
Reading unit 30, for reading the standard resolution of preset face identification system, standard resolution includes standard Height and normal width;
Adjustment unit 40, for adjusting the interface dimensions of surface view control according to the depth-width ratio of standard resolution, so that At least one of interfacial level adjusted, interface width are consistent with the first screen height or the first screen width, and The depth-width ratio of interface dimensions adjusted and the depth-width ratio of standard resolution are consistent;
Interception unit 50, for what is acquired using surface view control adjusted interception by the camera of mobile terminal Facial image to be identified, and it is sent to face identification system.
In the present solution, standard resolution by obtaining face identification system, and adjusts table according to standard resolution The interface width and interface width of face view control enable and are accorded with by the facial image to be identified that surface view control intercepts The standard resolution for closing face identification system will not make facial image to be identified the phenomenon that distortion, stretch occur, to improve The recognition accuracy of face identification system.
In one embodiment, surface view control is the application program being used in combination with face identification system, example If face is registered APP, the camera that surface view control is able to use mobile terminal realizes camera function, and by calling movement The system API of terminal realizes customized take pictures.
It is to be appreciated that surface view (Surface View) control installed on mobile terminal can directly display camera shooting " Y " of the yuv data (image data) of head output, YUV indicates brightness (Luminance or Luma), that is, grayscale value, and That " U " and " V " is indicated is then coloration (Chrominance or Chroma), and effect is description colors of image and saturation degree, for referring to Determine the color of pixel.
In one embodiment, the first screen width can be determined by Screen Width, pass through Screen Height determines the first screen height.
Specifically, there are shooting button (entity button or virtual push button are strong) in mobile terminal, if button does not trigger, that The image data that camera obtains is displayed in real-time in the display screen of mobile terminal, so the resolution ratio of image data is general For screen resolution, such as iPhone6plus, its screen resolution is 736 × 414, then the preview image of camera Resolution ratio is also 736 × 414.And Surface View control be a customized creation can real-time display camera acquired Preview image, in camera application, the display area size of preview image is determined by the interface resolution ratio of Surface View It is fixed, then, if the standard resolution ratio set in Surface View interface resolution ratio and face identification system is inconsistent When, it will cause through Surface View truncated picture and occur the phenomenon that stretching distortion after uploading face identification system.
It is to be appreciated that mobile terminal can be mobile phone, smart phone, laptop, tablet computer, wearable Smart machine etc., it will be appreciated by those skilled in the art that the construction of embodiments of the present invention also can be used in fixed Terminal.
For example, iPhone6plus, its screen resolution is 736 × 414, i.e. 16:9, the surface view control after initialization Part Surface View interfacial level is 736, interface width 414.If however, the standard scores of preset face identification system Resolution is 640*480, and the depth-width ratio of screen resolution is greater than the depth-width ratio of standard resolution, then the face to be identified being truncated to Image will be stretched, it is therefore desirable to be adjusted to the interface dimensions of Surface View control, finally according to adjusted Surface View control intercepts the facial image to be identified acquired by the camera of mobile terminal, wherein people to be identified The format of face image includes JPEG, PNG.
Optionally, the interfacial level and interface width of the surface view control installed on mobile terminal are initialized, so that Interfacial level is the first screen height, and interface width is the first screen width, specifically includes: calling the camera in mobile terminal Camera is connected on surface view control by data-interface;The interfacial level and interface width of surface view control are initialized, Wherein, interfacial level is the first screen height, and interface width is the first screen width;Control camera starts real-time image acquisition Acquired image real-time data transmission to surface view control can be shown by data, camera.Such as IPhone6plus, its screen resolution are 736 × 414, then the surface view control in iPhone6plus installation is initial Interfacial level after change is 736, interface width 414.
In one embodiment, surface view control is the application program being used in combination with face identification system, example As face is registered APP.
Optionally, adjustment unit includes the first adjustment subelement.
The first adjustment subelement is greater than the depth-width ratio of standard resolution for the depth-width ratio when screen resolution, adjusts table The interface width of face view control adjusts interfacial level to the first screen width multiplied by standard resolution to the first screen width Depth-width ratio.
When the depth-width ratio of screen resolution is greater than the depth-width ratio of standard resolution, then with the first screen in screen resolution On the basis of width, the interface width of surface view control is adjusted to the first screen width, the height of interfacial level to standard resolution Wide ratio is multiplied by the first screen width.
For example, when screen resolution is 736 × 414 (iPhone6plus);Standard resolution is 640*480;It can be calculated The depth-width ratio of screen resolution is 1.77, and the depth-width ratio of standard resolution is 1.33, then the depth-width ratio of screen resolution is greater than The depth-width ratio of standard resolution, the interfacial level of surface view control adjusted are 552, interface width 414.Surface view Control will not be displayed in full screen the preview image of camera, it is possible to understand that and ground covers the part of distinguishing up and down of preview image, that Distortion will not be stretched by the facial image to be identified that surface view control intercepts, can equal proportion zoom to standard resolution 640*480。
Optionally, adjustment unit includes second adjustment subelement.
Second adjustment subelement is less than the depth-width ratio of standard resolution for the depth-width ratio when screen resolution, adjusts table The interfacial level of face view control adjusts interface width to the first screen height divided by standard resolution to the first screen height Depth-width ratio.
For example, when screen resolution is 800*1280 (laptop);Standard resolution is 640*480;It can be calculated The depth-width ratio of screen resolution is 0.625, and the depth-width ratio of standard resolution is 1.33, then the depth-width ratio of screen resolution is less than The depth-width ratio of standard resolution, the interfacial level of surface view control adjusted are 800, interface width 600.Surface view Control will not be displayed in full screen the preview image of camera, it is possible to understand that and ground, the left and right of preview image, part is covered respectively, that Distortion will not be stretched by the facial image to be identified that surface view control intercepts, can equal proportion zoom to standard resolution 640*480。
Optionally, interception unit includes interception subelement, scaling subelement, transmission sub-unit.
Subelement is intercepted, for the enabling signal when the camera for detecting mobile terminal, is regarded using surface adjusted Figure control intercepts the facial image to be identified acquired by camera;Subelement is scaled, for dividing facial image to be identified Resolution equal proportion zooms to standard resolution;Transmission sub-unit, for the facial image to be identified after scaling to be sent to face Identifying system.For example, the facial image to be identified of the 552*414 of interception is amplified to 640*480.Face knowledge can thus be met The picture demand of other system.
Optionally, device further includes second acquisition unit, extraction unit, generation unit.
Second acquisition unit, for obtaining the facial image sample prestored in face identification system;Extraction unit, for answering The edge contour of target face is extracted from facial image sample with edge detection algorithm;Generation unit, for according to edge wheel Exterior feature generates effective face acquisition zone signal, wherein effective face acquisition zone signal is presented on surface view in the form of virtual box On the interface of control.Effective face acquisition zone signal is used to indicate user and adjusts posture so that camera shooting acquires effective face figure Picture.
It is to be appreciated that facial image is easy to be cut into during interception half of face or the incomplete situation of part face. The cv2.findContours function in Open CV can be used in the method for edge detection.The shape of edge contour is people's shape of face Shape, and the edge contour of target image and the edge contour of standard picture match.
Specifically, the boundary in facial image sample is searched, character contour is detected, in particular, the face in character contour Contouring, according in Open CV cv2.findContours function return face mask multiple presets, length and width, Center point coordinate and rotation angle determine the edge contour of target face.It is presented in the form of virtual box on this basis again In the interface of surface view control.
It is to be appreciated that can be shown on the surface view control of mobile terminal when camera acquires facial image again Effective face acquisition zone signal, such as the surface view control of mobile terminal can be shown in by prompting frame mode of taking pictures.From And when user is reused, posture can be quickly adjusted, the position of camera and face is adjusted, so that face has been adjusted to It imitates in face acquisition zone, so that the facial image photographed can be used in recognition of face after interception, it is not in people The incomplete situation of face.
The embodiment of the invention provides a kind of computer non-volatile memory medium, storage medium includes the program of storage, Wherein, when program is run, equipment where control storage medium executes following steps:
The screen resolution of mobile terminal is obtained, screen resolution includes the first screen height and the first screen width;Just The interfacial level and interface width for the surface view control installed on beginningization mobile terminal, so that interfacial level is the first screen Highly, interface width is the first screen width;The standard resolution of preset face identification system is read, standard resolution includes Calibrated altitude and normal width;The interface dimensions of surface view control are adjusted according to the depth-width ratio of standard resolution, so that adjusting At least one of interfacial level, interface width after whole are consistent with the first screen height or the first screen width, and adjust The depth-width ratio of interface dimensions afterwards and the depth-width ratio of standard resolution are consistent;It is intercepted using surface view control adjusted logical The facial image to be identified of the camera acquisition of mobile terminal is crossed, and is sent to face identification system.
Optionally, when program is run, equipment where control storage medium executes following steps: when the height of screen resolution Depth-width ratio of the width than being greater than standard resolution, adjusts the interface width of surface view control to the first screen width, and adjust boundary Face height is to the first screen width multiplied by the depth-width ratio of standard resolution.
Optionally, when program is run, equipment where control storage medium executes following steps: when the height of screen resolution Depth-width ratio of the width than being less than standard resolution, adjusts the interfacial level of surface view control to the first screen height, and adjust boundary Face width is to the first screen height divided by the depth-width ratio of standard resolution.
Optionally, when program is run, equipment where control storage medium executes following steps: when detecting mobile terminal Camera enabling signal, intercept the face figure to be identified that acquires by camera using surface view control adjusted Picture;The resolution ratio equal proportion of facial image to be identified is zoomed into standard resolution;By the facial image to be identified hair after scaling It send to face identification system.
Optionally, when program is run, equipment where control storage medium executes following steps: obtaining face identification system In the facial image sample that prestores;The edge contour of target face is extracted from facial image sample using edge detection algorithm; Effective face acquisition zone signal is generated according to edge contour, wherein effective face acquisition zone signal is presented in the form of virtual box On the interface of surface view control.
Fig. 3 is a kind of schematic diagram of computer equipment provided in an embodiment of the present invention.As shown in figure 3, the meter of the embodiment Machine equipment 100 is calculated to include: processor 101, memory 102 and storage in the memory 102 and can run on processor 101 Computer program 103, processor 101 execute computer program 103 when realize embodiment in image size fit method, To avoid repeating, do not repeat one by one herein.Alternatively, realizing image in embodiment when the computer program is executed by processor 101 Size fit device in the function of each model/unit do not repeated one by one herein to avoid repeating.
Computer equipment 100 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.Computer equipment may include, but be not limited only to, processor 101, memory 102.It will be understood by those skilled in the art that Fig. 3 The only example of computer equipment 100 does not constitute the restriction to computer equipment 100, may include than illustrate it is more or Less component perhaps combines certain components or different components, such as computer equipment can also be set including input and output Standby, network access equipment, bus etc..
Alleged processor 101 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
Memory 102 can be the internal storage unit of computer equipment 100, for example, computer equipment 100 hard disk or Memory.What memory 102 was also possible to be equipped on the External memory equipment of computer equipment 100, such as computer equipment 100 inserts Connect formula hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory Block (Flash Card) etc..Further, memory 102 can also both including computer equipment 100 internal storage unit or Including External memory equipment.Memory 102 is for storing other program sum numbers needed for computer program and computer equipment According to.Memory 102 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or group Part can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown Or the mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, device or unit it is indirect Coupling or communication connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer It is each that device (can be personal computer, server or network equipment etc.) or processor (Processor) execute the present invention The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read- Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various It can store the medium of program code.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.

Claims (10)

1. a kind of size fit method of image, which is characterized in that the described method includes:
The screen resolution of mobile terminal is obtained, the screen resolution includes the first screen height and the first screen width;
The interfacial level and interface width of the surface view control installed on the mobile terminal are initialized, so that the interface Height is first screen height, and the interface width is first screen width;
The standard resolution of preset face identification system is read, the standard resolution includes calibrated altitude and normal width;
The interface dimensions of the surface view control are adjusted according to the depth-width ratio of the standard resolution, so that boundary adjusted At least one of face height, interface width are consistent with first screen height or first screen width, and adjust The depth-width ratio of interface dimensions afterwards is consistent with the depth-width ratio of the standard resolution;
The face to be identified acquired using the surface view control interception adjusted by the camera of the mobile terminal Image, and it is sent to the face identification system.
2. the method according to claim 1, wherein described adjust institute according to the depth-width ratio of the standard resolution State the interface dimensions of surface view control, comprising:
When the screen resolution depth-width ratio be greater than the standard resolution depth-width ratio, adjust the surface view control Interface width adjusts the interfacial level to first screen width multiplied by the standard scores to first screen width The depth-width ratio of resolution.
3. the method according to claim 1, wherein described adjust institute according to the depth-width ratio of the standard resolution State the interface dimensions of surface view control, comprising:
When the screen resolution depth-width ratio be less than the standard resolution depth-width ratio, adjust the surface view control Interfacial level adjusts the interface width to first screen height divided by the standard scores to first screen height The depth-width ratio of resolution.
4. the method according to claim 1, wherein described intercepted using the surface view control adjusted The facial image to be identified acquired by the camera of the mobile terminal, and it is sent to the face identification system, comprising:
When the enabling signal for the camera for detecting the mobile terminal, intercepted using the surface view control adjusted logical Cross the facial image to be identified of the camera acquisition;
The resolution ratio equal proportion of the facial image to be identified is zoomed into the standard resolution;
Facial image to be identified after scaling is sent to the face identification system.
5. method described according to claim 1~any one of 4, which is characterized in that described using adjusted described The facial image to be identified that the interception of surface view control is acquired by the camera of the mobile terminal, and it is sent to the face After identifying system, the method also includes:
Obtain the facial image sample prestored in the face identification system;
The edge contour of target face is extracted from the facial image sample using edge detection algorithm;
Effective face acquisition zone signal is generated according to the edge contour, wherein effective face acquisition zone signal is with virtual The form of frame is presented on the interface of the surface view control.
6. a kind of size fit device of image, which is characterized in that described device includes:
Acquiring unit, for obtaining the screen resolution of mobile terminal, the screen resolution includes the first screen height and the One screen width;
Initialization unit, for initializing the interfacial level and interface width of the surface view control installed on the mobile terminal Degree, so that the interfacial level is first screen height, the interface width is first screen width;
Reading unit, for reading the standard resolution of preset face identification system, the standard resolution includes standard height Degree and normal width;
Adjustment unit, for adjusting the interface dimensions of the surface view control according to the depth-width ratio of the standard resolution, with So that at least one of interfacial level adjusted, interface width and first screen height or first screen width It is consistent, and the depth-width ratio of interface dimensions adjusted is consistent with the depth-width ratio of the standard resolution;
Interception unit, for being acquired using the surface view control interception adjusted by the camera of the mobile terminal Facial image to be identified, and be sent to the face identification system.
7. device according to claim 6, which is characterized in that the adjustment unit includes:
The first adjustment subelement is greater than the depth-width ratio of the standard resolution for the depth-width ratio when the screen resolution, adjusts The interface width of the whole surface view control adjusts the interfacial level to first screen to first screen width Curtain width multiplied by the standard resolution depth-width ratio.
8. device according to claim 6, which is characterized in that the adjustment unit includes:
Second adjustment subelement is less than the depth-width ratio of the standard resolution for the depth-width ratio when the screen resolution, adjusts The interfacial level of the whole surface view control adjusts the interface width to first screen to first screen height Curtain is highly divided by the depth-width ratio of the standard resolution.
9. a kind of computer non-volatile memory medium, the storage medium includes the program of storage, which is characterized in that described Equipment perform claim program controls the storage medium when running where requires the size of image described in 1 to 5 any one suitable Method of completing the square.
10. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realizes claim 1 to 5 when executing the computer program The step of size fit method of image described in any one.
CN201910327401.0A 2019-04-23 2019-04-23 A kind of size fit method and device of image Pending CN110209266A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910327401.0A CN110209266A (en) 2019-04-23 2019-04-23 A kind of size fit method and device of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910327401.0A CN110209266A (en) 2019-04-23 2019-04-23 A kind of size fit method and device of image

Publications (1)

Publication Number Publication Date
CN110209266A true CN110209266A (en) 2019-09-06

Family

ID=67786082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910327401.0A Pending CN110209266A (en) 2019-04-23 2019-04-23 A kind of size fit method and device of image

Country Status (1)

Country Link
CN (1) CN110209266A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765799A (en) * 2019-10-21 2020-02-07 高新兴科技集团股份有限公司 Client code scanning identification method, device, equipment and storage medium
CN110830716A (en) * 2019-11-08 2020-02-21 苏宁金融科技(南京)有限公司 Image generation method and device, computer equipment and storage medium
CN111679988A (en) * 2020-06-12 2020-09-18 中国银行股份有限公司 Testing method and device of face recognition system and related equipment
CN111797933A (en) * 2020-07-10 2020-10-20 百度在线网络技术(北京)有限公司 Template matching method and device, electronic equipment and storage medium
CN112817507A (en) * 2021-01-26 2021-05-18 广州虎牙科技有限公司 Control adaptation method and device, electronic equipment and storage medium
CN113051010A (en) * 2019-12-28 2021-06-29 Oppo(重庆)智能科技有限公司 Application picture adjusting method in wearable device and related device
CN113505685A (en) * 2021-07-06 2021-10-15 浙江大华技术股份有限公司 Monitoring equipment installation positioning method and device, electronic equipment and storage medium
CN114040100A (en) * 2021-11-02 2022-02-11 上汽通用五菱汽车股份有限公司 Vehicle-mounted camera display method, system and equipment based on dynamic adaptation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6067112A (en) * 1996-07-12 2000-05-23 Xerox Corporation Interactive desktop display system for automatically adjusting pan and zoom functions in response to user adjustment of a feedback image
CN102984476A (en) * 2012-12-12 2013-03-20 深圳创维-Rgb电子有限公司 Widescreen self-adapting image processing method and device
CN108628656A (en) * 2018-05-09 2018-10-09 平安普惠企业管理有限公司 Interface adaptation method, device, computer equipment and storage medium on ios device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6067112A (en) * 1996-07-12 2000-05-23 Xerox Corporation Interactive desktop display system for automatically adjusting pan and zoom functions in response to user adjustment of a feedback image
CN102984476A (en) * 2012-12-12 2013-03-20 深圳创维-Rgb电子有限公司 Widescreen self-adapting image processing method and device
CN108628656A (en) * 2018-05-09 2018-10-09 平安普惠企业管理有限公司 Interface adaptation method, device, computer equipment and storage medium on ios device

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765799A (en) * 2019-10-21 2020-02-07 高新兴科技集团股份有限公司 Client code scanning identification method, device, equipment and storage medium
CN110765799B (en) * 2019-10-21 2023-05-02 高新兴科技集团股份有限公司 Client code scanning identification method, device, equipment and storage medium
CN110830716A (en) * 2019-11-08 2020-02-21 苏宁金融科技(南京)有限公司 Image generation method and device, computer equipment and storage medium
CN113051010A (en) * 2019-12-28 2021-06-29 Oppo(重庆)智能科技有限公司 Application picture adjusting method in wearable device and related device
CN113051010B (en) * 2019-12-28 2023-04-28 Oppo(重庆)智能科技有限公司 Application picture adjustment method and related device in wearable equipment
CN111679988A (en) * 2020-06-12 2020-09-18 中国银行股份有限公司 Testing method and device of face recognition system and related equipment
CN111679988B (en) * 2020-06-12 2023-10-10 中国银行股份有限公司 Face recognition system testing method and device and related equipment
CN111797933A (en) * 2020-07-10 2020-10-20 百度在线网络技术(北京)有限公司 Template matching method and device, electronic equipment and storage medium
CN112817507A (en) * 2021-01-26 2021-05-18 广州虎牙科技有限公司 Control adaptation method and device, electronic equipment and storage medium
CN112817507B (en) * 2021-01-26 2023-11-03 广州虎牙科技有限公司 Control adaptation method, device, electronic equipment and storage medium
CN113505685A (en) * 2021-07-06 2021-10-15 浙江大华技术股份有限公司 Monitoring equipment installation positioning method and device, electronic equipment and storage medium
CN114040100A (en) * 2021-11-02 2022-02-11 上汽通用五菱汽车股份有限公司 Vehicle-mounted camera display method, system and equipment based on dynamic adaptation

Similar Documents

Publication Publication Date Title
CN110209266A (en) A kind of size fit method and device of image
TWI686774B (en) Human face live detection method and device
US10783354B2 (en) Facial image processing method and apparatus, and storage medium
JP7413400B2 (en) Skin quality measurement method, skin quality classification method, skin quality measurement device, electronic equipment and storage medium
CN107613202B (en) Shooting method and mobile terminal
US11308655B2 (en) Image synthesis method and apparatus
KR101141643B1 (en) Apparatus and Method for caricature function in mobile terminal using basis of detection feature-point
WO2019148968A1 (en) Mobile terminal, facial unlocking method, and related product
TW201126298A (en) Data processing device and method for regulating the lighting power of a display
CN105405130B (en) License image highlight detection method and device based on cluster
CN109801412B (en) Door access unlocking method and related device
CN107172354A (en) Method for processing video frequency, device, electronic equipment and storage medium
CN109741338A (en) A kind of face dividing method, device and equipment
CN104766354B (en) The method and mobile terminal that a kind of augmented reality is drawn
JP4367010B2 (en) System, program and method
CN112434546A (en) Face living body detection method and device, equipment and storage medium
KR102364929B1 (en) Electronic device, sever, and system for tracking skin changes
US8170299B2 (en) Image output method, image output device, and image output program
JP5578186B2 (en) Character image creation method, image processing apparatus, image processing program, and image conversion network system
CN112261320A (en) Image processing method and related product
WO2022063321A1 (en) Image processing method and apparatus, device and storage medium
WO2019218879A1 (en) Photographing interaction method and apparatus, storage medium and terminal device
CN107644455B (en) Face image synthesis method and device
CN107580182B (en) Snapshot method, mobile terminal and computer readable storage medium
WO2017128977A1 (en) Image processing method and device

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