我是MATLAB的新手,我想知道我可以从指定边界内部提取图像的一部分,基于区分颜色(在我的情况下为红色边界),该函数,首先跟踪图像的边界,然后它提取该特定边界内部的图像部分.我附上了我的图像(人头图像),我想从头部提取大脑部分,图像的其他部分应该被忽略.我试图找到边缘,使用下面的代码(它显示1为边界,0为无边界),但它只显示0.
任何帮助将不胜感激.
附PS图像显示原始图像和图像与边界....代码将被工作的一个具有边界和将提取的图像位于该边界内的一部分.
以下是我试过的代码:
BW = edge(x)
BW = edge(x,'sobel')
BW = edge(x,'sobel',thresh)
BW = edge(x,'sobel',thresh,direction)
[BW,thresh] = edge(x,'sobel',...)
BW = edge(x,'prewitt')
BW = edge(x,'prewitt',thresh)
BW = edge(x,'prewitt',thresh,direction)
[BW,thresh] = edge(x,'prewitt',...)
BW = edge(x,'roberts')
BW = edge(x,'roberts',thresh)
[BW,thresh] = edge(x,'roberts',...)
BW = edge(x,'log')
BW = edge(x,'log',thresh)
BW = edge(x,'log',thresh,sigma)
[BW,threshold] = edge(x,'log',...)
BW = edge(x,'zerocross',thresh,h)
[BW,thresh] = edge(x,'zerocross',...)
BW = edge(x,'canny')
BW = edge(x,'canny',thresh)
BW = edge(x,'canny',thresh,sigma)
[BW,threshold] = edge(x,'canny',...)
Run Code Online (Sandbox Code Playgroud)

我有一个在JLabel中导入的图像.Java中是否有内置函数可用于通过Slider更改图像的亮度和对比度?
如何从另一个.au3文件访问"我的文档/下载"文件夹中的.au3文件?
我知道如何从这个代码访问桌面上的文件:
Run(@AutoItExe & ' "' & @ScriptDir & '\file2.au3"')
Run Code Online (Sandbox Code Playgroud)
但我无法在"我的文档/下载"文件夹中访问它.基本上我想一次又一次地递归调用相同的.au3文件.
如何在Java应用程序运行时阻止键盘和鼠标的输入.就像我们使用BlockInput(1)阻止AutoIt中的输入一样,我也想在Java中做同样的事情.