Based on hand behavior catcher machine interaction method
Technical field
The present invention relates to utilize and catch the method that the hand behavior realizes man-machine interaction, belong to vision measurement technology and field of computer technology.
Background technology
Be subjected to the restriction of main flow display device and application software, traditional man-machine interaction mode is a kind of operation that is limited in the two dimensional surface usually.Proposition along with notions such as stereoscopic vision, virtual reality, augmented realities, the user likes more natural mode, in the virtual environment of more imaginative power, carry out reciprocation and influence each other with operand, thereby produce " immersing " impression and experience in being equal to true environment, therefore the data glove Study on Technology is developed and uses.Data glove can be followed the tracks of flexible and changeable gesture of user and dimensional orientation, makes the operator naturally and understandably the consciousness of oneself be passed to computing machine.More existing research institutions are doing a lot of work aspect the research and development of data glove both at home and abroad, and have released some data glove product and application thereof.The data glove product all must utilize accurate sensor to realize the measurement of data, and the difference of used sensor makes differing greatly of measuring accuracy and these two technical indicators of maximum sample frequency.The data glove bulk material mostly is expensive snapback fibre, and all needs to be worn on operator's hand, data glove to manipulate between process and the computing machine in use to be connected with order wire, and communication interface adopts RS232, high bit rate 115.2kbps.These data glove valuable product and be used for scientific research do not see that as yet civilian level product releases more.
Summary of the invention
The objective of the invention is to adopt two-dimensional signal to carry out man-machine interaction at traditional man-machine interaction mode (conventional mouse), do not fit into novel display technique (as the 3D projection, 3-D display), and data glove equipment complexity, cost an arm and a leg and deficiencies such as connection constraint are arranged, proposed a kind of based on hand behavior catcher machine interactive mode, i.e. vision mouse.Adopt this non-contact measurement of vision measurement, realization is obtained operation hand specific markers three-dimensional information, and realizes man-machine interaction according to the changes in coordinates of mark, has realized the function of conventional mouse.
The present invention adopts following technical scheme:
A kind of based on hand behavior catcher machine interaction method, utilize camera collection to post the hand images of mark, it is sent in the computing machine, in computing machine, store marker samples parameter and camera characteristic parameter, comprise the following steps:
(1) at least two at hand can stick different marks in independently movable position, and hand are placed in the visual field of camera;
(2) utilize the camera continuous acquisition to comprise the hand images sequence of whole marks, it is sent in the computing machine;
(3) computing machine is according to the corresponding marker samples parameter of being stored, and snoop tag is also discerned not isolabeling;
(4) three-dimensional coordinate of mark center point in the mark coordinate system that is detected according to the hand images of being gathered and camera calculation of characteristic parameters;
(5) set a change threshold that is marked at the coordinate figure of hand images hand images follow-up, whether exceed the change threshold that sets according to isolabeling coordinate change amount not with it, and the direction of changes in coordinates, realization is to the control of mouse.
As preferred implementation, of the present invention based on hand behavior catcher machine interaction method, step wherein (3) comprises the following steps:
(1) sets binary-state threshold, convert the hand images that collects to bianry image;
(2) this bianry image is done the connected domain analysis, search for and discern the image-region that all have edge feature;
(3) image-region and each the marker samples parameter of each that will identify with edge feature compares, and identifies each not isolabeling.
Be located at and post two different marks of mark A and mark B on hand, the hand images of being gathered is the plane picture of hand, and step wherein (5) comprises the following steps:
(1) adjacent two two field pictures is calculated the D coordinates value of mark A and mark B respectively and try to achieve the change amount of each mark coordinate figure; Whether judge mark A surpasses described change threshold with respect to the left and right directions on manual manipulation plane or the coordinate change amount of fore-and-aft direction, if surpass, then call the mouse_event function in the Windows api function storehouse, according to coordinate change amount, moving direction and the mobile pixel number of mouse beacon on the basis of current location.
(2) if marker for determination A does not move, then continue judge mark B and whether surpass described change threshold with respect to the above-below direction coordinate change amount on manual manipulation plane, if surpass, then call the mouse_event function among the Windows API, mouse beacon produces the right button operation.
(3) if marker for determination B does not carry out the right button operation, then continue the coordinate change amount of judge mark B on the manual manipulation plane and whether surpass described change threshold, if surpass, then call the mouse_event function in the Windows api function storehouse, mouse beacon produces the left button operation.
Man-computer mode of the present invention adopts vision technique to carry out three-dimensional coordinate and asks for, and is subjected to the restriction of camera sample rate and program runtime, and the highest sample frequency is 15.6Hz.The precision of cursor control has reached 2 pixels, error rate by key control is 4%, can realize that the cursor of mouse moves control and button control function, can finish the routine operation (browsing page to computing machine, file operations etc.), to take Installed System Memory be 40M in program run.The present invention adopts three-dimensional information to realize the basic function of mouse, has characteristics such as constraint simple in structure, that cost is low, the employing non-cpntact measurement is broken away from connection.
Description of drawings
The used mark synoptic diagram of Fig. 1 the present invention, (a): the back of the hand standard laid down by the ministries or commissions of the Central Government note; (b): forefinger end mark;
The pinhole imaging system model synoptic diagram that Fig. 2 the present invention uses;
Fig. 3 the present invention realizes the mouse control program flow diagram;
Fig. 4 the present invention realizes cursor of mouse positioning function process flow diagram;
Fig. 5 the present invention realizes mousebutton control function process flow diagram.
Embodiment
The invention provides a kind of camera that adopts and replace the special-purpose Fibre Optical Sensor or the man-machine interaction method of piezoelectric sensor, can realize obtaining operator's hand three-dimensional information.Only need to paste specific markers, adopt the non-contact information metering system, broken away from the constraint of gloves and order wire, improved the comfort level and the degree of freedom of operator's hand in the back of the hand portion and finger tip.The present invention can finish traditional mouse basic function, promptly the mouse control method of catching based on the hand behavior both can use jointly with mouse, also can not have independent use the under the situation of mouse, can realize each generic operation to computing machine fully, experiment test is satisfactory for result.
The invention will be further described below in conjunction with accompanying drawing and example.
Peripherals of the present invention is made up of camera, specific markers, fixed support, image data line and computing machine.Selected have automatic focus function and Ka Er Zeiss camera lens, and model is the camera that sieve skill is seen mini high definition type soon, technical parameter: 2,000,000 pixel ccd image sensors, 30 frame/seconds of sample rate.Camera is fixed on the support, takes over against hand place operation planar.The mark that is adopted as shown in Figure 1, two mark A and B are pasted on the back of the hand and forefinger end respectively, are affixed on the right hand usually by custom.Marker characteristic is black squares frame class mark, and distinguishes with the difference of marker character center pattern.The size of the back of the hand mark A is elected length of side 5cm as, forefinger end mark B length of side 1.5cm; Mark A center pattern is circle, and mark B center pattern is a right-angle triangle.
Verified the relation between tracking effective range (ultimate range on video camera and mark place plane under promptly can the capture of labels situation) and the label size by experiment.The capturing ability of this man-machine interaction mode adversary portion gauge point and the magnitude relationship of label size are tight.Adopt the mark of 7cm, 9cm, 11cm and four kinds of different sizes of 18cm, obtain to catch under the different size parameter effective range of hand gauge point.By experiment, can obtain as drawing a conclusion: label size is big more, and the tracking effective range is big more.But owing to influenced by the visual field, the two is not linear change, and along with the increase of label size, it is more little that the tracking effective range increases by on a year-on-year basis.Because mark must be affixed on palm back and finger tip, be subject to the size of the back of the hand and finger tip, the size of determining mark A and B at last is respectively 5cm and 1.5cm, the two all can effectively be hunted down in the tracking scope of 25cm, determine that thus support bracket fastened height is 30cm, camera is 25cm apart from mark place plan range.
The present invention adopts this Integrated Development Environment of Microsoft viscul c++6.0, by above-mentioned hardware and program, has realized the function of mouse action.Fig. 3 realizes the process flow diagram of mouse action for the present invention.Concrete steps are as follows:
(1) program initialization comprises the initialization video configuration, reads marker samples parameter and camera characteristic parameter.The initialization video configuration comprises photographic images size, sampling frame frequency and color space, is configured to 640*480,30 frame/seconds and RGB 24 respectively.
(2) obtain video image, snoop tag is also discerned different marker samples.Utilize single camera to obtain to comprise the image of whole marks to be input in the system, adopt binary-state threshold 100, convert the coloured image that collects to bianry image.This bianry image is done the connected domain analysis, search for and discern the image-region that all have the square edge feature.Utilize template matching algorithm, will extract to such an extent that the mark in image-region and the marker samples storehouse is compared, find out zone that matching degree is higher than setup parameter and promptly think the not isolabeling that the system that identifies adopts.
(3) calculate the three-dimensional coordinate of mark center point in the mark coordinate system that is detected.By the pin-hole imaging model, set up mark coordinate system O
m-X
mY
mZ
m, camera coordinate system O
c-X
cY
cZ
cWith the desirable screen coordinate system O of video camera
u-X
uY
u, the mutual relationship between coordinate system as shown in Figure 4.Desirable screen coordinate (x by mark center point
u, y
u) and transition matrix T
Cm(the mark coordinate is tied to the transition matrix between the camera coordinate system) calculates the three-dimensional coordinate (x of different mark center point in the mark coordinate system
m, y
m, z
m).
(4) according to the not variation of the coordinate figure of isolabeling, call the mouse_event function in the Windows api function storehouse, realize the control to mouse, the flow process of cursor positioning operation as shown in Figure 4.The D coordinates value of record mark A is also calculated the change amount of adjacent two two field picture coordinate figures; Whether the coordinate change amount of the x direction of judge mark A (manual manipulation plane left and right directions) and y direction (manual manipulation plane fore-and-aft direction) surpasses threshold value 10, if surpass, then call the SetCursorPos (xvalue in the Windows api function storehouse, yvalue) function, mouse beacon moving direction and the mobile pixel number on the basis of current location.The pixel number and the coordinate change amount that move are linear, and scale-up factor can pass through program setting.
(5) if marker for determination A does not move, whether z direction (manual manipulation plane above-below direction) the coordinate change amount that then continues judge mark B surpasses threshold value 20, if surpass, then call the mouse_event function in the Windows api function storehouse, mouse beacon produces the left button operation.If marker for determination B does not carry out the left button operation, then continue the coordinate change amount of judge mark B on x-y plane (hand place operation planar) and whether surpass setting threshold, if surpass, then call the mouse_event function in the Windows api function storehouse, mouse beacon produces the right button operation.The process flow diagram of mouse beacon left and right press key operation as shown in Figure 5.
(6) close video acquisition, EOP (end of program).
At last, catch mutual experiment by the hand gauge point, some important technology parameters of the behavior of making type hand being caught human-computer interaction technology quantize, and estimate this technology actual effect.The maximum sample frequency that experiment test obtains this technology is 15.6Hz, the precision of cursor control has reached 2 pixels, error rate by key control is 4%, it is 40M that program run takies Installed System Memory, the cursor that can realize mouse moves control and button control function, can finish routine operation (browsing page, file operation etc.) to computing machine.
The present invention is because of system simply greatly reduces cost, and the civilian commercialization that helps technology is popularized.Different with traditional human-computer interaction device, this man-computer mode adopts space three-dimensional information to realize interactive operation, under the situation that series of concepts such as stereoscopic vision, virtual reality and augmented reality constantly are suggested, this man-computer mode has remarkable advantages more, will be more widely used and more long-range development.