Getting blobs from similar colored contours in grayscale image
Here is a simple steps in c++ to identify the Objects you want to detect! Hope this solves your problem!



void main()
{
    Mat mSource_Bgr,mSource_Gray,mSmoothed,mEdge,mThres;
    mSource_Bgr= imread(FileName_S.c_str(),IMREAD_COLOR);
    cvtColor(mSource_Bgr,mSource_Gray,COLOR_BGR2GRAY);

    medianBlur(mSource_Gray,mSmoothed,5); /*Just to smooth the Edges*/
/*This is for Automatically calculating the Canny Threshold values*/
    double CannyAccThresh = threshold(mSmoothed,mThres,0,255,CV_THRESH_BINARY|CV_THRESH_OTSU);
    double CannyThresh = 0.1 * CannyAccThresh;

    Canny(mSmoothed,mEdge,CannyThresh,CannyAccThresh); 

    Mat kernal_E,kernal_D;
    int erosion_size=2,dilation_size=2;
    kernal_E= getStructuringElement( MORPH_RECT,Size( 2*erosion_size + 1, 2*erosion_size+1 ),
                                       Point( erosion_size, erosion_size ) );
    kernal_D= getStructuringElement( MORPH_RECT,Size( 2*dilation_size + 1, 2*dilation_size+1 ),
                                       Point( dilation_size, dilation_size ) );
    dilate(mEdge,mEdge,kernal_D);//Just to make sure all the Edges are closed
    erode(mEdge,mEdge,kernal_E);

    imshow("mCanny_Edge",mEdge);
    imwrite(FileName_S+ "mCanny_Edge.bmp",mEdge);




    vector&lt;vector&lt;Point&gt; &gt; contours;
    vector&lt;Vec4i&gt; hierarchy;
    /// Find contours
    findContours( mEdge.clone(), contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
    /// Approximate contours to polygons + get bounding rects and circles
    vector&lt;vector&lt;Point&gt; &gt; contours_poly( contours.size() );
    for( size_t i = 0; i &lt; contours.size(); i++ )
    { 
        approxPolyDP( Mat(contours[i]), contours_poly[i], 1, true );
    }

    for (int i = 0; i &lt; contours_poly.size(); i++)
    {
        if(contours_poly[i].size()&gt;100)//Just a filter You can add more here
            drawContours(mSource_Bgr,contours_poly,i,Scalar(0,255,0),2);
    }
    imshow("mResult",mSource_Bgr);



    }