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
Image Analyst 2013 年 9 月 29 日
Actually, it's not attached here.

サインインしてコメントする。

回答 (3 件)

Image Analyst
Image Analyst 2013 年 9 月 29 日

0 投票

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
hamed abdulaziz 2013 年 9 月 29 日
Thank you Image Analyst,I rewrote the code using green Channel but the same error massage is displyed!!
hamed abdulaziz
hamed abdulaziz 2013 年 9 月 29 日
I add link https://www.dropbox.com/s/rjttybncg0dwxev/hair.bmp for sample hair image
Image Analyst
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
hamed abdulaziz 2013 年 9 月 29 日
The radial coordinates returned in xp are the values along the x'-axis, which is oriented at theta degrees counterclockwise from the x-axis. The origin of both axes is the center pixel of the image, which is defined asfloor((size(I)+1)/2)
hamed abdulaziz
hamed abdulaziz 2013 年 9 月 29 日
I wrote my code according to this paper : http://www.ncbi.nlm.nih.gov/pubmed/21316042
Image Analyst
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
hamed abdulaziz 2013 年 9 月 29 日
my be ? how can I deal with a vector xp as a string?is that possible?
hamed abdulaziz
hamed abdulaziz 2013 年 9 月 29 日
but I've got the same error !!! what the disappointed I have?!please guide me

サインインしてコメントする。

hamed abdulaziz
hamed abdulaziz 2013 年 9 月 29 日

0 投票

1 件のコメント

suganya R
suganya R 2016 年 3 月 7 日
use imclose operation for removing hair with disk size 2

サインインしてコメントする。

asma arafat
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
Walter Roberson 2017 年 5 月 9 日
You should create a new Question for that.

サインインしてコメントする。

質問済み:

2013 年 9 月 29 日

コメント済み:

2017 年 5 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by