Prev: Find word in string
Next: starn matlab with crontab
From: Walter Roberson on 30 Jul 2010 18:52 Lars-Göran Nord wrote: > "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 >> For example >> > 0 1 >> > 1 1 >> > Is the area of this 3? Or is it sqrt(2)? Or something different? > I have say I was wrong, 3 is right. Area of a triangle is 1/2 * base * height. If we interpret the base and height here to each be 2, then we would have 1/2 * 2 * 2 which would be an area of 2. If we interpret the 1's as marking pixel centers, then the base and height would each be 1, leading to an area of 1/2 . With regard to the length of the lines: Unfortunately at that resolution I cannot see how "smooth" the lines are. Would it be acceptable to approximate the length as if each line segment is convex when viewed from one of its sides? If you do not have to deal with zig-zags and figuring out the micro-level length, then I think it would likely be _relatively_ easy to find piecewise straight-line approximations based upon tangents to the curve that are extended to some tolerance from the actual line.
From: Lars-Göran Nord on 31 Jul 2010 06:13 "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <i2vk8c$7vp$1(a)fred.mathworks.com>... > "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! >Thank you Sean, >Interesting to hear you also have been hit with crack analysis problems. I can follow your area talk that I will use on the original image (none one pixel image) were the cracks have a width. >Just summing the pixels to get the length from my one pixel line is not sinking in, if I have a 45 deg. line i.e. all pixels connected corner by corner then this will be a quite incorrect method to me????? > Am I blinded by my method to use the one pixel line for getting my length, is there something in this perimeter I have missed? >Tiff image and a crop of .fig is now on drop. Lars
From: Lars-Göran Nord on 31 Jul 2010 06:26 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <fd388927-5180-480e-aedb-0f7efdc47061(a)d17g2000yqb.googlegroups.com>... > 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. > I have more images no one tiff and one crop of .fig >There are no brakes in the lines but if this will happen I will try your hint, thanks. > What I need in the end of all this is crack length, mean crack width and numbers of 3 and 4 crack intersections. Thanks again. Lars
From: Lars-Göran Nord on 31 Jul 2010 08:29 Walter Roberson <roberson(a)hushmail.com> wrote in message <i2vlar$2g2$1(a)canopus.cc.umanitoba.ca>... > Lars-Göran Nord wrote: > > "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 > >> For example > >> > 0 1 > >> > 1 1 > >> > Is the area of this 3? Or is it sqrt(2)? Or something different? > > > I have say I was wrong, 3 is right. > > Area of a triangle is 1/2 * base * height. > > If we interpret the base and height here to each be 2, then we would have > 1/2 * 2 * 2 which would be an area of 2. > > If we interpret the 1's as marking pixel centers, then the base and height > would each be 1, leading to an area of 1/2 . > > > With regard to the length of the lines: > > Unfortunately at that resolution I cannot see how "smooth" the lines are. > Would it be acceptable to approximate the length as if each line segment is > convex when viewed from one of its sides? If you do not have to deal with > zig-zags and figuring out the micro-level length, then I think it would likely > be _relatively_ easy to find piecewise straight-line approximations based upon > tangents to the curve that are extended to some tolerance from the actual line. >Thanks for your answer Walter >I have uploaded more images now > There are 3 things I need, crack (line) length, mean crack width and numbers of 3 and 4 "way crossings" >Right now I'm looking into the perimeter use (as Sean meantioned) and might be able to use perimeter/2 as the total crack length and then area/length to get mean crack width. Lars
From: Image Analyst on 31 Jul 2010 13:53
Lars: Well we're getting a little more info, bit by bit. It seems you are looking at cracks in something (rather than metal grains). Maybe Sean can help you, expecially if you're also dealing with cracks in concrete. The image you posted does have breaks. But it also has background so it looks like you saved the figure and uploaded it rather than saved the actual image - hence the background padding and breaks. Perhaps the next bit of information you could supply would be the actual binary image (not the saved image of it displayed in a figure), the original grayscale image from which you derived the binary image, and the code you used to derive the binary image. There is an option in bwmorph() that can find branchpoints in the skeleton. You will want to use that to count the number of crack intersections. To get crack width, you will not want to skeletonize the cracks, which of course just reduces all binary cracks down to a single pixel width. You'll want to measure the original, un-skeletonized binary image. Please don't start replying right after a > symbol of the prior post - that will just end up adding your message onto the prior one, so for example, Google will collapse all your text into the prior message since it thinks it's part of the same message, and I don't see it unless I expand it. |