how to obtain the gray level values of the image pixels??

1 次查看(过去 30 天)
I'm doing handwriting analysis,for that one feature is to identify the pressure.For the analysis of pen pressure, Mean gray level value is computed using the gray level values of the image pixels.But how to take these gray level values?? For reference i have attached the image.Please do help me.Thank you
if i use
meanIntensityValue = mean(grayImage(:));
is it that mean of both white and black pixels ? i want only mean of black pixels.

回答(1 个)

Image Analyst
Image Analyst 2015-12-19
You can get a mask of the letters using my attached demo.
Then do
meanGrayLevel = grayImage(mask);
  9 个评论
Image Analyst
Image Analyst 2015-12-22
mask in that line of code is called binaryImage in the document_threshold.m file.
You can put the line of code to compute the mean gray level wherever you need it, perhaps right after you compute the binary image mask.
Meghashree G
Meghashree G 2016-1-8
Thank you sir.And very sorry for asking after a long gap! I am now calculating meanGrayLevel,but its not displaying anything in the terminal.How do i get the value?please help me

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by