Ask Your Question

try_automation's profile - activity

2018-03-10 20:02:33 -0500 received badge  Student (source)
2018-03-08 11:26:24 -0500 received badge  Supporter (source)
2018-03-08 11:26:22 -0500 marked best answer filter2D Filter out crosses

Hello,

I am a bit new to openCV and have been using it pretty successfully for cleaning up and rotating images before OCR. However I have come across a problem with some documents. If you see the attached image below you will see that if you zoom into the image there are all these little plus looking things in white. I was wondering if someone could point me in the right direction for removing them. I tried something like below. However I believe I am a off in what I am trying to do. If this is in the right direction, could you point me to what would be a better value for my kernel. Or if this is totally off, what kind of method should I be using? Thank you! (note plus sign is 3x3 box)

`cv::Mat myPlusKernel = (cv::Mat_<float>(5, 5) << -0.025, -0.025, -0.025, -0.025, -0.025, -0.025, -0.025, 0.3, -0.025, -0.025, -0.025, 0.3, 0.3, 0.3, -0.025, -0.025, -0.025, 0.3, -0.025, -0.025, -0.025, -0.025, -0.025, -0.025, -0.025);

cv::filter2D(img1_pre, img1, -1, myPlusKernel, cv::Point(-1, -1), (0, 0), cv::BORDER_DEFAULT);
if (debug) {
    cv::namedWindow("CK", cv::WINDOW_AUTOSIZE); // Create a window for display.
    cv::imshow("CK", img1); // Show our image inside it.
    cv::imwrite("CK.jpg", img1);
    cv::waitKey(0);
}`

image description

2018-03-08 11:26:22 -0500 received badge  Scholar (source)
2018-03-08 11:26:20 -0500 commented answer filter2D Filter out crosses

YES that worked!!! Thank you very very very much!!!

2018-03-08 11:24:27 -0500 commented answer filter2D Filter out crosses

Thank you, I think my example is messed up because it's a screenshot of a section, the true crosses are 3x3 boxes. So fo

2018-03-08 09:55:41 -0500 commented answer filter2D Filter out crosses

Thank you! That helped a lot, however it does like you say make the text run together. Do you know if there is by any ch

2018-03-07 18:55:47 -0500 asked a question filter2D Filter out crosses

filter2D Filter out crosses Hello, I am a bit new to openCV and have been using it pretty successfully for cleaning up

2018-03-07 18:55:47 -0500 asked a question filter2D Filter out crosses

filter2D Filter out crosses Hello, I am a bit new to openCV and have been using it pretty successfully for cleaning up