01304 827609 info@use-ip.co.uk Find us

iDS-2CD7A46GO license plate as text

Pakov

New Member
Messages
2
Points
1
Hello and greetings to all in forum,
I'm new here and already need help :)

I bought an ANPR cam Hikvision iDS-2CD7A46GO-IZHS mounted on a passage and
connected to intern network but now use SD card for save image, also possible a folder on network.
I want to use it only for plate number recog. send or query
as text to a Textbox in My own WindowsApp C#.
Without image or video, if a car comes, text “AB1234” appears in textbox.
for example, all the new image file name from smart view and filtered only the plate.
or maybe something with alarm triger.

How can I do it the best, with minimal changes in My APP (is already burdened)
if someone has an example I would be very grateful

Thank you very much,
Regards
 
Last edited:

codlord

Active Member
Messages
107
Points
28
The way I currently do it is to set up the ANPR camera to FTP images to a local or remote FTP server, then you have to process the files as they appear (filenames can have the plate number, camera name, date etc). The process puts data into a database then you have the data for whatever display/query you want to do. It's not quite instant, 5-10 seconds behind realtime perhaps.

I would be interested if there is a better way or in-built process or method for extracting or sending each ANPR capture properly in realtime from HikVision.
 
Upvote 0

Pakov

New Member
Messages
2
Points
1
Thanks for replay,
I have tried FTP, for real-time not enough and complicated,
Ivms 5200, I can't use second soft on system.
The camera is already saving name of picture with plate number on SD Card,
I had hoped query that somehow simultaneously.
I took Hikvision because it seems easy, but now I’m not sure anymore
Tried to contact support, is also difficult, no success. Should use two more but that’s how it’s going to be difficult
maybe I have to try other brands.

Currently, only with HckNETSDK (from HIKVISION Demo) and all the dll-s
works with one cam on real-time but,
1 - it blocks me always one of two Serial Port for other function ?
2 – sometimes after 1-2 recognized plate, sometimes after 15-20 plate with
FatalExecutionEngineError “ on (CHCNetSDK.NET_ITS_PLATE_RESULT)Marshal.PtrToStructure(pAlarmInfo, typeof(CHCNetSDK.NET_ITS_PLATE_RESULT)); “write Error” ? no idea why..
If something helps you, the c# code,


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;

namespace CAM
{

public partial class Form1 : Form
{
private Int32 m_lUserID = -1;
private bool m_bInitSDK = false;
private CHCNetSDK.NET_DVR_SETUPALARM_PARAM struAlarmParam;
private Int32[] m_lAlarmHandle = new Int32[200];
private CHCNetSDK.MSGCallBack_V31 m_falarmData_V31 = null;
private int m_lFortifyHandle;

public Form1()
{
InitializeComponent();
}
private void btnLogin_Click(object sender, EventArgs e)
{
Control.CheckForIllegalCrossThreadCalls = false;
m_bInitSDK = CHCNetSDK.NET_DVR_Init();
if (m_bInitSDK == false)
{
MessageBox.Show("NET_DVR_Init error!");
return;
}
else
{
CHCNetSDK.NET_DVR_SetLogToFile(3, "C:\\SdkLog\\", true);
for (int i = 0; i < 200; i++)
{
m_lAlarmHandle = -1;
}
if (m_falarmData_V31 == null)
{
m_falarmData_V31 = new CHCNetSDK.MSGCallBack_V31(MsgCallback_V31);
}
CHCNetSDK.NET_DVR_SetDVRMessageCallBack_V31(m_falarmData_V31, IntPtr.Zero);
}
if (m_lUserID < 0)
{
string DVRIPAddress = tbIP.Text;
Int16 DVRPortNumber = Int16.Parse(textBoxPor.Text);
string DVRUserName = textBoxUser.Text;
string DVRPassword = textBoxPas.Text;
CHCNetSDK.NET_DVR_DEVICEINFO_V30 DeviceInfo = new CHCNetSDK.NET_DVR_DEVICEINFO_V30();
m_lUserID = CHCNetSDK.NET_DVR_Login_V30(DVRIPAddress, DVRPortNumber, DVRUserName, DVRPassword, ref DeviceInfo);
for (int i = 0; i < 200; i++)
{
m_lAlarmHandle = -1;
}
if (m_falarmData_V31 == null)
{
m_falarmData_V31 = new CHCNetSDK.MSGCallBack_V31(MsgCallback_V31);
}
CHCNetSDK.NET_DVR_SetDVRMessageCallBack_V31(m_falarmData_V31, IntPtr.Zero);
struAlarmParam = new CHCNetSDK.NET_DVR_SETUPALARM_PARAM();
struAlarmParam.dwSize = (uint)Marshal.SizeOf(struAlarmParam);
struAlarmParam.byAlarmInfoType = 1;
struAlarmParam.byLevel = 1;
int AlarmHandle = CHCNetSDK.NET_DVR_SetupAlarmChan_V41(m_lUserID, ref struAlarmParam);
MessageBox.Show("Login OK");
return;
}
}
public bool MsgCallback_V31(int Command, ref CHCNetSDK.NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser)
{
ProcessCommAlarm_ITSPlate(ref pAlarmer, pAlarmInfo, dwBufLen, pUser);
return true;
}
public delegate void ProcessCommAlarm_ITS_Handle(ref CHCNetSDK.NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser);
private void ProcessCommAlarm_ITSPlate(ref CHCNetSDK.NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser)
{
if (this.InvokeRequired)
{
ProcessCommAlarm_ITS_Handle handle = new ProcessCommAlarm_ITS_Handle(ProcessCommAlarm_ITSPlate);
this.BeginInvoke(handle, pAlarmer, pAlarmInfo, dwBufLen, pUser);
}
else
{
CHCNetSDK.NET_ITS_PLATE_RESULT struITSPlateResult = new CHCNetSDK.NET_ITS_PLATE_RESULT();
uint dwSize = (uint)Marshal.SizeOf(struITSPlateResult);
struITSPlateResult = (CHCNetSDK.NET_ITS_PLATE_RESULT)Marshal.PtrToStructure(pAlarmInfo, typeof(CHCNetSDK.NET_ITS_PLATE_RESULT));
string platetxt = System.Text.Encoding.Default.GetString(struITSPlateResult.struPlateInfo.sLicense);
if (!string.IsNullOrEmpty(platetxt) && platetxt.Length > 1)
{
ITSPlate.Text = platetxt;
}
}
}
private void btn_Exit_Click(object sender, EventArgs e)
{
if (m_lFortifyHandle != -1)
{
CHCNetSDK.NET_DVR_CloseAlarmChan_V30(m_lFortifyHandle);
m_lFortifyHandle = -1;
MessageBox.Show("Alarm", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
if (m_lUserID >= 0)
{
CHCNetSDK.NET_DVR_Logout(m_lUserID)
m_lUserID = -1;
}
CHCNetSDK.NET_DVR_Cleanup();
Application.Exit();
}
}
}
/////////
Sorry for my English
it's not my, its google :)
 
Upvote 0
Top