我有兴趣提取区域内的对象。
例如,
图1显示了我的激光轮廓的强度分布。 根据激光强度,我将轮廓划分为2个感兴趣区域(ROI1和ROI2)。
图2显示了我的正响应的exp结果与激光强度分布的重叠。 正响应数据文件由x和y坐标组成。 如您所见,结果散布在激光轮廓图像上。
这就是我想要做的,我想提取ROI2中的斑点并丢弃所有其余部分,如图3所示。 我该怎么做? 具体来说,如何在matlab中定义不规则形状ROI2并提取正响应数据的坐标。 谢谢您的帮助。
I am interested in extracting the objects inside the region.
For example,
Fig1 showed the intensity profile of my laser profile. According to the laser intensity, I divide the profile into 2 region of interest (ROI1 and ROI2).
Fig2 showed the overlap of my exp result of positive responses and the laser intensity profile. The positive response data file is composed of x and y coordinates. As you can see the results are scattered over the laser profile image.
Here is what I want to do, I want to extract the spots within the ROI2 and discard all the rest as shown in Fig3. How can I do it? Specifically, how can I define a irregular shape ROI2 in matlab and extract the coordinates of positive response data. Thanks for the help.
最满意答案
正如eykanal所说,你可以使用impoly函数在你的图像中创建你想要的任何ROI。 提取coordiantes的一般解决方案是创建所需的ROI,并使用find提取坐标和一些设置操作以删除不需要的点。 喜欢这个:
imshow(image) h = impoly() ; %# draw ROI1 ROI1 = createMask(h); %# create binary mask of ROI1 h2 = impoly(); %# draw dummy_ROI consisting of ROI1+ROI2 dummy_ROI = createMask(h2); %# create binary mask ROI2 = dummy_ROI-ROI1; %# create ROI2 p = find(ROI2); %# find all coordinates of ROI2 points = intersect(ind,p); %# find all points with linear index ind that are %# part of ROI2As eykanal says, you can use the impoly function to create any sort of ROI you want in your image. A general solution for extracting coordiantes is to create the ROI you want, and the use find to extract the coordinates and some set operation to remove unwanted points. Like this:
imshow(image) h = impoly() ; %# draw ROI1 ROI1 = createMask(h); %# create binary mask of ROI1 h2 = impoly(); %# draw dummy_ROI consisting of ROI1+ROI2 dummy_ROI = createMask(h2); %# create binary mask ROI2 = dummy_ROI-ROI1; %# create ROI2 p = find(ROI2); %# find all coordinates of ROI2 points = intersect(ind,p); %# find all points with linear index ind that are %# part of ROI2更多推荐
发布评论