@@ -25,8 +25,8 @@ TEST(ximgproc_SparseTableMorph, compare_with_original_erode)
25
25
Mat kernel = getStructuringElement (cv::MorphShapes::MORPH_ELLIPSE, kernelSize, Point (kRadius , kRadius ));
26
26
27
27
src.setTo (240 );
28
- putText (src, " A" , Point (sz.height / 5 * 1 , sz.height / 20 * 15 ), HersheyFonts::FONT_HERSHEY_TRIPLEX, 10 , Scalar (250 , 40 , 40 ), 30 , LineTypes::FILLED);
29
- putText (src, " B" , Point (sz.height / 5 * 2 , sz.height / 20 * 16 ), HersheyFonts::FONT_HERSHEY_TRIPLEX, 10 , Scalar (20 , 230 , 0 ), 30 , LineTypes::FILLED);
28
+ putText (src, " A" , Point (sz.height / 5 * 1 , sz.height / 20 * 15 ), HersheyFonts::FONT_HERSHEY_TRIPLEX, 10 , Scalar (255 , 40 , 40 ), 30 , LineTypes::FILLED);
29
+ putText (src, " B" , Point (sz.height / 5 * 2 , sz.height / 20 * 16 ), HersheyFonts::FONT_HERSHEY_TRIPLEX, 10 , Scalar (20 , 255 , 0 ), 30 , LineTypes::FILLED);
30
30
putText (src, " C" , Point (sz.height / 5 * 3 , sz.height / 20 * 17 ), HersheyFonts::FONT_HERSHEY_TRIPLEX, 10 , Scalar (10 , 10 , 255 ), 30 , LineTypes::FILLED);
31
31
32
32
cv::TickMeter timer;
@@ -196,7 +196,7 @@ TEST(develop, POW2RECT_COVERING)
196
196
197
197
// visualize sparse table
198
198
std::vector<std::vector<Mat>> st = std::get<0 >(ret);
199
- int cellSize = 10 ;
199
+ int cellSize = 16 ;
200
200
Mat concatSt;
201
201
std::vector<Mat> hconMat (st.size (), Mat ());
202
202
for (int row = 0 ; row < st.size (); row++) for (int col = 0 ; col < st[row].size (); col++)
@@ -230,14 +230,14 @@ TEST(develop, POW2RECT_COVERING)
230
230
for (int i = 0 ; i < rects.size (); i++)
231
231
{
232
232
Rect rect = rects[i];
233
- Point lt ((rect.x ) * rate + i, (rect.y ) * rate + i);
234
- Point lb ((rect.x ) * rate + i, (rect.y + (1 << rect.height )) * rate - 15 + i);
235
- Point rb ((rect.x + (1 << rect.width )) * rate - 15 + i, (rect.y + (1 << rect.height )) * rate - 15 + i);
236
- Point rt ((rect.x + (1 << rect.width )) * rate - 15 + i, (rect.y ) * rate + i);
237
- cv::line (kernel, lt, lb, color[i], 2 );
238
- cv::line (kernel, lb, rb, color[i], 2 );
239
- cv::line (kernel, rb, rt, color[i], 2 );
240
- cv::line (kernel, rt, lt, color[i], 2 );
233
+ Point lt ((rect.x ) * rate + i % 11 , (rect.y ) * rate + i % 11 );
234
+ Point lb ((rect.x ) * rate + i % 11 , (rect.y + (1 << rect.height )) * rate - 11 + i % 11 );
235
+ Point rb ((rect.x + (1 << rect.width )) * rate - 11 + i % 11 , (rect.y + (1 << rect.height )) * rate - 11 + i % 11 );
236
+ Point rt ((rect.x + (1 << rect.width )) * rate - 11 + i % 11 , (rect.y ) * rate + i % 11 );
237
+ cv::line (kernel, lt, lb, color[i % 20 ], 2 );
238
+ cv::line (kernel, lb, rb, color[i % 20 ], 2 );
239
+ cv::line (kernel, rb, rt, color[i % 20 ], 2 );
240
+ cv::line (kernel, rt, lt, color[i % 20 ], 2 );
241
241
}
242
242
imshow (" kernel" , kernel);
243
243
0 commit comments