Most efficient way for extracting line profiles?
PeterR
I am momentarily trying to extract line profiles from an image for further analysis.
I understand that for the x- and y-directions,
ImageTransform
GetRow
and GetCol
would be appropriate - but how can I most efficiently extract DIAGONAL line profiles?Thanks in advance for any help :)
Best regards,
Peter
DisplayHelpTopic "Image Analysis[ImageLineProfile]"
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 6, 2014 at 04:06 pm - Permalink
ImageLineProfile
does some smoothing and interpolating magic, so it might happen that the extracted line profile might have an different x-scaling than the rest of my extracted profiles...Seems I have to go for loop and extract all relevant pixels that way and write them to a new wave (at least for the diagonal profiles)?
June 6, 2014 at 04:21 pm - Permalink
You can do that but it would be more efficient to use ImageLineProfile operation. Here is an example:
•newimage fff
•make/n=2 xxx,yyy
•xxx={0,99}
•yyy={0,199}
•ImageLineProfile xwave=xxx,ywave=yyy, srcwave=fff,width=0
I hope this helps,
A.G.
WaveMetrics, Inc.
June 6, 2014 at 04:58 pm - Permalink
Thanks.
September 6, 2016 at 04:03 pm - Permalink
The code above was not intended to illustrate how to use ImageLineProfile in the presence of scaling. Assuming that you scaled your image prior to executing ImageLineProfile then you should add the /SC flag to get the scaled profile waves. Here is an example:
newimage ddd
SetScale/P x 0,-1,"", ddd
make/n=2 xxx,yyy
xxx={0,-99}
yyy={0,199}
ImageLineProfile/sc xwave=xxx,ywave=yyy, srcwave=ddd,width=0
appendtograph/t w_lineProfiley vs w_lineProfilex
I hope this helps,
A.G.
WaveMetrics, Inc.
September 8, 2016 at 12:37 pm - Permalink
September 9, 2016 at 03:44 pm - Permalink