Пример #1
0
 public void labelHOG(string objNama, List<Rectangle> rec)
 {
     string routingKey = "lumen.visual.hogobj.recognition";
     var recognizedObjects = new RecognizedObjects();
     for (int a = 0; a < rec.Count; a++)
     {
         Rectangle bound;
         bound = rec[a];
         var recognizedObject = new RecognizedObject();
         var lblObj = new RecognizedObject { name = objNama, topPosition = new Vector2 { x = bound.X, y = bound.Y } };
         recognizedObjects.trashes.Add(lblObj);
     }
     string nama = JsonConvert.SerializeObject(recognizedObjects);
     byte[] buffer = Encoding.UTF8.GetBytes(nama);
     channelSend.BasicPublish("amq.topic", routingKey, null, buffer);
 }
Пример #2
0
        public void labelHOGBawah(List<string> namaBendaBawah, List<Rectangle> recBawah)
        {
            string routingKey = "lumen.visual.hogobj.recognition";
            var recognizedObjects = new RecognizedObjects();
            recognizedObjects.hasPosition = true;
            recognizedObjects.hasDistance = false;
            recognizedObjects.hasYaw = false;

            string ba = "";
            for (int a = 0; a < recBawah.Count; a++)
            {
                boundBawah = recBawah[a];
                ba = namaBendaBawah[a];
                var recognizedObject = new RecognizedObject();
                var lblObj = new RecognizedObject { name = ba, bottomPosition = new Vector2 { x = boundBawah.Location.X + (boundBawah.Width / 2), y = boundBawah.Location.Y + (boundBawah.Height / 2) } };
                recognizedObjects.trashes.Add(lblObj);
            }

            string nama = JsonConvert.SerializeObject(recognizedObjects);
            byte[] buffer = Encoding.UTF8.GetBytes(nama);
            channelSend.BasicPublish("amq.topic", routingKey, null, buffer);
        }
Пример #3
0
 public void koorHOG(float kX, float kY)
 {
     string routingKey = "lumen.misc.save.birdcalibration";
     var recognizedObjects =  new RecognizedObjects();
     var obj = new RecognizedObject { topPosition = new Vector2 { x = kX, y = kY } };
     recognizedObjects.trashes.Add(obj);
     //HOGobject hgb = new HOGobject { x = kX, y = kY };
     string hand = JsonConvert.SerializeObject(recognizedObjects);
     byte[] buffer = Encoding.UTF8.GetBytes(hand);
     channelSend.BasicPublish("amq.topic", routingKey, null, buffer);
 }