How to quantize histogram of gray scale image using LLoyd max algorithm upto 25 iterations

5 ビュー (過去 30 日間)
Naushad Varish
Naushad Varish 2016 年 1 月 23 日
コメント済み: Image Analyst 2016 年 1 月 27 日
I have a gray scale images, i built histgram of it and find probability distribution function(Pdf) and corresponding greyscale values. i want to quantize it into non uniform bins( intervals) until i got MSE of all bins(intervals).
thank you in advance

回答 (1 件)

Image Analyst
Image Analyst 2016 年 1 月 23 日
編集済み: Image Analyst 2016 年 1 月 23 日
I'm not familiar with LLoyd, but if you define your bin edges, finding out what bin a gray level belongs in is trivial with the find() function. One of the ways
bin = find(grayLevel < edges, 1, 'first');
yourHist(bin) = yourHist(bin) + 1;
but that's so obvious you've probably tried it already, so at this point all I can say is to post your complete code so I can fix it.
Of course you can also have MATLAB do it with histcounts() where you can pass in the edges. Did you try that?
  8 件のコメント
Naushad Varish
Naushad Varish 2016 年 1 月 27 日
which version you are using sir... i am using MATLABR2013a... You can type help lloyds on command window you will get the detail of it.
Image Analyst
Image Analyst 2016 年 1 月 27 日
I'm using R2015b. Maybe they took it out then. If you type
which -all lloyds
it will tell you what toolbox it's in. If it's built-in you'll see something like this:
>> which -all plot
built-in (C:\Program Files\MATLAB\R2015b\toolbox\matlab\graph2d\plot)
plot is a built-in method
Otherwise you'll see some toolbox after the \toolbox\.
Also, the help for it also mentions which toolbox it's in.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOrange についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by