Re: Generating a random matrix through a natural image
- From: Dev <gunadp@xxxxxxxxx>
- Date: Wed, 20 Aug 2008 16:31:07 -0700 (PDT)
On Aug 21, 3:14 am, aruzinsky <aruzin...@xxxxxxxxxxxxxxxxxxxx> wrote:
On Aug 20, 2:31 am, Dev <gun...@xxxxxxxxx> wrote:
On Aug 20, 1:32 pm, Edward Rosten <Edward.Ros...@xxxxxxxxx> wrote:
On Aug 19, 3:05 am, Dev <gun...@xxxxxxxxx> wrote:
Hi All,
I want to create a random valued matrix from a natural image matrix..
For example, if we take the lena image 256x256, the pixel values in
the matrix 256x256 should be arranged in such a way that the values
are not related to each other. Basically, I should have the same
histogram from the two matrices, but I want to remove dependencies
between pixels in a natural image. I used the algintrlv method in
matlab,
image_file = imread('E:\TestData\lena.jpg');
im1 = algintrlv(image_file,128,'takeshita-costello',125,126);
try
im1 = zeros(size(image_file));
im1(:) = randperm(image_file(:));
-Ed
--
(You can't go wrong with psycho-rats.)(http://mi.eng.cam.ac.uk/~er258)
/d{def}def/f{/Times s selectfont}d/s{11}d/r{roll}d f 2/m{moveto}d -1
r 230 350 m 0 1 179{ 1 index show 88 rotate 4 mul 0 rmoveto}for/s 12
d f pop 235 420 translate 0 0 moveto 1 2 scale show showpage
Thanks for all the replies. I tried the ones sent by Thomas and
Edward, but came up with problems. For aruzinsky's method, can you pls
send me the algorithm, so that I can try it out? Meanwhile I tried a
dewhitening method, though it takes away the correlations, it doesn't
give the same histogram. Any further help is greatly appreciated.
Thanks,
Dev- Hide quoted text -
- Show quoted text -
I believe illywhacker is correct, you can't get rid of correlations by
permuting the pixels. However, I suspect that, for a 256x256 image,
the correlations are sufficiently close to zero for most or all
practical intents and purposes.
You take any sorting algorithm and modify it to operate on two arrays,
array1 and array2. Comparisons are made only on the elements of
array1, whereas element movements are made on both arrays. Thus,
"array2 is sorted with respect to values in array1." Alternatively,
you can modify a sorting algorithm to sort an array2 of indices
without sorting array1.- Hide quoted text -
- Show quoted text -
Just to clarify my intention, I am testing an algorithm fro
deconvolution. The algorithm works perfectly for a random image, but
not for a natural image like lena. So I want to test whether there's
any effect on correlation of pixels to my algorithm. For that I need
to take away the correlation between pixels in the lena image, but
keep the same histogram, so that the values are same.
.
- Follow-Ups:
- Re: Generating a random matrix through a natural image
- From: Martin Brown
- Re: Generating a random matrix through a natural image
- References:
- Generating a random matrix through a natural image
- From: Dev
- Re: Generating a random matrix through a natural image
- From: Edward Rosten
- Generating a random matrix through a natural image
- Prev by Date: Re: Generating a random matrix through a natural image
- Next by Date: Image comparison in OpenCV
- Previous by thread: Re: Generating a random matrix through a natural image
- Next by thread: Re: Generating a random matrix through a natural image
- Index(es):