what is the best way for thresholding this image .....please?

i wrote this code {
img=imread(..........);
imshow(img);
medimage=medfilt2(img,[5 5]);%median Filtering image
figure,imshow(medimage);
z=adapthisteq(medimage);
figure,imshow(z);
H = fspecial('unsharp');
y=imfilter(z,H);
figure,imshow(y);
s=roipoly(y);
nnew=img.*cast(s,class(img));
figure,imshow(nnew);
}
the result was similar to this
how i can do thresholding to make the veins obvious with white color at a black background.
help please , i am really needs this? simple reply will be most suitable to me
i am just a new in the matlab world.
thanks

6 Comments

It would be helpful if you format the code in your question. Edit the question, select the code, and click on the "{} Code" button. Thank you.
when i select the code, during editing there is no {} code button
That's a bit surprising, but instead, just put two spaces at the start of each line of code.
Thank you, that's helpful and I can see what your code so far does. However, with apologies, I have to tell you that the next step is not obvious - picking out the veins is a mini-project.
i thanks you for your cooperation with me so much, but i didnot undestand your last comment.

Sign in to comment.

Answers (1)

Did you search http://iris.usc.edu/Vision-Notes/bibliography/contentsmedical.html#Medical%20Applications,%20CAT,%20MRI,%20Ultrasound,%20Heart%20Models,%20Brain%20Models to find papers such at this: Garbey, M., Merla, A., Pavlidis, I., Estimation of blood flow speed and vessel location from thermal video, CVPR04(I: 356-363).

8 Comments

yes
i asked before
but i dont find suitable answer , so try to ask the question by different way
also about your link , i visited it and didn't find what i want
I am sorry, but I don't think I can help any more than Image Analyst has. There is probably not a simple solution to this problem - you may need to look at the literature, and also experiment. Adaptive local thresholding might be good, but other techniques might also apply.
Unless someone else can do better, I think this may go beyond what a MATLAB Answers reply can tackle.
I agree. There are probably masters or Ph.D. projects on this subject which goes way beyond the kind of turnkey code we can provide to you here. I've seen this before, where you try to solve the problem for that one image and then the person comes up with a second image where the algorithm doesn't work, and then even if it got fixes to handle the second image, it could go on and on that way as additional weird images are added. People in your situation generally survey the literature and come up with modifications of or improvements on published algorithms themselves. Our role in this would be perhaps to give you guidance as to some possible algorithms (using built-in MATLAB functions) or places to look, which we've done, not to do algorithm development. Good luck with it though.
thanks for your time
i already understood my project theoretically but my problem in implementing the project by matlab.
and by this group , i want to understand more about matlab.
in any case , thank you again.
If you understand your project theoretically, then you already know which algorithm is appropriate to extract the information you want to your satisfaction. If you do not know which algorithm is appropriate to extract the information you want to your satisfaction, then you do not really understand the full theoretical problem.
if i didn't understand , i didn't ask about the adaptive local thresholding for this image
thanks
and i am sorry if my questions are annoying to the group
It's not that you're annoying, it's more about aligning expectations. We can't do more than a few minutes of coding for you - we simply don't have the time to do lengthy, free, private consulting for anybody. For example if you need help with the adapthisteq() function, (which is the first step in adaptive local thresholding that you say you want to do - I've already mentioned that, did you try it?) we might be able to provide a demo beyond what the help does, if you provide an image. That would only be a few minutes work, not hours or days of work. So, now, let me see your adapthisteq() code and the results.
thanks for all your valuable time for comments

Sign in to comment.

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Asked:

on 24 Jan 2012

Community Treasure Hunt

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

Start Hunting!