Visualization of 3D DCT coefficients image
6 ビュー (過去 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?

0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!