Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can do it by generating random color using rand() function in c++

Scalar clr(rand() % 255,rand() % 255,rand() % 255); // create random color variable

for ( ) // inside loop
{
cvLine(shape, cvPoint(z,a), cvPoint(o,n), clr(p,r,u),1,1);  // draw circle 
}

You can do it by generating random color using rand() function in c++

   // create random color variable
   Scalar clr(rand() % 255,rand() % 255,rand() % 255); // create random color variable
  for ( ) // inside loop
 {
 cvLine(shape, cvPoint(z,a), cvPoint(o,n), clr(p,r,u),1,1); clr,1,1);  // draw circle 
 }

You can do it by generating random color using rand() function in c++

   // create random color variable
   Scalar clr(rand() % 255,rand() % 255,rand() % 255); 

    for ( ) // inside loop
    {
    cvLine(shape, cvPoint(z,a), cvPoint(o,n), cv::Line(shape, cv::Point(z,a), cv::Point(o,n), clr,1,1);  // draw circle line with random color 
    }

You can do it by generating random color using rand() function in c++

 // create random color variable
   Scalar clr(rand() % 255,rand() % 255,rand() % 255); 

    for ( ) // inside loop
    {
    cv::Line(shape, cv::Point(z,a), cv::Point(o,n), clr,1,1);    // create random color variable
       Scalar clr(rand() % 255,rand() % 255,rand() % 255);  

       // draw line with random color            
       cv::Line(shape, cv::Point(z,a), cv::Point(o,n), clr,1,1); 
    }