Re: orthogonal complement
- From: markeroon@xxxxxxxxx
- Date: 21 Sep 2006 06:56:17 -0700
Peter... you're quite right. Thanks for picking up on that!
Still, even after fixing that problem, I'm still not getting a zero
matrix when I calculate the product of cPerp^t and C. As mentioned
later in the thread, my matrix may not be of full rank and this would
be causing a problem. However, I believe that the final few columns
would still be zero vectors. Strange, to say the least.
Thanks for your help (much appreciated),
-Mark
Peter Spellucci wrote:
In article <1158761766.593934.23540@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
markeroon@xxxxxxxxx writes:
>Hi everybody:
>
>I have an rxc matrix C, and I'm trying to find the othogonal complement
>of its column space. Does it make sense to take the singular value
>decomposition of C (where C=UWV^t) and make the orthogonal complement
>(cPerp) the (r-c)th to (c)th columns of U? I'm not sure if anyone here
>uses the OpenCV image processing library, but I'll attach my source
>anyway for possible clarification:
>
>Ut = cvCreateMat( r, r, CV_32F );
>W = cvCreateMat( r, c, CV_32F );
>Vt = cvCreateMat( c, c, CV_32F );
>cPerp = cvCreateMat( r, r-c, CV_32F );
>
>cvSVD( C, W, Ut, Vt, CV_SVD_U_T|CV_ SVD_V_T ); //both are transposed
>
>// make U
>CvMat* U = cvCreateMat( r, r, CV_32F );
>cvTranspose( Ut, U );
>
>//copy the r-c to r columns to the new vector
>for( int i=0; i<rows; i++ ) {
> for( int j=0; j<(rows-cols) ; j++ ) {
> CV_MAT_ELEM( *cPerp, float, i, j ) = cvmGet( U, i,j+(rows-cols)
>);
> }
>}
>
>The logic seems fine to me,
>but when I multiply C and cPerp together (using cvMatMul or
>cvMatMulAdd) , I don't get zeros as my elements. Am I making some
>fundamental error?
>
>Thanks in advance for any insight,
>-Mark
>
your idea is quite o.k.:
if
r=rows>c=cols
and
C = U * W * V'
U is r times r , V' is c times c and W diagonal nonnegative of the
same shape as C , U, V unitary, then you get
U(:,c:r-1)'*C=O
but in your code you have forgotten :
rows=r;
cols=c;
and shouldn't it read
CV_MAT_ELEM( *cPerp, float, i, j ) = cvmGet( U, i,j+cols)
????
hth
peter
.
- References:
- orthogonal complement
- From: markeroon
- Re: orthogonal complement
- From: Peter Spellucci
- orthogonal complement
- Prev by Date: Re: orthogonal complement
- Next by Date: Re: orthogonal complement
- Previous by thread: Re: orthogonal complement
- Next by thread: Re: orthogonal complement
- Index(es):
Relevant Pages
|