Display Colorframe in kinect in Full screen - windows

I want to display the kinect color frame in wpf with full screen , but when i am trying it ,
I got only very less quality video frames.
How to do this any idea??

The Kinect camera doesn't have great resolutions. Only 640x480 and 1280x960 are supported. Forcing these images to take up the entire screen, especially if you're using a high definition monitor (1920x1080, for example), will cause the image to be stretched, which generally looks awful. It's the same problem you run into if you try to make any image larger; each pixel in the original image has to fill up more pixels in the expanded image, causing the image to look blocky.
Really, the only thing to minimize this is to make sure you're using the Kinect's maximum color stream resolution. You can do that by specifying a ColorImageFormat when you enable the ColorStream. Note that this resolution has a significantly lower number of frames per second than the 640x480 stream (12 FPS vs 30 FPS). However, it should look better in a fullscreen mode than the alternative.
sensor.ColorStream.Enable(ColorImageFormat.RgbResolution1280x960Fps12);

Related

sws_scale performance comparison to media players real time resize

While playing 4K video user can resize players window - and result image will be scaled smoothly in run time.
On the other hand - program written with libav which reads 4k video file frame by frame and scale it down with sws_scale function do it less effective: it took more time then video duration to resize it.
Why is it so? Maybe because player fps is less and some frames are skipped - but video still looks smooth?
This is because most video players do scaling in the video card's hardware. With GL, for example, scaling (or even format conversion from YUV to RGB) is free.

How does video players display video grater than native resolution of monitor?

I have a 1920x1080 resolution MP4 video file. It is encoded using H.264 video codec.
My monitor's native resolution is 1280x780. I am able to play this video file in vlc player or using totem player without any issue.
Can somebody explain me how video players display video files larger than the monitor's native resolution?
Image scaling algorithms can be used at different levels: by video player itself, by operating system, even by monitor hardware. Simplest method of image scaling is "nearest-neighbor scaling", picking the nearest pixel colour. There are some advanced techniques, however, you can find them in this article.
Stretching it down. That is, leaving some pixels out of the painting. The same as resizing down an image with a paint program.

How to display 1:1 on a rMBP when not running in "Best for Retina"

Let's say I have a rMBP, and an image that is 1000x1000 pixels.
If I display the image onscreen at 1:1 while running the MBP in "Best for Retina" mode, it will be displayed 1:1 on the actual retina display pixels (i.e. it will take up the same screen real estate as a 500x500 image on a 1440x900 screen).
However, if I then switch to one of the "scaled" resolution modes, e.g. 1680x1050, the system no longer displays the image 1:1, but scales it down (it occupies the same screen real estate as a 500x500 image on a 1680x1050 screen).
I would like a way to have the image continue to display 1:1 on the retina display, regardless of the system resolution in use. I realize that I could calculate an appropriate "scaled" size, and scale the image up so that when it is scaled back down it corresponds to a 1:1 mapping, but this results in a noticeable quality degradation.
When running the MBP in the "scaled" resolutions, does Apple not provide any way to control the on-screen pixels directly (bypassing the scaling for just a part of the screen)?
No. Display scaling occurs at a very low level within the GPU and affects the entire display; there is no way to bypass it for part of the screen.
Look at it this way: If you set the resolution of an ordinary laptop's display to, say, 800x600, there is no way to display an image at the native resolution of the LCD, or to render content inside the black pillarboxes on the sides of the display. For all intents and purposes, the LCD is 800x600 while it's set to that resolution; the fact that it's actually (say) an 1440x900 display is temporarily forgotten.
The same principle applies to the MacBook Pro Retina display. The nature of the scaling is a little more complicated, but the "original" resolution of the display is still forgotten when you apply scaling, and there is no way to render directly to it.
Here are the APIs for addressing the pixels directly:
https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW1

Best video codec for smooth 1920x1080 playback on older machines (quality not important)

I'm new to Video technology, so any feedback (such as if I've underspecified the problem) would be greatly appreciated.
I need to display an animation (currently composed of about a thousand PNGs) on Windows and am trying to determine the best video codec or parameters for the job.
Video playback must be smooth at 30 fps
Output display is 1920x1080 on a secondary monitor
Quality does not matter (within limits)
Will be displaying alpha blended animation on top, so no DXVA
Must run on older hardware (Core Duo 4400 + nVidia 9800)
Currently using DirectShow to display the video.
Question:
Is it easier on the CPU to shrink the source to 1/2 size (or even 1/4) and have the CPU stretch it at run time?
Is there a video codec that is easier on the CPU than others?
Are there parameters for video codecs that mean less decompression is required? (The video will be stored on the HD, so size doesn't matter except as it impacts program performance).
So far:
- H.264 from ffmpeg defaults produces terrible tearing and some stuttering.
- Uncompressed video from VirtualDub produces massive stuttering.
There are so many different degrees of freedom to this problem, I'm flailing. Any suggestions by readers would be much appreciated. Thank you.
MJPEG should work. I used it for 1080i60 some 3 years back, and the playback was never an issue. Even encoding worked on-the-fly with a machine of quite similar performance to what you describe.
File size will be about 10MB/s for good quality video.
Shrinking the video will help, because if you are drawing the video to screen using e.g. DirectX, you can use the GPU to stretch it.

How to do hi-res offscreen rendering in QuickTime for Windows?

I need to render a QuickTime movie into a GWorld that may not be the movie's natural size, on Windows. When the movie is scaled up, say by a factor of 1.5, I see some jaggies. Whereas if I open the same movie in QuickTime Player (version 7.6.6 on Windows Vista) and stretch the window, I see jaggies while stretching, but when I release the mouse, the image smooths out. It must be using some smarter scaling algorithm or antialiasing. What do I need to do to render at a bigger size besides SetMovieGWorld and SetMovieBox?
Here's a little of the smooth version:
(source: frameforge3d.com)
And here's the slightly jaggy counterpart:
(source: frameforge3d.com)
(Although this shows text, it's not a text track, just part of the image.)
I tried calling SetMoviePlayHints with various flags such as hintsHighQuality, with no effect.
Here's the big picture, in case you might have a suggestion for a whole different approach. The movie is side by side stereo. The left and right halves of the image need to be composited (in one of several ways) and then drawn to the screen. For instance a movie I'm testing with has a natural size of 2560 x 720, but is displayed at a natural size of 1280 x 720. The way I'm currently doing it is rendering to a GWorld, and then in a SetMovieDrawingCompleteProc callback, uploading the left and right halves to OpenGL textures with glTexSubImage2D, and rendering to the screen using a GLSL shader.
I tried using an Apple Developer Technical Support incident to get help with this, but their reply was basically "we don't do Windows".
Can you use DirectX and more specifically, DirectShow to display your movie instead of using Apple's SDK? I know that DirectX can play QuickTime movies.
If you can use DirectShow then you can search for or create your own video transform filters to do antialiasing and smoothing.

Resources