Boundary smoothing in a shape optimization result using NURBS Toolbox (actually, if you have another suggestion please tell me)

2 次查看(过去 30 天)
Hello everyone! I am trying to smooth a boundary of a image, which is the result of a shape optimization like the image below
the routine is that: using BWboundaries function I select every contour between black and white then delete the coordinates that didn't changes the direction in x and y at the same time. So when I try to use the function nrbplot (NURBS Toolbox) to do the actually smoothing part of the process, the results doesn't go as expected. Can someone point me the correct direction to solve my problem?

采纳的回答

Image Analyst
Image Analyst 2017-9-19
Either blur the image and then threshold it, or increase the size of the image and interpolate it or blur and threshold.
  18 个评论
Image Analyst
Image Analyst 2020-7-29
No idea on CAD, but to get a smoothed binary image, assuming you have the resolution, you can blur it and then threshold again to get a logical image again.
windowSize = 5; % Whatever, more for a smoother blur and shape. Odd number starting with 3.
kernel = ones(windowSize);
kernel = kernel / windowSize^2;
blurredImage = imfilter(double(binaryImage), kernel);
binaryImage = blurredImage < 0.5;

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by