|
Hi,
I looked at your code again and discovered you are squaring the coordinates !?!?
b.P0.x and the like should not be inside pow(...,2) !
Also I would suggest to keep the bezier curves large enough, i.e. I hope you are
not trying to draw a bezier that only spans a few pixels (would waste CPU cycles
and might be off due to quantization effects).
|
|
|
|
|
Thanks for that. I never would have found that out. I got the formula for Bezier curves off the internet and coded it in C++ but i didn't keep the original formula so i just assumed i copied it right.
Thanks again.
|
|
|
|
|
You're welcome.
When in doubt about some formula, I check the edge conditions, in your case the
Bezier must yield P0 and P2 for the special values t=0 and t=1.
Furthermore, squaring a physical thing (such as a coordinate) does not
occur often.
Best regards,
|
|
|
|
|
There is still just one little problem. Sometimes the curves don't go from one to the other and stay there. That is, one curve keeps repeating over and over as if if (b[start].t < b[start].t2) doesn't evaluate to true???
Here is a link to download the viz so you can see for yourself. http://www.savefile.com/files/550244[^]
Read the readme, it tells you how to install it. If you can't get it to install tell me and i'll post some pics instead.
|
|
|
|
|
I've been interested in making a 2D side-view platformer. I've been experimenting with video footage of an actor, and how to process that footage down to useable game sprites.
Image: http://www.18giants.com/example1.jpg
As you can see, seperating the figure from the background (in code) is a real challenge. Her arms are especially close to the color of the wall behind her.
I've tried keying on r,g,b, on chroma, on hue, on saturation, and several combinations thereof. I tried keying on frame-to-frame changes. I tried getting a reference frame (without her in the shot) and keying off the differences. I also tried counting the colors, sorting them by a two-color cutout of the figure, and applying the results back to each frame.
Nothing's really working, especially on the arms.
I KNOW I'm supposed to spring for a green stage and all that, or just get an artist to hand-process every frame, but I wanted to find a cheap, software solution if I could.
Do you know of anybody doing this kind of thing? Have you heard about an algorythm I haven't tried yet?
Thanks!
|
|
|
|
|
How i solved that stuff normally is that i think of every element of the person as a different layer that i need. So i end up with multiple movies , one wih the legs , the other with the head , and a oher with ..Then i impose them ontop of each other. You can do basic pos effects in Adobe Premiere , but if you have to go more hardcore,try After Effects. A hint with after effecs : You can nest projects in projects. So tweaking of one colourkey in a layer will show you a nice result in all those nested colour key layers together.
|
|
|
|
|
I think the answer you received does not address your question. At least I got it diferent. I assume you want to record an actor and then remove the background so that you can use the frames of the actor over the background of a game. The tricky part is that you don't want to spend a lot of money on a "green" background (which would be easilly removed, of course). Is this right?
If I got it right then I can imagine a number of solutions and also many details that should be observed (depending on the final quality you intend to achieve).
The easiest solution I can think of is dressing the actor in colors, instead of using a green background. From the image you posted I would sugest:
1) Paint her face light blue (this paint should not be too expensive).
2) Leave the hair black.
3) Paint the arms green (or dress them in a tight green bluse and gloves).
4) Wear a red sleavless shirt.
5) Wear blue pants.
6) Wear green shoes (or socks, I can't see the details very well).
(this is for the given image only, other images may sugest a diferent colour scheme)
Then it will be easier to remove the background against the actor's colors. Simply learn the background and subtract. Well, it is not as easy if you get a lot of noise (if you do then reply to this message for techniques how to remove noise). When you have removed the background then you just replace the actor's colours by software. All shadows should be valid and accurate after this and you get your actor isolated.
Then, for realism and credibility, you should use an alpha channel (for transparency) for the sprite drawing (during the game). Make at least one alpha pixel in contour. If you have a typical color for background then reply to this message for techniques on how to recompute the best contour.
I hope this helps,
Rilhas
|
|
|
|
|
Does anyone know of a good pic compiler with source code that's not licensed under GPL?
Thanks
|
|
|
|
|
For C/C++ or assembly? What PIC family?
|
|
|
|
|
Rilhas wrote: For C/C++ or assembly?
C/C++
Rilhas wrote: What PIC family?
PIC18F8722
|
|
|
|
|
Well, for C with the PIC18 family I would sugest The MPLAB C18 Compiler. I don't think it is GPL, because it is a comercial product sold by MICROCHIP. I consider it to be moderately priced (around 350 EUR), and I've used it and it is good. It has some bugs, but very easy to find and work around. You can find it at http://www.microchipdirect.com/productsearch.aspx?Keywords=SW006011[^].
This is not a C++ compiler. For that I don't know any products from personal experience.
I hope this helps,
Rilhas
|
|
|
|
|
I was looking for an alternative to microchip that I can build into a personal project. Being commercial, microchip doesn't lend itself well to that objective.
|
|
|
|
|
From the news page:
I only had one number theory class as an undergrad and we didn't talk about Mock Theta functions, but some researchers at UW apparently have made some major breakthroughs in Mock Theta function theory:
http://www.news.wisc.edu/13497.html[^]
--
Marcus Kwok
|
|
|
|
|
Hello everyone,
I am in search of an algorithm to find the most appropriate division technique of an area.
For example; I have 3 100x500 cm of sheets and I want to get 15 50x40 cm, 2 100x100 etc. sheets. So I have to divide these 100x500 cm sheets into smaller parts. But when I -let's say- try to get 15 50x40 cm sheets from only one 100x500 cm sheet probably there will be a loss (500 mod 40 != 0).
So I have to use a combine of 50x40, 100x100 etc. sheets.
Also there isn't a must to only use quadrangles. Polygonial sheets may also used.
So is there an algorithm to get the desired number of different area shapes from a number of main shapes with less loss ?
Thanks for your helps and best regards.
.:: Something is Wrong ::.
|
|
|
|
|
IIRC what you're describing is an NP complete problem.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Sorry about my English I am not good with abbreviations. So what do you mean by IIRC and NP..
.:: Something is Wrong ::.
|
|
|
|
|
|
Maximilien wrote: NP stands for a Non Polygonial class of problems.
I think you mean "nondeterministic polynomial".
--
Marcus Kwok
|
|
|
|
|
|
sorry. IIRC is short for If I Recall Correctly, and is internet slang for I think this is right, but am not certain.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
But at least there must be a subset of the NP, that is deterministic.. Am I wrong ?
.:: Something is Wrong ::.
|
|
|
|
|
There is, it's the set of problems called P. That's the sort of problem that can be done in at worst polynomial time on a normal computer.
Your question appears to indicate a bit of a vocabulary/jargon problem.
P is the set of problems that can be done in polynomial time on a dterministic turing machine. All normal computers are deterministic turing machines.
NP is the set of problems that can be done in polynomial time on a nondterministic turing machine. A nondeterministic machine guesses the correct solution (the first time, every time, in a nonexplainable way) and then proves that it is correct. A deterministic turing machine can simulate a non deterministic one, by trying each possible solution in sequence. This takes exponential time. A quantum computer is capable of directly running multiple data sets at once, but the fastest QC ever built is still no faster than a normal machine due to the low maximum qbit count it can work with.
It's believed, but not proven than P is a subset of NP, but that the two are not equal.
Depending on the problem, and conditions applied to it, there may or may not be a solution in P that can give a reasonable approximation with a known worst case error. Except for well known problems the approximations are unlikely to be published anywhere except in academic journals.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Really thanks for the explanation. So if we return to the point is there a way to "guess" or "approximate" the most proper division technique ?
.:: Something is Wrong ::.
|
|
|
|
|
probably, but given the lack of response I don't think anyone posting here is aware of one. If you can't find anything via google you'll need to do a journal search for papers on the subject. I don't know if CS journals charge for online access or not. If so, it may be cheaper to visit the library of a major college/university than to buy access.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Ok, I will give a try, and if get a result I will share it . But at least, which keywords should I use in search? Any ideas?
.:: Something is Wrong ::.
|
|
|
|