Prev: Find word in string
Next: starn matlab with crontab
From: Lars-Göran Nord on 30 Jul 2010 17:29 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <dcc648d5-1c79-4c4f-b1de-53919ded9e61(a)g35g2000yqa.googlegroups.com>... > On Jul 30, 2:50 pm, "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> > wrote: > > The image is now on drop, onepixelline(a)drop.io > > This picture was made in photoshop and then processed in matlab, bwmorph(bw2, 'thin', inf); > > > > Lars- > ------------------------------------------------------------------------------------------------------------------------------ > Correction: Your image is at http://drop.io/onepixelline > > You can use bwarea() if you want a different way of calculating area > than sum(). sum() sums up all the "set" pixels. bwarea() applies > weighting factors to adjust for the fact that pixels, in a triangle > say, may be considered to have partial areas in each pixel depending > on whether neighboring pixels are set. For example > 0 1 > 1 1 > Is the area of this 3? Or is it sqrt(2)? Or something different? I think it's 2+sqrt(2), but I have to think it over one more time:-) Thanks
From: Lars-Göran Nord on 30 Jul 2010 17:42 "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> wrote in message <i2vg70$mm4$1(a)fred.mathworks.com>... > ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <dcc648d5-1c79-4c4f-b1de-53919ded9e61(a)g35g2000yqa.googlegroups.com>... > > On Jul 30, 2:50 pm, "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> > > wrote: > > > The image is now on drop, onepixelline(a)drop.io > > > This picture was made in photoshop and then processed in matlab, bwmorph(bw2, 'thin', inf); > > > > > > Lars- > > ------------------------------------------------------------------------------------------------------------------------------ > > Correction: Your image is at http://drop.io/onepixelline > > > > You can use bwarea() if you want a different way of calculating area > > than sum(). sum() sums up all the "set" pixels. bwarea() applies > > weighting factors to adjust for the fact that pixels, in a triangle > > say, may be considered to have partial areas in each pixel depending > > on whether neighboring pixels are set. For example > > 0 1 > > 1 1 > > Is the area of this 3? Or is it sqrt(2)? Or something different? > > I think it's 2+sqrt(2), but I have to think it over one more time:-) > > Thanks I have say I was wrong, 3 is right.
From: Lars-Göran Nord on 30 Jul 2010 18:19 "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> wrote in message <i2vgvc$bkb$1(a)fred.mathworks.com>... > "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> wrote in message <i2vg70$mm4$1(a)fred.mathworks.com>... > > ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <dcc648d5-1c79-4c4f-b1de-53919ded9e61(a)g35g2000yqa.googlegroups.com>... > > > On Jul 30, 2:50 pm, "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> > > > wrote: > > > > The image is now on drop, onepixelline(a)drop.io > > > > This picture was made in photoshop and then processed in matlab, bwmorph(bw2, 'thin', inf); > > > > > > > > Lars- > > > ------------------------------------------------------------------------------------------------------------------------------ > > > Correction: Your image is at http://drop.io/onepixelline > > > > > > You can use bwarea() if you want a different way of calculating area > > > than sum(). sum() sums up all the "set" pixels. bwarea() applies > > > weighting factors to adjust for the fact that pixels, in a triangle > > > say, may be considered to have partial areas in each pixel depending > > > on whether neighboring pixels are set. For example > > > 0 1 > > > 1 1 > > > Is the area of this 3? Or is it sqrt(2)? Or something different? > > > > I think it's 2+sqrt(2), but I have to think it over one more time:-) > > > > Thanks > I have to ask if your example is at the crossing of the lines, this part is quite small and might be treated in different ways if it helps to simplifie things. Lars > I have say I was wrong, 3 is right.
From: Sean on 30 Jul 2010 18:38 "Lars-Göran Nord" <lars-goran.nordh(a)uddeholm.se> wrote in message <i2vfo0$mtp$1(a)fred.mathworks.com>... > "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <i2vah4$gtb$1(a)fred.mathworks.com>... > > "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message = > > > If you just use > > sum() > > as I mentioned above it will give you an over estimate but depending on your application that may not be a bad thing. What are these lines measuring and what are you doing with the results? > > > > > > -Sean > > Typo, that sum() was kind of important to that sentence meaning anything. > > Very good comments, first of all the lines are measuring crack lengt (thermal fatigue of steel) and when I have the length of the one pixel lines (cracks) I will calculate an average crack width by dividing the total crack area from the original image with the length of cracks. > From the start I had an idea of finding pixels connected corner by corner and giving them the value sqrt(2) and all others connected face to face 1. I don't follow your 3*sqrt(2). First off, the 3*sqrt(2) was a typo; I meant just sqrt(2). (My typing has been failing me today, fortunately weekend is here!) For calculating the area of the crack just summing the pixels of the skeleton will probably give you an accurate enough length. The crack isn't a geometric surface and thus trying to fit a triangulated surface is probably no more accurate than a pixel face one. Also, since you're using total area in pixels as your area it would make sense to me to not triangulate the line and then pollute that measurement with pixel area. I.e. you would want triangulated perimeter of the outside of the crack to stay consistent. Those are just a few thoughts. We do a lot of work with crack propagation in concrete x-cmt images and that's usually what we use. Have a great weekend; hopefully you can get away from this!
From: ImageAnalyst on 30 Jul 2010 18:51
The image you uploaded looks pretty well binarized and skeletonized. It also has many breaks in the skeleton. If it were me, I'd just sum up all the pixels. I'd probably first try to get better lines with no breaks in them. Looks like the original image was maybe like metallic crystals and you then tried an edge detection and then thresholded and skeletonized. You might get a better skeleton with a better pre- process. Maybe the edges are weak in some areas due to noise or whatever. Maybe you could try a bilateral filter (http:// homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/ Bilateral_Filtering.html), or the mean shift algorithm to clean up the image before running the edge filter. If you share more information you'll get better suggestions. |