How could I measure width of a weld?

1 view (last 30 days)
Mark
Mark on 1 Feb 2015
Edited: Mark on 8 Feb 2015
Hi, I'd like to write a code to measure the width of a plastic bag weld. I'm very inexperienced but I have an idea to seperate the outer boundary of the bag and the inner boundary of the weld and somehow calculate the width by comparing every pixel in the outer boundary to the closest one of the inner one. If the current width would be lower than set threshold, it would pop out error and show where there's an error. I think I could filter the image in such a way that I would have the outer boundary in one mask and the inner boundary in second one. I'm attaching a very simple image, demonstrating these borders.
Would something like this be possible and how would I go about doing it? Would there be a better way?
If you could help with anything, that would be amazing.
Thank you.

Answers (1)

Image Analyst
Image Analyst on 1 Feb 2015
Yes. You could use image analysis. See my File Exchange for tutorials. The exact algorithm depends on your image of course, and you have not shown us that (yet).
  4 Comments
Mark
Mark on 1 Feb 2015
Yes, the clean band around the yellow is the part that I would like to check. Improper weld would result in leaking of the yellow liquid into the band - > yellow in the band area. I'm really unsure about the algorithm that could be used here. There should also be an inspection, whether the actual bag is ruptured. That could look like a small tear in the otherwise smooth surface with even colour, which could be picked up by the edge detection as it would be a pretty significant change in intensity of the pixels around.
The first problem would be the complete basics though... The actual edge detection. When converted to gray scale, the image loses quite bit of information and it doesnt turn out good at all. The intensity is pretty much the same on the edge of the image as they are in the edges of the bag so this is how it looks like with even relatively high threshold for the function. Obivously if I lower the threshold it is even worse. Is there a different practice? Is there a possibilty of using another colour model for better results?
Image Analyst
Image Analyst on 1 Feb 2015
I don't think that if the yellow leaks into the flange area that it will be intense enough color to see. And I think first you need to find that flange and I don't think edge detection is the way to go. What I would do first is to find the yellow, like by adapting one of the color segmentation algorithms in my file Exchange. Then I would dilate that binary mask a certain number of pixels to get the flange area. Subtract the two masks to get just the flange area alone. Then I would use that mask to extract the original image in the flange region and get the standard deviation of the pixels. If the flange is uniform, that stdev will be low and if there is a leak, it will be higher. You could also do edge detection on the flange and look for high edge count.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!