Ask Your Question

Nehalkumar's profile - activity

2020-05-05 10:28:28 -0600 received badge  Popular Question (source)
2019-11-04 02:23:37 -0600 received badge  Notable Question (source)
2018-08-10 01:29:45 -0600 received badge  Notable Question (source)
2016-11-26 10:37:33 -0600 received badge  Popular Question (source)
2016-02-15 11:43:18 -0600 received badge  Popular Question (source)
2014-08-02 02:06:27 -0600 commented answer how to detect and count pills (capsules)

as per our discussion , i am use findContours then after find area and drawContours but camera distance give different number pills from different distance. how to solve distance problem ? you have any idea regarding this.

2014-08-01 00:41:16 -0600 received badge  Supporter (source)
2014-07-30 23:44:21 -0600 commented question how to detect and count pills (capsules)

ok i am also think on it and you get then update me . Thank you....

2014-07-29 08:57:16 -0600 received badge  Student (source)
2014-07-29 01:25:54 -0600 commented question how to detect and count pills (capsules)

Hello StevenPuttemans i upload images please check and give solution how to detect all pills using opencv android

2014-07-23 05:14:41 -0600 commented question how to detect and count pills (capsules)

background is white(normal no another item at background) and light is appropriate for detect. it's depend on shape(cylinder shape)

2014-07-23 04:54:10 -0600 commented question how to detect and count pills (capsules)

These images are from google. But in my criteria 5 to 10 capsule on table and user start app camera and count the capsules. like i have 10 live capsules on table and count it

2014-07-23 04:11:55 -0600 commented question how to detect and count pills (capsules)

How to detect capsules from image using opencv android ? Just now i am using generalize Hough transform algorithm to detect capsules

2014-07-23 02:15:28 -0600 asked a question how to detect and count pills (capsules)

Which algorithm is use full to detect pills and capsules. And after detection count the number of capsules on the table using opencv android.

image description

image description

2014-07-07 01:19:29 -0600 received badge  Critic (source)
2014-07-05 04:47:10 -0600 commented answer How to count number of coins in android opencv ?

hello balaji i am uploading all images which i am getting during counting coin procedure. please check and give feedback.i am not get 100% result.Give another solution . thanking you

2014-07-05 04:43:45 -0600 answered a question How to count number of coins in android opencv ?

These all are screen shot of counting coin procedure 1)input image description 2)gray image description 3)smooth image description 4)threshold image description 5)canny image description 6)smooth image description 7)output image description

i am not get 100 % result every time ? some time get 100% and some time dummy data get

2014-07-04 08:25:11 -0600 commented answer How to detect coin and pills using opencv android ?

hello Mathieu thank you for answer but my problem is i am not get 100% result like(i count 10 coins and some time i get 10 and some time 9,8,11,..,7 so on ). in android is possible i get 100% correct result like i count 10 coin and i get 10.

2014-07-04 08:23:57 -0600 commented answer How to count number of coins in android opencv ?

hello balaji thank you for answer but my problem is i am not get 100% result like(i count 10 coins and some time i get 10 and some time 9,8,11,..,7 so on ). in android is possible i get 100% correct result like i count 10 coin and i get 10

2014-07-02 05:15:36 -0600 commented answer How to detect coin and pills using opencv android ?

Here is my code but i am not able to count coin please help me

http://answers.opencv.org/question/36111/how-to-count-number-of-coins-in-android-opencv/

2014-07-02 04:29:56 -0600 asked a question How to count number of coins in android opencv ?

Here is my code but i am not able to count the coins..

Bitmap i = getBitmap(imgPath + "mmsqqq.jpg");

    //Log.i("after Bitmap i",""+imgPath);
    Bitmap bmpImg = i.copy(Bitmap.Config.ARGB_8888, false);
    //Log.i("after Bitmap bmpImg",""+imgPath);
    Mat srcMat = new Mat ( bmpImg.getHeight(), bmpImg.getWidth(), CvType.CV_8UC3);
    Bitmap myBitmap32 = bmpImg.copy(Bitmap.Config.ARGB_8888, true);
    Utils.bitmapToMat(bmpImg, srcMat);


    //convert to gray scale and save image
    Mat gray = new Mat(srcMat.size(), CvType.CV_8UC1);
    //Imgproc.cvtColor(srcMat, gray, Imgproc.COLOR_RGB2GRAY,4);
    Imgproc.cvtColor(srcMat, gray, Imgproc.COLOR_BGRA2GRAY);
    //write bitmap
    Boolean grayBool = Highgui.imwrite(imgPath + "gray.jpg", gray);
    //Toast.makeText(this, "Gray scale image saved!", Toast.LENGTH_SHORT).show();

    //thresholding
    Mat threshed = new Mat(bmpImg.getWidth(),bmpImg.getHeight(), CvType.CV_8UC1);
    Imgproc.adaptiveThreshold(gray, threshed, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 75, 5);//15, 8 were original tests. Casey was 75,10
    //Imgproc.adaptiveThreshold(threshed, threshed, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY_INV, 75, 5);
    Core.bitwise_not(threshed, threshed);
    Utils.matToBitmap(threshed, bmpImg);
    //write bitmap
    Boolean boolThr = Highgui.imwrite(imgPath + "threshed.jpg", threshed);
    //Toast.makeText(this, "Thresholded image saved!", Toast.LENGTH_SHORT).show();


    //perform Canny Edge Detection and convert to 4 channel
    Mat edge = new Mat();
    Mat dst = new Mat();
    Imgproc.Canny(threshed, edge, 80, 90);
    Imgproc.cvtColor(edge, dst, Imgproc.COLOR_GRAY2RGBA,4);
    //convert to bitmap
    Bitmap resultBitmap = Bitmap.createBitmap(dst.cols(), dst.rows(),Bitmap.Config.ARGB_8888);           
    Utils.matToBitmap(dst, resultBitmap);
    //write bitmap
    Boolean bool = Highgui.imwrite(imgPath + "edges.jpg", dst);
    //Toast.makeText(this, "Edge information image saved!", Toast.LENGTH_SHORT).show();


    //smoothing
    Mat smoothed = new Mat(bmpImg.getWidth(),bmpImg.getHeight(), CvType.CV_8UC1);
    Imgproc.GaussianBlur(dst, smoothed, new org.opencv.core.Size(3,3), 50);
    Utils.matToBitmap(smoothed, bmpImg);
    //write bitmap
    Boolean boolSmoothed = Highgui.imwrite(imgPath + "smoothed.jpg", smoothed);
    //Toast.makeText(this, "Smoothed image saved!", Toast.LENGTH_SHORT).show();

    //morphological operations
    //dilation
    Mat dilated = new Mat(bmpImg.getWidth(),bmpImg.getHeight(), CvType.CV_8UC1);
    Imgproc.dilate(smoothed, dilated, Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new org.opencv.core.Size (16, 16)));
    Utils.matToBitmap(dilated, bmpImg);
    //write bitmap
    Boolean boolDilated = Highgui.imwrite(imgPath + "dilated.jpg", dilated);
    //Toast.makeText(this, "Dilated image saved!", Toast.LENGTH_SHORT).show();

    //erosion
    Mat eroded = new Mat(bmpImg.getWidth(),bmpImg.getHeight(), CvType.CV_8UC1);
    Imgproc.erode(dilated, eroded, Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new org.opencv.core.Size(15, 15)));
    Utils.matToBitmap(eroded, bmpImg);
    //write bitmap
    Boolean boolEroded = Highgui.imwrite(imgPath + "eroded.jpg", eroded);
    //Toast.makeText(this, "Eroded image saved!", Toast.LENGTH_SHORT).show();


    //hough circles
    Mat circles = new Mat();

    // parameters
    int iCannyUpperThreshold = 100;
    int iMinRadius = 20;
    int iMaxRadius = 100;
    int iAccumulator = 100;

    Imgproc.HoughCircles(eroded,circles,Imgproc.CV_HOUGH_GRADIENT,1.0, eroded.rows()/8,iCannyUpperThreshold,iAccumulator,iMinRadius,iMaxRadius);
    Log.i("cccccccccccccccccccccc","cccc"+circles.cols());      
    // draw
    if (circles.cols() > 0)
    {           
        //Toast.makeText(this, "Coins : " +circles.cols() , Toast.LENGTH_LONG).show();
        alertString = "Number of coins detected : " + circles.cols();
        displayAlert(alertString);
    }
    else
    {
        //Toast.makeText(this, "No coins found", Toast.LENGTH_LONG).show();
        alertString = "No objects detected";
        displayAlert(alertString);
    }

Help me to solve this problem. Thank You.

image description image description

2014-07-02 03:58:28 -0600 received badge  Scholar (source)
2014-07-02 03:58:11 -0600 commented answer How to detect coin and pills using opencv android ?

any idea about counting the object using opencv android (like capsules and coin)

2014-07-01 07:11:28 -0600 commented question How to detect coin and pills using opencv android ?

Thank you itay. i will check and post result..

2014-07-01 06:15:38 -0600 commented question How to detect coin and pills using opencv android ?

its unknown type (coin means count circle) and (pills means capsules).

2014-07-01 05:50:29 -0600 commented question How to detect coin and pills using opencv android ?

my app goal is if i press on count coin button then they count number coin and second time i press pills button they count number of pills.

2014-07-01 04:50:27 -0600 commented question How to detect coin and pills using opencv android ?

Thank You for feedback and please check images give solution.

2014-07-01 04:47:31 -0600 received badge  Editor (source)
2014-07-01 02:02:52 -0600 asked a question How to detect coin and pills using opencv android ?

I am not understanding how to detect coin and pills in android using opencv.

If anyone know hten help me or give link or give code so i understand and work on it. image description image description image description Thank You