Ejemplo n.º 1
0
        public string MoveTempPicture(ref string errMessage, TempPicture oTempPicture)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                string ret          = null;
                string destFilePath = SystemParametersBusiness.Instance.ListSystemParameter["CapPicPath"] + @"\" + oTempPicture.CameraID +
                                      @"\" + oTempPicture.Datetime.ToString(@"yyyy\\MM\\dd\\HH\\") + oTempPicture.CameraID + oTempPicture.Datetime.ToString(@"_yyyy_MM_dd_HH_mm_ss_fff") + ".jpg";
                if (File.Exists(oTempPicture.FilePath))
                {
                    string path = Path.GetDirectoryName(destFilePath);
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }
                    File.Move(oTempPicture.FilePath, destFilePath);
                    TempPictureDataAccess.DeleteTempPicture(db, oTempPicture.PictureID);
                    ret = destFilePath;
                }
                return(ret);
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(null);
            }
        }
Ejemplo n.º 2
0
        public static DataSet GetTempPicture(Database db, TempPicture oTempPicture)
        {
            string cmdText = string.Format("select * from TempPicture where CameraId={0} and DateTime='{1}'", oTempPicture.CameraID, oTempPicture.Datetime);

            try
            {
                return(db.ExecuteDataSet(CommandType.Text, cmdText));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        public int InsertTempPicture(ref string errMessage, TempPicture oTempPicture)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                return(TempPictureDataAccess.InsertTempPicture(db, oTempPicture));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }
Ejemplo n.º 4
0
        public int DeleteTempPictureFromDbAndDisk(ref string errMessage, TempPicture oTempPicture)
        {
            Database db = DatabaseFactory.CreateDatabase();

            errMessage = "";
            try
            {
                if (File.Exists(oTempPicture.FilePath))
                {
                    File.Delete(oTempPicture.FilePath);
                }
                return(TempPictureDataAccess.DeleteTempPicture(db, oTempPicture.PictureID));
            }
            catch (Exception ex)
            {
                errMessage = ex.Message + ex.StackTrace;
                logger.Error("Error Message:" + ex.Message + " Trace:" + ex.StackTrace);
                return(-1);
            }
        }
Ejemplo n.º 5
0
        public static int InsertTempPicture(Database db, TempPicture oTempPicture)
        {
            StringBuilder sbField = new StringBuilder();
            StringBuilder sbValue = new StringBuilder();

            sbField.Append("INSERT INTO  [TempPicture](");
            sbValue.Append("values (");
            //sbField.Append("[PictureID]");
            //sbValue.AppendFormat("'{0}'", oTempPicture.PictureID);
            sbField.Append("[CameraID]");
            sbValue.AppendFormat("{0}", oTempPicture.CameraID);
            sbField.Append(",[Datetime]");
            //sbValue.AppendFormat(",'{0}'", oTempPicture.Datetime);
            sbValue.AppendFormat(",'{0}'", oTempPicture.Datetime);
            sbField.Append(",[IsHistroy]");
            //sbValue.AppendFormat(",'{0}'", oTempPicture.Datetime);
            sbValue.AppendFormat(",'{0}'", oTempPicture.IsHistroy);
            sbField.Append(",[FilePath])");
            sbValue.AppendFormat(",'{0}')", oTempPicture.FilePath);

            string cmdText = sbField.ToString() + " " + sbValue.ToString();

            try
            {
                cmdText = cmdText.Replace("\r\n", "");
                db.ExecuteNonQuery(CommandType.Text, cmdText);
                //string cmdText2 = "select max(PictureID) from TempPicture";
                //return int.Parse(db.ExecuteScalar(CommandType.Text, cmdText2).ToString());
                int id = int.Parse(db.ExecuteScalar(CommandType.Text, "SELECT     ident_current('TempPicture')").ToString());
                return(id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Agent that runs a scheduled task
        /// </summary>
        /// <param name="task">
        /// The invoked task
        /// </param>
        /// <remarks>
        /// This method is called when a periodic or resource intensive task is invoked
        /// </remarks>
        protected override void OnInvoke(ScheduledTask task)
        {
            try
            {
                var isProvider = Windows.Phone.System.UserProfile.LockScreenManager.IsProvidedByCurrentApplication;
                if (isProvider)
                {
                    var setting = GetSetting();
                    if (RunNow(setting.Frequency))
                    {
                        IsolatedStorageSettings iss = IsolatedStorageSettings.ApplicationSettings;
                        if (iss.Contains("myPhoneLockScreenLockSettingsLastRun"))
                            iss.Remove("myPhoneLockScreenLockSettingsLastRun");
                        iss.Add("myPhoneLockScreenLockSettingsLastRun", DateTime.Now);
                        iss.Save();
                        var templates = GetTemplates();
                        var selectedTemplate = templates.Where(s => String.Equals(setting.Template, s.Name)).FirstOrDefault();
                        if (selectedTemplate == null)
                            selectedTemplate = templates.Where(s => String.Equals("Default", s.Name)).FirstOrDefault();

                        //Check for Album Selected
                        if (!String.IsNullOrEmpty(setting.Album))
                        {
                            //Check for Album
                            var ml = new MediaLibrary();
                            var album = GetAlbum(setting.Album, ml.RootPictureAlbum);
                            if (album != null)
                            {
                                //Check for Photos
                                List<Picture> pictures = new List<Picture>();
                                List<Picture> selectedPictures = new List<Picture>();

                                PopulatePictures(pictures, album, 3 * selectedTemplate.NoOfImages);
                                if (pictures.Count > 0)
                                {
                                    List<int> randomNumbers = new List<int>();
                                    var repeatCount = 0;
                                    while (randomNumbers.Count < selectedTemplate.NoOfImages)
                                    {
                                        repeatCount++;
                                        var nextNumber = randumNumber.Next(pictures.Count);
                                        if (!randomNumbers.Contains(nextNumber) || repeatCount > 3 * selectedTemplate.NoOfImages)
                                        {
                                            randomNumbers.Add(nextNumber);
                                        }
                                    }

                                    DynamicImageCanvas mainCanvas = null;
                                    bool isCompleted = false;

                                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                                    {
                                        var actualheight = Application.Current.Host.Content.ActualHeight;
                                        var actualwidth = Application.Current.Host.Content.ActualWidth + 100;

                                        actualheight = actualheight > 800 ? 800 : actualheight;
                                        actualwidth = actualwidth > 580 ? 580 : actualwidth;
                                        mainCanvas = new DynamicImageCanvas(actualheight, actualwidth);
                                        isCompleted = true;
                                    }
                                    );

                                    while (!isCompleted) ;

                                    var indexer = 0;
                                    for (int i = 0; i < selectedTemplate.NoOnVertical; ++i)
                                    {
                                        for (int j = 0; j < selectedTemplate.NoOnHorizontal; ++j)
                                        {
                                            isCompleted = false;
                                            Action<object> action = (object obj) =>
                                            {
                                                var data = obj as object[];
                                                TempPicture picture = (TempPicture)data[1];
                                                DynamicImageCanvas c = (DynamicImageCanvas)data[2];
                                                AddImageToCanvas((int)data[0], picture.Picture, picture.SelectedTemplate.NoOnVertical, picture.SelectedTemplate.NoOnHorizontal, picture.SelectedTemplate.NoOfImages, c, picture.PicturePlace);
                                                isCompleted = true;
                                            };
                                            TempPicture tpicture = new TempPicture();
                                            tpicture.Picture = pictures[randomNumbers[indexer]];
                                            tpicture.SelectedTemplate = selectedTemplate;
                                            tpicture.PicturePlace = new MyPhoneLockScreen.Model.Point(j, i);
                                            Task t1 = new Task(action, new object[] { indexer, tpicture, mainCanvas });
                                            t1.Start();
                                            while (true)
                                            {
                                                if (isCompleted)
                                                    break;
                                            }
                                            indexer++;
                                        }
                                    }

                                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                                    {
                                        try
                                        {
                                            string lockfileName;

                                            var currentImage = Windows.Phone.System.UserProfile.LockScreen.GetImageUri();

                                            if (currentImage.ToString().EndsWith(lockfileNameA))
                                            {
                                                lockfileName = lockfileNameB;
                                            }
                                            else
                                            {
                                                lockfileName = lockfileNameA;
                                            }

                                            Uri uri = new Uri(lockfileName, UriKind.Relative);

                                            // Create virtual store and file stream. Check for duplicate tempJPEG files.
                                            using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
                                            {
                                                if (myIsolatedStorage.FileExists(lockfileName))
                                                {
                                                    myIsolatedStorage.DeleteFile(lockfileName);
                                                }

                                                using (IsolatedStorageFileStream fileStream = myIsolatedStorage.CreateFile(lockfileName))
                                                {
                                                    WriteableBitmap wb = new WriteableBitmap(mainCanvas, null);
                                                    wb.Invalidate();
                                                    // Encode WriteableBitmap object to a JPEG stream.
                                                    System.Windows.Media.Imaging.Extensions.SaveJpeg(wb, fileStream, wb.PixelWidth, wb.PixelHeight, 0, 100);

                                                    fileStream.Close();
                                                    mainCanvas.Clear();
                                                }
                                            }
                                            mainCanvas = null;

                                            GC.Collect();
                                            GC.WaitForPendingFinalizers();

                                            var schema = "ms-appdata:///Local/";
                                            var newUri = new Uri(schema + lockfileName, UriKind.Absolute);
                                            Windows.Phone.System.UserProfile.LockScreen.SetImageUri(newUri);
                                        }
                                        catch (Exception ex)
                                        {
                                            Debug.WriteLine(ex.StackTrace);
                                        }
                                    });
                                }
                                else
                                {
                                    ShowPicture(setting);
                                }
                            }
                            else
                            {
                                ShowPicture(setting);
                            }
                        }
                        else
                        {
                            ShowPicture(setting);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.StackTrace);
            }
            finally
            {
                //ScheduledActionService.LaunchForTest("MyPhoneLock-LockScreenChangerAgent", TimeSpan.FromSeconds(10));
                NotifyComplete();
            }
        }
        public void Handle(byte[] bytes)
        {
            try
            {
                logger.Info("开始解析人脸数据");

                //获取xml
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.LoadXml(BitConverter.ToString(bytes, 4));

                string      errMessage = "";
                int         cameraid = -1;
                DateTime    timeid = new DateTime(1, 1, 1);
                XmlNodeList xml_cameras, xml_faces;
                xml_cameras = xmlDocument.SelectSingleNode("/pr/cameras").ChildNodes;
                foreach (XmlNode xmlItem in xml_cameras)
                {
                    XmlElement camera = (XmlElement)xmlItem;
                    cameraid = Convert.ToInt32(camera.GetAttribute("id"));
                    timeid   = new DateTime(long.Parse(camera.GetAttribute("timeid")));
                    if (!CapturePictureBusiness.Instance.IsExistCapturePicture(ref errMessage, cameraid, timeid))
                    {
                        //将改图像从TempPicture表移动到CapturePicture//先获取临时图像GetTempPicture,再移动图像MoveTempPicture
                        //图像还在临时图像库中
                        TempPicture    tempPicture          = TempPictureBusiness.Instance.GetTempPicture(ref errMessage, cameraid, timeid);
                        string         destFile             = TempPictureBusiness.Instance.MoveTempPicture(ref errMessage, tempPicture);
                        CapturePicture capturePictureinsert = new CapturePicture()
                        {
                            CameraID = cameraid, Datetime = timeid, FilePath = destFile
                        };
                        CapturePictureBusiness.Instance.Insert(ref errMessage, capturePictureinsert);
                    }
                    //识别结果入库
                    CapturePicture oCapturePicture = CapturePictureBusiness.Instance.GetCapturePicture(ref errMessage, cameraid, timeid);
                    xml_faces = xmlItem.FirstChild.ChildNodes;//获得faces节点
                    string facePath = SystemParametersBusiness.Instance.ListSystemParameter["FacePicPath"] + @"\" + cameraid +
                                      @"\" + timeid.ToString(@"yyyy\\MM\\dd\\HH\\") + cameraid + timeid.ToString(@"_yyyy_MM_dd_HH_mm_ss_fff");
                    int i = 1;
                    foreach (XmlNode faceItem in xml_faces)
                    {
                        XmlNode    rectNode     = faceItem.FirstChild;
                        XmlNode    scoreNode    = faceItem.LastChild;
                        XmlElement rectElement  = (XmlElement)rectNode;
                        XmlElement scoreElement = (XmlElement)scoreNode;
                        REct       facerect     = new REct();
                        facerect.X = Convert.ToInt32(rectElement.GetAttribute("x"));
                        facerect.Y = Convert.ToInt32(rectElement.GetAttribute("y"));
                        facerect.W = Convert.ToInt32(rectElement.GetAttribute("w"));
                        facerect.H = Convert.ToInt32(rectElement.GetAttribute("h"));
                        int RectId = REctBusiness.Instance.Insert(ref errMessage, facerect);

                        //抠图
                        Image     newImage  = Image.FromFile(oCapturePicture.FilePath);
                        Bitmap    tmpbitmap = new Bitmap(facerect.W + 1, facerect.H + 1);
                        Rectangle rectSrt   = new Rectangle(facerect.X, facerect.Y, facerect.W, facerect.H);
                        Rectangle rectDst   = new Rectangle(0, 0, facerect.W, facerect.H);
                        Graphics  graphic   = Graphics.FromImage(tmpbitmap);
                        graphic.DrawImage(newImage, rectDst, rectSrt, GraphicsUnit.Pixel);
                        string faceFile = facePath + "_" + i + ".jpg";
                        string path     = Path.GetDirectoryName(faceFile);
                        if (!Directory.Exists(path))
                        {
                            Directory.CreateDirectory(path);
                        }
                        tmpbitmap.Save(faceFile, ImageFormat.Jpeg);

                        Face xmlface = new Face();
                        xmlface.score     = Convert.ToSingle(scoreElement.InnerText);
                        xmlface.RectID    = RectId;
                        xmlface.PictureID = oCapturePicture.PictureID;
                        xmlface.FacePath  = faceFile;
                        int faceId = FaceBusiness.Instance.Insert(ref errMessage, xmlface);
                    }
                }
                //解析人脸数据并入库

                /*******************处理流程:
                 *
                 * 1)解析xml文件,获取cameraid和DateTime
                 * 2)根据cameraid和DateTime判断改图像是否已经进入CapturePicture表
                 * 3)如果是;转5;
                 * 4)如果否,将改图像从TempPicture表移动到CapturePicture//先获取临时图像GetTempPicture,再移动图像MoveTempPicture
                 * 5)识别结果入库
                 */

                CurrentFace = FaceBusiness.Instance.GetFace(ref errMessage, cameraid, timeid);
                OnDataChanged(this, new DataChangeEventArgs(GetType().Name));
                logger.Info("结束解析人脸数据");
            }
            catch (Exception ex)
            {
                logger.Error("解析人脸数据错误:" + FromASCIIByteArray(bytes));
            }
        }
Ejemplo n.º 8
0
        public void Handle(byte[] bytes)
        {
            try
            {
                logger.Info("开始解析事件数据");

                //获取xml
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.LoadXml(BitConverter.ToString(bytes, 4));

                string      errMessage = "";
                int         cameraid;
                int         pictureid = 0;
                int         eventid;
                int         objid;
                DateTime    timeid;
                XmlNodeList xml_cameras;
                xml_cameras = xmlDocument.SelectSingleNode("/pr/cameras").ChildNodes;
                foreach (XmlNode xmlItem in xml_cameras)
                {
                    XmlElement camera = (XmlElement)xmlItem;
                    cameraid = Convert.ToInt32(camera.GetAttribute("id"));
                    timeid   = new DateTime(long.Parse(camera.GetAttribute("timeid")));
                    if (!CapturePictureBusiness.Instance.IsExistCapturePicture(ref errMessage, cameraid, timeid))
                    {
                        //将改图像从TempPicture表移动到CapturePicture//先获取临时图像GetTempPicture,再移动图像MoveTempPicture
                        //图像还在临时图像库中
                        TempPicture    tempPicture          = TempPictureBusiness.Instance.GetTempPicture(ref errMessage, cameraid, timeid);
                        string         destFile             = TempPictureBusiness.Instance.MoveTempPicture(ref errMessage, tempPicture);
                        CapturePicture capturePictureinsert = new CapturePicture()
                        {
                            CameraID = cameraid, Datetime = timeid, FilePath = destFile
                        };
                        pictureid = CapturePictureBusiness.Instance.Insert(ref errMessage, capturePictureinsert);
                    }

                    CapturePicture oCapturePicture = CapturePictureBusiness.Instance.GetCapturePicture(ref errMessage, cameraid, timeid);

                    Event ev = new Event();
                    ev.CarNum     = Convert.ToInt32(camera.GetAttribute("CarNum"));
                    ev.Congestion = Convert.ToInt32(camera.GetAttribute("Congestion"));
                    ev.PictureID  = pictureid;
                    eventid       = EventBusiness.Instance.Insert(ref errMessage, ev);

                    XmlNodeList objectlist = xmlItem.ChildNodes;
                    foreach (XmlNode xmlitem1 in objectlist)
                    {
                        XmlElement objecttarget = (XmlElement)xmlitem1;
                        ObjectInfo obj          = new ObjectInfo();
                        if (Convert.ToInt32(objecttarget.GetAttribute("stop")) == 1)
                        {
                            obj.stop = true;
                        }
                        else
                        {
                            obj.stop = false;
                        }
                        if (Convert.ToInt32(objecttarget.GetAttribute("illegalDir")) == 1)
                        {
                            obj.illegalDir = true;
                        }
                        else
                        {
                            obj.illegalDir = false;
                        }
                        if (Convert.ToInt32(objecttarget.GetAttribute("CrossLine")) == 1)
                        {
                            obj.CrossLine = true;
                        }
                        else
                        {
                            obj.CrossLine = false;
                        }
                        if (Convert.ToInt32(objecttarget.GetAttribute("changeChannel")) == 1)
                        {
                            obj.changeChannel = true;
                        }
                        else
                        {
                            obj.changeChannel = false;
                        }
                        obj.EventId = eventid;
                        objid       = ObjectBusiness.Instance.Insert(ref errMessage, obj);
                        foreach (XmlNode rectitem in objecttarget.ChildNodes)
                        {
                            XmlElement rectelement = (XmlElement)rectitem;
                            EventRect  myrect      = new EventRect();
                            myrect.x        = Convert.ToInt32(rectelement.GetAttribute("x"));
                            myrect.y        = Convert.ToInt32(rectelement.GetAttribute("y"));
                            myrect.w        = Convert.ToInt32(rectelement.GetAttribute("w"));
                            myrect.h        = Convert.ToInt32(rectelement.GetAttribute("h"));
                            myrect.ObjectId = objid;
                            EventRectBusiness.Instance.Insert(ref errMessage, myrect);
                        }
                    }
                }

                /*******************处理流程:
                 *
                 * 1)解析xml文件,获取cameraid和DateTime
                 * 2)根据cameraid和DateTime判断改图像是否已经进入CapturePicture表
                 * 3)如果是;转5;
                 * 4)如果否,将改图像从TempPicture表移动到CapturePicture//先获取临时图像GetTempPicture,再移动图像MoveTempPicture
                 * 5)识别结果入库
                 */


                logger.Info("结束解析事件数据");
            }
            catch (Exception ex)
            {
                logger.Error("解析事件数据错误:" + FromASCIIByteArray(bytes));
            }
        }
        public void Handle(byte[] bytes)
        {
            try
            {
                logger.Info("开始解析车牌数据");
                //获取xml
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.LoadXml(BitConverter.ToString(bytes, 4));

                string      errMessage = "";
                int         cameraid;
                DateTime    timeid;
                XmlNodeList xml_cameras, xml_vehicles;
                xml_cameras = xmlDocument.SelectSingleNode("/pr/cameras").ChildNodes;
                foreach (XmlNode xmlItem in xml_cameras)
                {
                    XmlElement camera = (XmlElement)xmlItem;
                    cameraid = Convert.ToInt32(camera.GetAttribute("id"));
                    timeid   = new DateTime(long.Parse(camera.GetAttribute("timeid")));
                    if (!CapturePictureBusiness.Instance.IsExistCapturePicture(ref errMessage, cameraid, timeid))
                    {
                        //将改图像从TempPicture表移动到CapturePicture//先获取临时图像GetTempPicture,再移动图像MoveTempPicture
                        //图像还在临时图像库中
                        TempPicture    tempPicture          = TempPictureBusiness.Instance.GetTempPicture(ref errMessage, cameraid, timeid);
                        string         destFile             = TempPictureBusiness.Instance.MoveTempPicture(ref errMessage, tempPicture);
                        CapturePicture capturePictureinsert = new CapturePicture()
                        {
                            CameraID = cameraid, Datetime = timeid, FilePath = destFile
                        };
                        CapturePictureBusiness.Instance.Insert(ref errMessage, capturePictureinsert);
                    }
                    //识别结果入库
                    CapturePicture oCapturePicture = CapturePictureBusiness.Instance.GetCapturePicture(ref errMessage, cameraid, timeid);

                    xml_vehicles = xmlItem.FirstChild.ChildNodes;//获得faces节点
                    foreach (XmlNode vehicleItem in xml_vehicles)
                    {
                        XmlNode    vehicleNode        = vehicleItem.FirstChild;
                        XmlNode    vehicleRectNode    = vehicleNode.FirstChild;
                        XmlElement vehicleElement     = (XmlElement)vehicleNode;
                        XmlElement vehicleRectElement = (XmlElement)vehicleRectNode;
                        REct       vehicleRect        = new REct();
                        vehicleRect.X = Convert.ToInt32(vehicleRectElement.GetAttribute("x"));
                        vehicleRect.Y = Convert.ToInt32(vehicleRectElement.GetAttribute("y"));
                        vehicleRect.W = Convert.ToInt32(vehicleRectElement.GetAttribute("w"));
                        vehicleRect.H = Convert.ToInt32(vehicleRectElement.GetAttribute("h"));
                        int     rectId  = REctBusiness.Instance.Insert(ref errMessage, vehicleRect);
                        Vehicle vehicle = new Vehicle();
                        vehicle.platenumber = Convert.ToString(vehicleElement.GetAttribute("platenumber"));
                        vehicle.speed       = Convert.ToSingle(vehicleElement.GetAttribute("speed"));
                        if (Convert.ToInt32(vehicleElement.GetAttribute("stemagainst")) == 1)
                        {
                            vehicle.stemagainst = true;
                        }
                        else
                        {
                            vehicle.stemagainst = false;
                        }
                        if (Convert.ToInt32(vehicleElement.GetAttribute("accident")) == 1)
                        {
                            vehicle.accident = true;
                        }
                        else
                        {
                            vehicle.accident = false;
                        }
                        if (Convert.ToInt32(vehicleElement.GetAttribute("stop")) == 1)
                        {
                            vehicle.stop = true;
                        }
                        else
                        {
                            vehicle.stop = false;
                        }
                        if (Convert.ToInt32(vehicleElement.GetAttribute("linechange")) == 1)
                        {
                            vehicle.linechange = true;
                        }
                        else
                        {
                            vehicle.linechange = false;
                        }

                        vehicle.platecolor   = Convert.ToString(vehicleElement.GetAttribute("platecolor"));
                        vehicle.vehiclecolor = Convert.ToString(vehicleElement.GetAttribute("vehiclecolor"));
                        vehicle.confidence   = Convert.ToSingle(vehicleElement.GetAttribute("confidence"));
                        vehicle.REctId       = rectId;
                        vehicle.PictureID    = oCapturePicture.PictureID;
                        int vehicleId = VehicleBusiness.Instance.Insert(ref errMessage, vehicle);
                    }
                }
                //解析车牌数据并入库

                /*******************处理流程:
                 *
                 * 1)解析xml文件,获取cameraid和DateTime
                 * 2)根据cameraid和DateTime判断改图像是否已经进入CapturePicture表
                 * 3)如果是;转5;
                 * 4)如果否,将改图像从TempPicture表移动到CapturePicture//先获取临时图像GetTempPicture,再移动图像MoveTempPicture
                 * 5)识别结果入库
                 */

                logger.Info("结束解析车牌数据");
            }
            catch (Exception ex)
            {
                logger.Error("解析车牌数据错误:" + FromASCIIByteArray(bytes));
            }
        }