필터 지우기
필터 지우기

How to separate image as like below in the given link?

조회 수: 2 (최근 30일)
krithika P
krithika P 2011년 9월 24일
hi FRIENDS,
thanks to all ..i have an image .by applying GAUSSIAN STANDARD SMOOTHING FILTER I HAVE TO GET THE RESULT LIKE
(GAUSSIAN SMOOTHING FILTER)
ORIGINAL IMAGE -----------------------------> SMOOTH PART +EDGES
sigma=5,
I=imread('lena256.jpg');
h=fspecial('gaussian',[10,10],sigma);
figure,surfc(h);
o=imfilter(I,h,'same','conv');
figure,imshow(o);
HOW TO SEPARATE IT ... HERE I HAVE CODE FOR GETTING SMOOTH PART.. HOW TO FOR EDGES PART OF IMAGE ...I HAVE LINK FOR THIS PLEASE GO THROUGH IT.. THEY HAVE GIVEN FOUR FIGURES ..BOTTOM ROW OF FIGURES I WANTED TO GET ...PLEASE ANY ONE HELP ME
  댓글 수: 2
Jan
Jan 2011년 9월 24일
Using standard upper/lower case improves the readability.
krithika P
krithika P 2011년 9월 25일
k thanks for your contribution... i will mind case for my next post ..

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

채택된 답변

Image Analyst
Image Analyst 2011년 9월 24일
Like it said, just subtract the smoothed image from the original. That will give you the "edges" or higher spatial frequencies. Since you at least gave a shot at it with some code, I'll give you some "corrected" code:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures.
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.
fontSize = 15;
% Read in a standard MATLAB color demo image.
folder = fullfile(matlabroot, '\toolbox\images\imdemos');
baseFileName = 'peppers.png';
fullFileName = fullfile(folder, baseFileName);
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, 'file')
% Didn't find it there. Check the search path for it.
fullFileName = baseFileName; % No path this time.
if ~exist(fullFileName, 'file')
% Still didn't find it. Alert user.
errorMessage = sprintf('Error: %s does not exist.', fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
rgbImage = imread(fullFileName);
% Get the dimensions of the image. numberOfColorBands should be = 3.
[rows columns numberOfColorBands] = size(rgbImage);
% Display the original color image.
subplot(2, 2, 1);
imshow(rgbImage, []);
title('Original Color Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
% set(gcf, 'Position', get(0,'Screensize'));
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
sigma = 7;
h=fspecial('gaussian',[35, 35], sigma);
% Display the original color image.
subplot(2, 2, 2);
surfc(h);
title('Gaussian Blurring Kernel', 'FontSize', fontSize);
% Smooth it in RGB space.
smoothedImage = imfilter(rgbImage, h, 'same', 'conv');
% Display the image.
subplot(2, 2, 3);
imshow(smoothedImage, []);
title('Smoothed Color Image (Low Pass Image)', 'FontSize', fontSize);
% Calculate the difference
diffImage = smoothedImage - rgbImage;
% Display the image.
subplot(2, 2, 4);
imshow(diffImage, []);
title('Edges Image (High Pass Image)', 'FontSize', fontSize);
msgbox('Done with demo!');
However, you're probably better off doing it in the V channel of HSV color space, rather than in rgb color space, to avoid color artifacts.
  댓글 수: 1
krithika P
krithika P 2011년 9월 25일
Exactly what i want you have provided...thank you so much ..continue the great job..it is very helpful to me..thanks once again

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by