Skip to content

Commit

Permalink
Fixed missing initialization and iplimage release
Browse files Browse the repository at this point in the history
Missing initialization fixed of output variable in renderImage function.
cvReleaseImage of outTemp var in renderChains function.
  • Loading branch information
minyongyoon committed Oct 9, 2012
1 parent 1eb944b commit 2e6b479
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TextDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ void normalizeImage (IplImage * input, IplImage * output) {
}

void renderComponents (IplImage * SWTImage, std::vector<std::vector<Point2d> > & components, IplImage * output) {
for (std::vector<std::vector<Point2d> >::iterator it = components.begin(); it != components.end();it++) {
cvZero(output);
for (std::vector<std::vector<Point2d> >::iterator it = components.begin(); it != components.end();it++) {
for (std::vector<Point2d>::iterator pit = it->begin(); pit != it->end(); pit++) {
CV_IMAGE_ELEM(output, float, pit->y, pit->x) = CV_IMAGE_ELEM(SWTImage, float, pit->y, pit->x);
}
Expand Down Expand Up @@ -278,7 +279,7 @@ void renderChains (IplImage * SWTImage,
cvCreateImage ( cvGetSize ( output ), IPL_DEPTH_32F, 1 );
renderComponents(SWTImage,componentsRed,outTemp);
cvConvertScale(outTemp, output, 255, 0);

cvReleaseImage(&outTemp);
}

IplImage * textDetection (IplImage * input, bool dark_on_light)
Expand Down

0 comments on commit 2e6b479

Please sign in to comment.