I am been trying and getting the error even though the file name is same
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
% Clear workspace and command window
clear all;
clc;
close all;
% Read images with different exposure times
I1 = imread('scene1.png');
I2 = imread('scene2.png');
I3 = imread('scene3.png');
% Convert images to double precision
I1 = double(I1);
I2 = double(I2);
I3 = double(I3);
% Combine images to create HDR image
HDR = I1 + I2 + I3;
% Normalize the HDR image to the range [0, 255]
HDR_normalized = uint8(255 * mat2gray(HDR));
% Display the normalized HDR image
imshow(HDR_normalized);
title('Normalized HDR Image');
Error using imread>get_full_filename
File "scene1.png" does not exist.
Error in imread (line 372)
fullname = get_full_filename(filename);
Error in untitled (line 11)
I1 = imread('scene1.png'); % Update the filename and extension if necessary
2 comentarios
Walter Roberson
el 23 de Oct. de 2024
Or possibly scene1 exists but has a different file extension such as scene1.jpg
Respuestas (1)
Jayanti
el 23 de Oct. de 2024
Hi Omeir,
The error message suggest that MATLAB is unable to find the file “scene1.png” in the current directory. This can happen if the file is not located where MATLAB is currently looking.
To list files with a specific extension, such as “.png”, you can use the “dir” function. You can see the list of “png” files present by typing the below code in the MATLAB command window.
pngFiles = dir('*.png');
for i = 1:length(pngFiles)
disp(pngFiles(i).name);
end
If the needed “png” is not listed, you can follow any one of the below steps:
- Consider moving "scene1.png" and all other files to the current working directory where your MATLAB script is running.
- Specify the full path to the file in your code.
I1 = imread('full_path_to_your_images\scene1.png');
3. You can add the directory where “scene1.png” is located to the MATLAB path.
addpath('full_path_to_your_images\scene1.png');
Hope this will resolve your query!
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!