示例#1
0
        public TargetFeatureMsg Comparison(TargetFeatureMsg msg)
        {
            TargetFeatureMsg msg_reply = new TargetFeatureMsg();
            ZMessage         zMsg      = new ZMessage();

            zMsg.Add(new ZFrame(msg.ToByteArray()));
            socket.Send(zMsg);

            using (ZFrame reply = socket.ReceiveFrame())
            {
                //Console.WriteLine(" Received: {0} {1}!", requestText, reply.ReadString());


                msg_reply.MergeFrom(reply.Read());
                Console.WriteLine("" + msg_reply.ImageBase64);
                if (ShowOBJInfo != null)
                {
                    try
                    {
                        ShowOBJInfo(msg_reply);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
                return(msg_reply);
            }
            return(null);
        }
示例#2
0
        public TargetFeatureMsg Detection(TargetFeatureMsg msg)
        {
            try
            {
                TargetFeatureMsg msg_reply = new TargetFeatureMsg();
                ZMessage         zMsg      = new ZMessage();
                zMsg.Add(new ZFrame(msg.ToByteArray()));
                socket.Send(zMsg);

                using (ZFrame reply = socket.ReceiveFrame())
                {
                    //Console.WriteLine(" Received: {0} {1}!", requestText, reply.ReadString());


                    msg_reply.MergeFrom(reply.Read());
                    Console.WriteLine("" + msg_reply.ImageBase64);

                    return(msg_reply);
                }
            }catch (Exception ex)
            {
                //LogHelper.WriteLog(typeof(ZmqDetection), ex.Message);
            }

            return(null);
        }