How may I change certain areas of a geometry (specified by point point) with reference to a geometry?

4 次查看(过去 30 天)
I have two pointclouds containing x,y,z cordinates of two similar geometry. Say A and B. A is suppose a square of size 1mm by 1mm. B is also a square of size 0.5mm by 0.5mm. However, in B one edge is distorted (see attached figure). Now I wish to correct it, which means, change it to sqaure of size 0.5mm by 0.5mm. Is there a way to do it?

采纳的回答

yanqi liu
yanqi liu 2022-1-5
clc; clear all; close all;
[X,map,alpha] = imread('https://ww2.mathworks.cn/matlabcentral/answers/uploaded_files/852940/Picture1.png');
figure; imshow(alpha);
bw = im2bw(alpha);
bw = bwareaopen(imfill(bw, 'holes'), 1000);
bw2 = bwareafilt(bw, 2);
bw(bw2) = 0;
[r,c] = find(bw);
bw(min(r):max(r),min(c):max(c)) = 1;
bw = logical(bw);
be = imdilate(bwperim(bw), strel('disk', 3));
alpha(be) = 255;
figure; imshow(be);
figure; imshow(alpha);
  13 个评论
Ajay Goyal
Ajay Goyal 2022-1-7
Thank you very much my friend. It will solve the purpose. I am home quarantined since yesterday and will try to study it on Monday, if report is in my favor :). Take care Regards, Dr. Ajay
yanqi liu
yanqi liu 2022-1-8
it is my pleasure,in thie question,we use the loop iteration for compute,and choose the best result. of course,may be use some parameter to adjust

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by