A kind of method, apparatus and robot of determining photographed scene
Technical field
The invention belongs to robotic technology field more particularly to a kind of method, apparatus and robot of determining photographed scene.
Background technique
Intelligent hardware product is very universal in people's daily life, especially has phonetic function or assistant's function
The Intelligent hardware product of energy, such as robot, are mainly used in the associated scenario of music and Intelligent housing.However,
Artificially passive use state, the function without identification scene are unable to locating for automatic identification user existing major part machine
Actual scene.
Therefore, it is necessary to a kind of scheme be proposed, to solve the above problems.
Summary of the invention
In view of this, the embodiment of the invention provides the method, apparatus and robot of a kind of determining photographed scene, to solve
Existing robot can not automatic identification application scenarios the problem of.
The first aspect of the embodiment of the present invention provides a kind of method of determining photographed scene, comprising:
When receiving shooting instruction, start the filming apparatus;
It detects in the picture of the filming apparatus shooting with the presence or absence of face;
Face if it exists then selects the face to conform to a predetermined condition as benchmark face from the face;
The face in the picture in addition to the benchmark face is identified based on the benchmark face, with the determination picture
In face quantity;
Current photographed scene is determined based on the face quantity.
Optionally, before starting the filming apparatus, further includes:
Determine sound source position;
Correspondingly, after starting the filming apparatus, further includes:
The picture at the sound source position is shot by the filming apparatus.
Optionally, the face for selecting one to conform to a predetermined condition from the face includes: as benchmark face
Clarity highest is selected from the face and the face nearest apart from the robot is as benchmark face.
Optionally, described that the face in the picture in addition to the benchmark face is identified based on the benchmark face, with
Determine that the face quantity in the picture includes:
Using the shooting angle of the benchmark face as benchmark angle, respectively offset predetermined angular is detected in the picture to the left and right
Face, with the face quantity in the determination picture.
Optionally, after determining the face quantity in the picture, further includes:
Acquire the voice messaging in the picture;
Correspondingly, described to determine that current photographed scene includes: based on the face quantity
Current photographed scene is determined based on the voice messaging of the face quantity and acquisition.
The second aspect of the embodiment of the present invention provides a kind of device of scene type judgement, comprising:
Starting module, for when receiving shooting instruction, starting the filming apparatus;
Detection module, for detecting in the picture that the filming apparatus is shot with the presence or absence of face;
Selecting module, for face if it exists, then selected from the face face to conform to a predetermined condition as
Benchmark face;
Identification module, for being identified based on the benchmark face to the face in the picture in addition to the benchmark face,
With the face quantity in the determination picture;
First determining module, for determining current photographed scene based on the face quantity.
Optionally, the device of the determination photographed scene, further includes:
Second determining module, for determining sound source position;
Shooting module, for shooting the picture at the sound source position by the filming apparatus.
Optionally, the selecting module includes:
Selecting unit, for clarity highest is selected from the face and the face nearest apart from the robot as
Benchmark face.
Optionally, the first determining module includes:
First determination unit, for respectively deviating predetermined angle to the left and right using the shooting angle of the benchmark face as benchmark angle
Degree detects the face in the picture, with the face quantity in the determination picture.
Optionally it is determined that the device of photographed scene further include:
Acquisition module, for acquiring the voice messaging in the picture;
Correspondingly, first determining module includes:
Second determination unit, for determining current shooting based on the voice messaging of the face quantity and acquisition
Scene.
The third aspect of the embodiment of the present invention provides a kind of robot, including memory, processor and is stored in institute
State the computer program that can be run in memory and on the processor, which is characterized in that the processor executes the meter
The step of method in first aspect is realized when calculation machine program.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage
Media storage has computer program, which is characterized in that side in first aspect is realized when the computer program is executed by processor
The step of method.
In embodiments of the present invention, by starting the filming apparatus in robot when receiving shooting instruction, institute is detected
State in the picture of filming apparatus shooting with the presence or absence of face, if it exists face, then selected from the face one meet it is predetermined
The face of condition identifies the face in the picture of shooting in addition to the benchmark face as benchmark face, with the determination picture
Face quantity in face determines current photographed scene based on the face quantity, realizes the function for automatically determining photographed scene
Energy.The embodiment of the present invention is easy to operate, cost of implementation is low, has stronger usability and practicality.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is the implementation process schematic diagram of the method for the determination photographed scene that the embodiment of the present invention one provides;
Fig. 2 is the implementation process schematic diagram of the method for determining photographed scene provided by Embodiment 2 of the present invention;
Fig. 3 is the structural block diagram of the device for the determination photographed scene that the embodiment of the present invention three provides;
Fig. 4 is the schematic diagram for the robot that the embodiment of the present invention four provides.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed
Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific
The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, in case unnecessary details interferes description of the invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " instruction is described special
Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step,
Operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment
And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is
Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt
Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that "
Or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to
Determine " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment one
Fig. 1 shows the implementation process schematic diagram of the method for the determination photographed scene of the offer of the embodiment of the present invention one.Such as Fig. 1
Shown, the method for the determination photographed scene can be applied to the robot comprising filming apparatus, specifically may include following steps:
Step 101: when receiving shooting instruction, starting filming apparatus.
When robot receives shooting instruction, control starts the filming apparatus.Wherein, filming apparatus can be machine
Camera or camera on people etc..User remotely can send shooting instruction to robot by remote controler, be also possible to
User presses the switch button in robot and sends shooting instruction to robot, can also be that user passes through phonetic order to machine
Human hair send shooting instruction.
Step 102: detecting in the picture of the filming apparatus shooting with the presence or absence of face.
Wherein, picture can be the picture in short-sighted frequency, the picture being also possible in photo.If it is short-sighted frequency, to short
Video carries out parsing and obtains image, detects to the picture in image, judges in picture with the presence or absence of face;If it is photograph
Piece, the then picture directly detected in photo whether there is face.
Step 103: face if it exists then selects the face to conform to a predetermined condition as benchmark from the face
Face.
It should be noted that general robot all can detecte face, face if it does not exist, robot is to user
Prompting message is sent, so that user carries out prompt investigation to robot according to the prompting message, to confirm being that robot is
System has that the shooting angle of failure or robot exists, and user carries out corresponding adjustment.
Optionally, step 103 specifically includes:
Clarity highest is selected from the face and the face nearest apart from the robot is as benchmark face.
The distance of the clarity and every face of all faces in picture apart from robot filming apparatus is calculated, it will be clear
It spends highest and the face nearest apart from the robot is as benchmark face.Generally, the people nearest apart from robot filming apparatus
Face, its resolution is the highest.Illustratively, can be by face feature point quantity more than predetermined value, and the maximum face of face frame is made
For clarity highest and the face nearest apart from the robot.
Step 104: the face in the picture in addition to the benchmark face being identified based on the benchmark face, with determination
Face quantity in the picture.
Optionally, the face in the picture in addition to the benchmark face is identified based on the benchmark face, with determination
Face quantity in the picture includes:
Using the shooting angle of the benchmark face as benchmark angle, respectively offset predetermined angular is detected in the picture to the left and right
Face, with the face quantity in the determination picture.
Illustratively, using the shooting angle of benchmark face as benchmark angle, each 45 degree of offset is to the left and right to detect the picture
In face to get to face quantity in addition to benchmark face, the face quantity in addition to benchmark face is added into base
The quantity 1 of quasi- face then obtains the face quantity in the picture.
Step 105: current photographed scene is determined based on the face quantity.
Illustratively, face quantity and the relationship of photographed scene are as shown in table 1:
Number |
Photographed scene |
1 people |
Desk, computer desk |
2~3 people |
Home scenarios, appointment |
4~5 people |
Have a dinner party, gambling party, game open it is black |
6~8 people |
Family party is had a dinner party |
9 people or more |
KTV, large-scale party |
Table 1
Based on the quantity of face in determining picture, according to the relationship of preset face quantity and photographed scene, determination is worked as
Preceding photographed scene.
In embodiments of the present invention, by starting the filming apparatus in robot when receiving shooting instruction, institute is detected
State in the picture of filming apparatus shooting with the presence or absence of face, if it exists face, then selected from the face one meet it is predetermined
The face of condition identifies the face in the picture of shooting in addition to the benchmark face as benchmark face, with the determination picture
Face quantity in face determines current photographed scene based on the face quantity, realizes the function for automatically determining photographed scene
Energy.The embodiment of the present invention is easy to operate, cost of implementation is low, has stronger usability and practicality.
Embodiment two
Fig. 2 shows the implementation process schematic diagrames of the method for determining photographed scene provided by Embodiment 2 of the present invention.Such as Fig. 1
Shown, the method for the determination photographed scene specifically comprises the following steps 201 to step applied to the robot comprising filming apparatus
Rapid 208.
Step 201: determining sound source position.
Optionally, the sound source position of current scene is determined by sound transducer and position sensor.
Step 202: when receiving shooting instruction, starting filming apparatus.
Step 203: the picture at the sound source position is shot by the filming apparatus.
Due to having determined that sound source position, robot shoot the sound source by the filming apparatus in step 201
Picture at position.
Step 204: detecting in the picture of the filming apparatus shooting with the presence or absence of face.
Step 205: face if it exists then selects the face to conform to a predetermined condition as benchmark from the face
Face.
Step 206: the face in the picture in addition to the benchmark face being identified based on the benchmark face, with determination
Face quantity in the picture.
Step 207: acquiring the voice messaging in the picture.
The voice messaging in picture is acquired, judges that the comprehensive state of the voice messaging, comprehensive state can be quiet, orderly
Speech or mixed and disorderly speech etc..
Step 208: current photographed scene is determined based on the voice messaging of the face quantity and acquisition.
Illustratively, the relationship of the voice and photographed scene of face quantity and acquisition is as shown in table 2:
Number |
Voice messaging |
Photographed scene |
1 people |
Self-timer |
Desk, computer desk |
2~3 people |
Orderly speech |
Home scenarios, appointment |
4~5 people |
Mixed and disorderly speech |
Have a dinner party, gambling party, game open it is black |
6~8 people |
Mixed and disorderly speech |
Family party is had a dinner party |
9 people or more |
Mixed and disorderly speech |
KTV, large-scale party |
Table 2
The voice messaging based on the face quantity and acquisition carries out comprehensive analysis, according to preset face number
The relationship of the voice and photographed scene of amount and acquisition, determines current photographed scene.
Wherein, the realization process of step 202, step 204, step 205 and step 206 respectively with step 101, step 102,
Step 103 is similar with step 104, and details are not described herein.
The embodiment of the present invention on the basis of example 1, increases the acquisition to voice messaging in shooting picture, is based on
The face quantity and the voice messaging of acquisition determine current photographed scene, to improve the accuracy of identification.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Embodiment three
Referring to FIG. 3, it illustrates the structural block diagrams of the device of the determination photographed scene of the offer of the embodiment of the present invention three.Really
The device 30 for determining photographed scene includes: that starting module 31, detection module 32, selecting module 33, identification module 34 and first are determining
Module 35.Wherein, the concrete function of each module is as follows:
Starting module 31, for starting filming apparatus when receiving shooting instruction;
Detection module 32, for detecting in the picture that the filming apparatus is shot with the presence or absence of face;
Selecting module 33 then selects the face to conform to a predetermined condition to make for face if it exists from the face
For benchmark face;
Identification module 34, for being known based on the benchmark face to the face in the picture in addition to the benchmark face
Not, with the face quantity in the determination picture;
First determining module 35, for determining current photographed scene based on the face quantity.
Optionally it is determined that the device 30 of photographed scene, further includes:
Second determining module, for determining sound source position;
Shooting module, for shooting the picture at the sound source position by the filming apparatus.
Optionally, selecting module 33 includes:
Selecting unit, for clarity highest is selected from the face and the face nearest apart from the robot as
Benchmark face.
Optionally, the first determining module 35 includes:
First determination unit, for respectively deviating predetermined angle to the left and right using the shooting angle of the benchmark face as benchmark angle
Degree detects the face in the picture, with the face quantity in the determination picture.
Optionally it is determined that the device 30 of photographed scene further include:
Acquisition module, for acquiring the voice messaging in the picture;
Correspondingly, the first determining module 35 includes:
Second determination unit, for determining current shooting based on the voice messaging of the face quantity and acquisition
Scene.
In embodiments of the present invention, by starting the filming apparatus in robot when receiving shooting instruction, institute is detected
State in the picture of filming apparatus shooting with the presence or absence of face, if it exists face, then selected from the face one meet it is predetermined
The face of condition identifies the face in the picture of shooting in addition to the benchmark face as benchmark face, with the determination picture
Face quantity in face determines current photographed scene based on the face quantity, realizes the function for automatically determining photographed scene
Energy.The embodiment of the present invention is easy to operate, cost of implementation is low, has stronger usability and practicality.
Example IV
Fig. 4 is the schematic diagram for the robot that the embodiment of the present invention four provides.As shown in figure 4, the robot 4 of the embodiment wraps
It includes: processor 40, memory 41 and being stored in the computer that can be run in the memory 41 and on the processor 40
Program 42, such as determine the method program of photographed scene.The processor 40 is realized above-mentioned when executing the computer program 42
Step in the embodiment of the method for each determining photographed scene, such as step 101 shown in FIG. 1 is to 105.Alternatively, the processing
Device 40 realizes the function of each module in above-mentioned each Installation practice, such as module shown in Fig. 3 when executing the computer program 42
31 to 35 function.
Illustratively, the computer program 42 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 41, and are executed by the processor 40, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for
Implementation procedure of the computer program 42 in the robot 4 is described.For example, the computer program 42 can be divided
At first judgment module and sending module, the concrete function of each module is as follows:
First judgment module, for judging institute when listening to the voice messaging inputted by the speech input device
Whether the length for stating voice messaging is greater than preset length;
Sending module, for when the length is greater than preset length, then the voice messaging being sent to server, with
So that the server is carried out parsing to the voice messaging and obtain parsing result, and is corresponding according to parsing result generation
It is complete to be sent to the mobile terminal for matching connection with the robot by operational order for the parsing result and the operational order
At corresponding operation.
The robot 4 can be desktop PC, notebook, palm PC etc. and calculate equipment.The robot can
It include but are not limited to, processor 40, memory 41.It will be understood by those skilled in the art that Fig. 4 is only showing for robot
Example, does not constitute the restriction to robot, may include components more more or fewer than diagram, or combine certain components, or
The different component of person, such as the robot can also include input-output equipment, network access equipment, bus etc..
Alleged processor 40 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), ready-made 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.
The memory 41 can be the internal storage unit of the robot 4, such as the hard disk or memory of robot 4.
The memory 41 is also possible to the External memory equipment of the robot 4, such as the plug-in type being equipped in the robot 4 is hard
Disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card
(Flash Card) etc..Further, the memory 41 can also both include the internal storage unit of the robot 4 or wrap
Include External memory equipment.The memory 41 is for other programs needed for storing the computer program and the robot
And data.The memory 41 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 of description and succinctly, only with above-mentioned each function
Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing
The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list
Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system
The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with
It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute
The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as
Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately
A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device
Or the INDIRECT COUPLING or communication connection of unit, it 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 software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium
It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code
Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described
The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice
Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions
Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.