Rotational Cross-Section Average
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Michel Rickhaus
il 17 Nov 2021
Commentato: Michel Rickhaus
il 24 Nov 2021
Can someone helt me to figure this one out?
I have an grayscale image of concentric bright rings agains black. Using
A=double(imread('2H-CAR-C6_05.tif'));
[x,y]=meshgrid(1:size(A,1), 1:size(A,2));
result=[x(:),y(:),A(:)];
I can read convert the brightness to a z coordinate (the units of the coordinate system dont matter too much currently).
What I'd like to do now is to get an average cross section of the 3d image. Basically:
- Get cross section through the middle of the image
- Store values of that cross section
- Rotate the cross section around the center of the image by an angle (say 1 degree)
- Add these values to the values before
- Loop until 360° and then either show sum or average of this
As a bonus would be to ignore values outside a certain z-range :)
Ideas? Any help is greatly appreciated!
0 Commenti
Risposta accettata
Raj Bhakta
il 21 Nov 2021
Hi Michel,
If I understand correctly, you want the average value of a "slice" ( a single row) for the z coordinate. If so, we can use the original image itself to get this value, using:
averageValue = A(size(A,1)/2,:);
This gives us a single value along the middle of the image. Then, rotate the image 1 degree by using imrotate
rotatedImg = imrotate(A,1);
The imrotate function changes the image size to preserve the rotation and fills in the image with black pixels where it needs padding. In your averaging function, you can ignore these by only averaging over the pixels that have a value greater than 0.
middleRow = rotatedImg(size(rotatedImd,1)/2,:)>0;
averageValue = mean(middleRow);
Hope this helps!
-Raj
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Geometric Transformation and Image Registration in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!