Contribution from all pixels to 1 pixel
Mostra commenti meno recenti
Hello all,
I've got a series of 2D image slices, with each pixel being a measure of intensity. I'm looking to work out the contribution from all pixels to each individual pixel using a function relating the intensity of each pixel to the distance from the contributing pixel. Would anyone know a fast efficient way to do this? I've tried a function using cumsum but its not going to plan
Thanks
Jim
Risposte (1)
Image Analyst
il 2 Ago 2012
0 voti
Why do you think that all other pixels have any influence on one single pixel? Do you know your image is , say, blurred with a large point spread function? If so, have you tried inverse filtering or wiener filtering or richardson-lucy deconvolution?
12 Commenti
Jim O'Doherty
il 3 Ago 2012
Image Analyst
il 3 Ago 2012
I think you're going to have to do that by scanning your volume and doing the calculations. It would take far too much memory to do something like bwdist() for every pixel in the volume and store it. Maybe you can use bwdist as you scan and get the distance transform for every pixel, but you can't store the EDT for every voxel, nor do you need to.
Image Analyst
il 3 Ago 2012
That will happen, even for mathematically perfect scaling. Just look at your diagrams and imagine what's going to happen to that bay as your "constant distance" increases. You're going to close off that bay. You can use imresize to maintain the shape at a larger resolution but it won't be a constant distance anymore.
Jim O'Doherty
il 4 Ago 2012
Jim O'Doherty
il 4 Ago 2012
Image Analyst
il 4 Ago 2012
That doesn't look right. You've calculating a new d array for every pixel. You're overwriting it because its indexes don't depend on pxRow and pxCol. Maybe I'm misunderstanding what you want but if you want the distance of every pixel to every other pixels, then...well let's just take the upper left pixels and let's say you have a million pixels. So for that upper left pixel you have a million distances. And you have another million distances for the pixel next to it, and so on. Every one of the million pixels will have a million distances. So the grand total is a billion distances, or about 8 GB of memory. I see no reason why you need to store all of those in memory at one time.
Jim O'Doherty
il 5 Ago 2012
Image Analyst
il 6 Ago 2012
Well I think you know what those are. 4 of them will be 1 and 4 of them will be sqrt(2).
Walter Roberson
il 6 Ago 2012
And this would seem to be a good application of conv2() with a square kernel of the distances away from the center pixel. Something like
s2r = 1/sqrt(2);
kernel = [s2r, 1, s2r; 1, 0, 1; s2r, 1, s2r];
Jim O'Doherty
il 6 Ago 2012
Modificato: Jim O'Doherty
il 6 Ago 2012
Walter Roberson
il 6 Ago 2012
kernels specify a pattern of multiplications and additions, that are to be used in a "sliding window" manner.
When the distances are sqrt(2) do you want to add the full voxel value to the central voxel, or do you want to add the value divided by sqrt(2) ?
If you want to add the full voxel value, then your kernel would, I think, be simply ones(3,3,3)
Jim O'Doherty
il 8 Ago 2012
Modificato: Jim O'Doherty
il 8 Ago 2012
Categorie
Scopri di più su Image Segmentation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!