| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 
 |  
#include <iostream>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <cv.h>
#include <highgui.h>
 
using namespace std;
using namespace cv;
 
int main()
{
    IplImage* in = cvLoadImage( "cameraman.tif",0);
    int w,h;
    w = (*in).width;
    h = (*in).height;
    CvMat* matt = cvCreateMat(h,w,CV_32F);
    cvGetMat(in,matt,0,0);
 
    CvMat* U  = cvCreateMat(h,h,CV_32F);
    CvMat* W  = cvCreateMat(h,w,CV_32F);
    CvMat* V  = cvCreateMat(w,w,CV_32F);
 
    cvSVD(matt, W, NULL, NULL,0);
 
    cout<<"EigenValues"<<endl;
    return 0;
} |