PARP Research Group | Universidad de Murcia |

## Interoperability with OctaveTo enable the QVision to inter-operate with Octave, the following line must be not commented at the CONFIG += qvoctave QVision applications will automatically link to the include and binary files for the Octave library. ## Converting QVision objects from and to Octave library typesThe QVision includes functionality to convert QVMatrix objects from and to Octave // First create an Octave matrix Matrix octMatrix(rows, cols); // Next, init the contents of the OpenCV matrix. [...] // Converts the Octave matrix to a QVision matrix QVMatrix qvMatrix = octMatrix; // Do things with the QVision matrix [...] // Convert back the QVision matrix to a new Octave matrix Matrix octMatrix2 = qvMatrix; ## Using QVMatrices with functions of the Octave libraryYou can generally use QVMatrix objects directly with Octave library functions and code. This is so because the QVMatrix class provides a constructor and a cast operator, to convert QVMatrix objects from and to Matrix objects, transparently to the programmer. The following code uses Octave library functionality to obtain the Hessenberg decomposition of a square QVMatrix A = QVMatrix::random(3,3); HESS hessA(A); // Hessenberg decomposition of matrix 'A' const QVMatrix H = hessA.hess_matrix(), P = hessA.unitary_hess_matrix(); When executing this code, matrices A = QVMatrix (3, 3) [ [ 0.215825 0.431953 0.226107 ] [ 0.920128 0.281059 0.276235 ] [ 0.881062 0.307458 0.416501 ] ] H = QVMatrix (3, 3) [ [ 0.215825 -0.468366 -0.135431 ] [ -1.273933 0.637416 -0.064699 ] [ 0.000000 -0.095923 0.060145 ] ] P = QVMatrix (3, 3) [ [ 1.000000 0.000000 0.000000 ] [ 0.000000 -0.722273 -0.691608 ] [ 0.000000 -0.691608 0.722273 ] ] P*H*P' = QVMatrix (3, 3) [ [ 0.215825 0.431953 0.226107 ] [ 0.920128 0.281059 0.276235 ] [ 0.881062 0.307458 0.416501 ] ] To enable the QVision to interoperate with Octave, the following line must be present (and un-commented) at the CONFIG += qvoctave QVision applications will automatically link to the include and binary files for the Octave library. ## Converting QVision objects from and to Octave library typesThe QVision includes functionality to convert QVMatrix objects from and to Octave // First create an Octave matrix Matrix octMatrix(rows, cols); // Next, init the contents of the OpenCV matrix. [...] // Converts the Octave matrix to a QVision matrix QVMatrix qvMatrix = octMatrix; // Do things with the QVision matrix [...] // Convert back the QVision matrix to a new Octave matrix Matrix octMatrix2 = qvMatrix; ## Using QVMatrices with functions of the Octave libraryYou can generally use QVMatrix objects directly with Octave library functions and code. This is so because the QVMatrix class provides a constructor and a cast operator, to convert QVMatrix objects from and to Matrix objects, transparently to the programmer. The following code uses Octave library functionality to obtain the Hessenberg decomposition of a square QVMatrix A = QVMatrix::random(3,3); HESS hessA(A); // Hessenberg decomposition of matrix 'A' const QVMatrix H = hessA.hess_matrix(), P = hessA.unitary_hess_matrix(); When executing this code, matrices A = QVMatrix (3, 3) [ [ 0.215825 0.431953 0.226107 ] [ 0.920128 0.281059 0.276235 ] [ 0.881062 0.307458 0.416501 ] ] H = QVMatrix (3, 3) [ [ 0.215825 -0.468366 -0.135431 ] [ -1.273933 0.637416 -0.064699 ] [ 0.000000 -0.095923 0.060145 ] ] P = QVMatrix (3, 3) [ [ 1.000000 0.000000 0.000000 ] [ 0.000000 -0.722273 -0.691608 ] [ 0.000000 -0.691608 0.722273 ] ] P*H*P' = QVMatrix (3, 3) [ [ 0.215825 0.431953 0.226107 ] [ 0.920128 0.281059 0.276235 ] [ 0.881062 0.307458 0.416501 ] ] |