sibarrick Posted May 7, 2006 Share Posted May 7, 2006 Hi all, Whilst looking around at papers on PSD and MWE I came across all sorts of info on RBF's (radial basis functions) since these are used to calculate the weights for the PSD. I also came across a way of using them to do feature morphing between topologically different meshes using a method called Thin plate spline mapping. Anyhoo I've been experimenting and put together this basic sop that impliments it. Basically the idea is that you mark feature points on two different meshes and this sop would deform the input mesh to match (approximately) the second mesh using the transformed feature points. In the papers they generally use it to morph different heads and then do weight transfer from the morphed head onto the new unmorphed one. The transferred weights are capture weights so the head can then be animated without having to manually set the weights up for it. The applications of this are quite varied though so I thought I'd share it. I have one problem with it at the moment. It works but after a few clicks in the hip file it will crash with a memory error. So if anyone can see what I've done wrong that would be great. It's a very simple piece of code, I must have just missed an initialisation or something but I can't see it. I'll look at it again later and see if I can spot it with fresh eyes. The attached just uses a linear basis but I've commented the bit you need to change to try different types of interpolations. RBFmorpher.zip enjoy! 1 Quote Link to comment Share on other sites More sharing options...
edward Posted May 7, 2006 Share Posted May 7, 2006 Some pics? I'm just too lazy to download and try it. Quote Link to comment Share on other sites More sharing options...
Jason Posted May 7, 2006 Share Posted May 7, 2006 I havent downloaded this but it this type of thing is very useful thing. I believe I've even RFE'd it in the past. Digital Domain has a very similar thing written for Maya guys which uses Thin Plate Spline RBFs to interpolate shapes. Linear interpolation can be so ugly and you always have to hide it by blending in other shapes with staggered timing to hide the bumps caused by the discontinuities. This tool really helps ensuring that facial animation (if you're using Blend Shapes) is smooth and more natural looking. I've found many uses in FX work for this type of smoothed interpolation. I've sketched around in the past by using a Trail SOP to generate connected polys, converted them to curves (FitSOP) and then these as the new curves as the rails for interpolated shapes. I haven't tried this with character faces though. I'll be it wouldn't be the speediest for thousands of points. I'd love to see other types of shape interpolation available Houdini, so thanks Simon! Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 7, 2006 Author Share Posted May 7, 2006 @Edward When I get some nore time I'll try and make some pics for you. Still need to squash that bug first. @Jason It's quick for small numbers of feature points, not sure the math holds up when the number gets high. Basically to set up the weights you have to solve N linear equations, where N is the number of feature points. I don't think the solving methods will hold up for 100's let alone thousands. The idea is that the points are very sparsely generated and that you don't need many to control the surface. However if its thosaunds of points you wish to deform it would be super fast. This is because you only create N weights, so if you have 1000's of points controlled by only 10 feature points it would be quicker than most other methods. Also doing the original calculation to set it up only involves solving for 10 equations which is also very quick. I'll post results when I've played with it some more. By the way I'm always open to any idea for deformers..... (Must try and find time to look at that cloth solver you sent me....) Quote Link to comment Share on other sites More sharing options...
rjpieke Posted May 8, 2006 Share Posted May 8, 2006 I have one problem with it at the moment. It works but after a few clicks in the hip file it will crash with a memory error. So if anyone can see what I've done wrong that would be great. 27323[/snapback] Hey Simon ... I think the problem is your set of tP = P and P = tP calls. I don't think UT_Permutation has a proper copy constructor, so you'll get memory badness when P and tP go out of scope and both try to delete the same memory (the array of values that the UT_Permutation class stores). Cheers! Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 8, 2006 Author Share Posted May 8, 2006 Thanks! good thinking I check it out. I must say that this method feels very "face robot" if you know what I mean..... "solving for skin motion" but not a skin solver... Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 8, 2006 Author Share Posted May 8, 2006 Cool, it works. In fact I don't even need those copies as LUBackSub doesn't seem to modify them. Here's the stable version, and I'll try and make some nice piccies for Edward later. RBFmorpher.zip Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 8, 2006 Author Share Posted May 8, 2006 Here's some piccies and a hip file to play with. It took more points than I hoped to get anywhere near the target but mildy less work than it would've doing it with a lattice in points mode. Since I don't really want this for matching faces I think it will work very well. Anyway judge for yourselves. 1. Original head 2. Target head 3. RBF morphed head 4. Point lattice deform - with one fixed capture radius ExampleRBF.zip cheers to rjpieke for spotting the UT_Permutations error, saved me a few hours hunting... Quote Link to comment Share on other sites More sharing options...
rjpieke Posted May 8, 2006 Share Posted May 8, 2006 cheers to rjpieke for spotting the UT_Permutations error, saved me a few hours hunting... 27382[/snapback] My pleasure - Rob Quote Link to comment Share on other sites More sharing options...
thekenny Posted May 9, 2006 Share Posted May 9, 2006 Simon, just cuz I'm crazy... what paper did you base your work from? (link) i'm sitting looking at this and trying to think how to use this... NEAT -k Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 9, 2006 Author Share Posted May 9, 2006 AUTOMATIC FACE MORPHING FOR TRANSFERRING FACIAL ANIMATION and The Artifical Actors project go to Animation Tools - Muscle Simulation and download the pdf. It's huge but go to page 49. Here's a small update, I've added some different kernels for calculating the RBF part. RBFmorpher.zip Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted May 9, 2006 Share Posted May 9, 2006 Here's a small update, I've added some different kernels for calculating the RBF part. Hey Simon, Just took a quick peek now: Very Nice!! :thumbsup: Don't know the details at all, but it seems like a useful deformer. Good stuff, and thanks for sharing! Quote Link to comment Share on other sites More sharing options...
Jason Posted May 9, 2006 Share Posted May 9, 2006 Simon, this is a great thing, thanks;) However, I've noticed if you change around the inputs a lot to things with different point counts it will freak out. I have some more thoughts for you on this but I'll have to write to you about this later. It turns out that my previous reply to you on this was related to a similar piece of technology based on RBFs but not the equivalent of this at all. Here is a RedHat 9 dso for anyone who wants to to play along. EDIT: This is for 8.0.589. Should work with any Houdini version around that build, I hope. Not much seemed to change in the Journals around that period. SOP_RBFmorpher_RH9_dso.zip Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 10, 2006 Author Share Posted May 10, 2006 Simon, this is a great thing, thanks;)However, I've noticed if you change around the inputs a lot to things with different point counts it will freak out. I have some more thoughts for you on this but I'll have to write to you about this later. It turns out that my previous reply to you on this was related to a similar piece of technology based on RBFs but not the equivalent of this at all. Here is a RedHat 9 dso for anyone who wants to to play along. EDIT: This is for 8.0.589. Should work with any Houdini version around that build, I hope. Not much seemed to change in the Journals around that period. 27418[/snapback] Could you explain a bit more about what you did to make it freak out. I've only tested it with that one file so far. I did try pumping in a subd surface of the original head and it seem to be happy. But I haven't given it much of a workout yet. Here's a compiled H8.0.410 dso for winows users SOP_RBFmorpher.zip Quote Link to comment Share on other sites More sharing options...
thekenny Posted May 10, 2006 Share Posted May 10, 2006 thanks simon, will be reading through lunch. i saw the actors site before... and skimmed through it... i'll have to be more careful on the next thing... you never know what you can find out there.. it looks really interesting (yourSOP) I tried it out and it worked fine... I was able to make it slow down with a resampleSOP adding more points on the reference curves.. but the results were very similar to the sparse curves.. cool -k Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 10, 2006 Author Share Posted May 10, 2006 I idea here is definetely to use as sparse a number of points as possible, if you were to need lots then using a point lattice would probably be better. This technique works well with sparse point density where a point lattice will fail and with dense points its the other way around.... Quote Link to comment Share on other sites More sharing options...
LEO-oo- Posted May 11, 2006 Share Posted May 11, 2006 Simon - nice! Good job! Quote Link to comment Share on other sites More sharing options...
Jason Posted May 11, 2006 Share Posted May 11, 2006 Could you explain a bit more about what you did to make it freak out. SOP_RBFmorpher.zip 27428[/snapback] Its pretty easy; while the display is on the RBF morpher, change the number of deform points (2nd input). It doesnt like having mismatched numbers of points on the point cloud. 1) take a sphere, 2) scatter 25 points on it 3) create a RBF Morpher and wire the sphere into the 1st input 4) wire the scatter into the RBD Morpher 2nd and 3rd inputs. all is good. 5) duplicate the scatter and make it generate 100 points 6) wire this new scatter into the 3rd input of the same Morpher Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 11, 2006 Author Share Posted May 11, 2006 Its pretty easy; while the display is on the RBF morpher, change the number of deform points (2nd input). It doesnt like having mismatched numbers of points on the point cloud.1) take a sphere, 2) scatter 25 points on it 3) create a RBF Morpher and wire the sphere into the 1st input 4) wire the scatter into the RBD Morpher 2nd and 3rd inputs. all is good. 5) duplicate the scatter and make it generate 100 points 6) wire this new scatter into the 3rd input of the same Morpher 27481[/snapback] Oh right, yes that makes a lot of sense. I'll add a test to prevent it trying to solve a situation where the point counts don't match. Cheers! Here's a version with this fix implemented RBFmorpher.zip Quote Link to comment Share on other sites More sharing options...
aracid Posted August 16, 2006 Share Posted August 16, 2006 hey all i dont think this should be under hdk, however i want to follow this morphing thread. it was mentioned that one can use the uv values of 2 object to blend between objects with topological mismatches. can someone mention what vop/vex i can use to extract the object or world space position using the second objects uv value, or is there another method of extracting this data ? thanks in advance brian Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.