Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
loglog representation of an image

Subject: loglog representation of an image

From: carlos lopez

Date: 26 Mar, 2012 23:35:13

Message: 1 of 7

Hello:
I want to perform a 2D PSD analysis of some raster data (an image), which in turn produces another image. Its row/columns are now not spatial indices but frequencies. Since my PSD appears not to be easily interpretable, I am looking for some alternatives. One possibility is to represent the function with log scale in both frequencies. Is there any hint/package which resamples the image resulting from the 2D PSD using log scaling?
Regards
Carlos

PD: my (few) lines of code are presently
load MSVdata %holds matrix krigedData and GroundTruth
sesgo=mean(krigedData(:)-GroundTruth(:));
F = fftshift( abs( fft2(krigedData-GroundTruth-sesgo) ).^2 );
[M,N]=size(F);
imagesc(lF(1:floor(M/2),1:floor(N/2))); colorbar;

Subject: loglog representation of an image

From: ImageAnalyst

Date: 27 Mar, 2012 01:40:04

Message: 2 of 7

My earlier reply was sampling intensities in a log scale. That
probably wasn't what you wanted, though that is often used to make the
spectrum easier to see. You can use interp2() to resample your 2D
array with a non-linear sampling in the lateral dimensions. I think
that's what you are wanting.

Subject: loglog representation of an image

From: ImageAnalyst

Date: 27 Mar, 2012 01:37:18

Message: 3 of 7

Why can't you just do

logF = log(F); % Take log
imshow(logF, []); % Display log of the intensity
colormap(jet(256)); % Make a colormap and apply it.
colorbar; % Display a colorbar.

Subject: loglog representation of an image

From: carlos lopez

Date: 27 Mar, 2012 21:06:17

Message: 4 of 7

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <7b1a8dce-f078-458a-b787-d7e74028c58d@wb9g2000pbc.googlegroups.com>...
> Why can't you just do
>
> logF = log(F); % Take log
> imshow(logF, []); % Display log of the intensity
> colormap(jet(256)); % Make a colormap and apply it.
> colorbar; % Display a colorbar.
Hello:
That's not the goal. After the 2D PSD is performed, a function h(fx,fy) is represented as an image (fx means frequency related to spatial dimension x; same for y)
Representing h(log(fx),log(fy)) is different to log(h(x,y)).
I am not an expert on 2D PSD; just familiar with 1D PSD for turbulence applications. Thus, from the expected answers I want to know:
a) if what I am requesting is nonsense
b) not to reinvent the wheel if there is already some code available.
Regards, and thank you in advance for your opinions.
Carlos

Subject: loglog representation of an image

From: carlos lopez

Date: 27 Mar, 2012 21:10:19

Message: 5 of 7

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <39210e7f-ec25-4517-80de-bd7be91a9460@oq7g2000pbb.googlegroups.com>...
> My earlier reply was sampling intensities in a log scale. That
> probably wasn't what you wanted, though that is often used to make the
> spectrum easier to see. You can use interp2() to resample your 2D
> array with a non-linear sampling in the lateral dimensions. I think
> that's what you are wanting.
Hello, ImageAnalyst:
For some reason your first comment appears in my browser in the last position, and I have ignored in my answer.
Yes: merely sampling intensities in the log scale is not what I am intended to achieve.
Regards
Carlos

Subject: loglog representation of an image

From: ImageAnalyst

Date: 27 Mar, 2012 21:16:37

Message: 6 of 7

On Mar 27, 5:10 pm, "carlos lopez" <clv2clv_000000...@adinet.com.uy>
wrote:
> ImageAnalyst <imageanal...@mailinator.com> wrote in message <39210e7f-ec25-4517-80de-bd7be91a9...@oq7g2000pbb.googlegroups.com>...
> > My earlier reply was sampling intensities in a log scale.  That
> > probably wasn't what you wanted, though that is often used to make the
> > spectrum easier to see.  You can use interp2() to resample your 2D
> > array with a non-linear sampling in the lateral dimensions.  I think
> > that's what you are wanting.
>
> Hello, ImageAnalyst:
> For some reason your first comment appears in my browser in the last position, and I have ignored in my answer.
> Yes: merely sampling intensities in the log scale is not what I am intended to achieve.
> Regards
> Carlos

-----------------------------------------------------------------------------------
OK, but what about resampling spatially using interp2() like I
suggested?

Subject: loglog representation of an image

From: carlos lopez

Date: 28 Mar, 2012 00:24:24

Message: 7 of 7

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <29bbd516-3fd8-4cc8-8087-99559d82117d@wb9g2000pbc.googlegroups.com>...
> On Mar 27, 5:10 pm, "carlos lopez" <clv2clv_000000...@adinet.com.uy>
> wrote:
> -----------------------------------------------------------------------------------
> OK, but what about resampling spatially using interp2() like I suggested?
Probably it is the cleanest solution. I'll give it a try.
Thank you a lot
Carlos

Tags for this Thread

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.

Contact us