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.
aww, you went all the way explaining, and then forgot the error .. please add that !
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