Giter Club home page Giter Club logo

cvblob's People

Contributors

mdegans avatar steelskin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cvblob's Issues

Fix cvb_track

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.

cvblob library

can u please tell us the cvblob library version u have used for this algorithm

Label Value discontinuous

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:
imglabelMat
imggray.png:
image
imgout.png:
image

Label max_label

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);

Unhandled exception

I build this project and got the following error:
Unhandled exception at 0x01E137EF (msvcr100d.dll) in TestDLL.exe: 0xC0000005: Access violation reading location 0x676E702E.

For your information

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.