Make one result for multiple images

조회 수: 2 (최근 30일)
Mehrzad Javadzadeh
Mehrzad Javadzadeh 2022년 2월 19일
답변: Image Analyst 2023년 10월 20일
Hello all;
I'm using 'imread' to read a single image and make three different types of image intensity analyse on them. I have nine images (same resolutions and details) from a polarised microscope)).
The problem is this:
I can give images one by one. Then I'll have three results for each of them (at all, I'll have 27 results). I want to give all of the nine images at the same time and get just three results for all of them. I want to make a 3D Polar Plot (I have one sample with different angles). So, do you have any idea to give all of my images and have just three results for all of them at the same time instead of one by one?
Here is my code (I've removed some parts):
D=imread('xxxxxx.tif','tif');
im_out=D;
figure;
imshow(im_out);
[p,o,~]=size(im_out);
for j=1:1
b=im_out(:,:,j);
tb=b;
tb=double(tb);
00000000000
figure;
mesh(tb)
title('Normalized light intensity of focal plane')
xlabel('Pixels')
ylabel('Pixels')
zlabel('Normalized Intensity')
axis auto
colorbar
end
mtb=max(max(tb));
0000000000
[aa,bb]=size(tb);
for i=1:aa
f=find(tb(:,i)==1);
if ~isempty(f)
figure(50);
hold on;
axis auto
xlabel('Pixels')
ylabel('Normalised Intensity')
plot(tb(:,i))
end
end
  댓글 수: 1
yanqi liu
yanqi liu 2022년 2월 21일
yes,sir,may be use Parallel Computing Toolbox to get parallel for loop process

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

답변 (2개)

Udit06
Udit06 2023년 10월 20일
Hi Mehrzad,
I understand you want to want to take multiple images and apply some preprocessing on them in one go. You can achieve the same using MATLAB's "imageDatastore" object and "tranform" function. "imageDatastore" is used to manage a collection of image files and using "transform" function can be used to apply a specific function to each image in the image datastore. You can refer to the following MathWorks documentations to learn more about "imageDatastore" object and "transform" function respectively.
  1. https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.html
  2. https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.transform.html
I hope this helps.

Image Analyst
Image Analyst 2023년 10월 20일
What are your 3 results? I don't understand at all your code where you are using mesh() on the red channel of the image.
What I'd do is have a single for loop over all images, as per the FAQ:
then in the loop I'd have a function that generated the 3 results from that one image, like
these3Results = GetResults(thisImage); % Get the 3 results from this image.
Then somehow store and plot the results of all the images. It doesn't matter that they're done "one at a time" though you can try the parallel processing toolbox with parfor if you want to try that.
If you still have a problem, write back.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by