Need solution how to detect crack on egg's shell

Status
Not open for further replies.

aman1988

New Member
recently, my lecturer given me a task on how to detect crackk on egg shell using matlab (image processing toolbox)
im totally a newbie in this area. i read all forum, learn step by step n i stuck at how to define the region as crackk.
can someone guide me directly cuz due date is near.


View attachment 61932
this image i take using candling method. using a normal white bulb.


View attachment 61933
my last image of boundary


how to make the picture clearer just only views the crackk..

HELP ME! TY
 
Think about how a crack is different from a non crack.
Write a routine to remove the non crack splotches.
 
can be more specific on how to write a routine to remove the non crack splotches?
i had trouble on how to create the routine.. in my learning, only covered basic about image processing.
 
No, matlab was invented long after I left school.
 
You need to write code to look for long spots on the egg. It looks like short spots are fine. Long spots are a crack.
 
Hi,

This is a little interesting.

Based on your posted images, i would think the simplest method would be a tracing method where you scan the image in an orderly fashion say left to right and top to bottom looking for a light spot. Once you find a light spot, you follow the pixels in various directions to figure out the length of the spot. If the spot is long enough it's a crack.

Also, you probably wont want to do this but if you bathe the egg in food coloring diluted with water the crack is easier to detect.
 
Last edited:
Looking at the crack; the edges of the crack look sharper than the edges around the spots. Try playing with edge detect, and fine edge detect.
 
aman1988 engineers are thinkers. Why are you refusing to think!

Surely you can figure out how a crack differs from a non crack.
 
It's not such an easy problem, even for someone with experience in 2D video processing algorithms.

If you can eliminate the outer 10% edge of the egg and process only the part directly facing the camera the job gets easier.

Then islanding can remove the majority if small isolated splotches but will probably not be enough processing in total. You may need to add some type of linear feature detection after the islanding process removes most of the splotches.
 
You need to write code to look for long spots on the egg. It looks like short spots are fine. Long spots are a crack.

such as? i mean the code. from my references, my senior does this code to detect dirt.



so i think to detect crack is very similar to detect dirt but using different technique.
pls give some hint to doing the code.

p/s : this code come with interface, so i only take the dirt part
 
Last edited:

dear mr RB, can u give me some hint how to eliminate the outer 10% edge like you said. i mean i need more references.
 

right now i dun have enough time to thinks. can u teach me?
 
dear mr RB, can u give me some hint how to eliminate the outer 10% edge like you said. i mean i need more references.

I meant to remove the outer edge from all the testing. This can be done by only allowing and using the more central oval area.

I don't want to be rude but it does sound like you want everyone else to do your homework project for you...
 
right now i dun have enough time to thinks. can u teach me?

Hi,

Well first you load the image into memory as a bitmap, 24 bit or 32 bit most likely.
Then you start at the top or bottom row and scan across the row peeking the color pixel values, then the next row, etc., until you've scanned every row. While you are peeking all the color values, you create an array that stores say 128 of the brightest colors, where the array holds the count of those colors found. You then look for the max count and that color becomes your search color or you use several colors if they are nearly the same and you'll search for either of those colors.
You then scan again, looking for groups of pixels that match one of the search colors. If a pixel is adjacent (above, below, left, right, diagonal, etc.) to the current pixel it is considered one of the group. You'll have to figure out how to do this algorithmically.

I actually had to do this once in a program, but instead of searching for patches of grouped pixels of the same color i only had to search for straight lines that were connected forming rectangles. That was a little easier. To do this, i looked at the surrounding pixels and if one of them was the same color that became the next current scan pixel.
You probably have to follow the pixels across and up and down and diagonally and find the greatest path distance between the border pixels, path distance being the sum of individual pixel distances. this wont be super easy to work out, but you should be able to come up with something.
You probably only need the greatest distance across a patch, which could be in any direction and even change direction, but that might not be too hard to do.
 
Last edited:
I meant to remove the outer edge from all the testing. This can be done by only allowing and using the more central oval area.

I don't want to be rude but it does sound like you want everyone else to do your homework project for you...

mr RB. no i want to do it by myself as it is for my future too. what i mean is i need someone who can guide me. hard without any knowledge and experience. btw thanks for ur answer
 

i try 1st. if cant i will ask u again
 
Just stumbled across this thread and thought the problem set was quite an interesting one and something that I would not have had much trouble with as a student, but I've nothing to do with matlab.

I have no idea what sort of course aman1988 is doing or what background knowledge he has already learned.

So knowing nothing about matlab I should be able to give you almost direct solutions and not actually do it for you.

The question was put to you, "What differentiates a crack from non-crack ?"
Or, define in mathematical terms what isn't a crack. Calculus is the tool you want.
So I hope you've already covered basic calculus else you might consider going back and learning the basics.

Well any pixel which is surrounded by similiar pixels is not part of a crack.
Where a pixel varies greatly from it's neighbour defines some sort of boundary.
Differentiation of a pixel's luminance or chromonance from it's neighbours either immediate or distant.

You're second image looks like a good start. It doesn't define the edges of the egg, and there are large clusters of pixels in the center which I would consider to be noise. The most obvious part of the crack is there, while the weaker parts are not.

Some simple alogrythms might help eliminate some of the noise. Weighting the pixels. Assigning each pixel weight and then running a "game of life" kind of algorythm over it. eliminate pixels which do not have at least two neighbouring pixels on opposite sides etc.
 

ty so much..
now i understand.
im was a mechanical student once.
cont my further study in industrial automation & robotics technology
so a bit hard to do anything without any knowledge.
that's y here i seek for guidance
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…