Ask Your Question

choro's profile - activity

2020-07-30 02:40:08 -0600 received badge  Notable Question (source)
2019-11-18 04:52:58 -0600 received badge  Popular Question (source)
2017-08-12 02:12:07 -0600 received badge  Scholar (source)
2017-08-09 08:29:56 -0600 commented answer Why I can't create a polylines

thank you very much :))

2017-08-09 07:11:02 -0600 received badge  Student (source)
2017-08-09 05:22:06 -0600 received badge  Editor (source)
2017-08-09 05:21:05 -0600 asked a question Why I can't create a polylines

t2 is a vector(Point2f). When I create a circle that's success. but can't create a polylines

     for (int sn=0; sn<2; sn++){
            mat.copyTo(image);
            for(int ar=0; ar<jnt[0]

.size(); ar++){
            t1 = pointz.at(ar);
            t0 = jnt[ax].at(ar); //ref
            t1.x = c60 * (t0.x - t1.x) - s60 * (t0.y - t1.y) + t1.x;
            t1.y =  s60 * (t0.x - t1.x) + c60 * (t0.y - t1.y) + t1.y;
            t.push_back(t1);
        }
        t2=t;
        t.clear();
        etrans = evec.t();
        Qnew = Mat (t2).reshape(0,5);
        yminq = Qnew - q_bar;
        b_bar = etrans.mul(yminq);
        q_new = q_bar +( b_bar.mul(evec));
        qbaru = q_new.reshape(0,1);
        y_bar = qbaru;
        pointz = t2;
        q_bar = Mat(t2).reshape(0,5);
        waitKey(1000);

    }
    for(int ao=0; ao<t2.size(); ao++){
        Point pt = t2.at(ao);
        circle(image,pt,1,Scalar(0,0,255),2);
    }
    cvtColor(image, image, COLOR_BGR2GRAY);
    polylines(image,t2,false,Scalar(255,255,255),2,150,0);
    imshow("Fitting",image);

this is the error

OpenCV Error: Assertion failed (p.checkVector(2, CV_32S) >= 0) in cv::polylines, file ........\opencv\modules\core\src\drawing.cpp, line 2067

thankyou :)

2017-07-25 21:57:23 -0600 asked a question Search Minimal Value in Open CV

Excuse me, is there anyone knows how to search minimal value from this valueimage description

i have tried with minMaxLoc but it didn't work... am I wrong? Or any suggestion? Thank you

2017-06-11 10:48:42 -0600 asked a question Scanning white pixel and make rectangle for border contour

Excuse me, i wanna scan white pixel in this image and make border around whole contour that has white color . But I dont know how to code it. This is the result. :( I'm so confuse .

C:\fakepath\1.JPG

C:\fakepath\2.JPG

Mat grayi;
//To store the thresholded image
Mat ret;
//convert the image to grayscale
cvtColor(intpro,grayi,CV_BGR2GRAY);
imshow("Gray Image",grayi);
//threshold the image
threshold(grayi,ret,0,255,CV_THRESH_OTSU);
imshow("Thres",ret);

Mat grayi;
//To store the thresholded image
Mat ret;
//convert the image to grayscale
cvtColor(intpro,grayi,CV_BGR2GRAY);
imshow("Gray Image",grayi);
//threshold the image
threshold(grayi,ret,0,255,CV_THRESH_OTSU);
imshow("Thres",ret);Mat horizontal(ret.cols,2,CV_32S);//horizontal histogram
horizontal = Scalar::all(255);
Mat vertical(ret.rows,1,CV_32S);//vertical histogram    
vertical = Scalar::all(255);

for(int i=0;i<ret.cols;i++)
{
    int hor= horizontal.at<int>(i,0)=countNonZero(ret(Rect(i,0,1,ret.rows)));           
cout<< hor;
rectangle(ret, Rect(0, i, hor, 1), Scalar(255,255,255), 2);
}
for(int i=0;i<ret.rows;i++)
{
    int ver = vertical.at<int>(i,0)= countNonZero(ret(Rect(0,i,ret.cols,1)));
    cout<< ver;
    //= countNonZero(ret(Rect(0,i,ret.cols,1)));
    rectangle(ret, Rect(0, i, ver, 1), Scalar(255,255,255), 2);
}
imshow("cc",ret);

} please anyone help me :(. Thank you