Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mat operation & openmp mixed

Hi all, it's possible to mix mat operation & openmp?? like list code:

for ( ir = r_begin; ir < r_end; ir++ )
    {           
        /* For each image column */
        for ( ic = c_begin; ic < c_end; ic++ )
        {
            sum = sum_sq = 0;
            centervalue=src2.at<uchar>(ir,ic);

            cv::Rect roi(ic-c_begin,ir-r_begin,win_size,win_size);
            Mat roi_image=src2(roi);


            /* Calculate the local mean and variance */
            cv::meanStdDev(roi_image,local_mean,local_var);
            /* Calculate local threshold */
            threshold = local_mean.val[0] + k_value * sqrt ( local_var.val[0] -C);
                    .................
        }
    }

if i add openmp

#pragram omp parallel for
    for ( ir = r_begin; ir < r_end; ir++ )
        {           
            /* For each image column */
            for ( ic = c_begin; ic < c_end; ic++ )
            {
            ..............
            }
        }

and i get a error message.