how to obtain the gray level values of the image pixels??
이전 댓글 표시
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
2015년 12월 19일
You can get a mask of the letters using my attached demo.
Then do
meanGrayLevel = grayImage(mask);
댓글 수: 9
Image Analyst
2015년 12월 19일
You might also need to consider the width of the pen line. It might be narrower when the pressure is lighter.
Meghashree G
2015년 12월 20일
Meghashree G
2015년 12월 20일
Image Analyst
2015년 12월 20일
bwdist() can give that.
Walter Roberson
2015년 12월 20일
imgradient is in the image processing toolbox since R2012b. Either you have an earlier MATLAB or you do not have that toolbox installed (or licensed.)
Meghashree G
2015년 12월 20일
Meghashree G
2015년 12월 22일
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
2016년 1월 8일
카테고리
도움말 센터 및 File Exchange에서 Image Data Acquisition에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!