Display gray color only from grayscale image
4 ビュー (過去 30 日間)
古いコメントを表示
Hi all
Apology for my ignorance as this is quite new to me.
I'm currently working on MRI images and have tried numerous times using some thresholding methods to display gray area of MRI image/s but to no avail.
Any pixel with grayscale value (0-255) of less than 5 & more than 250 will be eliminated and thus only showing pixels within 6-249.
Any helps are much appreciated.
Regards Demon
2 件のコメント
Walter Roberson
2013 年 1 月 17 日
The places where those pixels were: do you need those places to be transparent?
採用された回答
Image Analyst
2013 年 1 月 17 日
You can alter the image to mask out (set to zero) those pixels with gray levels outside 5 and 250 inclusive:
darkPixels = grayImage <= 5;
lightPixels = grayImage >= 250;
pixelsToExclude = darkPixels | lightPixels;
grayImage(pixelsToExclude) = 0;
Is that what you want to do?
10 件のコメント
Image Analyst
2013 年 1 月 19 日
You're welcome. The closest I get is Newcastle. But good luck with your project.
その他の回答 (2 件)
Amith Kamath
2013 年 1 月 17 日
For most tasks of analysing pixel values and thresholding, I've found http://www.mathworks.com/matlabcentral/fileexchange/6770 very useful.
You could use:
[levelLow bwLow] = thresh_tool(IM);
[levelHi bwHi] = thresh_tool(IM);
%to get the mask for each of the lower and upper level in bw.
depending on the datatype of your image, you can then just do an and operation between your image and the bw images.
参考
カテゴリ
Help Center および File Exchange で 3-D Volumetric Image Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!