-
I have a problem. Take notes
-
when i use the method of at to get the pixel value,an abnormal interrupt process has occurred.I find that thresh.at<uchar>(i, j) is abnormal.Here's what surprises me,Some images are normal.so,I use this i < thresh.rows &&j < thresh.cols ,not i <= thresh.rows &&j <= thresh.cols.It is ok.
vector<int> White_Pixel_Y_Cut_2;
for (int i = Variable_Table_Black_Lines_okay_Y[Variable_Table_Black_Lines_okay_Y.size() - 1] + 5; i < Variable_Table_Black_Lines_okay_Y[Variable_Table_Black_Lines_okay_Y.size() - 1] + vertical_spacing*0.75 - 5; i++)//thresh.rows
{
for (int j = Max_Variable_Table_Black_Lines_okay_X[0] - 5; j < Max_Variable_Table_Black_Lines_okay_X[0] + 5; j++)
{
if(i >= 0 && i < thresh.rows &&j < thresh.cols && j>=0)
{
//qDebug() << i << j;
value = thresh.at<uchar>(i, j);
if (value == 255)
{
White_Pixel_Y_Cut_2.push_back(i);
}
}
}
}
I hope I can help you,If you have any questions, please comment on this blog or send me a private message. I will reply in my free time.