Can anybody help me on how to smooth out edges to make it rounded and fair? i am using MATLAB and i am quite new to this. Thank you.

댓글 수: 4

Walter Roberson
Walter Roberson 2015년 7월 25일
Which edges?
Cas Cas
Cas Cas 2015년 7월 25일
What did you use to plot? If you used surf, try this
surf(peaks)
shading interp
Walter Roberson
Walter Roberson 2015년 7월 26일
What is it that you have available to be plotted? Are you working with a rectangular array of data, or do you have a function that you can evaluate to determine additional data points?
Rena Berman
Rena Berman 2017년 1월 12일
(Answers Dev) Restored question.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2015년 7월 26일

0 개 추천

You can blur the whole thing with
blurredImage = conv2(data, ones(15), 'same');
If you want to blur just the edges and leave the rest as-is, first blur the whole thing, then find the edges in the original image and replace them with the blurred version. Something like (untested):
blurredImage = conv2(data, ones(15), 'same');
stdImage = stdfilt(data, ones(9));
edgeImage = stdImage > 5; % Whatever value works.
output = data; % Initialize
% Now replace edge pixels with blurred ones.
output(edgeImage) = blurredImage(edgeImage);

댓글 수: 11

Rey Kelvin Peralta
Rey Kelvin Peralta 2015년 7월 26일
편집: Walter Roberson 2015년 7월 26일
Why blur sir?? i want to smoothen the edges to generate the 3d model. these are the codes i used:
y = rgb2gray(imresize(imread('G_0003.jpg'),.2));
z = 255.0 - 1.0 * double(y);
z = z ./5;
surface(z);
This is also the image: http://pasteboard.co/2frG8Ll9.jpg
Rey Kelvin Peralta
Rey Kelvin Peralta 2015년 7월 26일
also how do i see the output of the blur sir?? i did what you said but i dont know how to see the result of it
Image Analyst
Image Analyst 2015년 7월 26일
Why blur? Because blurring smooths the image.
Do you want to smooth the edges only , or smooth everything?
To view the image, which I called output, use [] with imshow
imshow(output, []);
Also, you might try a Fourier filter to get rid of that grid pattern first.
Rey Kelvin Peralta
Rey Kelvin Peralta 2015년 7월 26일
So i should blurr first so that it'll be smooth? and get rid of the jagged edges? is there any other way to smoothen out the round edges sir?
Rey Kelvin Peralta
Rey Kelvin Peralta 2015년 7월 26일
i want to smooth the model itself sir. And also afterwards is there a way to export it to blender?
Rey Kelvin Peralta
Rey Kelvin Peralta 2015년 7월 26일
1 more thing sir. if i blurr doesnt it remove the details of the image? i want to preserve the shape of the image. thank you
Walter Roberson
Walter Roberson 2015년 7월 26일
I think the blur should be
blurredImage = conv2(data, ones(15)/(15*15), 'same');
This would be a moving average blur; without the division by 15*15 you would be doing a moving sum rather than a moving average
Rey Kelvin Peralta
Rey Kelvin Peralta 2015년 7월 27일
편집: Rey Kelvin Peralta 2015년 7월 27일
i tried using blurr but it just blurred the image. it doesnt show the model anymore. i just need to smoothen the edges of the center piece. to show its 3d model. I just need the embossed part be smoothed out so it can show the model clean
Image Analyst
Image Analyst 2015년 7월 27일
Thanks Walter for the correction. It DOES smooth it, Rey. If you don't notice it then either the window width of 15 is not large enough, or else you're not displaying the right image. You should notice a definite reduction in noise with displaying it with either imshow() or surf().
Rey Kelvin Peralta
Rey Kelvin Peralta 2015년 7월 28일
when you did it sir, did it smoothen the center piece? can you show me please? thanks you
Walter Roberson
Walter Roberson 2015년 7월 28일
The following discussion refers to the original image, not reduced to .2 of original size. The 2800+ by 4800+ image.
Try using
blurredImage = conv2(data,ones(75,75)./(75*75),'same');
surf(blurredImage, 'edgecolor', 'none')
You might need to play slightly with the 75 to get the best result, but it is more than 70 and less than 80, something pretty close to 75. Maybe 73.
The more obvious texture is approximately 74 pixels apart with a width of about 23 pixels, but there is also a 5-division submesh within each larger square, so roughly every 10 pixels. It appears the coin has been photographed through the mesh, which makes it important to remove the mesh first. I do not know the best way to remove a texture.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2015년 7월 25일

댓글:

2017년 1월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by