Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab中沿直线段的像素强度值_Matlab_Image Processing_Pixels - Fatal编程技术网

Matlab中沿直线段的像素强度值

Matlab中沿直线段的像素强度值,matlab,image-processing,pixels,Matlab,Image Processing,Pixels,考虑使用Matlabimagesc()轴显示的图像,这些轴具有一些通用描述,例如10x10像素,其中每个像素的强度值在[0 255]中 使用图像分析工具包中的imline()方法,我想沿着用户交互定义的线检索像素强度值。通常称为“线条轮廓”。这里的重要区别在于,平行于X轴或Y轴的线是不够的。这条线必须由用户以交互方式绘制 到目前为止,我已经研究了Matlab方法Inprofile()和impixel(),但到目前为止,我还没有获得理想的结果。这是一段代码,它读取单击图像(objectHandle

考虑使用Matlabimagesc()轴显示的图像,这些轴具有一些通用描述,例如10x10像素,其中每个像素的强度值在[0 255]

使用图像分析工具包中的imline()方法,我想沿着用户交互定义的线检索像素强度值。通常称为“线条轮廓”。这里的重要区别在于,平行于X轴或Y轴的线是不够的。这条线必须由用户以交互方式绘制


到目前为止,我已经研究了Matlab方法Inprofile()impixel(),但到目前为止,我还没有获得理想的结果。

这是一段代码,它读取单击图像(
objectHandle
)的位置,并更新文本框中的行(
currentLine
句柄)值和字符串(
Coords
handle)


incrofile
正是这样做的。你在哪里遇到了困难?Maube使用交互式输入。在这种情况下,为
axes寻找
回调
操作
@Crowley Callbacks for axes解决了我所有的问题。谢谢。如果你想让我投票支持你的建议,请将其作为解决方案发布。
%% Code here
axis tight
imageHandle = imshow('input\foo.jpg');
set(imageHandle,'ButtonDownFcn',{@ImageClickCallback,Coords,currentLine});
%% Code there

function ImageClickCallback (objectHandle,~,Coords,currentLine)
axesHandle  = get(objectHandle,'Parent');
coordinates = get(axesHandle,'CurrentPoint');   %// This line reads the click
coordinates = coordinates(1,1:2);
LineX=get(currentLine,'xdata');
LineY=get(currentLine,'ydata');
set(currentLine,'xdata',[LineX,coordinates(1)])
set(currentLine,'ydata',[LineY,coordinates(2)])

set(Coords.X,'string',{'X';num2str(coordinates(1),'%.0f')})
set(Coords.Y,'string',{'Y';num2str(coordinates(2),'%.0f')})

end