|
Doh! Didn't see it. Any way for a user like me to move a message or shall I just wait for an admin to do it (and probably rightfully chastise me in the process. ).
I'll definitely check out the article and thanks!
Hypermommy
|
|
|
|
|
I have a formula y=x*(x-1) , given y , how do you find x ? (x is never less than 2.)
It occured to me that x*(x-1) is very close to x^2 especially as x increases, so I'm taking the square root and using CEILING (at least in SQL).
Something about this doesn't seem kosher, how would y'all do this?
|
|
|
|
|
if those variables are integers, then for x>1 you know (expand the multiplications to verify):
(x-1)^2 < x*(x-1) < x^2
which means (still assuming x>1):
x-1 < SQRT(y) < x
or
SQRT(y) < x < 1+SQRT(y)
so yes the ceiling should do it, as would the floor of SQRT(y)+1
if those variables are reals, then you either write the formula for a quadratic equation, or you use an iterative process, such as Newton-Raphson's.
|
|
|
|
|
Oh, yes, of course integers, the only real numbers.
|
|
|
|
|
OK.
Now could you please go here[^] and offer your usual wisdom. Thanks.
|
|
|
|
|
Oh, right I saw that earlier, not sure what to say.
|
|
|
|
|
Well, this is a quadratic equation, with roots at 0 and 1 and therefore a midpoint at ½.
y = (x - ½)² - ¼ (expand and compare with the initial constant which was 0)
(x - ½)² = y + ¼
x - ½ = sqrt(y + ¼)
x = sqrt(y + ¼) + ½
Since you're already using a square root this won't be much more expensive than what you're doing now (maybe less, not sure of the cost of ceil) and it's accurate.
x(x - 1) isn't that close to x², it differs by x and therefore the relative error only goes down as 1/x. That's a very poor approximation and I don't see why you'd use it if it's also an expensive one with a sqrt in it.
|
|
|
|
|
|
Hello
I'm searching for some algorithm that could compare two files by content and return the list of differences. I have successfully implemented the LCS - Longest Common Subsequence algorithm and got it up and running with backtracking, but this algorithm is only usable for short strings. Event with some optimizations (trimming) this algorithm blows up the memory with long string (marix size is quadratic to the length processed string)
Can you please help me out on what my options are?
Thanks you very much and have a wonderful day!
Tomas
|
|
|
|
|
|
Luc's may have won, but I like mine PIEBALDdiff[^].
It doesn't bother with LCS or Levenshtein (yet) and still gets good results with (probably) less memory and more flexibility.
|
|
|
|
|
Nah. Mine was meaner.
|
|
|
|
|
|
Is only going to happen when your brother is the governor of Florida.
|
|
|
|
|
I would like to create a program in C# to process audio and perform low pass and high pass filtering on it.
Can anyone tell me where I should start to implement these filters? Is there any source code you are aware of, or maybe ready made DLLs which I can use?
|
|
|
|
|
Don't know specifically about stuff in C#... but the low and high pass filter design algorithms are all digital signal processing (DSP) algorithms, so as far as study and design of the algorithm itself, you can use Matlab (or the open source alternative Octave) to lay out the design. Once understood, you can code it yourself onto C#.
Try Google to see if there's open source libraries for this, they're fairly common audio synthesis operations so there must be libraries out there (although unfortunately I couldn't direct you right to one).
|
|
|
|
|
For frequency filters the general pattern is: fourier transform input, filter transform, fourier inverse (which is magically the same transform! ) the filtered transform to get a new sound stream. I haven't done it but I did, a while back, look for fast fourier transform in C# and there was a pretty good library out there.
I realise this is minimally helpful but hopefully that gives you some search pointers at least.
|
|
|
|
|
Fast Fourier Transform filtering is certainly an option.
It's a very intuitive solution since, like BobJanova states, band-pass filtering can be easily achieved by doing these steps:
1) Forward FFT of the input data,
2) Zeroing the result bins of the frequencies that we want to remove, and finally,
3) Perform reverse FFT on the same data.
However, this is a very expensive approach, if fast execution is a must, I would recommend trying a FIR digital filter instead. I have no experience designing such a filter myself, but there used to be a really great freeware tool around named DSPlay. I Googled for a while and unfortunately can't find it any more. This GUI tool allowed you to easily create band-pass filters by specifying a few input parameters and generated very simple C code that was directly usable in C#.
Let me take a look as I'm certain I have the DSPlay tool in a pervious hard disk backup...
|
|
|
|
|
I've done a bit of work on this in the past, and one very useful resource is the audio biquad cookbook - http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt[^].
Biquads are a quick and easy way to get the sorts of effects you're looking for. If you want to explore more, or need higher quality, do some searches for digital filter designs or DSP designs - there are loads of sites which have examples as well as the maths behind them.
I should add that I wrote my filter code in C, rather than C#, and although it probably will be OK on modern machines, you might not get as high performance (throughput).
Days spent at sea are not deducted from one's alloted span - Phoenician proverb
|
|
|
|
|
How I can implement this algorithm?
I found this algorithm is not very easy for it.
Can anyone give me some idear.
Before i found several question about nearest color.
FindNearestColor{...}
maybe color texture is used ?
face1 and face2 ,match face2's colour into face1.
I know this is not very easy. How about this algorithm?? thanks
Everything will be happy!
|
|
|
|
|
I'm not very familiar with photoshop or this particular function is but since no one else has answered I'll try and help you but I may be misunderstanding the question.
Colors are normally represented as 3 bytes. One for red, one for green, and one for blue (RGB)and all colors are a mixture of those 3 values. So if I understand the question right all you would need to do is get those values and then compare them.
Maybe you could elaborate on what this Photoshop function does and more people would be able to help you.
|
|
|
|
|
For example: My problem is just like that: matting image technique. Switch person's face.
Just you know ,we need recognize the persion's face. If we can recoginize the persion's face. How to fuse the face color? as you know there are some difference between these two faces.I did not know how to do research on this problem. thank you very much!
Everything will be happy!
|
|
|
|
|
I searched and do a research for this topic,I found Poisson Image Editing algorithm can solve my problem.
Poisson Image Edit algorithms
thank you very much!
Everything will be happy!
|
|
|
|
|
Face detection is quite a complex subject and requires a fair amount of research. However there are some libraries available which you can probably find via Google.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Yes face detection is difficult. I use sereral libriaries too.
Everything will be happy!
|
|
|
|