Counting eggs of hen
Hi Experts,
I'm trying to count eggs on this picture with Opencv. but, I don't know what is the best way.
If you recommend me any way of counting eggs on the picture, please let me know your advice. if using classifier is the best way, pls let me know how to make classifier. or, could you pls provide me existing classifier for egg counting..?
thanks a lot..
Best Regards, HJ PS: As Ziri asked, I added more pictures and the colors of egg I want to count are white and brown. thanks a lot. Ziri
You can count egg blobs doing simple color threshold (choose color space model ) For overlapping eggs you can use watershed algorithm with Distance transform like in this example but instead of doing simple threshold
Use InRange function.
please provide some additional images if you have. let's think on a more general solution.
@Ziri.. Just, I have one doubt. If the color of the holder and eggs are same
Hi Ziri, Thanks a lot for your kind help.. I added 2 more pictures.. and , I want to count white and brown eggs
You can start by preparing training data ( positive and negative images) of egg with different colors in different situations... then use cascade classifier Check this link . -If results are not satisfying you'll have to use better methods ( Convolutional Neural Network ).
Hi Ziri, Thanks again.. I'll test cascade classifier first and try CNN if needed..
i think cascade classifier dont work. try new train_HOG.cpp there is a PR waiting to be accepted.
As worse as a cascade classifier will fail at this (to simply object and not rotation invariant) it will fail with HOG also. Your task needs something more versatile like DPM, DeepLearning, ACF/ICF ... although those are not available through OpenCV.
@nanuyo you keep updating the question, with little to no response. Can you at least respond to peoples suggestions?
sorry to Steven, as you advised, I reallised that it is not easy to count eggs on the basket with legacy computer vision algorithms. so, I will try to count eggs on the case only and removed a picture(eggs in the basket).and I want to add more simpler pictures for you .. but this editor (add comment) doesn't provide us attaching pictures.. Can I add the other pictures into the main story ?