필터 지우기
필터 지우기

Thresholding an Image in MATLAB?

조회 수: 1 (최근 30일)
Anand
Anand 2014년 3월 17일
댓글: Anand 2014년 3월 18일
if the distance is less it would output a smiling expression and if the distance is more it would output a neutral expression.
A = smile expression B = Neutral expression
A = 129;
B = 188;
Threshold = 155;
if A > B
error('threshold_grayscale_image : min_threshold is greater then max_threshold');
end
end
selected = (min_threshold >= A) & (B <= max_threshold);
thresholded_image(selected) = A;
return;
  댓글 수: 3
sumi
sumi 2014년 3월 18일
how to assign a threshold value...
Anand
Anand 2014년 3월 18일
yes thats correct, any ideas?

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2014년 3월 17일
I don't know what you mean. Do you mean you want to display an image of someone smiling or neutral depending on the condition? Do you have images for those two cases?
And how are you determining the "distance"?
  댓글 수: 10
Image Analyst
Image Analyst 2014년 3월 18일
You defined T to be 155. You can call it T or Threshold, it doesn't matter, but they must be the same. A and B are just sample values from two of your images and are not really used. D is the actual value that your algorithm will calculate for whatever the current image is. You should add comments, right?
% D is the value for this face image.
% A typical value for a smiling face might be 129.
% A typical value for a neutral face might be 188.
% The threshold, or borderline, between smiling and not smiling
% is set to 155.
Anand
Anand 2014년 3월 18일
Thank you ever so much!! I have got the threshold to run the want it to.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by