Ask Your Question

Peliks's profile - activity

2019-05-14 17:02:02 -0600 received badge  Popular Question (source)
2013-08-20 17:08:20 -0600 asked a question How to get the mass center of a contour ? Android opencv.

This is the c++ code.

vector<Moments> mu(contours.size() );
      for( int i = 0; i < contours.size(); i++ ){
          mu[i] = moments( contours[i], false );
      }

//Mass center
vector<Point2f> mc( contours.size() );
    for( int i = 0; i < contours.size(); i++ ){ 
        mc[i] = Point2f( mu[i].m10/mu[i].m00 , mu[i].m01/mu[i].m00 ); 
    }

This is my code so far in android. i can't convert the mass center to android.

    //moments
List<Moments> mu = new ArrayList<Moments>(contours.size());
    for (int i = 0; i < contours.size(); i++) {
        mu.add(i, Imgproc.moments(contours.get(i), false));
    }

//mass center
    List<MatOfPoint2f> mc = new ArrayList<MatOfPoint2f>(contours.size()); 
    for( int i = 0; i < contours.size(); i++ ){
        mc.add((mu.get(i).get_m10() / mu.get(i).get_m00() , mu.get(i).get_m01()/mu.get(i).get_m00()));
    }

Error in this line :

mc.add((mu.get(i).get_m10() / mu.get(i).get_m00() , mu.get(i).get_m01()/mu.get(i).get_m00()));

Thanks in advance.

2013-07-25 12:45:32 -0600 commented question Convex Hull on Java Android OpenCV 2.3

Have you solved this?

2013-07-17 10:03:32 -0600 received badge  Student (source)
2013-07-17 09:54:12 -0600 received badge  Editor (source)
2013-07-17 09:48:43 -0600 asked a question How to identify different images using OpenCV android?

Hi everyone, we are going to detect/identify the rice disease based on the segmented damaged part (3rd picture). The first picture has a disease called "Brown Spot" and the bottom is called "Rice Blast" and we have a plan on identifying other diseases. We are using opencv4android.

Basically these rice diseases vary mainly on colors and shape. Do you have an idea on how we are going to identify the different diseases? Thank you in advance.

This is the image. RiceDiseaseImage