Ask Your Question

fabiano moreira's profile - activity

2018-07-26 20:02:06 -0600 received badge  Notable Question (source)
2017-06-13 20:46:31 -0600 received badge  Popular Question (source)
2016-06-23 22:37:32 -0600 commented answer SimpleBlobDetector in opencv for android

hello , I already have a parameter file in the assets folder, but I can not read through the read () method ; Can you help me? I change the parameters of the file, and they do not make changes to the image.

public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {

    Mat src = inputFrame.gray();
    cannyEdges = src.clone();


    FeatureDetector blobDetector;
    blobDetector = FeatureDetector.create(FeatureDetector.SIMPLEBLOB);

    MatOfKeyPoint keypoints1 = new MatOfKeyPoint();

    blobDetector.read("params.xml");

    blobDetector.detect(src,keypoints1);

    org.opencv.core.Scalar cores = new org.opencv.core.Scalar(0,255,0);
    org.opencv.features2d.Features2d.drawKeypoints(src,keypoints1,cannyEdges,cores,2);
2015-11-06 21:06:48 -0600 commented answer OpenCV - Blob detection Java with params

great berak. It worked perfect. thank you

2015-11-05 13:57:06 -0600 asked a question OpenCV - Blob detection Java with params

I need a Java code with blob detection using parameters (example filterByCircularity). I found several examples in C ++ and Python, but none in Java with OpenCV. I have the code below and need to implement the parameters of blobs detection, (example filterByCircularity). Someone has already implemented this?

Mat orig = Highgui.imread("E:\\PhotoIn.jpg",Highgui.IMREAD_GRAYSCALE);

Mat MatOut= new Mat();

FeatureDetector blobDetector;

blobDetector = FeatureDetector.create(FeatureDetector.SIFT);

MatOfKeyPoint keypoints1 = new MatOfKeyPoint();

blobDetector.detect(orig,keypoints1); 

org.opencv.core.Scalar cores = new org.opencv.core.Scalar(0,0,255);

org.opencv.features2d.Features2d.drawKeypoints(orig,keypoints1,MatOut,cores,2);

Highgui.imwrite("e:\\PhotoOut.jpg", MatOut);
2015-11-05 06:06:39 -0600 commented question Simple Blob Detector Params Meaning

Barry , I need this code in JAVA using blob detection using the parameters . Could you send me? Just found to date examples in C ++ and Python .

2015-10-06 21:27:22 -0600 commented answer Count drops of blood

Great Lberger . Two questions: You use Eclipse for C ++ ? It is possible to run this code in C ++ on android ?

2015-10-06 20:30:52 -0600 commented question Count drops of blood

Exactly LBerger and LorenaGdl. Even using a picture with paint circles in the program is not working. You have any suggestions . Thank you.

2015-10-05 22:19:28 -0600 answered a question Count drops of blood

I wrote the code to Java and it's not working . Could someone help me?

int count=0; Mat orig = Highgui.imread("E:\photo.jpg",Highgui.CV_LOAD_IMAGE_GRAYSCALE); Imgproc.adaptiveThreshold(orig, orig, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY , 15, 5); Imgproc.dilate(orig, orig, Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(2, 2))); ArrayList <matofpoint> contours = new ArrayList < MatOfPoint >(); contours.clear(); Imgproc.findContours ( orig , contours , new Mat (), Imgproc . RETR_LIST , Imgproc.CHAIN_APPROX_SIMPLE ); for(int a=0;a<contours.size();a++) <br=""> { if(Imgproc.contourArea(contours.get(a)) > 20 & Imgproc.contourArea(contours.get(a)) < 150 ) { Rect rect = Imgproc.boundingRect(contours.get(a)); Core.rectangle(orig,new Point(rect.x,rect.y),new Point(rect.x+rect.width,rect.y+rect.height),new Scalar(0, 255, 0)); count++; } } Highgui.imwrite("e:\photoout.jpg", orig);

2015-10-05 12:03:34 -0600 answered a question Detect red pimples on face using openCV

galharth , I have the same need her , but need to do the counting drops of blood on the skin. I posted this in the forum. There is this same implementation in Java?

2015-10-02 00:41:15 -0600 asked a question Count drops of blood

Hi, I need to develop a java program openCV to run on Android. The program will capture an image of a skin and make the score drops of blood that is enclosed within a square of 2.5 cm. I'm currently using the blob detection, but the program is not functioning well. Still unable to delineate the count within the area of 2.5 cm. I would like some help from you. Thank you.

Photo 1: https://drive.google.com/file/d/0B-HZ...

Photo 2: https://drive.google.com/file/d/0B-HZ...

Edit:

I wrote the code to Java and it's not working . Could someone help me?

int count=0;
        Mat orig = Highgui.imread("E:\\photo.jpg",Highgui.CV_LOAD_IMAGE_GRAYSCALE);
        Imgproc.adaptiveThreshold(orig, orig, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY , 15, 5);
        Imgproc.dilate(orig, orig, Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(2, 2)));
        ArrayList <MatOfPoint> contours =  new  ArrayList < MatOfPoint >(); 
        contours.clear();
        Imgproc.findContours ( orig , contours ,  new  Mat (),  Imgproc . RETR_LIST ,  Imgproc.CHAIN_APPROX_SIMPLE );
        for(int a=0;a<contours.size();a++)  
        {
             if(Imgproc.contourArea(contours.get(a)) > 20 & Imgproc.contourArea(contours.get(a)) < 150 )
             {
                 Rect rect = Imgproc.boundingRect(contours.get(a));
                 Core.rectangle(orig,new Point(rect.x,rect.y),new Point(rect.x+rect.width,rect.y+rect.height),new Scalar(0, 255, 0));
                 count++;
             }
        }
         Highgui.imwrite("e:\\photoout.jpg", orig);