How do I segment an image containing 4 animals lying close to each other into separate blobs?

I am working on a project where I need to segment an image containing various pigs lying very close to each other. I need to get each pig to become a separate object on the image (so that i can do some statistics on individual pigs). I have read about the watershed transform but it gives me very bad results. I was hoping that someone might tell me how to approach this issue using any technique (I'm not very experienced with MATLAB). I would be be very grateful for any kind of help. I have attached the grayscale, rgb and binary images for details.

Answers (2)

Look into deep learning. Sorry, but it's not going to be some simple 50 line program.

6 Comments

I wish I could, it's not really within the scope of my project and there are time limitations too. Looking at the binary image i posted above, Isn't there a way that i could fit an ellipse into the individual pigs and use the line dividing the angle between 2 adjacent ellipses into equal parts to separate the pigs. Also i forgot to mention that I have the raw depth data obtained from a kinect sensor. Is there any statistical method or algorithm i can apply to the depth data on the conjoined pigs to separate them? Any suggestion would be appreciated.
I think the possible shapes are just too complicated to do it automatically so you'll have to use imfreehand to hand draw the separations. Since you're under a time crunch, this is probably the fastest way. Otherwise you might spend weeks or months coming up with a deep learning solution. Hand tracing it can get it done within hours probably.
Thank you for your answers. If I had the time, what deep learning technique would you suggest that i use to solve this problem?
Start with something simple like AlexNet but you're going to still have to hand trace the animals so that you can put the localization data into the network along with the images themselves so the network can learn how to split apart animals.
Is there a way to use watershed segmentation to separate the area I circled in the above binary image? Please help me out with the code if there is. Thank you.

Sign in to comment.

You might try this link
Detecting Mammals in UAV Images: Best Practices to address a substantially Imbalanced Dataset with Deep Learning
Knowledge over the number of animals in large wildlife reserves is a vital necessity for park rangers in their efforts to protect endangered species. Manual animal censuses are dangerous and expensive, hence Unmanned Aerial Vehicles (UAVs) with consumer level digital cameras are becoming a popular alternative tool to estimate livestock. Several works have been proposed that semi-automatically process UAV images to detect animals, of which some employ Convolutional Neural Networks (CNNs), a recent family of deep learning algorithms that proved very effective in object detection in large datasets from computer vision. However, the majority of works related to wildlife focuses only on small datasets (typically subsets of UAV campaigns), which might be detrimental when presented with the sheer scale of real study areas for large mammal census. Methods may yield thousands of false alarms in such cases. In this paper, we study how to scale CNNs to large wildlife census tasks and present a number of recommendations to train a CNN on a large UAV dataset. We further introduce novel evaluation protocols that are tailored to censuses and model suitability for subsequent human verification of detections. Using our recommendations, we are able to train a CNN reducing the number of false positives by an order of magnitude compared to previous state-of-the-art. Setting the requirements at 90% recall, our CNN allows to reduce the amount of data required for manual verification by three times, thus making it possible for rangers to screen all the data acquired efficiently and to detect almost all animals in the reserve automatically.

Categories

Products

Release

R2014a

Asked:

on 11 Jun 2018

Edited:

on 9 Jul 2018

Community Treasure Hunt

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

Start Hunting!