Displaying GIF Image Matlab
古いコメントを表示
I tried using this code
[X,map] = imread('electricity.gif');
imshow(X,map)
I also tried looking at online help but it does not solve my problem.
Thank you
6 件のコメント
Walter Roberson
2012 年 4 月 21 日
"moves" -- do you mean that it is animated GIF ? If so then do you want it to animate but it currently does not, or does it currently animate and you want it to be static ?
Rooy
2012 年 4 月 21 日
編集済み: Walter Roberson
2019 年 4 月 23 日
Rooy
2012 年 4 月 21 日
BERGHOUT Tarek
2017 年 2 月 6 日
may be u need to create a programe that shows each frame evry time
Maram Abd
2021 年 2 月 6 日
what is the ansower ?
Image Analyst
2021 年 2 月 6 日
@Maram Abd, scroll down to see the "Answers". These are just "Comments" up here which are typically used to ask the poster to clarify the question and/or attach missing data or code. Steve's Image Processing Blog in the blog section here has also discussed GIF images
採用された回答
その他の回答 (2 件)
Walter Roberson
2012 年 4 月 21 日
編集済み: Walter Roberson
2017 年 2 月 6 日
0 投票
GIF Player from File Exchange
3 件のコメント
Gopinath Karuppannan
2020 年 2 月 15 日
Hello Walter
By using GIF player script, i am getting error in the Matrix dimensions. I have attached the error image as well as gif file. Please find in attachment.
Image Analyst
2020 年 2 月 15 日
current_frame is probably an RGB image, and transparent_color might be a 3 element vector so you can't compare them that way. You might have to compare one color channel at a time
redMask = currentFrame(:, :, 1) == transparent_color(1);
greenMask = currentFrame(:, :, 2) == transparent_color(2);
blueMask = currentFrame(:, :, 3) == transparent_color(3);
If you want an overall mask where all 3 are true, then AND them together
mask = redMask & greenMask & blueMask;
FWIW, that error was an error internal to readgif(), which is used internally by imread(). At least as of R2019b, current_frame should be an indexed image during this test (if I recall correctly), and transparent_color should then be a scalar as defined in the file/frame header.
I don't exactly know why readgif() breaks in this one case that nobody needs solved anymore. The file isn't the most common sort of arrangement. There may be GIF functionality imread() doesn't support, and some things it really just can't support in an ideal way due to the conventions for image handling in MATLAB. So don't be surprised if readgif() breaks or returns garbage.
For what it's worth, the file can be re-saved using 'donotspecify' disposal instead of 'leaveinplace', and it reads fine and looks the same.
Rooy
2012 年 4 月 21 日
0 投票
カテゴリ
ヘルプ センター および File Exchange で Display Image についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





