how to convert a graph from the satellite data to an image form

% Import satellite data
set_data = imread('satellite_data.jpg');
% Reshape the data into an image format
sat_image = reshape(sat_data,[512 ,512]);
% Apply a filter to smooth the image
sat_image_filtered = medfilt2(sat_image, [3,3]);
% Display the image
imshow(sat_image_filtered);

回答 (2 件)

Shaik
Shaik 2023 年 5 月 15 日

0 投票

% Import satellite data
sat_data = imread('satellite_data.jpg');
% Reshape the data into an image format
[rows, columns, ~] = size(sat_data);
sat_image = reshape(sat_data, rows, columns);
% Apply a filter to smooth the image
sat_image_filtered = medfilt2(sat_image, [3, 3]);
% Display the image
imshow(sat_image_filtered);
Hi, try this
Walter Roberson
Walter Roberson 2023 年 5 月 15 日

0 投票

jpg files are almost always rgb (but on rare occasions are grayscale). If the file is rgb then the number of elements in the file is a multiple of 3. You reshape the image to 512 by 512, but that implies that you have 2^18 elements in the file and that is never a multiple of 3.
I wonder if you want imresize instead of reshape()?

カテゴリ

ヘルプ センター および File Exchange で Reference Applications についてさらに検索

製品

質問済み:

2023 年 5 月 15 日

回答済み:

2023 年 5 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by