Rotating pcolor plot and plotting a cross-section

I am taking an image of USAF bar targets with x-y single-pixel values. I want to plot a cross-section of the bar targets to analyze the contrast. The cross-section line must be normal to the bars on the target. You can see below that my target is not aligned perfectly. I would appreciate any help!
The main part of my code that is relevant is:
...
[X,Y] = meshgrid(x,y); % Creates a meshgrid given horizontal and vertical length increments, x and y.
A = reshape(Value,N,M); % Where N and M are the number of columns and rows respectively.
pcolor(X,Y,A);
...
This produces the following image:
Thank you in advance!

 채택된 답변

Walter Roberson
Walter Roberson 2018년 4월 12일

0 개 추천

For the purpose of display, probably the easiest way to do the rotation is to create a hgtransform group that you parent the image object to, and makehgtform() to create the rotation matrix which you then apply to the hgtransform group. This will have the effect of rotating what is displayed.
For taking the cross-section, improfile is happy to handle an angled line. What improfile does underneath is interp2() over the vector of coordinates.

댓글 수: 1

Thank you, I was able to achieve both using your suggestions!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Interactions, Camera Views, and Lighting에 대해 자세히 알아보기

질문:

2018년 4월 12일

댓글:

2018년 4월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by