|
Re: homography matrix: msg#01195lib.opencv
--- In OpenCV@xxxxxxxxxxxxxxx, Fadi Chakik <fadichakik@...> wrote: > > Hello, > > Is there any possible way using OpenCV to initialize MANUALLY and explicitly the homography matrix. I have only one view (image) on which I would like to apply a random projective transformation. > > I tried to define H like: > > #define PI 3.1415926535897932384626433832795 > > CvMat* HomographyMatrix = cvCreateMatHeader(3,3,CV_64FC1); > IplImage *srcImage, *srcImageWarped; > double m[9]; > > float theta=phi=PI; //random values just for testing > float lambda1=1, lambda2=0.2; //random values just for testing > > m[0]= cos(theta); > m[1]= -sin(theta)*sin(phi); > m[2]= -sin(theta)*cos(phi); > m[3]= 0; > m[4]= 1/(lambda1*cos(phi)); > m[5]= -1/(lambda1*sin(phi)); > m[6]= sin(theta); > m[7]= 1/(lambda2*cos(theta)*sin(phi)); > m[8]= 1/(lambda2*cos(theta)*cos(phi)); > cvInitMatHeader( HomographyMatrix, 3, 3, CV_64FC1, m ); > > cvWarpPerspective(srcImage, srcImageWarped, HomographyMatrix, CV_WARP_FILL_OUTLIERS, cvScalarAll(0)); > > > I got always error on cvWarpPerspective: "bad flag (parameter or structure field) (unrecognized or unsupported arraytype) in function cvGetMat, cxcore\src\cxarray.cpp (2863)". > > Help will be appreciated. > > Is there any way to initialize the matrix without randmoly without passing throught phi, theta and lambdai. > > Thank you. > -Fadi > > > --------------------------------- > Yahoo! Mail > Use Photomail to share photos without annoying attachments. > > [Non-text portions of this message have been removed] > Hi, I am studying perspective transform. And the same error "unrecognized or unsupported arraytype" occured during calculation of matrix. I change CV_64FC1 type. Look at carefully function definiton. And change number that end of type "CV_64FC'1'" 1,2,3,4 . When you compile it OpenCV give error and line number due to error. In MS Visual studio Edit->GoTo: write line number when page that contain opencv function you use. It will show you why error occured. Sinan Change settings: http://www.yahoogroups.com/mygroups, select Get Emails (get all posts) Daily Digest (one summary email per day) Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-unsubscribe@xxxxxxxxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: How to access pixels - urgent question: 01195, Luiz Curado |
|---|---|
| Next by Date: | cvLoadImage throws exception when used in a .NET Thread: 01195, wesley |
| Previous by Thread: | Interpolation on border of image (when wraping)i: 01195, Alejandro F. Reimondo |
| Next by Thread: | High Pass filter with OpenCV: 01195, gregoryseront |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |