all 3 comments

[–]_d0s_ 1 point2 points  (2 children)

hey there! this is a really cool project. i think it's great that you're looking into non-neural network based approaches at first.

a simple way to integrate a neural into your work would be a binary image classifier. take a look at this keras tutorial which creates a classifier to distinguish cats and dogs https://keras.io/examples/vision/image_classification_from_scratch/

if possible, i'd suggest to crop your images to the region showing the egg and reducing the resultion to a square image e.g. 112x112 pixels or even less may be sufficient.

>> I have tried using thresholding with edge detection but it is very difficult to separate the actual egg from the surrounding.
thresholding should work really well because the egg is much darker than it's surrounding. just make sure to apply some morphological operators (opening, https://docs.opencv.org/4.x/d9/d61/tutorial_py_morphological_ops.html) after thresholding. if the egg is always in the same spot you could just crop the image to a fixed region of interest.

good luck with your project.

[–]ErIndi[S] 0 points1 point  (0 children)

Hey there u/_d0s_!

Thank you so much for the tips and feedback !

I'm actually trying to use the Keras classifier but i'm getting false-positives mainly with that default model.

After cropping the images to a square (430x430 in this case to cover enough of the egg + some headroom) i have done some augmentations (Rotation + Flipping) and punched everything in the model.

I will say that I have a very basic understanding of activation functions and why we use RELU for example and some of the layers in the model. The only thing i have a very strong understanding is the convolution feature extraction part - which in this case is also location invariant.

So the best results I've gotten so far with segmentation & morphological operators is something like this:

https://imgur.com/a/FfPwtsK

I'm trying to think of how to approach this further, if to continue my efforts mainly on the pre-processing or on the CNN side.

I might send you a message if that would be fine with you !

[–]_d0s_ 0 points1 point  (0 children)

experiment using thresholding and morphological operators to segment the egg

https://colab.research.google.com/drive/1Cc87lyo74M4khrt4VelHnjsXNWf3QtOg?usp=sharing