I am a beginner in OpenCV and C++.How to remove the shadow of scanned document in opencv c++.I will appreciate your help.
1 | initial version |
I am a beginner in OpenCV and C++.How to remove the shadow of scanned document in opencv c++.I will appreciate your help.
2 | No.2 Revision |
I am a beginner in OpenCV and C++.How How to remove the shadow of scanned document in opencv c++.I will appreciate your help.
3 | No.3 Revision |
How to remove the shadow of scanned document in opencv c++.I will appreciate your help.
4 | No.4 Revision |
C:\fakepath\Screen Shot 2015-06-19 at 7.57.23 pm.pngHow to remove the shadow of scanned document in opencv c++.I will appreciate your help.
Here is my code.
//src have my actual mat object image. cv::Mat source(src.rows, src.cols,CV_8UC1); cv::addWeighted(src, 2.5, src, -1, 2.0, source); cv::GaussianBlur(source, imgH, cv::Size(5, 5), cv::BORDER_WRAP); cv::cvtColor(imgH,imgH,CV_BGR2RGB);
imgH = imgH + cvScalar(-50, -50, -50);
//Now replace the black background with white color
cv::floodFill(imgH, cv::Point(10,10), cv::Scalar(255,255,255), (cv::Rect*)0, cv::Scalar(), cv::Scalar(255,255,255));
cv::floodFill(imgH, cv::Point(imgH.cols-10 ,10), cv::Scalar(255,255,255), (cv::Rect*)0, cv::Scalar(), cv::Scalar(255,255,255));
cv::floodFill(imgH, cv::Point(10,imgH.rows-10), cv::Scalar(255,255,255), (cv::Rect*)0, cv::Scalar(), cv::Scalar(255,255,255));
cv::floodFill(imgH, cv::Point(imgH.cols-10,imgH.rows-10), cv::Scalar(255,255,255), (cv::Rect*)0, cv::Scalar(), cv::Scalar(255,255,255));
5 | No.5 Revision |
C:\fakepath\Screen Shot 2015-06-19 at 7.57.23 pm.pngHow to remove the shadow of scanned document in opencv c++.I will appreciate your help.
Here is my code.
//src have my actual mat object image.
cv::Mat source(src.rows, src.cols,CV_8UC1);
cv::addWeighted(src, 2.5, src, -1, 2.0, source);
cv::GaussianBlur(source, imgH, cv::Size(5, 5), cv::BORDER_WRAP);
6 | No.6 Revision |
C:\fakepath\Screen Shot 2015-06-19 at 7.57.23 pm.png
How to remove the shadow of scanned document in opencv c++.I will appreciate your help.help.
I can removed the background from outside of my image (O).how to remove the background gray color inside circle of image.
Here is my code.
cv::Mat source(src.rows, src.cols,CV_8UC1);
7 | No.7 Revision |
C:\fakepath\Screen Shot 2015-06-19 at 7.57.23 pm.png
How to remove the shadow of scanned document in opencv c++.I will appreciate your help.
I can removed the background from outside of my image (O).how to remove the background gray color inside circle of image.
Here is my code.
//src have my actual mat object image.
cv::Mat source(src.rows, src.cols,CV_8UC1);
cv::addWeighted(src, 2.5, src, -1, 2.0, source);
cv::GaussianBlur(source, imgH, cv::Size(5, 5), cv::BORDER_WRAP);
cv::cvtColor(imgH,imgH,CV_BGR2RGB);
imgH = imgH + cvScalar(-50, -50, -50);
//Now replace the black background with white color
cv::floodFill(imgH, cv::Point(10,10), cv::Scalar(255,255,255), (cv::Rect*)0, cv::Scalar(), cv::Scalar(255,255,255));
cv::floodFill(imgH, cv::Point(imgH.cols-10 ,10), cv::Scalar(255,255,255), (cv::Rect*)0, cv::Scalar(), cv::Scalar(255,255,255));
cv::floodFill(imgH, cv::Point(10,imgH.rows-10), cv::Scalar(255,255,255), (cv::Rect*)0, cv::Scalar(), cv::Scalar(255,255,255));
cv::floodFill(imgH, cv::Point(imgH.cols-10,imgH.rows-10), cv::Scalar(255,255,255), (cv::Rect*)0, cv::Scalar(), cv::Scalar(255,255,255));