Prev: plot
Next: NDsolve problem
From: Alessandro on
is it possible to have a not rectangular image in Mathematica?

I have a lot of images acquired by microscope - they are all squared,
with the circular field of view surrounded by black.
I'd like - for further processing - to crop all the black region
outside the circle.

Or perhaps images are all rectangular in M?

alessandro

From: Patrick Scheibe on
Hi,

> is it possible to have a not rectangular image in Mathematica?

no. You can of course use SparseArray to create one and therefore you
could create an image where you don't have to specify the whole image
matrix

Image[SparseArray[{{1, 1} -> 0.3, {7, 2} -> 0.5, {9, 9} -> 1}, {10,
10}]]

but internally it stores the whole matrix

InputForm[%]


> I have a lot of images acquired by microscope - they are all squared,
> with the circular field of view surrounded by black.
> I'd like - for further processing - to crop all the black region
> outside the circle.

but if the outside of your circular region is black then it is already
croped in some way because filters like binarization, blur-filters,
segmentation, registration, ... will ignore the black regions. I don't
see your concerns.

Cheers
Patrick


From: Christopher Arthur on
AspectRatio->1
PlotRegion->{{xmin,xmax},{ymin,ymax}}


Alessandro a =E9crit :
> is it possible to have a not rectangular image in Mathematica?
>
> I have a lot of images acquired by microscope - they are all squared,
> with the circular field of view surrounded by black.
> I'd like - for further processing - to crop all the black region
> outside the circle.
>
> Or perhaps images are all rectangular in M?
>
> alessandro
>
>
>


From: Helen Read on
On 7/2/2010 7:28 AM, Alessandro wrote:
> is it possible to have a not rectangular image in Mathematica?
>
> I have a lot of images acquired by microscope - they are all squared,
> with the circular field of view surrounded by black.
> I'd like - for further processing - to crop all the black region
> outside the circle.
>
> Or perhaps images are all rectangular in M?

disk = Graphics[Disk[]]

ImageAdd[disk, pic]

Where pic is your original image. You might have to adjust the size of
the disk.

See the Documentation for lots of other functions for working with images:

guide/ImageProcessing


--
Helen Read
University of Vermont

From: David Bailey on
On 03/07/10 13:20, Patrick Scheibe wrote:
> Hi,
>
>> is it possible to have a not rectangular image in Mathematica?
>
> no. You can of course use SparseArray to create one and therefore you
> could create an image where you don't have to specify the whole image
> matrix
>
> Image[SparseArray[{{1, 1} -> 0.3, {7, 2} -> 0.5, {9, 9} -> 1}, {10,
> 10}]]
>
> but internally it stores the whole matrix
>
> InputForm[%]
>
>
>> I have a lot of images acquired by microscope - they are all squared,
>> with the circular field of view surrounded by black.
>> I'd like - for further processing - to crop all the black region
>> outside the circle.
>
> but if the outside of your circular region is black then it is already
> croped in some way because filters like binarization, blur-filters,
> segmentation, registration, ... will ignore the black regions. I don't
> see your concerns.
>
> Cheers
> Patrick
>
>
Of course, you can fill the black part of your image with a totally
transparent 'colour' using the 4-argument form of RGBColor. That will
mean that you can place the image over other graphics, and only the
circular region will obscure what is underneath.

David Bailey

http://www.dbaileyconsultancy.co.uk

 | 
Pages: 1
Prev: plot
Next: NDsolve problem