필터 지우기
필터 지우기

How to apply moment preserving to grayscale document image

조회 수: 1 (최근 30일)
goldensona
goldensona 2012년 11월 12일
Hi how to apply moment preserving to grayscale document image to obtain gray values. how to proceed i need a example code.
  댓글 수: 7
Image Analyst
Image Analyst 2012년 12월 31일
It is not clear. Please explain it to someone else and have them write it down and paste their explanation back here. Otherwise all I can say is try this:
outputImage = inputImage;
Everything from the input image will be preserved, including ALL moments.
goldensona
goldensona 2013년 1월 2일
편집: goldensona 2013년 1월 2일
I want to Convert of Input image to Binary form - By Apply moment-preserving threshold (W. H. Tsai, “Moment-Preserving Thresholding:) to input image to obtain two representative gray values g1 and g2, i have to compute threshold value from it , T = (g1 + g2)/2; using the threshold i need to convert it into binary.

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

답변 (1개)

Image Analyst
Image Analyst 2013년 1월 2일
Ah, finally now we're getting somewhere. Moment preserving THRESHOLDING. That thresholding word is important. You really didn't explain the algorithm though. So I have no idea what g1 and g2 are, given some arbitrary gray scale image. And the FAQ applies here.
But let's assume you have them and you calculated a threshold value of T according to your formula. Then you could binarize (threshold) the image into two levels (foreground and background) simply by doing this:
binaryImage = grayImage < T; % Or you can use <=, >, or >= if you want.
This will not preserve ALL moments, but may preserve one or a few of the moments if T was chosen appropriately.
  댓글 수: 2
goldensona
goldensona 2013년 1월 6일
g1,g2 is grey scale values from a image.
Image Analyst
Image Analyst 2013년 1월 6일
Yes, I know that. How about 42 and 213 - will those do? If not, then why not?

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

Community Treasure Hunt

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

Start Hunting!

Translated by