Code Monkey home page Code Monkey logo

Comments (5)

chitsaw avatar chitsaw commented on May 15, 2024

Try the following patch on Sources\Imaging\Microsoft.Psi.Imaging\ImagePool.cs:

diff --git a/Sources/Imaging/Microsoft.Psi.Imaging/ImagePool.cs b/Sources/Imaging/Microsoft.Psi.Imaging/ImagePool.cs
index fcd9f449f..f5a20ed38 100644
--- a/Sources/Imaging/Microsoft.Psi.Imaging/ImagePool.cs
+++ b/Sources/Imaging/Microsoft.Psi.Imaging/ImagePool.cs
@@ -17,10 +17,10 @@ namespace Microsoft.Psi.Imaging
         /// <param name="width">Width of image requested</param>
         /// <param name="height">Height of image requested</param>
         /// <param name="pixelFormat">Pixel format for requested image</param>
-        /// <returns>Returns an image frmo the pool</returns>
+        /// <returns>Returns an image from the pool</returns>
         public static Shared<Image> GetOrCreate(int width, int height, PixelFormat pixelFormat)
         {
-            return KeyedSharedPool<Image, ValueTuple<long, PixelFormat>>.GetOrCreate(ValueTuple.Create((long)(width * height), pixelFormat), () => Image.Create(width, height, pixelFormat));
+            return KeyedSharedPool<Image, ValueTuple<int, int, PixelFormat>>.GetOrCreate(ValueTuple.Create(width, height, pixelFormat), () => Image.Create(width, height, pixelFormat));
         }
 
         /// <summary>

from psi.

admayber avatar admayber commented on May 15, 2024

Error still occurs, unfortunately. In case it's helpful, the error is originating at line 216 of Microsoft.Psi.Imaging\Operators.cs, in the middle of this code block:

graphics.ScaleTransform(xScale, yScale);
graphics.DrawImage(image.ToManagedImage(), new Point(0, 0));   \\ line that causes error
return ImagePool.GetOrCreate(bitmap);

from psi.

chitsaw avatar chitsaw commented on May 15, 2024

Thanks for the additional info. We'll investigate further and get back to you.

from psi.

chitsaw avatar chitsaw commented on May 15, 2024

The Resize operator does not work with the raw depth image format. In order to perform imaging operations on the depth stream, it should first be converted to a color or grayscale image like so:

var depthImageStream = kinectSensor.DepthImage.ToGray().Resize(100, 100).EncodeJpeg(90, DeliveryPolicy.LatestMessage).Out;

We should probably throw a more helpful exception than the underlying generic GDI+ error.

from psi.

admayber avatar admayber commented on May 15, 2024

Ahh okay, that corrects the issue for me. Thank you!

from psi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.