Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <fstream>
#include "blob.h"
#include "BlobResult.h"
#include "highgui.h" //include it to use GUI functions.

const int NUMCORES = 2;
using namespace std;
Expand Down
5 changes: 3 additions & 2 deletions library/BlobResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ CBlobResult::CBlobResult(IplImage *source, IplImage *mask,int numThreads)
{
if(mask!=NULL){
Mat temp = Mat::zeros(Size(source->width,source->height),CV_8UC1);
Mat(source).copyTo(temp,Mat(mask));
cvarrToMat(source).copyTo(temp,cvarrToMat(mask));
compLabeler.set(numThreads,temp);
compLabeler.doLabeling(m_blobs);
}
else{
compLabeler.set(numThreads,source);
Mat temp = Mat::zeros(Size(source->width,source->height),CV_8UC1);
compLabeler.set(numThreads,temp);
compLabeler.doLabeling(m_blobs);
}
}
Expand Down
6 changes: 3 additions & 3 deletions library/blob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ double CBlob::Mean( IplImage *image )
offset.x = -m_boundingBox.x;
offset.y = -m_boundingBox.y;

Mat mask_mat(mask);
Mat mask_mat = cvarrToMat(mask);

//If joined
if(isJoined){
Expand Down Expand Up @@ -787,9 +787,9 @@ CvBox2D CBlob::GetEllipse()
void CBlob::FillBlob( IplImage *image, CvScalar color, int offsetX , int offsetY, bool intContours, const IplImage *srcImage)
{
if(srcImage==NULL)
FillBlob(Mat(image),color,offsetX,offsetY,intContours,Mat());
FillBlob(cvarrToMat(image),color,offsetX,offsetY,intContours,Mat());
else
FillBlob(Mat(image),color,offsetX,offsetY,intContours,Mat(srcImage));
FillBlob(cvarrToMat(image),color,offsetX,offsetY,intContours,cvarrToMat(srcImage));
}
void CBlob::FillBlob( Mat image, CvScalar color, int offsetX, int offsetY, bool intContours, const Mat srcImage){
CV_FUNCNAME("CBlob::FillBlob");
Expand Down