Radon transform and Prewitt filters for hair removal
이전 댓글 표시
Hi All,
I'm working on dermoscopic images (skin cancer images)that contains a light and thick hair,how can detect the predominant orientation of hairs in the image by using Radon transform, followed by filtering the image by Prewitt filters using the orientation of existing hairs I tried to write this code :
if true
% %%Radon transform and Prewitt filters
rgbImage = imread('hair.bmp');
redChannel =rgbImage(:, :, 1);
greenChannel =rgbImage(:, :, 2);
blueChannel =rgbImage(:, :, 3);
theta = 0:180;
[R,xp] = radon(rgbImage,theta);
BW = edge(rgbImage,'prewitt',[],xp);
imshow(R)
imshow(BW)
end
but I've got this error message :
Error using edge>parse_inputs (line 607) Invalid input arguments.
Error in edge (line 190) [a,method,thresh,sigma,thinning,H,kx,ky] = parse_inputs(varargin{:});
Error in Untitled2 (line 12) BW = edge(rgbImage,'prewitt',[],xp);
I attached a bitmap image contains hair called (hair.bmp),could any one guid me please because I'm really stuck in my project,thanks in advance. Hamed
댓글 수: 1
Image Analyst
2013년 9월 29일
Actually, it's not attached here.
답변 (3개)
Image Analyst
2013년 9월 29일
The documentation for edge() says:
Class Support
I is a nonsparse 2-D numeric array.
BW isa 2-D array of class logical.
rgbImage is not a 2D image - it's a 3D color image. You need to pass one of the color channels you extracted into edge(), not the full RGB image.
BW = edge(greenChannel,'prewitt',[],xp);
댓글 수: 8
hamed abdulaziz
2013년 9월 29일
hamed abdulaziz
2013년 9월 29일
Image Analyst
2013년 9월 29일
Look at all the inputs until you find one that is not what is expected. So, what is xp? Is it the type of variable that edge() can handle?
hamed abdulaziz
2013년 9월 29일
hamed abdulaziz
2013년 9월 29일
Image Analyst
2013년 9월 29일
hamed:
The help for edge() says this:
BW = edge(I,'prewitt',thresh,direction) specifiesthe direction of detection for the Prewitt method. direction is a string specifying whether to look for 'horizontal' or 'vertical' edges or 'both' (default).
The help for radon() says this:
[R,xp] = radon(...) returns a vector xp containing the radial coordinates correspondingto each row of R.
So edge() wants a string and you're passing in a double vector. Do you think that might cause problems?
hamed abdulaziz
2013년 9월 29일
hamed abdulaziz
2013년 9월 29일
hamed abdulaziz
2013년 9월 29일
0 개 추천
댓글 수: 1
suganya R
2016년 3월 7일
use imclose operation for removing hair with disk size 2
asma arafat
2017년 5월 9일
0 개 추천
how i can remove eyebrows from an image to use edge detectors after that and i don't need eyebrows to detect as edge. any help!!?
댓글 수: 1
Walter Roberson
2017년 5월 9일
You should create a new Question for that.
카테고리
도움말 센터 및 File Exchange에서 Image Category Classification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!