Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
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?

Réponse acceptée

yanqi liu
yanqi liu le 5 Jan 2022
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 commentaires
Ajay Goyal
Ajay Goyal le 7 Jan 2022
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 le 8 Jan 2022
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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Fixed-Point Conversion dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by