Hi, I’m trying to make a single pixel white like this:
vertical_filtered_mat.at<uint>(y, x) = 255;
And it throws these COMPILATION errors:
How can I fix this?
src code:
inline Point catch_feature( Mat img,
uint8_t threshold = 50,
uint8_t shrink_factor = 5,
uint8_t ker_dim = 3) {
// vars
int height = img.cols;
int width = img.cols;
int filtered_met_size = height - ker_dim + 1;
Mat vertical_filtered_mat = Mat::zeros(Size(filtered_met_size / shrink_factor, filtered_met_size / shrink_factor), CV_8U);
Mat horizontal_filtered_mat = Mat::zeros(Size(filtered_met_size / shrink_factor, filtered_met_size / shrink_factor), CV_8U);
// logic
// vertical seperator
for (size_t y = 1; y < height - 1; y += shrink_factor) {
for (size_t x = 1; x < width - 2; x += shrink_factor) {
// check if 2 places to the right is brighter
if (img.at<uchar>(y, x + 2) - img.at<uchar>(y, x) > threshold) {
for (int dy = -((ker_dim - 1) / 2); dy <= (ker_dim - 1) / 2; dy++) {
for (int dx = -((ker_dim - 1) / 2); dx <= (ker_dim - 1) / 2; dx++) {
if (img.at<uchar>(y + dy, x + dx + 2) - img.at<uchar>(y + dy, x + dx) > threshold) {
vertical_filtered_mat.at<uint>(y, x) = 255; // ERROR HERE
}
}
}
}
}
}
return Point(-1, -1);
}
Thanks