promotion image of download ymail app
Promoted
阿泰 發問時間: 電腦與網際網路程式設計 · 1 0 年前

用matlab來算entropy

輸入:一個五乘五的矩陣112422121354321311214321111243處理:符號出現次數機率110P1=10/2527P2=7/2534P3=4/2543P4=3/2551P5=1/25計算熵值H=P1*log2P1 + P2log2P2 + P3log2P3 + P4log2P4 + P5log2P5輸出:輸出H值網路有查到entropy函數,但我不知道要如何用。http://www.cs.rug.nl/~rudy/matlab/doc/entropy.html

1 個解答

評分
  • 1 0 年前
    最佳解答

    問題是針對影像部分嗎?

    我在HELP有查到嫡值的用法,但實作出來嫡值為0,在想看看吧!!

    =============================================================

    Entropy of an intensity image

    Syntax

    E = entropy(I)

    Description

    E = entropy(I) returns E, a scalar value representing the entropy of intensity image I. Entropy is a statistical measure of randomness that can be used to characterize the texture of the input image. Entropy is defined as

    -sum(p.*log(p))

    where p contains the histogram counts returned from imhist. By default, entropy uses two bins for logical arrays and 256 bins for uint8, uint16, or double arrays.

    I can be a multidimensional image. If I has more than two dimensions, the entropy function treats it as a multidimensional intensity image and not as an RGB image.

    Example

    I = imread('circuit.tif');

    J = entropy(I)

    參考資料: MATLAB
    • Commenter avatar登入以對解答發表意見
還有問題?馬上發問,尋求解答。