Click here to Skip to main content
15,884,298 members
Articles / Programming Languages / C++

STL like template based coding with the MMX/SSE extension

Rate me:
Please Sign up or sign in to vote.
4.76/5 (17 votes)
17 Nov 20062 min read 113.8K   669   45  
STL like template based coding with the MMX/SSE extension using OpenCV, vigra, and boost.
/************************************************************************/
/*                                                                      */
/*               Copyright 2004-2005 by Hirotaka Niitsuma               */
/*                                                                      */
/*                                                                      */
/*    This file is part of the STLLCV computer vision library.          */
/*    ( Version 0.1, Sep 28 2005 )                                      */
/*    You may use, modify, and distribute this software according       */
/*    to the terms stated in the LICENSE file included in               */
/*    the STLLCV distribution.                                          */
/*                                                                      */
/*    The STLLCV Website is                                             */
/*        http://www2s.biglobe.ne.jp/~niitsuma/STLLCV/                  */
/*    Please direct questions, bug reports, and contributions to        */
/*        niitsuma@mub.biglobe.ne.jp�@�@�@                              */
/*                                                                      */
/*  THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY EXPRESS OR          */
/*  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED      */
/*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
/*                                                                      */
/************************************************************************/

#include "stllcv/ublascvmatrix.hxx"

using namespace stllcv; 

int main(int argc, char * argv[])
{
	//init as identity_matrix
	CWrapCvMat<boost::numeric::ublas::matrix<float> > mat((boost::numeric::ublas::matrix<float>)boost::numeric::ublas::identity_matrix<float>(4));
	std::cout << "mat= " << mat  << std::endl;
	
	

	CWrapCvMat<boost::numeric::ublas::matrix<float> > matI((boost::numeric::ublas::matrix<float>)boost::numeric::ublas::identity_matrix<float>(4)); 

	//multiple as uBLAS
	mat *= 2 ; 
	std::cout << "mat= " << mat  << std::endl;

	cvmInvert(&(CvMat)mat, &(CvMat)matI );
	std::cout << "matI= " << matI  << std::endl;


	cvInvert(mat.pCvMat, matI.pCvMat );
	std::cout << "matI= " << matI  << std::endl;




	return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Japan Japan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions