Thread Subject: How can I "granulate" an image?

Subject: How can I "granulate" an image?

From: Ida Haggstrom

Date: 25 Oct, 2008 11:36:02

Message: 1 of 5

Hi!
I wonder if anyone knows if it's possible to display an image, not as usual with the whole pixel a certain graylevel, but as a point instead. I.e., I want the image "granulated" so that adjacent pixels don't touch when displayed. Thanks!
/Ida

Subject: How can I "granulate" an image?

From: ImageAnalyst

Date: 26 Oct, 2008 00:45:18

Message: 2 of 5

On Oct 25, 7:36=A0am, "Ida Haggstrom" <ida_haggst...@yahoo.se> wrote:
> Hi!
> I wonder if anyone knows if it's possible to display an image, not as usu=
al with the whole pixel a certain graylevel, but as a point instead. I.e., =
I want the image "granulated" so that adjacent pixels don't touch when disp=
layed. Thanks!
> /Ida
---------------------------------------------------------------------------
Ida:
I'm not aware of any way to do this that's built-in. You'd have to do
it yourself by writing the pixels spaced out on a larger black image.
Why do you want to do this?
Regards,
ImageAnalyst

Subject: How can I "granulate" an image?

From: Adam Chapman

Date: 26 Oct, 2008 10:37:05

Message: 3 of 5

On Oct 25, 11:36=A0am, "Ida Haggstrom" <ida_haggst...@yahoo.se> wrote:
> Hi!
> I wonder if anyone knows if it's possible to display an image, not as usu=
al with the whole pixel a certain graylevel, but as a point instead. I.e., =
I want the image "granulated" so that adjacent pixels don't touch when disp=
layed. Thanks!
> /Ida

The only way I can imagine would be to strech out the image you have,
and fill whote pixels between:

%double image size
im=3Dimresize(im,[2*size(im,1), 2*size(im,2)]);

%fill every other column and row with white
im(1:2:size(im,1),:)=3D1;
im(:,1:2:size(im,2))=3D1;

imshow(im,[])

The above code woulfd be for a grayscale image with intensity 0-1.
Fill with pixel intensity 255 for 8-bit pixel intensities, and for rgb
images you would need to fill rows and columns in each colour chanel.

Hope this helps,
Adam

Subject: How can I "granulate" an image?

From: Ida Haggstrom

Date: 26 Oct, 2008 11:51:02

Message: 4 of 5

Hi, and thanks for a quick reply!
The reason for wanting to "granulate" the image is that I have a stack of 2D PET images, which I build into a 3D volume using the program vol3d.m (http://www.mathworks.com/matlabcentral/fileexchange/4927). I use alphamap to set the transparency so I can rotate the volume and see the insisde of the volume also. However, the volume turnout with quite low contrast, and it's hard to se the details. I figured maybe it would be clearer with a more granular image, with the spacing inbetween completely transparent. I will try doubling the image size and see what happens! =) Thanks!
/Ida

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <e76cc0ca-1371-4f8d-afe1-acf19896c539@e2g2000hsh.googlegroups.com>...
> On Oct 25, 7:36=A0am, "Ida Haggstrom" <ida_haggst...@yahoo.se> wrote:
> > Hi!
> > I wonder if anyone knows if it's possible to display an image, not as usu=
> al with the whole pixel a certain graylevel, but as a point instead. I.e., =
> I want the image "granulated" so that adjacent pixels don't touch when disp=
> layed. Thanks!
> > /Ida
> ---------------------------------------------------------------------------
> Ida:
> I'm not aware of any way to do this that's built-in. You'd have to do
> it yourself by writing the pixels spaced out on a larger black image.
> Why do you want to do this?
> Regards,
> ImageAnalyst

Subject: How can I "granulate" an image?

From: Per Sundqvist

Date: 26 Oct, 2008 12:56:02

Message: 5 of 5

"Ida Haggstrom" <ida_haggstrom@yahoo.se> wrote in message <gdv0b2$l17$1@fred.mathworks.com>...
> Hi!
> I wonder if anyone knows if it's possible to display an image, not as usual with the whole pixel a certain graylevel, but as a point instead. I.e., I want the image "granulated" so that adjacent pixels don't touch when displayed. Thanks!
> /Ida

Hi, use scatter to do it:

%--- generate an image-matrix in gray scale
I=rand(4,8)'; % I=imread('filename');
[row,col]=size(I);
[X,Y]=meshgrid(1:row,1:col);
A=1900;%area of pixel
figure(1), clf;scatter(X(:),Y(:),A,I(:),'o','filled');
colormap gray;axis equal;axis tight;axis off

help plot ('o','d','<',...),
help scatter

/Per

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
image granule g... Ida Haggstrom 25 Oct, 2008 07:40:05
rssFeed for this Thread

Contact us at files@mathworks.com