Visualization of 3D DCT coefficients image

7 views (last 30 days)
I need to visualize 3D DCT coefficients like the example image below. My 3d dct coefficient vector is F. My dct coefficient vector F
For my problem w=93, u=20, v=7. I need this scales dct coefficients visualization. Can you help me please?

Accepted Answer

praguna manvi
praguna manvi on 2 Jan 2025
As I see you are looking to visualize 3D DCT coefficients which can be achieved using the "scatter3" function along with a "colorbar" to obtain a matching plot as described above. Here is a sample code with a random coefficient vector "F":
% Assuming F is your 3D DCT coefficient vector
% F should be a 3D matrix of size (w, u, v)
w = 93;
u = 20;
v = 7;
% Replace with your actual data.
F = randn(w, u, v);
% Compute the energy spectrum
energy_spectrum = abs(F).^2;
% Create a 3D grid for plotting
[x, y, z] = ndgrid(1:w, 1:u, 1:v);
% Flatten the data for scatter3 plotting
x_flat = x(:);
y_flat = y(:);
z_flat = z(:);
energy_flat = energy_spectrum(:);
% Create a 3D scatter plot
figure;
scatter3(x_flat, y_flat, z_flat, 36, energy_flat, 'filled');
% Add color map
colormap(hot);
colorbar; % Display colorbar to show the energy scale
% Set plot labels and title
xlabel('W-axis');
ylabel('U-axis');
zlabel('V-axis');
title('3D DCT Energy Spectrum');
% Adjust view angle for better visualization
view(135, 30);
For more information on usage of "scatter3" function refer to the following link below:
Hope this helps!

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!