Boost logo

Ublas :

Subject: Re: [ublas] returning a ublas matrix from a function
From: Joaquim Duran (jduran.gm_at_[hidden])
Date: 2014-08-22 03:32:23


Ublas is a library for algebra, so the matrices or vectors could not
be displayed as an image. IMO, you should:

1 - Copy the contents of a GIL image to a matrix.

2 - Manipulate the contents of the matrix: filter,....

3 - Copy the matrix to a GIL image

4 - Show the contents of the new image.

Joaquim Duran

2014-08-22 9:08 GMT+02:00 sanann <padalasaisandeep_at_[hidden]>:
> 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-tp4666050p4666752.html
> Sent from the Boost - uBLAS mailing list archive at Nabble.com.
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: jduran.gm_at_[hidden]