Mat operation & openmp mixed

asked 2013-03-22 23:57:11 -0600

wuling gravatar image

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.

edit retag flag offensive close merge delete

Comments

1

aww, you went all the way explaining, and then forgot the error .. please add that !

berak gravatar imageberak ( 2013-03-23 02:16:15 -0600 )edit

The algorithm "Niblack local threshold" ref:http://fiji.sc/wiki/index.php/Auto_Local_Threshold The error happen: Microsoft c++ at memory position 0x04f9f5a4,occurs exception cv:Exception.(Sorry ,I use Tradition Chinese)

Stop at VS xstring file,where vs version: VS2008

wuling gravatar imagewuling ( 2013-03-23 03:40:37 -0600 )edit