Panasonic GP-MH310 series Technical Manual page 31

Hd color camera module
Table of Contents

Advertisement

Function Descriptions
Auto Pursuit
Sample Program
/***********************************************/
/*
Auto Pursuit Function
/***********************************************/
int screen_shot_exe( uchar lateral_ratio, uchar vertical_ratio, uchar lateral_dir, uchar vertical_dir)
{
/*
lateral_dir
/*
vertical_dir
/*
lateral_ratio
/*
vertical_ratio
/*
zoom_r
/*
view_angle_pan
/*
view_angle_tilt
/*
PI
/*
tilt
position
/*
pan_angle
/*
tilt_angle
/*
pan_move
/*
tilt_move
/*
(The unit : degree,Shown value : x100 of the actual degree )
ulong pan_angle, tilt_angle;
/*
Change the move ditstance (%) obtained by the request command to the pan-tilt move distance (angle).
pan_angle = view_angle_pan [zoom_r] * lateral_ratio / 200;
tilt_angle = view_angle_tilt[zoom_r] * vertical_ratio / 200;
/*
When turning to the direction right
if( lateral_dir == PAN_RIGHT ){
pan_move = pan_angle;
/* The below correction process will be done at the tilt angle of 55-125 degrees. */
if( tilt
position > TILT_55_DEGREE && tilt
pan_move = pan_angle / cosf((pan_angle / 18000) * PI);
}
/*
When tilting to the direction top
if( vertical_dir == TIL_UP ){
tilt_move = tilt_angle;
/* The below correction process will be done at the tilt angle of 55 ~ 90 degrees. */
if( tilt
position > TILT_55_DEGREE && tilt
tilt_move -= pan_angle * tanf((pan_angle / 18000) * PI);
/* The below correction process will be done at the tilt angle of 90 ~ 125 degrees. */
else if( tilt
position >= TILT_90_DEGREE && tilt
tilt_move += pan_angle * tanf((pan_angle / 18000) * PI);
}
/**************************************************************************************************************************************************/
/*
At this position, the function will be called to execute pan-tilt movement,
/*
and based on the calcurated result above, move the camera to pan direction
/*
by pan_move angle and/or move the camera to tilt direction by tilt_move angle.
/*
(Note: The unit for "pan_move" and "tilt_move" is "degree", and the shown value is x100 of the actual degree. )
/**************************************************************************************************************************************************/
/* HB310
Zoom ratio and angle of view table
(PAN)
(The unit : degree,Shown value :
x100 of the actual degree) */
-aspect 16:9
const ushort view_angle_pan[10]=
{
5086,
//x1
2577,
//x2
1788,
//x3
1369,
//x4
1115,
//x5
940,
//x6
803,
//x7
709,
//x8
610,
//x9
544,
//x10
};
-aspect 4:3
const ushort view_angle_pan[10]=
{
4877,
//x1
2467,
//x2
1709,
//x3
1307,
//x4
1065,
//x5
897,
//x6
766,
//x7
676,
//x8
583,
//x9
520,
//x10
};
*/
:
p : Movement direction (Lateral) (1: Right, 2: Left)
:
q : Movement direction (Vertical) (1: Up , 2: Down)
:
rs : Lateral movement distance (%)
:
tu : Vertical movement distance (%)
:
Current zoom ratio
:
Zoom ratio and angle of view table (PAN)
:
Zoom ratio and angle of view table (TILT)
:
3.1415926535
:
Current tilt angle
:
Pan move distance before correction
:
Tilt move distance before correction
:
Pan move distance after correction
:
Tilt move distance after correction
*/
position < TILT_125_DEGREE )
*/
position < TILT_90_DEGREE )
position < TILT_125_DEGREE )
/* HB310
Zoom ratio and angle of view table (TILT)
(The unit : degree,Shown value :
x100 of the actual degree) */
-aspect 16:9
const ushort view_angle_tilt[10]=
{
2934,
1477,
1018,
777,
632,
532,
454,
401,
346,
310,
};
-aspect 4:3
const ushort view_angle_tilt[10]=
{
3705,
1867,
1289,
984,
801,
675,
576,
509,
439,
392,
};
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
Description of macro
PAN_RIGHT : 1 ( move direction ( horizontal ) ( 1:Right ) )
TIL_UP : 1 ( move direction ( vertical ) ( 1:Up ) )
TILT_55_DEGREE : set the value that is equivalent to tilt angle 55 at the user side.
TILT_90_DEGREE : set the value that is equivalent to tilt angle 90 at the user side.
TILT_125_DEGREE:set the value that is equivalent to tilt angle 125 at the user side.
//x1
//x2
//x3
//x4
//x5
//x6
//x7
//x8
//x9
//x10
//x1
//x2
//x3
//x4
//x5
//x6
//x7
//x8
//x9
//x10
−30−
* The value will be defined by the user side.
*/
 
*/
*/
*/
*/
 

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents