diff --git a/web/zm_config.php.z b/web/zm_config.php.z
index 9b24abecd..205b81fcf 100644
--- a/web/zm_config.php.z
+++ b/web/zm_config.php.z
@@ -148,7 +148,7 @@ $jws = array(
'video' => array( 'w'=>100, 'h'=>80 ),
'image' => array( 'w'=>48, 'h'=>80 ),
'frames' => array( 'w'=>500, 'h'=>300 ),
- 'stats' => array( 'w'=>600, 'h'=>200 ),
+ 'stats' => array( 'w'=>680, 'h'=>200 ),
'options' => array( 'w'=>760, 'h'=>480 ),
'optionhelp' => array( 'w'=>320, 'h'=>240 ),
'restarting' => array( 'w'=>250, 'h'=>150 ),
diff --git a/web/zm_html_view_stats.php b/web/zm_html_view_stats.php
index f6c12ac0a..eeb1895df 100644
--- a/web/zm_html_view_stats.php
+++ b/web/zm_html_view_stats.php
@@ -23,11 +23,19 @@ if ( !canView( 'Events' ) )
$view = "error";
return;
}
-$result = mysql_query( "select S.*,E.*,Z.Name as ZoneName,M.Name as MonitorName,M.Width,M.Height from Stats as S left join Events as E on S.EventId = E.Id left join Zones as Z on S.ZoneId = Z.Id left join Monitors as M on E.MonitorId = M.Id where S.EventId = '$eid' and S.FrameId = '$fid' order by S.ZoneId" );
+$result = mysql_query( "select S.*,E.*,Z.Name as ZoneName,Z.Units,Z.LoX,Z.LoY,Z.HiX,Z.HiY,M.Name as MonitorName,M.Width,M.Height from Stats as S left join Events as E on S.EventId = E.Id left join Zones as Z on S.ZoneId = Z.Id left join Monitors as M on E.MonitorId = M.Id where S.EventId = '$eid' and S.FrameId = '$fid' order by S.ZoneId" );
if ( !$result )
die( mysql_error() );
while ( $row = mysql_fetch_assoc( $result ) )
{
+ if ( $row['Units'] == 'Percent' )
+ {
+ $row['LoX'] = round(($row['LoX']*($row['Width']-1))/100);
+ $row['LoY'] = round(($row['LoY']*($row['Height']-1))/100);
+ $row['HiX'] = round(($row['HiX']*($row['Width']-1))/100);
+ $row['HiY'] = round(($row['HiY']*($row['Height']-1))/100);
+ }
+ $row['Area'] = (($row['HiX']-$row['LoX'])+1)*(($row['HiY']-$row['LoY'])+1);
$stats[] = $row;
}
@@ -44,21 +52,21 @@ function closeWindow()
}
-
-
+
+
= $zmSlangFrame ?> = $eid."-".$fid ?> |
= $zmSlangClose ?> |
= $zmSlangZone ?> |
-= $zmSlangAlarmPx ?> |
-= $zmSlangFilterPx ?> |
-= $zmSlangBlobPx ?> |
-= $zmSlangBlobs ?> |
-= $zmSlangBlobSizes ?> |
-= $zmSlangAlarmLimits ?> |
-= $zmSlangScore ?> |
+= $zmSlangAlarmPx ?> |
+= $zmSlangFilterPx ?> |
+= $zmSlangBlobPx ?> |
+= $zmSlangBlobs ?> |
+= $zmSlangBlobSizes ?> |
+= $zmSlangAlarmLimits ?> |
+= $zmSlangScore ?> |
= $stat['ZoneName'] ?> |
-= $stat['AlarmPixels'] ?> |
-= $stat['FilterPixels'] ?> |
-= $stat['BlobPixels'] ?> |
-= $stat['Blobs'] ?> |
-= $stat['MinBlobSize']."-".$stat['MaxBlobSize'] ?> |
-= $stat['MinX'].",".$stat['MinY']."-".$stat['MaxX'].",".$stat['MaxY'] ?> |
-= $stat['Score'] ?> |
+= sprintf( "%d (%d%%)", $stat['AlarmPixels'], (100*$stat['AlarmPixels']/$stat['Area']) ) ?> |
+= sprintf( "%d (%d%%)", $stat['FilterPixels'], (100*$stat['FilterPixels']/$stat['Area']) ) ?> |
+= sprintf( "%d (%d%%)", $stat['BlobPixels'], (100*$stat['BlobPixels']/$stat['Area']) ) ?> |
+= $stat['Blobs'] ?> |
+= sprintf( "%d-%d (%d%%-%d%%)", $stat['MinBlobSize'], $stat['MaxBlobSize'], (100*$stat['MinBlobSize']/$stat['Area']), (100*$stat['MaxBlobSize']/$stat['Area']) ) ?> |
+= $stat['MinX'].",".$stat['MinY']."-".$stat['MaxX'].",".$stat['MaxY'] ?> |
+= $stat['Score'] ?> |
|