public override Image ToRGB()
        {
            ImageRGB <T> result = (ImageRGB <T>)ImageFactory.Create(Width, Height, ColorModel.RGB, GetDataType());

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    result.R[x, y] = Gray[x, y];
                    result.G[x, y] = Gray[x, y];
                    result.B[x, y] = Gray[x, y];
                }
            }
            return(result);
        }
Exemple #2
0
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            if (FPinInContext[0] != FContext)
            {
                FContext = FPinInContext[0];
            }

            if (FContext == null)
            {
                FRunning = false;
                return;
            }

            if (FContext.running && !FRunning && FContext.context != null)
            {
                try
                {
                    FImageGenerator = FContext.context.FindExistingNode(global::OpenNI.NodeType.Image) as ImageGenerator;
                    FDepthGenerator = FContext.context.FindExistingNode(global::OpenNI.NodeType.Depth) as DepthGenerator;
                    FDepthGenerator.AlternativeViewpointCapability.SetViewpoint(FImageGenerator);

                    FImageRGB   = new ImageRGB();
                    FImageDepth = new ImageL16();
                    FImageWorld = new ImageRGB32F();

                    Size size = new Size(640, 480);
                    FImageRGBBuffer   = new Image <Bgr, byte>(size);
                    FImageDepthBuffer = new Image <Gray, ushort>(size);
                    FImageWorldBuffer = new Image <Rgb, float>(size);

                    FPinOutRGB[0]   = FImageRGB;
                    FPinOutDepth[0] = FImageDepth;
                    FPinOutWorld[0] = FImageWorld;

                    FThread  = new Thread(fnThread);
                    FRunning = true;
                    FThread.Start();
                    FPinOutStatus[0] = "OK";
                }
                catch (StatusException e)
                {
                    FRunning         = false;
                    FPinOutStatus[0] = e.Message;
                }
            }
        }
		public override void Initialise()
		{
			Close();

			lock(Lock)
			{
				if (Image == null || !Image.HasAllocatedImage)
				{
					Image = null;
					Initialised = false;
					return;
				}

				Image.ImageUpdate += ImageUpdate;
				Image.ImageAttributesUpdate += ImageAttributesUpdate;

				Initialised = true;
			}
		}
Exemple #4
0
        public override void Initialise()
        {
            Close();

            lock (Lock)
            {
                if (Image == null || !Image.HasAllocatedImage)
                {
                    Image       = null;
                    Initialised = false;
                    return;
                }

                Image.ImageUpdate           += ImageUpdate;
                Image.ImageAttributesUpdate += ImageAttributesUpdate;

                Initialised = true;
            }
        }
Exemple #5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Command != 0)
            {
                hash ^= Command.GetHashCode();
            }
            if (ImageRGB.Length != 0)
            {
                hash ^= ImageRGB.GetHashCode();
            }
            if (ImageDepth.Length != 0)
            {
                hash ^= ImageDepth.GetHashCode();
            }
            if (ImageIr.Length != 0)
            {
                hash ^= ImageIr.GetHashCode();
            }
            hash ^= cameraIds_.GetHashCode();
            if (ImageGrating.Length != 0)
            {
                hash ^= ImageGrating.GetHashCode();
            }
            if (CamIntri.Length != 0)
            {
                hash ^= CamIntri.GetHashCode();
            }
            if (OffsetParams.Length != 0)
            {
                hash ^= OffsetParams.GetHashCode();
            }
            if (CameraStatus.Length != 0)
            {
                hash ^= CameraStatus.GetHashCode();
            }
            if (StereoImages.Length != 0)
            {
                hash ^= StereoImages.GetHashCode();
            }
            if (IsLowBrightness != false)
            {
                hash ^= IsLowBrightness.GetHashCode();
            }
            if (RemapParams.Length != 0)
            {
                hash ^= RemapParams.GetHashCode();
            }
            if (ParameterValue.Length != 0)
            {
                hash ^= ParameterValue.GetHashCode();
            }
            if (Error.Length != 0)
            {
                hash ^= Error.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
		public void SetImage(ImageRGB image)
		{
			Image = image;
		}
Exemple #7
0
 public void SetImage(ImageRGB image)
 {
     Image = image;
 }