|
hey folks,
I've got quite a complex question for you...
suppose I've got two triangles in different pictures. I can easily compute the homography between those.
Is there a way to compute a Homography for each so that the distortion for each triangle is minimized???
I guess the aspect ratio (or diagonals in a square using this homography) can be used for measuring the amount of distortion.
but how to compute those "points in the middle" where distortion is least??
Say, given are:
x_1,x_2,x_3 (for one triangle)
x_4,x_5,x_6 (for the other one)
We want to know:
x_7,x_8,x_9 ( our destination triangle )
We also know:
H*x_i = x_j (where i = 1,2,3 and j=7,8,9)
H = Homography (/Affine transformation)
and
G*x_i = x_j (where i = 4,5,6 and j=7,8,9)
G = Homography (/Affine transformation)
H =
a b t_x
c d t_y
0 0 1
a/d should be minimal... for H and G
Is it true that b=-c because of rotation which gives no distortion??
any hints and links are appreciated
|
|
|
|
|
Hi -
I'm interested in a pet project to create a player which
will play mp3s (or wavs) backwards. I've never done any
mp3 encoding/decoding before, but it seems like it should
be easy to do with the following algorithm:
1 - load wav file
2- extract bytes which correspond to pcm sound data
3 - create a new file with the byte order reversed
4 - play with any old sound dll.
does this seem right? any suggestions on where to find a
specification of a standard wav file? am i correct in assuming
that pcm sound information can be directly reversed?
thanks - @lrg
|
|
|
|
|
Hi,
I think you got the idea right, however it is important to clarify that WAV files may be compressed (ADPCM, A-LAW, u-LAW, etc.). This means that you can find many WAV files whose bytes do not correspond to plain PCM samples.
In general I would say that you should modify your algorithm so that you load a file (WAV or MP3) and then normalize it to linear PCM samples. For ADPCM or x-LAW this may correspond to simple sample-based decompression schemes, for MP3 you should probably get a decoder (there are open source MP3 libraries out there). But please note that MP3 is a licensed technology (even if you get the algorithm or source code legally you still have to pay to use it).
After this normalization stage you simply reverse the samples and write them back to disk (or play them directly from RAM, why not??). The x-LAW files could be played directly simply by reversing the samples (even without decompressing) and saving to file or playing directly (requesting an x-LAW audio output format).
If you want to write to disk then uncompressed WAV is the easiest (just a few header bytes and you're done). If you want to write back MP3 it can be a little trickier (and subject to the same royalty restrictions as the decoder).
Anyway, these comments are for simple C/C++ implementations. The COM interface, C#, JAVA, and other languages and platforms may make the task easier (or not!).
About the WAV format: just search for "wav format specification" and you will find many references. For example, http://ccrma.stanford.edu/courses/422/projects/WaveFormat/[^] seems to be ok.
I hope this helps,
Rilhas
|
|
|
|
|
Thanks Rilhas,
That's just the sort of encouragement I needed. I had concluded the same thing - best to do the actual reversal on the simplest wav file. If I support compressed formats at all, I'll just convert them to basic PCM first using any old library.
Awesome dude!
-@LG
|
|
|
|
|
@largeinsd wrote: 3 - create a new file with the byte order reversed
For PCM wave files, this will only work for 8 bit (and below) waveforms. For anything above, you want to reverse the samples not the byte order. For example, a 16 bit PCM waveform monophonic waveform takes two bytes per sample. You don't want to reverse the byte order within the sample but rather reverse the sample order themselves.
So for example say we have the following values for a 16-bit monophonic waveform:
Sample 1
128 - byte 1
64 - byte 2
Sample 2
78 - byte 1
241 - byte 2
To reverse these samples so that they play backwards, we reverse the sample order while leaving the byte order within the samples alone:
Sample 2
78 - byte 1
241 - byte 2
Sample 1
128 - byte 1
64 - byte 2
Make sense?
|
|
|
|
|
leslie,
makes perfect sense. swap the sample order, but preserve the byte order within.
though i don't understand what you're saying with "128 - byte 1" or "78 - byte 1". what are you getting at with the 128, 64, 78, 241.
thanks - @lg
|
|
|
|
|
@largeinsd wrote: though i don't understand what you're saying with "128 - byte 1" or "78 - byte 1". what are you getting at with the 128, 64, 78, 241.
Those were just random numbers I picked for the byte values within the samples.
|
|
|
|
|
ok, cool.
one other question: how is the data encoded for stereo?
thanks - @lg
|
|
|
|
|
@largeinsd wrote: one other question: how is the data encoded for stereo?
Stereo samples are interleaved. What that means is that the samples alternate between the left and right channels. So you have the bytes that make up an individual sample and the block which is made up of two samples, left and right:
( block 1 ) ( block 2 )
left, right, left, right, etc...
|
|
|
|
|
So reversing the samples to get sound backwards effectively switches left and right !
|
|
|
|
|
Luc Pattyn wrote: So reversing the samples to get sound backwards effectively switches left and right !
Switching left and right just switches the channels, so left becomes right and vice versa. I think I may be missing your point.
In the case of a stereo wave file, we'd want to reverse the blocks while leaving the sample order within the blocks the same.
|
|
|
|
|
To state it in a slightly different way, if you do what has been told so far
to play the sound backwards, you also will be switching left and right channels,
with probably is not be what you want.
|
|
|
|
|
Luc Pattyn wrote: To state it in a slightly different way, if you do what has been told so far
to play the sound backwards, you also will be switching left and right channels,
with probably is not be what you want.
Right. So when reversing a stereo wave file, you'd want to reverse the block order while preserving the sample order within the blocks.
|
|
|
|
|
how to plot a graph using any equation like Y=a(1+sinX) on window??
There Is Nothing Right & Wrong
|
|
|
|
|
What is the domain [0, 2pi] or [0,230] ??
What scaling will you use.
First thing I would do is model this in excel then use that model to code with. You can even add a chart in excel as well to get you head round it.
You need a scaling, this is 1 to 360....or .... 1 to 100 (which you use a x)
Then use a free chart plugin to map x to y
|
|
|
|
|
0 to 2pi
There Is Nothing Right & Wrong
|
|
|
|
|
Well, it's a big topic, However, I can suggest you to:
(1) Put a few constrints on the equation (i.e. continuity maybe helpful, any equation is a bit broad concept...).
(2) Compute the range of the plot (i.e. the rectangle having bounds {XMin, Ymin, XMax, YMax}, notice, YMin, YMax depend upon the X-range). This allows you to set up the proper tranformation from curve domain to the drawing area.
(3) Then you have just to sample a certain amount of points in the interval and connect them.
Each of the above points, I Know, requires further details, but again, it is a rather big topic.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
For x=startX+1 to endX
y1=a(1+sin(x-1))
y2=a(1+sin(x))
connect points: (x-1,y1) and (x,y2)
End
<pre>
<div class="ForumSig">Regards,
Arun Kumar.A</div>
|
|
|
|
|
Hi all!!
Is any1 kind enuf to help me out about password security while developing web applications.
any material
any password security algo
any link
kindly do help me
thanx in advance
|
|
|
|
|
have a look at Crypto API [^] or System.Security.Cryptography [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Have you tried google ?
What development platform are you using as this makes a difference.
|
|
|
|
|
thanx for concern
actually I am developing an e-commerce application in asp.net using c#.
During user registration process, password will be taken from textbox and will be stored in SQL Server DB. i want to do encryption while storing password in DB and algorithm is required here.
|
|
|
|
|
lastFarhi wrote: password will be taken from textbox and will be stored in SQL Server DB. i want to do encryption while storing password in DB and algorithm is required here
Generally, storing a password is bad.
Most people hash the password and store that in the database.
When the user logs in you take the password they give, hash it, and compare this hash to what is stored in the database.
Encrypting the password means you can decrypt it (recover it), encryption is 2-way.
Hashing the password is 1-way, you can't recover the password from the hash.
The SHA family are the most common (current) algorithms.
http://en.wikipedia.org/wiki/SHA-1[^]
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Have you tried looking at the Crytopgraphy Application Block within Enterprise Library. Why not download Entperise Library from MSDN and give it a go. Personally, I find the Crytopgraphy Application Block within Enterprise Library to contain more useful routines than what is available within in the .net framework.
|
|
|
|
|
has anyone marshalled the Intel math kernal library to managed code (aka C#)? An example would be excellent. Thx
|
|
|
|