From: Sean on
"Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> wrote in message <i3hcep$kks$1(a)fred.mathworks.com>...
> "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <i3bva5$k78$1(a)fred.mathworks.com>...
> > "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> wrote in message
> > > Sean,
> > >
> > > I don't like the result,
> > >
> > > I love it:-)
> > > works flawlesly and gets correct answers:-)
> > > will check more tomorrow.
> > >
> > > Thanks Sean
> > >
> > > Lars
> >
> > Glad to hear, and you're welcome!
> > I hope the car is doing well also, that sounds like a much more interesting project overall.
> >
> > Let me know if you need anything else. As far as the above code it should work all of the time, unless, as the comment hinted at two objects are returned. In this case you'll have to decide what to do. It would be 1 or 2 lines of code to keep only the orientation which contains the center pixel.
> > I think I may program the max crack width algorithm I described above. It's a good excuse for me to program as opposed to journal/thesis write, which is far more enjoyable :)
> >
> > -Sean
>
>
>
> Hi Sean,
>
> I have tryed the script on a lot of "fake" cracks and it works all the times:-)
>
> Now to finding and counting the intersections (3 and 4 crossings) I have looked at my_orientations and can see that every intersection contains both + and - values in the columns, there is also like 4 values in the column at intersections (high angle) and 5 or maybe more values in columns at low angle intersections.
> Can this be used in some way???
> Or is the connectivity tool with "high connectivity" the right way to go?
>
> Lars

If I understand you correctly: you're trying to identify crack intersection points and how many intersections at these points?

Instead of using orientation for this, you might be able to use the 'BranchPoints' option in bwmorph() on the skeleton that's already been created. Each branch point returned will mean either 3 or 4 cracks coming in to it. You could find out how many by summing the neighbors it has that are on. In the event of two branch points touching you'd have to sum the points on this new object's perimeter. Here's an example of that occurring:

%%%%
%Test Skeleton
I = false(5);
I(2,2) = true;
I(:,3) = true;
I(1,1) = true;
I(3,4) = true;

%Get Branch Points
bpts = bwmorph(I,'branchpoints');

%Plot stuff
subplot(1,2,1);
imshow(I);
title('Original')
subplot(1,2,2);
imshow(bpts);
title('Branch Points')

%Sum Stuff
nbranch = sum(I(find(imdilate(bpts,strel('disk',1)) - bpts))==1); %#ok<FNDSB>

%Algorithm:
%Find the perimeter pixels by subtracting the original branch points image
%from the one pixel dilated branch points image. Sum these values that are
%true in the skeleton image.
%%%
From: Lars-Göran Nord on
"Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <i3hgul$8gc$1(a)fred.mathworks.com>...
> "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> wrote in message <i3hcep$kks$1(a)fred.mathworks.com>...
> > "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <i3bva5$k78$1(a)fred.mathworks.com>...
> > > "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> wrote in message
> > > > Sean,
> > > >
> > > > I don't like the result,
> > > >
> > > > I love it:-)
> > > > works flawlesly and gets correct answers:-)
> > > > will check more tomorrow.
> > > >
> > > > Thanks Sean
> > > >
> > > > Lars
> > >
> > > Glad to hear, and you're welcome!
> > > I hope the car is doing well also, that sounds like a much more interesting project overall.
> > >
> > > Let me know if you need anything else. As far as the above code it should work all of the time, unless, as the comment hinted at two objects are returned. In this case you'll have to decide what to do. It would be 1 or 2 lines of code to keep only the orientation which contains the center pixel.
> > > I think I may program the max crack width algorithm I described above. It's a good excuse for me to program as opposed to journal/thesis write, which is far more enjoyable :)
> > >
> > > -Sean
> >
> >
> >
> > Hi Sean,
> >
> > I have tryed the script on a lot of "fake" cracks and it works all the times:-)
> >
> > Now to finding and counting the intersections (3 and 4 crossings) I have looked at my_orientations and can see that every intersection contains both + and - values in the columns, there is also like 4 values in the column at intersections (high angle) and 5 or maybe more values in columns at low angle intersections.
> > Can this be used in some way???
> > Or is the connectivity tool with "high connectivity" the right way to go?
> >
> > Lars
>
> If I understand you correctly: you're trying to identify crack intersection points and how many intersections at these points?
>
> Instead of using orientation for this, you might be able to use the 'BranchPoints' option in bwmorph() on the skeleton that's already been created. Each branch point returned will mean either 3 or 4 cracks coming in to it. You could find out how many by summing the neighbors it has that are on. In the event of two branch points touching you'd have to sum the points on this new object's perimeter. Here's an example of that occurring:
>
> %%%%
> %Test Skeleton
> I = false(5);
> I(2,2) = true;
> I(:,3) = true;
> I(1,1) = true;
> I(3,4) = true;
>
> %Get Branch Points
> bpts = bwmorph(I,'branchpoints');
>
> %Plot stuff
> subplot(1,2,1);
> imshow(I);
> title('Original')
> subplot(1,2,2);
> imshow(bpts);
> title('Branch Points')
>
> %Sum Stuff
> nbranch = sum(I(find(imdilate(bpts,strel('disk',1)) - bpts))==1); %#ok<FNDSB>
>
> %Algorithm:
> %Find the perimeter pixels by subtracting the original branch points image
> %from the one pixel dilated branch points image. Sum these values that are
> %true in the skeleton image.
> %%%

Sean,

Thank you, I will start testing at once and will try to get this together for monday. I think I can dig out some "real" images of cracks then.
You are correct as a sniper:-) a hit every time:-)

Thank you Sean,

Lars
First  |  Prev  | 
Pages: 1 2 3 4 5 6 7 8 9 10
Prev: Find word in string
Next: starn matlab with crontab