Creating an image filter
古いコメントを表示
I'm currently trying to write a program that will read 80 images, all of the same size, and run each image through a filter/threshold before compiling them all into one single image.
The filter: The images are CT scans and in .jpg format. I am trying to create a high-pass filter or threshold that would assign all values below it(66) a 0 and anything above it 255.
I don't know where to start. I have some idea in my head but very limited knowledge on how to execute. Your help would be very much appreciated.
採用された回答
その他の回答 (1 件)
Wayne King
2011 年 10 月 3 日
Hi Daniel, If you have
images = dir('*jpg');
names = {images.name};
Then you should be able to loop through on the cell array
for ii = 1:numel(names)
I = imread(names{ii});
I(I<66) = 0;
I(I>66) = 255;
...
5 件のコメント
Daniel
2011 年 10 月 3 日
Image Analyst
2011 年 10 月 4 日
Well Daniel, you haven't defined exactly what you mean by "compile". So how are we supposed to answer you? Wayne gave you the "filter" part of your code but no one can help you anymore until you define "compile." Does it mean average together? Does it mean stack into a 3D image? Is it a maximum intensity projection? What the heck is it?
Daniel
2011 年 10 月 4 日
Image Analyst
2011 年 10 月 4 日
So can't you just do sumImage = sumImage + I ???
Walter Roberson
2011 年 10 月 4 日
You wouldn't want to use separate variables anyhow. See
http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F
カテゴリ
ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!