Image to Vector
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
0 投票
Hi,
How Can I convert a JPEG image into a vector?
Thanks, Ashish
1 件のコメント
Chandra Kurniawan
2011 年 12 月 18 日
Vectorization??
Did you mean tracing??
Something such converting raster image to vector??
採用された回答
Jan
2011 年 12 月 18 日
It depends.
You cannot convert a "JPEG image". JPEG is a file format and files are stored sequentially always. Therefore it is a kind of vector already.
The contents of the JPEG file can be imported as array using imread:
Img = imread(FileName);
For gray-scale images this is a 2D-matrix, for RGB-JPEGs this is a [Width x Height x 3] array. You can convert both to a vector by:
ImgVector = Img(:);
% Or:
ImgVector = rehsape(Img, 1, []);
But I cannot imagine how this could be useful.
9 件のコメント
Image Analyst
2011 年 12 月 18 日
Well one use is that you can do this
meanValue = mean(imageArray2D(:));
instead of
meanValue = mean(mean(imageArray));
(similar for min, max, and sum)
but somehow I don't think that's what he meant.
Jan
2011 年 12 月 18 日
What abount mean2 - a function which I will never use...
Image Analyst
2011 年 12 月 18 日
Yes, you could use that. I don't think there are corresponding "2" versions of all functions though, just some - for some weird reason.
Jan
2011 年 12 月 18 日
@Image Analyse: Sigh, sometimes it is tedious, if the OP does not react to comments. I really think we could create much better answers if we know the necessary details. I think, I should do something more efficient.
Image Analyst
2011 年 12 月 18 日
Sometimes authors come back weeks later to mark their question as solved. Does the system automatically nag authors via email if they haven't marked a question as solved after some time?
By the way I think I've seen lingo like this before where the questioner was wanting a feature vector - a completely different beast. I really wish people would post with a mindset like no one knows what they're talking about and make it so that no one could possibly make bad assumptions. They need to be as explicit as possible. I hate those that can be interpreted 3 different ways. If you get three different answers, each assuming one of the possible assumptions, and only one was right, then they've just wasted two people's time because those people used the assumptions that weren't what the author was intending.
Ashish Bhatt
2011 年 12 月 20 日
Thanks for the replying guys and sorry for delayed action.
I have further questions. I want to convert a lot of images to vector. For that I need to change 'FileName' every time inside the loop. How to do that? To be explicit:
for i = 1:number of images
Img = imread(FileName); %I want 'FileName' to change everytime loop %executes itself. i.e. for i = 1, Filename = image001; for i = 2, FileName = %image002; and so on.
ImgVector = Img(:); %convert array 'Img' to vector 'ImgVector'
vediomatrix(:,i) = ImgVector; %Store each vector into array 'vediomatrix'
end
Thanks
Walter Roberson
2011 年 12 月 20 日
http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
Ashish Bhatt
2011 年 12 月 20 日
Thank you Walter. That helps.
juveria fatima
2018 年 3 月 30 日
how to get back image from vector
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Images についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
