improfile length differs with output choice
1 次查看(过去 30 天)
显示 更早的评论
Hello,
The issue I'm having is that improfile is giving me a different length output depending on if I have it store the profile, or if I skip the output argument and have it plot it directly. It's clearly getting the correct end points, but the scale is different, and it seems to also be related to the angle the profile is crossing the image.
Here's my two methods (Including for loop in case that has any effect)
for aa = 1:4
% End points for lines to measure across:
C_pt = [7 315]; FarX = [88 246 269 137]; FarY = [48 179 396 555];
I{aa} = improfile(final,[C_pt(1) FarX(aa)],[C_pt(2) FarY(aa)]); % Intensity along lines bridging endpoints
end
And then plot(I{2}) will give a different value than if I run the below in the command window:
improfile(final,[7 246],[315 179]);
If you calculate the length of the profile from my coordinates (275), you'll find that the live output has the correct length. It's like it's dropping pixel resolution but only when I save the data. And like I said, this seems to be dependent on the angle of the profile (vertical, 45 deg, etc) but only when I have it save the output.
Update: I tried to force it to use the correct length by adding ",275)" at the end, and it doesn't really work correctly either. It's mostly correct, but the error around 120 is concerning.
0 个评论
回答(1 个)
Engineer
2018-5-13
Hello Mike, I have discovered the same issue on my data, and soluted as you did forcing n=distance between two points. I thought the error in my case was due the pixel on geo-rectified image I was using, because I did not check that "live no output" gives the right improfile length (also to me, checked now)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!