필터 지우기
필터 지우기

How to implement gray level probability density function?

조회 수: 14 (최근 30일)
chitresh
chitresh 2014년 2월 18일
답변: Image Analyst 2014년 2월 18일
the gray-level probability density function given as P(g) = h(g)/M, where h(g) is the number of pixels with gray level g and M is the total number of pixels in the image.
I want to implement this on a gray scale image, my question is what is h(g) in my case and what are gray level g... i know M is (row*colum) please answer

채택된 답변

Image Analyst
Image Analyst 2014년 2월 18일
% Get histogram:
[pixelCounts, grayLevels] = imhist(grayImage);
% Computer probability density function:
pdf = pixelCounts / numel(grayImage);

추가 답변 (1개)

Dishant Arora
Dishant Arora 2014년 2월 18일
you can use built in function imhist.

카테고리

Help CenterFile Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by