Summary of the invention
The application provides one kind and takes pictures reminding method and equipment, prompts user to be adjusted preview image, avoids image(such as: using the fragile position of subject as edge, character image is greater than half body but deficiency to the middle character image for exception occurWhole body), improve the quality of image.
In order to achieve the above objectives, the application adopts the following technical scheme that
It takes pictures reminding method in a first aspect, disclosing one kind, comprising: equipment receives predetermined registration operation instruction, in preview interfaceShow preview image;Preview image includes at least one character image.Further, equipment judge be at least one character imageIt is no to there is abnormal character image;So-called exception character image refers to that the head body ratio of character image is greater than the first thresholding less than secondThresholding.Wherein, the first thresholding be according to the long determining ratio value of half body length of portrait and portrait head, such as: 5, the second thresholding isAccording to portrait whole body length and the long determining ratio value of portrait head, such as: 8;If equipment determines at least one character imageThere are abnormal character images, then the user of the equipment is prompted to adjust preview image.
As it can be seen that in reminding method provided by the invention of taking pictures, when user is using equipment shooting photo, when detecting preview graphThere is abnormal character image as in, i.e. the length of character image is more than half body but insufficient whole body, then illustrates the edge of preview imageVery possible is the fragile position of subject, such as ankle, knee, this can seriously affect the effect of photo, therefore, equipmentUser can be prompted to be adjusted image, image adjusted is no longer using the fragile position of subject as edge, such asThe quality of image can be improved in this.
With reference to first aspect, in the first possible implementation of the first aspect, judge at least one target portraitIn specifically included with the presence or absence of abnormal portrait: for everyone object image in an at least character image, execute following behaviourMake: the head position of the character image is determined, in the specific implementation, can use face recognition technology determines head position.Further,The head body ratio of the character image is determined according to the head position;Finally, judging body than whether length is greater than the first thresholding and smallIn the second thresholding;If the head body ratio of character image is greater than the first thresholding less than the second thresholding, it is determined that character image is abnormal peopleObject image.
In this way, executing above-mentioned algorithm one by one to the character image in preview image, so that it may which determining in preview image has notThere is abnormal image.
With reference to first aspect or in the first possible implementation of first aspect, second in first aspect mayImplementation in, if the head body ratio of above-mentioned character image is greater than the first thresholding less than the second thresholding, it is determined that character image isAbnormal character image specifically includes: if the head body ratio of character image is greater than the first thresholding less than the second thresholding, calculating figure mapLongitudinal edge amount in first detection zone of picture and the longitudinal edge amount in the second detection zone of character image;First inspectionSurvey an edge in region and the default coincident of character image, the appointed part of the second detection zone and character image away fromIt is the first thresholding from the ratio long with portrait head;It is considered that the first detection zone is one of the default edge of character imageRegion, appointed part can be the head of character image, that is to say, that the second detection zone be 5, personage's head portrait be in oneA region, detection zone can be rectangle in specific implementation, and the second detection zone can be inspection at a distance from some positionThe centre symmetry line in region is surveyed at a distance from the position, the second detection zone may be considered at a distance from the head of character imageThe centre symmetry line of second detection zone is at a distance from the crown.This default edge can be it is vertical with personage's standing direction andEdge far from head.
Finally, if the longitudinal edge amount in the first detection zone is greater than or equal to the longitudinal edge in the second detection zoneAmount, it is determined that character image is abnormal character image.
That is if the length of a character image is greater than half body but insufficient whole body, further, this character imageIt is less than the longitudinal edge amount of edge (such as: lower edge) in the longitudinal edge amount of 5 bodies, then illustrating that preview image edge existsLongitudinal edge amount, it may be possible to leg, ankle of human body etc., then can more accurately determine that this character image is abnormal personageImage.
With reference to first aspect or in any one possible implementation of the above first aspect, in the third of first aspectIn the possible implementation of kind, calculating the longitudinal edge measurer body in the first detection zone of character image includes: in the first inspectionIt surveys in area and determines at least one set of detection line pair;Detection line to include two detection lines being parallel to each other,;First edge and detection lineIt is vertical to two detection lines for including;For each group of detection line pair, detection line is calculated to upper at least two groups test point pairGradient calculates each group of test point of at least two groups test point centering to the absolute value of gradient;Test point is to including detection line centeringThe first detection line on the first test point and detection line centering the second detection line on the second test point;By at least two groupsTest point is added the absolute value of gradient, obtain detection line pair gradient and;By the gradient of at least one set of detection line pair be added,Obtain the longitudinal edge amount in the first detection zone.
In the specific implementation, can determine the vertical of a detection zone by the gradient of the test point pair of calculating detection line pairTo edge amount.
With reference to first aspect or in any one possible implementation of the above first aspect, the 4th of first aspect theIn the possible implementation of kind, calculating the longitudinal edge measurer body in the second detection zone of character image includes: in the second inspectionIt surveys in area and determines at least one set of detection line pair;Detection line is to including two detection lines being parallel to each other;First edge and detection lineIt is vertical to two detection lines for including;For each group of detection line pair, detection line is calculated to upper at least two groups test point pairGradient calculates each group of test point of at least two groups test point centering to the absolute value of gradient;Test point is to including detection line centeringThe first detection line on the first test point and detection line centering the second detection line on the second test point;By at least two groupsTest point is added the absolute value of gradient, obtain detection line pair gradient and;By the gradient of at least one set of detection line pair be added,Obtain the longitudinal edge amount in the second detection zone.
With reference to first aspect or in any one possible implementation of the above first aspect, the 5th of first aspect theIn the possible implementation of kind, prompts the user of equipment to adjust preview image and specifically include: prompt adjustment information or operation information;Operation information is used to indicate user and executes specified operation, and to adjust shooting angle, adjustment information is abnormal for user promptThe corresponding target person adjustment stance of character image or adjustment position.
In this way, user can be prompted to be adjusted preview image, avoids occurring abnormal character image in photo, influence to shineThe effect of piece.
With reference to first aspect or in any one possible implementation of the above first aspect, the 6th of first aspect theIn the possible implementation of kind, the side in first to the 5th kind of possible implementation of above-mentioned first aspect and first aspectMethod can be applied to the scene of photo preview, when postal exception character image in photo, then the user of equipment be prompted to adjust photo, toolThe user that body can be prompt equipment cuts preview image according to specific mode.
Second aspect discloses a kind of equipment, comprising: receiving unit, for receiving predetermined registration operation instruction;
Display unit, for showing preview image in preview interface after receiving unit receives predetermined registration operation instruction;In advanceImage of looking at includes at least one character image;Judging unit, for judging at least one character image with the presence or absence of abnormal peopleObject image;The head body ratio of abnormal character image is greater than the first thresholding less than the second thresholding;First thresholding is according to half height of portraitDegree and the long determining ratio value of portrait head, the second thresholding are according to portrait whole body length and the long determining ratio value of portrait head;It mentionsShow unit, for determining at least one character image there is abnormal character image in judging unit, then prompts the user of equipmentAdjust preview image.
As it can be seen that existing when user is using equipment provided in an embodiment of the present invention shooting photo when detecting in preview imageAbnormal character image, the i.e. length of character image are more than half body but insufficient whole body, then illustrate that the edge of preview image is very possibleFor the fragile position of subject, such as ankle, knee, this can seriously affect the effect of photo, and therefore, equipment can promptUser is adjusted image, and image adjusted can be so mentioned using the fragile position of subject as edgeThe quality of hi-vision.
In conjunction with second aspect, in the first possible implementation of the second aspect, judging unit is specifically used for, forEveryone object image in an at least character image, determines the head body ratio of character image;Judge head body than whether length is greater than theOne thresholding and less than the second thresholding;If the head body ratio of character image is greater than the first thresholding less than the second thresholding, it is determined that figure mapAs being abnormal character image.
In conjunction in the possible implementation of the first of second aspect or the above second aspect, at second of second aspectIn possible implementation, judging unit is specifically used for, if the head body ratio of character image is greater than the first thresholding less than the second thresholding,Then determine that character image is that abnormal character image specifically includes: if the head body ratio of character image is greater than the first thresholding less than secondLimit then calculates vertical in the second detection zone of the longitudinal edge amount and character image in the first detection zone of character imageTo edge amount;One edge of the first detection zone and the default coincident of character image, the second detection zone and figure mapThe long ratio of the distance and portrait head of the appointed part of picture is the first thresholding;If the longitudinal edge amount in the first detection zone is greater thanOr equal to the longitudinal edge amount in the second detection zone, it is determined that character image is abnormal character image.
In conjunction in the possible implementation of the first of second aspect or the above second aspect, in the third of second aspectIn possible implementation, judging unit is specifically used for, and at least one set detection line pair is determined in the first detection zone;Detection line pairThe detection line being parallel to each other including two, first edge are vertical to two detection lines for including with detection line;For each group of inspectionSurvey line pair calculates detection line to the gradient of upper at least two groups test point pair, calculates each group of inspection of at least two groups test point centeringAbsolute value of the measuring point to gradient;Test point is to the first test point and detection line in the first detection line including detection line centeringThe second test point in second detection line of centering;Absolute value of at least two groups test point to gradient is added, detection line is obtainedPair gradient and;By the gradient of at least one set of detection line pair be added, obtain the first detection zone in longitudinal edge amount.
In conjunction in the possible implementation of the first of second aspect or the above second aspect, at the 4th kind of second aspectIn possible implementation, judging unit is specifically used for, and at least one set detection line pair is determined in the second detection zone;Detection line pairThe detection line being parallel to each other including two, first edge are vertical to two detection lines for including with detection line;For each group of inspectionSurvey line pair calculates detection line to the gradient of upper at least two groups test point pair, calculates each group of inspection of at least two groups test point centeringAbsolute value of the measuring point to gradient;Test point is to the first test point and detection line in the first detection line including detection line centeringThe second test point in second detection line of centering;Absolute value of at least two groups test point to gradient is added, detection line is obtainedPair gradient and;By the gradient of at least one set of detection line pair be added, obtain the second detection zone in longitudinal edge amount.
In conjunction in the possible implementation of the first of second aspect or the above second aspect, at the 5th kind of second aspectIn possible implementation, prompt unit is specifically used for, and prompts adjustment information or operation information;Operation information is used to indicate userSpecified operation is executed, to adjust shooting angle, adjustment information is used for the corresponding target person of user prompt exception character imageObject adjusts stance or adjustment position.
The third aspect discloses a kind of computer readable storage medium, and finger is stored in the computer readable storage mediumIt enables;When being run in its equipment described in above-mentioned second aspect and its possible implementation of any one, so that the equipmentExecute the reminding method of taking pictures as described in above-mentioned first aspect and its various possible implementations.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is retouched in detailIt states.
Daily when taking pictures, as shown in Figure 1, photo may include the upper part of the body of personage of being taken, such photo can claimFor " half body photograph ".Certainly, photo also may include the whole body of personage of being taken, as shown in Fig. 2, such photo is properly termed as" whole body photograph ".In addition to this, the abnormal portrait photographs that also will appear a kind of " being greater than half body deficiency whole body ", as shown in figure 3, this kind ofPhoto usually using the fragile position such as the knee for the personage that is taken, ankle as edge, can seriously affect the quality of photo in this way.
But user can't usually pay close attention to " whether edges are at the fragile position of subject " when taking pictures, thisJust it is easy to appear edges the fragile position of subject the case where for sample, eventually lead to the photo effect of shooting compared withDifference.
In reminding method provided by the invention of taking pictures, when user is using equipment shooting photo, when detecting in preview imageThere are abnormal character image, i.e. the head body ratio of character image is greater than the first thresholding less than the second thresholding, wherein the first thresholding is rootIt is determined according to half body length of portrait, the second thresholding is determined according to portrait whole body length, then illustrates the side at preview image edgeEdge is probably the fragile position of subject, such as ankle, knee, this can seriously affect the effect of photo, therefore, ifIt is standby user to be prompted to be adjusted image, image adjusted be no longer using the fragile position of subject as edge,The quality of image so can be improved.
The embodiment of the present invention provides a kind of equipment, and Fig. 4 is the structural schematic diagram of equipment provided in an embodiment of the present invention.This setsStandby can be mobile phone, tablet computer, PDA (Personal Digital Assistant, personal digital assistant) etc. comprising taking picturesThe terminal device of function, the embodiment of the present invention are illustrated so that equipment is mobile phone as an example, and Fig. 4 is shown and each implementation of the present inventionThe block diagram of the part-structure of the relevant mobile phone of example.
As shown in figure 4, mobile phone includes: processor 10, memory 11, camera model 12, display unit 13 and audio listMember 14.In addition to this, mobile phone can also include RF (radio frequency, radio frequency) circuit 15, input unit 16, gravity biographyThe components such as sensor 17 and power supply 18.It will be understood by those skilled in the art that handset structure shown in Fig. 4 does not constitute opponentThe restriction of machine may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
It is specifically introduced below with reference to each component parts of the Fig. 4 to mobile phone:
Processor 10 is the control centre of mobile phone, using the various pieces of various interfaces and connection whole mobile phone, is led toIt crosses operation or executes the software program and/or module being stored in memory 11, and call the number being stored in memory 11According to, execute mobile phone various functions and processing data, thus to mobile phone carry out integral monitoring.Optionally, processor 11 may includeOne or more processing units;Preferably, processor 11 can integrate application processor and modem processor, wherein applicationThe main processing operation system of processor, user interface and application program etc., modem processor mainly handles wireless communication.It canWith understanding, above-mentioned modem processor can not also be integrated into processor 11.
Memory 11 can be used for storing software program and module, and processor 10 is stored in the soft of memory 11 by operationPart program and module, thereby executing the various function application and data processing of mobile phone.Memory 11 can mainly include storageProgram area and storage data area, wherein storing program area can application program needed for storage program area, at least one function(such as sound-playing function, image player function etc.) etc.;Storage data area, which can be stored, uses created number according to mobile phoneAccording to (such as audio data, image data, phone directory etc.) etc..In addition, memory 11 may include high-speed random access memory,It can also include nonvolatile memory, a for example, at least disk memory, flush memory device or other volatile solid-states are depositedMemory device.
Camera model 12 is built in mobile phone, including camera, can be used for shooting photo or video.The processor of mobile phone10 are integrated with video processing function and webcam driver etc., state are taken pictures or image when mobile phone enters, by the processor 10 of mobile phoneThe reset signal of submitting resets camera, and camera enters working condition while transferring data to processor 10.
Display unit 13 can be used for showing information input by user or be supplied to user information and mobile phone it is variousMenu.Display unit 13 may include display panel 130, optionally, can use LCD (Liquid Crystal Display, liquidCrystal display), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) configure display surfacePlate 130.Further, touch screen 131 can cover display panel 130, when touch screen 131 detects touch on it or nearbyAfter operation, processor 10 is sent to determine the type of touch event, is followed by subsequent processing device 10 according to the type of touch event aobviousShow and corresponding visual output is provided on panel 130.Although touch screen 131 and display panel 130 are only as two in Fig. 4Vertical component realizes the input and input function of mobile phone, but in some embodiments it is possible to by touch screen 131 and display surfacePlate 130 is integrated and that realizes mobile phone output and input function.
Audio unit 14 can provide between user and mobile phone including voicefrequency circuit 140, loudspeaker 141, microphone 142Audio interface.Electric signal after the audio data received conversion can be transferred to loudspeaker 141, by loudspeaking by voicefrequency circuit 140Device 141 is converted to voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 142, by audioCircuit 140 is converted to audio data after receiving, and audio data is exported to memory 10 to be further processed.
RF circuit 15 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, will be under base stationAfter row information receives, handled to processor 10;In addition, the data of uplink are sent to base station.In general, RF circuit includes but unlimitedIn antenna, at least one amplifier, transceiver, coupler, LNA (low noise amplifier, low-noise amplifier),Duplexer etc..In addition, RF circuit 15 can also be communicated with network and other equipment by wireless communication.The wireless communication can be withUsing any communication standard or agreement, including but not limited to GSM (global system of mobile communication,Global system for mobile communications), GPRS (general packet radio service, general packet radio service), CDMA(code division multiple access, CDMA), WCDMA (wideband code divisionMultiple access, wideband code division multiple access), LTE (long term evolution, long term evolution), Email, SMS(short messaging service, short message service) etc..
Input unit 16 can be used for receiving the number or character information of input, and generate with the user setting of mobile phone andThe related key signals input of function control.Specifically, input unit 16 may include touch screen 131 and other input equipments 160.Touch screen 341, also referred to as touch panel, collect user on it or nearby touch operation (such as user using finger, touchingThe operations of any suitable object or attachment on touch screen 131 or near touch screen 131 such as pen), and according to presettingFormula drive corresponding attachment device.Optionally, touch screen 131 may include two portions of touch detecting apparatus and touch controllerPoint.Wherein, the touch orientation of touch detecting apparatus detection user, and touch operation bring signal is detected, it transmits a signal toTouch controller;Touch controller receives touch information from touch detecting apparatus, and is converted into contact coordinate, then givesProcessor 10, and order that processor 10 is sent can be received and executed.Furthermore, it is possible to using resistance-type, condenser type, infraredThe multiple types such as line and surface acoustic wave realize touch screen 131.In addition to touch screen 131, input unit 16 can also include otherInput equipment 160.Specifically, other input equipments 160 can include but is not limited to physical keyboard, function key (such as volume controlKey processed, power switch button etc.), trace ball, mouse, one of operating stick etc. or a variety of.
Gravity sensor (gravity sensor) 17 can detecte mobile phone and accelerate in all directions (generally three axis)The size of degree can detect that size and the direction of gravity when static, can be used to identify the application of mobile phone posture, (for example horizontal/vertical screen is cutChange, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc..Mobile phone can also wrapInclude other sensors, such as optical sensor.Specifically, optical sensor may include ambient light sensor and close to optical sensor.ItsIn, ambient light sensor can adjust the brightness of display panel 130 according to the light and shade of ambient light;It can be examined close to optical sensorWhether have object come close to or in contact with mobile phone, can close display panel 130 and/or backlight when mobile phone is moved in one's ear if surveying.Mobile phoneThe other sensors such as gyroscope, barometer, hygrometer, thermometer, the infrared sensor that can also configure, details are not described herein.
Mobile phone further includes the power supply 18 (such as battery) powered to all parts, it is preferred that power supply can pass through power supply pipeReason system and processor 10 are logically contiguous, to realize management charging, electric discharge and power managed etc. by power-supply management systemFunction.
In embodiments of the present invention, when mobile phone enters shooting state, display unit 13 shows that preview image, processor 10 obtainTake preview image.Further, processor 10 judges at least one character image that the preview image includes with the presence or absence of differentOrdinary person's object image.Wherein, the head body ratio of abnormal character image is greater than the first thresholding less than the second thresholding.Wherein, the first thresholding isIt is determined according to half body length of portrait, the second thresholding is determined according to portrait whole body length.It is above-mentioned in embodiments of the present inventionFirst position can be the fragile position such as the knee of character image, ankle, and the default edge of preview image can be preview imageLower edge.
If there is abnormal character image at least one character image that the determining preview image of processor 10 includes, i.e.,There are length to be greater than the character image that half body is less than whole body, then the preview image is likely to be the sensitive part with human body,Such as: knee, ankle are edge, then the user of the equipment is prompted to adjust the preview image.User's tune can specifically be promptedWhole shooting angle, such as: prompt user leans forward mobile phone.User adjusts shooting angle according to the prompt of mobile phone, and preview image is adjustedFor " half body photograph ".
In other embodiments, when mobile phone enters picture browsing state, processor 10 obtains the image that mobile phone is currently shown,Processor 10 judges at least one character image that the image that mobile phone is currently shown includes with the presence or absence of abnormal character image.IfThere is abnormal character image at least one character image that the determining preview image of processor 10 includes, is then set described in promptStandby user adjusts the preview image, exemplary, may remind the user that and cuts the figure that mobile phone is currently shown according to specific modePicture.Wherein, above-mentioned " image that mobile phone is currently shown " may be considered preview image described in the embodiment of the present invention.
In some embodiments, the display unit 13 of equipment shows that text prompt user adjusts preview image, alternatively, equipmentVoice messaging can also be played by audio unit 14 prompts user to adjust preview image.
The embodiment of the present invention provides one kind and takes pictures reminding method, as shown in figure 5, the described method comprises the following steps:
101, equipment receives predetermined registration operation instruction, shows preview image in preview interface;Preview image includes at least oneCharacter image.
In the specific implementation, the equipment in the embodiment of the present invention can be mobile phone.When equipment enters shooting state, equipment is obtainedPreview image is as preview image.
In some embodiments, when equipment enters picture browsing state, equipment obtains the image that equipment is currently shown.WhenSo, the image currently shown includes at least one character image.Equipment executes subsequent behaviour to the image currently shownMake.
If preview image includes character image, step 102 is carried out;If preview image does not include character image, equipmentIt does not continue to execute reminding method provided in an embodiment of the present invention of taking pictures.
102, the equipment judges at least one described character image with the presence or absence of abnormal character image;The exception peopleThe head body ratio of object image is greater than the first thresholding less than the second thresholding.
Wherein, preview image can be preview image of the equipment under shooting state, be also possible to equipment in picture browsingDisplay image under state.In the specific implementation, character image can be calculated according to the length of character image and personage are longHead body ratio.The length of character image can be character image along the length in standing direction, it is believed that be the head of character imageTo the length at the default edge of preview image.
Exemplary, with reference to Fig. 6, when equipment enters shooting state, equipment shows preview image, and default edge can be previewThe lower edge of image.The length of so character image is the length of lower edge of the crown of character image apart from preview image.
In some embodiments, if image is positive display, i.e., aobvious with reference to Fig. 7 when equipment enters picture browsing stateThe standing direction of character image and the standing direction of equipment user are almost the same in diagram picture, and default edge can be current displayThe lower edge of image, then the length of character image is the length of lower edge of the crown of character image apart from preview image;With reference to Fig. 8, if image is non-positive display, that is, the standing side in the standing direction and equipment user of character image in image is shownTo inconsistent, default edge can be the right hand edge of current display image, then the length of character image is the head of character imageThe length of right hand edge of the apex distance from preview image.Certainly, Fig. 8 is only one kind of non-positive display mode, in other non-forward directionsUnder display, edge is preset according to tool it is not limited here in left edge or the top edge that default edge can be current display imageThe display mode of body is determined.
In addition, the first thresholding is determined according to half body length of personage, the second thresholding is determined according to personage's whole body length's.In general, Asian male average height is 7.18 bodies, Asia women average height is 6.95 bodies, and American-European male is averaged bodyA height of 7.57 bodies, American-European women average height are 7.49 bodies.Therefore, the first thresholding can be 5 in embodiments of the present inventionHead is long, and it is long that the second thresholding can be 8 heads.
If the head body ratio of character image is that 8 heads are long in preview image, preview image may be that whole body shines.If pre-Look at character image in image head body ratio it is long less than 5 heads, then preview image may be that half body shines.Positioned at intermediate state, i.e.,The head body ratio of character image is long and long less than 8 heads greater than 5 heads, then the character image in preview image may be to be greater thanHalf body but insufficient whole body, then preview image may be using the human bodies frangible portion position such as the knee of character image, ankle as edge,The effect of this kind of image is bad, and the embodiment of the present invention is intended to identify this kind of image, and user is prompted to be adjusted, to mentionHi-vision effect.
In the specific implementation, equipment can determine the head of character image by human face detection tech, and then calculate by personageThe length at the crown of image to above-mentioned default edge is that how many head are long, then, the length of character image can be N (N be greater than1 number) head is long, that is to say, that and the head body ratio of character image is N.
In some embodiments, equipment determines that the head body ratio of character image is greater than the first thresholding (such as: big less than the second thresholdingIn less than 8 bodies of 5 bodies) after, the longitudinal edge amount of character image can also be further calculated, accurately to judge the character imageIt whether is abnormal personage.So-called longitudinal edge amount may be considered gradient caused by longitudinal element in image, such as: trouser legs, peopleThe leg etc. of picture.Specifically, the longitudinal edge amount in the first detection zone of the character image and the character image are calculatedThe second detection zone in longitudinal edge amount.With reference to Fig. 9, an edge of the first detection zone is pre- with the preview imageIf coincident, second detection zone is first thresholding at a distance from second appointed part of character image.ToolDuring body is realized, detection zone can be the head of character image with a rectangular area on character image, the second appointed partPortion, if the first thresholding is that 5 heads are long, the second detection zone can be a rectangle long apart from 5 head of character image headRegion.With reference to Fig. 9, straight line is (flat where the second detection zone may be considered head highest point at a distance from character image headRow presets the lower edge that edge is preview image in the default edge of preview image, Fig. 9) with the center line of the second detection zoneThe distance between (the default edge for being parallel to preview image).
In the specific implementation, the longitudinal edge amount in detection zone can be calculated in the following manner:
At least one set detection line pair is determined in detection zone.Wherein, the detection line is to including two inspections being parallel to each otherSurvey line, in addition, the detection line is between the five of the first edge length for being divided into the detection zone two detection lines for including/ mono-;The first edge is vertical to two detection lines for including with the detection line.Certainly, the interval of two detection linesIt can be other numerical value, such as: the one third of first edge length, the embodiment of the present invention are not construed as limiting this.It is exemplary, referenceFig. 9, first edge can be the long side of the first detection zone.
Further, for each group of detection line pair, the detection line is calculated to the gradient of upper at least two groups test point pair,And each group of test point is found out to the absolute value of gradient.It should be noted that the test point is to including the detection line pairIn the first detection line on the first test point and the detection line centering the second detection line on the second test point.
Finally, absolute value of at least two groups test point to gradient is added, the ladder of the detection line pair is obtainedDegree and.In turn, by the gradient of at least one set of detection line pair be added, obtain the longitudinal edge in second detection zoneAmount.
Further, if the longitudinal edge amount in first detection zone is greater than or equal in second detection zoneLongitudinal edge amount, it is determined that the character image is abnormal character image.In embodiments of the present invention, if the head of character imageBody ratio is greater than the first thresholding less than the second thresholding, and the head body ratio that specifically can be character image is greater than 5 less than 8.In general, Asia is maleProperty average height be 7.18 bodies, Asia women average height be 6.95 bodies, American-European male's average height be 7.57 bodies, EuropeBeauty's property average height is 7.49 bodies.If the head body ratio of character image is 8 in preview image, preview image may be completeBody shines.If the head body ratio of character image is less than 5 in preview image, preview image may be that half body shines.Positioned at intermediate state, i.e., the head body ratio of character image is greater than 5 and less than 8, then the character image in preview image may be greater than half body butIt is insufficient whole body.Further, the first detection zone is the fringe region of preview image, and the second detection zone is the 5 of character imageHead is in, and the leg of character image is normally comprised, if the longitudinal edge amount of the first detection zone is less than the second detection zoneLongitudinal edge amount, then show that the second detection zone is different from the first detection zone, it is more likely that the fringe region of preview imageIt does not include the leg of character image.
If 103, prompting the user of the equipment there are the abnormal character image at least one described character imageAdjust the preview image.
In the specific implementation, as long as there are an abnormal character image in preview image, equipment is prompted described in user's adjustmentPreview image.The purpose of adjustment is to make no longer to have abnormal character image in image.
In some embodiments, the user of equipment described in device prompts adjusts shooting angle.It is exemplary, when equipment is shootingState can shoot half body with recommended user and shine if equipment, which determines in current preview image, has abnormal character image, toolBody equipment furthered camera lens or top at the top of equipment of leaning forward by voice or text prompt user.Certainly, equipment can also recommendUser shoots whole body and shines, equipment by voice or text prompt user by camera lens tune is remote or hypsokinesis equipment at the top of.It needs to illustrateIt is that " equipment that leans forward top " here can be user's handheld device, using the lower edge of equipment as axis slewing, is set after rotationStandby top is close to user." at the top of hypsokinesis equipment " can be user's handheld device, using the lower edge of equipment as axis slewing, rotationFar from user at the top of equipment after turning.
In further embodiments, when equipment is shooting state, and equipment determine in current preview image exist it is abnormalCharacter image, equipment adjust stance or tune by the corresponding target person of exception portrait described in voice or text prompt user remindingWhole position.With reference to Figure 10, the corresponding target person of the exception portrait can be the corresponding reference object of the abnormal portrait.ShowExample, the corresponding target person of user prompt exception portrait moves forward, and shines to shoot half body;Alternatively, prompt userIt reminds the corresponding target person of abnormal portrait to move backward, is shone to shoot whole body.
In further embodiments, when equipment is picture browsing state, and equipment determines exist in the image that currently showsAbnormal character image, equipment then prompt the user of the equipment to cut the preview image according to specific mode.Figure after cuttingCharacter image as in is half body photograph, and there is no the people for taking appointed part (such as: human knee, the fragile position of ankle) as edgeObject image.
If 104, being not processed at least one described character image there are the abnormal character image.
Certainly, if there is no abnormal character image in preview image, show in preview image there is no with human body someAppointed part is the character image at edge, then will not be because of occurring leading to figure using human body some appointed part as image borderAs second-rate, therefore can be not processed.
In reminding method provided by the invention of taking pictures, when user is using equipment shooting photo, when image border is to be takenThe appointed part of object, such as the fragile position of ankle, knee of human body, the equipment method that the user can be prompted adjusts image,Image adjusted can so improve the quality of image no longer using the appointed part of subject as edge.
Below with equipment in screening-mode, and for only one reference object, bat provided in an embodiment of the present invention is introducedAccording to reminding method.In addition, the first thresholding is 5 heads length in the present embodiment, the second thresholding is that 8 heads are long.As shown in figure 11, describedMethod the following steps are included:
201, equipment determines the head position of character image in preview image.
In the specific implementation, equipment can use the head position that human face detection tech determines character image.It should be noted thatPreview image described in preview image, that is, embodiment of the present invention.
202, equipment calculates the head body ratio of character image in preview image, judges the head body of character image than whether being greater than 5Head is long and long less than 8 heads.
In embodiments of the present invention, if the head body ratio of character image is greater than 5 less than 8.In general, Asian male average heightFor 7.18 bodies, Asia women average height is 6.95 bodies, and American-European male's average height is 7.57 bodies, and American-European women is averageHeight is 7.49 bodies.If the head body ratio of character image is 8 in preview image, preview image may be that whole body shines.IfThe head body ratio of character image is less than 5 in preview image, then preview image may be that half body shines.Positioned at intermediate state, i.e. personageThe head body ratio of image is greater than 5 and less than 8, then the character image in preview image may be insufficient complete greater than half bodyBody.
Therefore, if the head body ratio of character image not being greater than 5 and in the range of less than 8, i.e. the head body ratio of character imageLess than 5 or the head body ratio of character image is greater than 8, then does not prompt.When the head body ratio of character image is less than 5, character image canIt can be that half body shines, when the head body ratio of character image is greater than 8, character image may be that whole body shines, and not need to mention under both of these caseShow that user adjusts preview image, executes step 203.
If the head body ratio of character image is greater than 5 and less than 8, needs to be implemented step 204 and further calculate character imageEdge amount, with judge character image appointed part whether be preview image edge.
203, equipment does not prompt.
204, whether the feather edge of equipment detection preview image has longitudinal edge amount.
In the specific implementation, detection zone can be a rectangular area on preview image with reference to Figure 12.Equipment detection is pre-When whether the feather edge of image look at has longitudinal edge amount, the detection zone of a rectangle can be divided in the feather edge of preview imageWhether (i.e. the first detection zone described in the embodiment of the present invention), detecting has longitudinal edge amount in this region.
Specifically, pairing vertical line is determined in detection zone, the upper and lower ends of the vertical line in detection zone are detection zonesBoundary, one group of pairing vertical line refers to two vertical lines in detection zone, and the spacing of this two vertical lines can be long for detection zone/ 5th (referring to Figure 12, can be 1/5th of the long side length in hough transform region) of degree.With reference to Figure 12, AG and DJIt is detection line pair, BH and EK are detection lines pair, and CI and FL are detection lines pair.For each group of detection line pair, respective pixel is calculatedGradient between point, sums after then taking absolute value, and such one group of detection line is to obtaining a vector.It is exemplary, it is assumed that AG lineOn the RGB numerical value of each point from top to bottom be (a1R, a1G, a1B), (a2R, a2G, a2B)……(aNR, aNG, a1B), on DJ lineThe RGB numerical value of each point is (b1 from top to bottomR, b1G, b1B), (b2R, b2G, b2B)……(bNR, bNG, b1B)。
So detection line is to the vector X that AG and DJ is obtained:
Further, all detection lines all obtain a vector into after crossing calculating, obtain one after adding each addition of vectorsVector seeks the variance of this vector, is exactly the longitudinal edge amount of detection zone.It is exemplary, it is assumed that detection zone is in total in Figure 12Have AG and DJ, BH and EK, CI and FL this three groups of detection lines pair, to detection line to AG and DJ execute it is above-mentioned be calculated vector X, it is rightBH and EK executes above-mentioned calculation process and obtains vector Y, executes above-mentioned calculation process to CI and FL and obtains vector Z.Further, it calculatesThe variance of vector (X+Y+Z), as the longitudinal edge amount (i.e. the longitudinal edge amount of the first detection zone) of detection zone.
If being zero in the longitudinal edge amount that the detection zone of the feather edge of preview image calculates, show preview imageThe not longitudinal pictorial element of feather edge does not include the leg of character image in the detection zone of the feather edge of possible preview imagePortion does not have to prompt user then executing 203.If in the longitudinal edge amount that the detection zone of the feather edge of preview image calculatesIt is zero, then shows that the feather edge of preview image has longitudinal pictorial element, in the detection zone of the feather edge of possible preview imageLeg including character image, then executing 205.
205, equipment calculates 5 edge amounts being in of character image, judges whether 5 edge amounts being in are greater than bottom edgeThe longitudinal edge amount of edge.
In the specific implementation, in preview image, 5 of character image are in the detection for dividing a rectangle with reference to Figure 13Whether region (i.e. the second detection zone described in the embodiment of the present invention), detecting has longitudinal edge amount in this region.It needsIt is bright, straight line where the center line (parallel with the feather edge of preview image) of the second detection zone and the character image crown (withThe feather edge of preview image is parallel) the distance between be 5 bodies.
Specifically, pairing vertical line is determined in the second detection zone, the upper and lower ends of the vertical line in the second detection zone areThe boundary of second detection zone, one group of pairing vertical line refers to two vertical lines in detection zone, and the spacing of this two vertical lines is/ 5th of second detection zone width.It is one group of detection line pair with reference to Figure 13, MN and OP, QR and ST are one group of detection linesRight, UV and WX are one group of detection lines pair.For each group of detection line pair, gradient between corresponding pixel points is calculated, is then taken absolutelyTo summing after value, such one group of detection line is to obtaining a vector.It is exemplary, it is assumed that the RGB of each point from top to bottom on MN lineNumerical value is (a ' 1R, a ' 1G, a ' 1B), (a ' 2R, a ' 2G, a ' 2B)……(a′NR, a ' NG, a ' 1B), it is each from top to bottom on OP lineThe RGB numerical value of point is (b ' 1R, b ' 1G, b ' 1B), (b ' 2R, b ' 2G, b ' 2B)……(b′NR, b ' NG, b ' 1B)。
So detection line is to the vector X ' that MN and OP is obtained:
Further, all detection lines all obtain a vector into after crossing calculating, obtain one after adding each addition of vectorsVector seeks the variance of this vector, is exactly the longitudinal edge amount of detection zone.It is exemplary, it is assumed that detection zone is in total in Figure 13Have MN and OP, QR and ST, UV and WX this three groups of detection lines pair, to detection line to MN and OP execute it is above-mentioned vector X ' is calculated,Above-mentioned calculation process is executed to QR and ST and obtains vector Y ', above-mentioned calculation process is executed to CI and FL and obtains vector Z '.Further,Calculate the variance of vector (X '+Y '+Z '), the longitudinal edge amount of as the second detection zone.
Further, the first detection zone is the fringe region of preview image, and the second detection zone is 5 bodies of character imagePlace, normally comprises the leg of character image, if the longitudinal edge amount of the first detection zone is vertical less than the second detection zoneTo edge amount, then show that the second detection zone is different from the first detection zone, it is more likely that the fringe region of preview image does not wrapInclude the leg of character image.It so then carries out step 203 and does not prompt user.Once judging the longitudinal edge of the first detection zoneAmount is greater than or the longitudinal edge amount of the second detection zone, then shows that the fringe region of very possible preview image includes figure mapThe leg of picture, thens follow the steps 206.
206, device prompts user adjusts preview image.
In the specific implementation, equipment can shoot half body with recommended user and shine with reference to Figure 14, and specifically, the display unit of equipment13 displays " to guarantee to take pictures quality, at the top of the equipment that woulds you please to lean forward ", user can lean forward mobile phone according to the text of display, for shootingObject shoots half body and shines.
With reference to Figure 15, equipment can shoot half body with recommended user and shine, and specifically, the display of display unit 13 of equipment is " to protectCard is taken pictures quality, and the camera lens that furthers is woulded you please ", user can further camera lens according to the text of display, shoot half body for reference object and shine.
With reference to Figure 16, equipment can shoot whole body with recommended user and shine, and specifically, the display of display unit 13 of equipment is " to protectQuality of taking pictures is demonstrate,proved, is woulded you please at the top of hypsokinesis equipment ", user can be complete for reference object shooting according to the text hypsokinesis mobile phone of displayBody shines.
With reference to Figure 17, equipment can shoot whole body with recommended user and shine, and specifically, the display of display unit 13 of equipment is " to protectQuality of taking pictures is demonstrate,proved, woulds you please zoom out on camera lens ", user can shoot whole body according to the text track back of display for reference objectAccording to.
In some embodiments, equipment can also prompt target person adjustment stance or position.With reference to Figure 18, equipment is shownShow that unit 13 can also show " woulding you please that the person of being taken is reminded to move backward ", is shone to shoot whole body.Certainly, in some embodimentsIn, the display of display unit 13 " woulding you please that the person of being taken is reminded to move forward " of equipment is shone to shoot half body.
In addition, equipment can also be chosen by adjusting prompting frame needs to adjust stance or position under more people's photographed scenesTarget person, while the target person adjustment stance or position that user prompt check boxes are chosen.As shown in figure 19, equipmentDisplay " woulds you please remind the person of being taken in check boxes to move forward ", to shoot half body photograph.In this way, user can be according to display textThe prompt of word reminds the personage in check boxes to adjust stance or position.In the specific implementation, adjustment prompting frame and recognition of face frame canTo exist simultaneously, but need to visually distinguish adjustment prompting frame and recognition of face frame.Exemplary, yellow box is face knowledgeOther frame, red boxes are adjustment prompting frame.It should be noted that adjustment prompting frame may be considered a kind of special recognition of faceFrame can prompt user to need to adjust the target person of stance or position.In addition, recognition of face frame is not limited solely to yellow sideFrame, is also not limited to form illustrated in fig. 19, and adjustment prompting frame is not limited solely to red boxes, also not only limits toIn form illustrated in fig. 19, the embodiment of the present invention is not construed as limiting this.
In some embodiments, when equipment is picture browsing state, equipment is determined by above-mentioned steps 201~206 to be neededPrompt user handles the image currently shown, i.e., above-mentioned image to be processed.Specifically, device prompts user is according to specific modeThe image currently shown is cut, the character image in image after cutting is half body photograph, is not present with appointed part (such as: human bodyKnee, ankle etc. fragility position) be edge character image.Exemplary, with reference to Figure 20, equipment can be prompted in a manner of boxHow user cuts the image currently shown.Exemplary, equipment shows " woulding you please cut photo with reference to box ", and user is aobvious with equipmentThe box shown is border cuts photo, obtains a half body and shines.
In some embodiments, the above-mentioned text that equipment is shown can also be played out by the audio unit 14 of equipment,The photo of voice prompting user image or current preview that how processing equipment is currently shown.
In some embodiments, as shown in figure 21, the system set interface of equipment provides a function button, for openingPhotographing prompt function.Specifically, when which is open state, equipment can be executed to take pictures described in the embodiment of the present invention and be mentionedShow method, preview image is detected in preview interface, once there is abnormal character image, then user is prompted to adjust preview graphPicture.When the function button is in off state, reminding method of taking pictures described in the embodiment of the present invention is not carried out in equipment, in preview circleFace is not detected preview image, and user will not be prompted to adjust preview image.
The embodiment of the present invention provides a kind of equipment, the equipment can be the present embodiments relate to equipment.It is usingIn the case where corresponding each each functional module of function division, Figure 22 shows a kind of possible structural representation of above equipmentFigure.As shown in figure 22, the equipment includes receiving unit 301, display unit 302, judging unit 303 and prompt unit 304.
Receiving unit 301, for supporting the equipment executes reception predetermined registration operation in the step 101 in above-described embodiment to refer toThe step of enabling, and/or other processes for techniques described herein.
Display unit 302, for supporting the equipment executes in the step 101 in above-described embodiment to show preview imageStep, and/or other processes for techniques described herein;
Judging unit 303 for supporting the equipment to execute the step 102 in above-described embodiment, and/or is used for this paper instituteOther processes of the technology of description;
Prompt unit 304 for supporting the equipment to execute the step 103 in above-described embodiment, and/or is used for this paper instituteOther processes of the technology of description.
It should be noted that all related contents for each step that above method embodiment is related to can quote correspondenceThe function of functional module describes, and details are not described herein.
Illustratively, using integrated unit, the structural schematic diagram of equipment provided by the embodiments of the present applicationAs shown in figure 23.In Figure 23, which includes: processing module 401 and communication module 402.Processing module 301 is used for equipmentMovement carry out control management, it is and/or described herein for executing for example, execute the step of above-mentioned processing unit 402 executesTechnology other processes.Communication module 402 is for the interaction between holding equipment and other equipment, for example, executing above-mentioned connectThe step of receiving unit 401 and the execution of transmission unit 403.As shown in figure 23, equipment can also include memory module 403, store mouldBlock 403 is used to store the program code and data of equipment.
When processing module 401 is processor, communication module 402 is RF circuit, when memory module 403 is memory, equipmentIt can be equipment shown in Fig. 4.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is anyChange or replacement within the technical scope of the present application should all be covered within the scope of protection of this application.Therefore, this ShenProtection scope please should be based on the protection scope of the described claims.