steelskin / cvblob Goto Github PK
View Code? Open in Web Editor NEWOpenCV Blob library
License: GNU Lesser General Public License v3.0
OpenCV Blob library
License: GNU Lesser General Public License v3.0
can u please tell us the cvblob library version u have used for this algorithm
I build this project and got the following error:
Unhandled exception at 0x01E137EF (msvcr100d.dll) in TestDLL.exe: 0xC0000005: Access violation reading location 0x676E702E.
the code:
`
//TestDLL.c : test of CvBlob DLL
cv::Mat img = cv::imread("test.png", 1);
cv::Mat grey;
grey.create(img.size(), CV_8UC1);
cv::cvtColor(img, grey, CV_BGR2GRAY, 1);
cv::threshold(grey, grey, 0, 255, CV_THRESH_BINARY + CV_THRESH_OTSU);
LARGE_INTEGER freq;
LARGE_INTEGER t0, tF, tDiff;
double elapsedTime;
// cvblob
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&t0);
cvb::BlobList blobs;
cvb::Label max_label = 250;
blobs.SimpleLabel(grey, max_label);
blobs.FilterByArea(10, img.cols * img.rows);
QueryPerformanceCounter(&tF);
tDiff.QuadPart = tF.QuadPart - t0.QuadPart;
elapsedTime = tDiff.QuadPart / (double) freq.QuadPart;
std::cout << "cvblob:" << elapsedTime << std::endl;
for (auto &a_blob : blobs.get_BlobsList()) {
// extract and draws blob contour
auto contours = a_blob->get_Contour().get_ContourPolygon();
if (contours.size() != 1) {
for (auto &iter = contours.begin(); iter != contours.end(); iter++) {
auto next_iter = iter;
next_iter++;
if (next_iter == contours.end())
cv::line(img, *iter, contours[0], cv::Scalar(0, 0, 255), 1, 8);
else
cv::line(img, *iter, *next_iter, cv::Scalar(0, 0, 255), 1, 8);
}
}
// extract and draws every blob internal hole contour
auto internal_contours = a_blob->get_InternalContours();
for (auto &a_contour : internal_contours) {
auto contour_dot = a_contour->get_ContourPolygon();
if (contour_dot.size() == 1)
continue;
for (auto &iter = contour_dot.begin(); iter != contour_dot.end(); iter++) {
auto next_iter = iter;
next_iter++;
if (next_iter == contour_dot.end())
cv::line(img, *iter, contour_dot[0], cv::Scalar(0, 255, 0), 1, 8);
else
cv::line(img, *iter, *next_iter, cv::Scalar(0, 255, 0), 1, 8);
}
}
// draws bounding box
cv::rectangle(img, a_blob->get_BoundingBox(), cv::Scalar(255, 0, 255));
// draws centroid
cv::circle(img, a_blob->get_Centroid(), 2, cv::Scalar(255, 0, 0), 2);
};
cv::imwrite("imggray.png", grey);
cv::imwrite("imgout.png", img);
cv::Mat labeImgTemp = blobs.get_ImageLabel() *24;
cv::imwrite("imglabelMat.png", labeImgTemp);
return 0;
`
In the picture(imglabelMat.png), the label values are discontinuous.
imglabelMat.png:
imggray.png:
imgout.png:
what's the meaning of the Lable?
I don't know how to give the the value to max_lable in below function? the test example is outdata
/// \brief Label the connected parts of a binary image.
/// Simple, fast algorithm. Does not compute contours.
/// \param img Input binary image (type = CV_8UC1).
void SimpleLabel(const cv::Mat &img, Label max_label);
/// \brief Label the connected parts of a binary image.
/// Algorithm based on paper "A linear-time component-labeling algorithm using contour tracing technique" of Fu Chang, Chun-Jen Chen and Chi-Jen Lu.
/// \param img Input binary image (type = CV_8UC1).
void LabelImage (const cv::Mat &img, Label max_label);
Hi, I wanted to add cvBlob as a submodule to one of my projects. I then noticed that CMakeLists.txt is missing from the git repository.
hi,
the two files cvb_track.cpp and cvb_track.h is not added to the vc project and when i add them they gives errors in the building but when i build without them they build successfully how do i get them to work.
Line 251 in c8448e2
unsigned int a = (a_track->maxx - a_track->minx + 1) * (a_track->maxy - a_track->miny + 1);
While installing cvblob the title error pops up in ubuntu terminal. I have cross-checked, there is no such header file in the zip file.
Am I missing something? Is there any alternative?
Hello,
Since github does no longer allow to commit -easely- in command line, I changed for framagit, and unfortunaly, I discovered your cvblob repository too late. I'm very sorry to discover your work today only :-/ For your information, learning ocr-math, I created another repository using cvblob.
Currently, I only fixed the Linux build, and added cmake build, nothing else. To respect your license, I have added the same as you in the cvblob repository. Of course, I'll study your changes and will probably use your version sooner or later. Waiting, don't hesitate to tell me what is wrong, and I'll fix that.
Everything is there : https://framagit.org/ericb/ocr-math/-/tree/main/cpp-implementation/cvblob
Thanks a lot for maintaining cvblob !
With best regards,
Eric Bachard
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.