• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
azer.darkblade

Kinect usermap smoothing using hq4x

5 posts in this topic

Hi, right now i am doing a post-processing of kinect's depth map. This is, of course, for gaming purpose so i need everything runs in realtime.
The game itself will be in HD and as you can guess, the problem is kinect's depth map has row resolution and it wouldn't be good. So i decided to use [url="http://www.hiend3d.com/hq4x.html"]hq4x[/url] to smooth the kinect's depth map since this filtering is very good on binary image.

Here's my steps:[list=1]
[*]My depth map resolution is only 320x240 (it's a sufficient resolution for gesture tracking, higher resolution may cause performance problem)
[*]Segment user's body only (this is very easy using user mask from OpenNI)
[*]I am using texture buffer and for speed consideration, the buffer should be power-of-two which is 512x512 (i don't want to cut my depth map so 512 is decided as the higher-nearest power-of-two).
[*]Then the 320x240 depth image is downsampled to 80x60 so when it's applied on hq4x the resolution is back to 320x240 and it's fit to 512x512 texture buffer
[*]Apply hq2x upsampling on 80x60 image
[/list]
Here's my input:
[img]http://www.azerdev.com/hq4x/in.png[/img]

And this is my output:
[img]http://www.azerdev.com/hq4x/out.png[/img]

As you can see, hq4x does pretty well and the result is very good but there's an issue, the resulted image still has sharp curvatures on the edge.

What i want look like this:
[img]http://www.azerdev.com/hq4x/goal.png[/img]

Currently i am stuck with this problem and i'm still thinking how to improve the result. Actually, I have an idea to do morphological erosion (or dilation) first, anyway i need to do research again :)

Perhaps anyone here has another idea :)

Thanks !
0

Share this post


Link to post
Share on other sites
I'm not all that familiar with the hqx upsamplers, but from my limited reading it seems like it's simply just a matter of changing the interpolation tables, it's obvious that the default implementation prefers to keep sharp features where possible which is something you don't seem to want. If it's possible or how easy it is to change the interpolation tables to prefer smoothness and also have the intended result I have no idea, but seems like that's your major issue (you are not using it for pixelart upscaling as intended for).

Otherwise, depending on what kind of quality you want, nearest neighbour upscaling and blurring and then using a threshold to give a black/white image yields quite similar results, although the output is obviously a lot more "round", the following is a quick and dirty test in photoshop with 4x gaussian blur (if you upsample with bilinear rather than nearest as I did you get slightly better and less wobbly results).

[img]http://img814.imageshack.us/img814/9456/67653822.png[/img] Edited by Syranide
2

Share this post


Link to post
Share on other sites
The technique in this paper might be of use to you: [url="http://research.microsoft.com/en-us/um/people/kopf/pixelart/"]http://research.micr.../kopf/pixelart/[/url]
Here's the comparison with hq4x: [url="http://research.microsoft.com/en-us/um/people/kopf/pixelart/supplementary/comparison_hq4x.html"]http://research.micr...rison_hq4x.html[/url]
However, it's pretty expensive...

I like the blur and threshold idea from Syranide; it would be very efficient. You could even apply an anti-aliasing filter such as FXAA before the upsampling step to get smoother results. Edited by Hodgman
1

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1344251234' post='4966635']
The technique in this paper might be of use to you: [url="http://research.microsoft.com/en-us/um/people/kopf/pixelart/"]http://research.micr.../kopf/pixelart/[/url]
Here's the comparison with hq4x: [url="http://research.microsoft.com/en-us/um/people/kopf/pixelart/supplementary/comparison_hq4x.html"]http://research.micr...rison_hq4x.html[/url]
However, it's pretty expensive...

I like the blur and threshold idea from Syranide; it would be very efficient. You could even apply an anti-aliasing filter such as FXAA before the upsampling step to get smoother results.
[/quote]

I actually thought about that specific microsoft article too, but I imagine that it would be too "jittery/quirky/erratic" for real-time use as even tiny variations could introduce major changes in the output I think (it is mind numbingly cool though!). If I'm not mistaken, I think they even mention that it has some issues with animations somewhere, but perhaps I'm mistaken.

This is not my area at all, but to me it seems like some kind of "blurring algorithm" needs to be used to keep it fluid and consistent between frames, anything that too intelligently decides "on individual pixels" seems like it would just cause erratic behavior in realtime.

Running FXAA before the upsampling actually seems like a really good idea I have to say, if it works well it would remove the "wobbly and jagged" look and could actually end up looking really good...

I was going to suggest some basic algorithm for just filling various edges and gaps with grey pixels as a way to smooth out the original image just to minimze the wobbly look, but it seems FXAA should just be better in every way. Edited by Syranide
0

Share this post


Link to post
Share on other sites
thanks for the replies since it's almost 2 weeks and nobody replied.

i tried hqx but it seems not very good while the image has noise, and so microsoft paper it's not real-time

Anyway, i (almost) solved the problem by using combination of edge detection and spline curve:
here's the result:

[img]http://azerdark.files.wordpress.com/2012/08/img_962.png[/img]

The result is really good but the fps dropped to 20-30 fps. The problem is i need a method that runs fast enough in real-time

Another idea is using morphological opening (still thinking how to implement this on shader):

[img]http://azerdark.files.wordpress.com/2012/08/img_179.png[/img]
but this one only removes a little noise around the edge, though.

Actually i don't need super-noise-removal algorithm, what i want is just approximation of the shape and loss of detail on several parts is fine to me since the goal is making a silhouette like this one:

[img]http://azerdark.files.wordpress.com/2012/08/silhouette.jpg[/img] Edited by azer89
0

Share this post


Link to post
Share on other sites
That's weird, I found your topic being second from the top... must've accidentally been on another page.

Anyway, did a quick photoshop blur again on your "original" image with a radius of 2 and it turned out pretty good I think, a lot better than your second I'd say, which seems to remove a lot of features while not really fixing the jaggedness.

[img]http://s8.postimage.org/pa0nc9bv9/Untitled_4awdawd.png[/img]

Again, I'm not really read up on this, but to me it seems that involving any significant decision making into the processing would ruin the realtime quality, making features appear/disappear and behave erratically, whereas blurring and such solutions would have a more consistent and fluid look (although not as high quality when looking at individual frames), and you could also get the result cheaply anti-aliased that way (if not using FXAA).


Just read your update, if you want that "continous shape" looking look, it seems to me like you have to give up the smaller features entirely and just fit some very rough curves over it all (but that could probably make it very "blobby" instead I think if you don't tune it carefully), or possibly just more blur. I'm curious though, I would think that from looking at that image that they don't use the buffer itself, but rather interpret the position of the body parts and then render a human model instead. Edited by Syranide
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0