Visualization of 3D DCT coefficients image

5 次查看(过去 30 天)
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?

采纳的回答

praguna manvi
praguna manvi 2025-1-2
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!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by