Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the sensor.
        /// </summary>
        /// <param name="grid">The <see cref="PixelGrid"/> instance to wrap.</param>
        /// <param name="compression">The compression to apply to the generated image.</param>
        /// <param name="name">Name of the sensor.</param>
        public GridSensor(PixelGrid grid, SensorCompressionType compression, string name)
        {
            m_SensorName  = name;
            m_PixelGrid   = grid;
            m_Compression = compression;

            Allocate();
        }
Ejemplo n.º 2
0
        public Encoder(PixelGrid grid, IEnumerable <string> tags, float blurStrength, float blurThreshold)
        {
            m_Grid = grid;
            m_Tags = tags;

            if (blurStrength > 0)
            {
                m_ApplyBlur = true;
                m_Blurring  = new Blurring(m_Grid, blurStrength, blurThreshold);
            }
        }
Ejemplo n.º 3
0
 public ColliderEncoder(
     PixelGrid grid,
     ColliderEncodingType encoding,
     IEnumerable <string> tags,
     float blurStrength,
     float blurThreshold)
     : base(grid, tags, blurStrength, blurThreshold)
 {
     m_EncodingType  = encoding;
     m_ChannelOffset = encoding == ColliderEncodingType.OneHotAndShortestDistance ? 1 : 0;
     m_ChannelIncr   = encoding == ColliderEncodingType.OneHotAndDistances ? 2 : 1;
 }
        public override void UpdateSensor()
        {
            ClampProperties();
            UpdateGeometry();

            if (Sensor != null)
            {
                m_Grid = NewGrid();
                base.UpdateSensor();
                Sensor.Detector = NewDetector();
                Sensor.Encoder  = NewEncoder();
            }
        }