Boost logo

Ublas :

Subject: Re: [ublas] returning a ublas matrix from a function
From: sanann (padalasaisandeep_at_[hidden])
Date: 2014-08-22 03:08:35


I am using boost for image processing, I found the boost::gil a bit too
complicated for a newbie.. so instead i tried using other available
libraries in boost to start off with.

So basically what i want to do is
1. Read a gray scale image.

2. Load the pixel values into a boost matrix.

3. Apply a random filter to the matrix.

4. convert the matrix back into and image for display.

so far what I have done is

   < QPixmap pixmap("lena.bmp");

   pixmap = pixmap.copy(512,512,128,128);
   pixmap = pixmap.scaled(128,128);
   QImage image = pixmap.toImage();
   QRgb col;

   int g;
   int width = pixmap.width();
   int height = pixmap.height();
   matrix<double> m(width,height);

   for (int j = 0; j < m.size2(); j++)
   {
       for (int i = 0; i < m.size1(); i++)
       {
            m(i,j) = qGray(image.pixel(i,j));
       }
   }>

so basically i guess the pixel values are being saved into a matrix 'm' now
i would like to display this matrix as an image is there someway that i can
do this?

thanks in advance

--
View this message in context: http://boost.2283326.n4.nabble.com/returning-a-ublas-matrix-from-a-function-tp4666050p4666751.html
Sent from the Boost - uBLAS mailing list archive at Nabble.com.