Thêm tính năng vẽ ROI vào khung cam bắt biển
This commit is contained in:
parent
2c6e326008
commit
c0c8b325d0
4
AIParkingApplication/LaneIn.Designer.cs
generated
4
AIParkingApplication/LaneIn.Designer.cs
generated
|
@ -69,6 +69,10 @@
|
||||||
this.pictureBoxPlateVideo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
this.pictureBoxPlateVideo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
this.pictureBoxPlateVideo.TabIndex = 0;
|
this.pictureBoxPlateVideo.TabIndex = 0;
|
||||||
this.pictureBoxPlateVideo.TabStop = false;
|
this.pictureBoxPlateVideo.TabStop = false;
|
||||||
|
this.pictureBoxPlateVideo.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBoxPlateVideo_Paint);
|
||||||
|
this.pictureBoxPlateVideo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBoxPlateVideo_MouseDown);
|
||||||
|
this.pictureBoxPlateVideo.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBoxPlateVideo_MouseMove);
|
||||||
|
this.pictureBoxPlateVideo.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBoxPlateVideo_MouseUp);
|
||||||
//
|
//
|
||||||
// grbPlateCamera
|
// grbPlateCamera
|
||||||
//
|
//
|
||||||
|
|
|
@ -25,6 +25,11 @@ namespace AIParkingApplication
|
||||||
private ApiController apiController;
|
private ApiController apiController;
|
||||||
private Logger appLogger;
|
private Logger appLogger;
|
||||||
|
|
||||||
|
private System.Drawing.Point StartPoint { get; set; }
|
||||||
|
private System.Drawing.Point CurrentCursorPosition { get; set; }
|
||||||
|
private Rectangle roiBox;
|
||||||
|
private bool IsDrawBox { get; set; }
|
||||||
|
|
||||||
public LaneIn(int doorId,
|
public LaneIn(int doorId,
|
||||||
string cameraId,
|
string cameraId,
|
||||||
string plateStream,
|
string plateStream,
|
||||||
|
@ -235,5 +240,43 @@ namespace AIParkingApplication
|
||||||
overviewCamera.OnOpenVideoStreamFailed += OverviewCamera_OnOpenVideoStreamFailed;
|
overviewCamera.OnOpenVideoStreamFailed += OverviewCamera_OnOpenVideoStreamFailed;
|
||||||
ConnectToDoorAccessControl();
|
ConnectToDoorAccessControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void pictureBoxPlateVideo_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Button == MouseButtons.Left)
|
||||||
|
{
|
||||||
|
StartPoint = e.Location;
|
||||||
|
roiBox = new Rectangle(StartPoint, new System.Drawing.Size(0, 0));
|
||||||
|
IsDrawBox = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pictureBoxPlateVideo_MouseMove(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (IsDrawBox)
|
||||||
|
{
|
||||||
|
CurrentCursorPosition = e.Location;
|
||||||
|
roiBox.Width = CurrentCursorPosition.X - StartPoint.X;
|
||||||
|
roiBox.Height = CurrentCursorPosition.Y - StartPoint.Y;
|
||||||
|
}
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pictureBoxPlateVideo_MouseUp(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (StartPoint.X + roiBox.Width > pictureBoxPlateVideo.Width || StartPoint.Y + roiBox.Height > pictureBoxPlateVideo.Height)
|
||||||
|
{
|
||||||
|
roiBox.X = roiBox.Y = 0;
|
||||||
|
roiBox.Width = pictureBoxPlateVideo.Width;
|
||||||
|
roiBox.Height = pictureBoxPlateVideo.Height;
|
||||||
|
}
|
||||||
|
IsDrawBox = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pictureBoxPlateVideo_Paint(object sender, PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Pen redPen = new Pen(Color.FromArgb(255, 255, 0, 0), 4);
|
||||||
|
e.Graphics.DrawRectangle(redPen, roiBox);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -153,6 +153,12 @@
|
||||||
<metadata name="lblPlateString.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="lblPlateString.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="lblCardTime.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="lblPlateString.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="lblStatusInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="lblStatusInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
4
AIParkingApplication/LaneOut.Designer.cs
generated
4
AIParkingApplication/LaneOut.Designer.cs
generated
|
@ -182,6 +182,10 @@
|
||||||
this.pictureBoxPlateVideo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
this.pictureBoxPlateVideo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
this.pictureBoxPlateVideo.TabIndex = 0;
|
this.pictureBoxPlateVideo.TabIndex = 0;
|
||||||
this.pictureBoxPlateVideo.TabStop = false;
|
this.pictureBoxPlateVideo.TabStop = false;
|
||||||
|
this.pictureBoxPlateVideo.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBoxPlateVideo_Paint);
|
||||||
|
this.pictureBoxPlateVideo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBoxPlateVideo_MouseDown);
|
||||||
|
this.pictureBoxPlateVideo.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBoxPlateVideo_MouseMove);
|
||||||
|
this.pictureBoxPlateVideo.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBoxPlateVideo_MouseUp);
|
||||||
//
|
//
|
||||||
// grbPlateCamera
|
// grbPlateCamera
|
||||||
//
|
//
|
||||||
|
|
|
@ -27,6 +27,11 @@ namespace AIParkingApplication
|
||||||
private Logger appLogger;
|
private Logger appLogger;
|
||||||
private bool isUsePrinter;
|
private bool isUsePrinter;
|
||||||
|
|
||||||
|
private System.Drawing.Point StartPoint { get; set; }
|
||||||
|
private System.Drawing.Point CurrentCursorPosition { get; set; }
|
||||||
|
private Rectangle roiBox;
|
||||||
|
private bool IsDrawBox { get; set; }
|
||||||
|
|
||||||
public LaneOut(int doorId,
|
public LaneOut(int doorId,
|
||||||
string cameraId,
|
string cameraId,
|
||||||
string plateStream,
|
string plateStream,
|
||||||
|
@ -315,5 +320,43 @@ namespace AIParkingApplication
|
||||||
overviewCamera.OnVideoFrameReceived += OverviewCameraOnVideoFrameReceived;
|
overviewCamera.OnVideoFrameReceived += OverviewCameraOnVideoFrameReceived;
|
||||||
overviewCamera.OnOpenVideoStreamFailed += OverviewCamera_OnOpenVideoStreamFailed;
|
overviewCamera.OnOpenVideoStreamFailed += OverviewCamera_OnOpenVideoStreamFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void pictureBoxPlateVideo_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Button == MouseButtons.Left)
|
||||||
|
{
|
||||||
|
StartPoint = e.Location;
|
||||||
|
roiBox = new Rectangle(StartPoint, new System.Drawing.Size(0, 0));
|
||||||
|
IsDrawBox = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pictureBoxPlateVideo_MouseMove(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (IsDrawBox)
|
||||||
|
{
|
||||||
|
CurrentCursorPosition = e.Location;
|
||||||
|
roiBox.Width = CurrentCursorPosition.X - StartPoint.X;
|
||||||
|
roiBox.Height = CurrentCursorPosition.Y - StartPoint.Y;
|
||||||
|
}
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pictureBoxPlateVideo_MouseUp(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (StartPoint.X + roiBox.Width > pictureBoxPlateVideo.Width || StartPoint.Y + roiBox.Height > pictureBoxPlateVideo.Height)
|
||||||
|
{
|
||||||
|
roiBox.X = roiBox.Y = 0;
|
||||||
|
roiBox.Width = pictureBoxPlateVideo.Width;
|
||||||
|
roiBox.Height = pictureBoxPlateVideo.Height;
|
||||||
|
}
|
||||||
|
IsDrawBox = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pictureBoxPlateVideo_Paint(object sender, PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Pen redPen = new Pen(Color.FromArgb(255, 255, 0, 0), 4);
|
||||||
|
e.Graphics.DrawRectangle(redPen, roiBox);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,12 @@
|
||||||
<metadata name="pictureBoxPlateImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="pictureBoxPlateImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="pictureBoxOverviewImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="pictureBoxPlateImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="grbCardInformation.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="grbCardInformation.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
@ -147,6 +153,24 @@
|
||||||
<metadata name="lblCardNumber.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="lblCardNumber.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="lblCardType.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="lblCardTimeOut.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="lblCardTime.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="lblMoneyAmount.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="lblPlateString.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="lblCardNumber.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="pictureBoxPlateImage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="pictureBoxPlateImage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user