If uncertainty principle is explained by wave function, then doesn't wave function collapse when we measure position or momentum?
The uncertainty principle as the other answers state comes in pairs of variables, being measured whereas the (in)famous collapse of the wave function happens with every measurement.
The wavefunction squared with its complex conjugate gives a probability distribution for finding a particle ( for simplicity) at (x,y,z,t) or with a fourvector (p_x,p_y,p_z,E). A probability distribution is a statistical measure, it needs many instances.
In throwing a dice, if the 6 face comes up the probability that it is up from then on is 1, and one needs to throw again to build up a probability distribution. You can say that the probability distribution has collapsed, because there is no difference with the quantum mechanical probability distribution. One measurement gives a value and from then on it is fixed.
Look at this double slit experiment one electron at a time.
The accumulation is the probability distribution for the quantum mechanical problem "electron scattering through two slits". A single measurement is a point on the screen, and the probability of being at that point ,once it has been measured at that point is 1. That electron's wavefunction has "collapsed".
So any measurement will "collapse" the wavefunction for the individual particle detected. One has to accumulate measurements to register the behavior of the wavefunction.
The uncertainty principle is basic in quantum mechanics but is one step further than the wavefunction, because it separates variables that can be measured together with any accuracy, for each individual particle, with the ones that cannot be measured with great accuracy together.
For example in particle detectors
Incoming K- beam towards +y axis.
The V in the picture with no incoming track is a K0 decay to π+ π- , at a point in the bubble chamber, a "collapse" of its wavefunction.
The connection with the HUP: We measure the momentum from the curvature of the tracks of the particles with an error Δ(p) for each. The Heisenberg uncertainty tells us that we cannot localize the decay point better than the limit given by Δ(p)Δ(x)>h. The greater the accuracy in momentum the more the uncertainty in position. The experimental errors are such that the constraint is fulfilled within experimental errors in the existing measurements.