diff --git a/src/openalpr/alpr_impl.cpp b/src/openalpr/alpr_impl.cpp index 5260d1e..f95f382 100644 --- a/src/openalpr/alpr_impl.cpp +++ b/src/openalpr/alpr_impl.cpp @@ -90,7 +90,7 @@ namespace alpr response.results.img_width = img.cols; response.results.img_height = img.rows; - for (uint i = 0; i < regionsOfInterest.size(); i++) + for (unsigned int i = 0; i < regionsOfInterest.size(); i++) { response.results.regionsOfInterest.push_back(AlprRegionOfInterest(regionsOfInterest[i].x, regionsOfInterest[i].y, regionsOfInterest[i].width, regionsOfInterest[i].height)); @@ -109,7 +109,7 @@ namespace alpr response.plateRegions = plateDetector->detect(img, regionsOfInterest); queue plateQueue; - for (uint i = 0; i < response.plateRegions.size(); i++) + for (unsigned int i = 0; i < response.plateRegions.size(); i++) plateQueue.push(response.plateRegions[i]); while(!plateQueue.empty()) @@ -158,7 +158,7 @@ namespace alpr int bestPlateIndex = 0; - for (uint pp = 0; pp < ppResults.size(); pp++) + for (unsigned int pp = 0; pp < ppResults.size(); pp++) { if (pp >= topN) break; @@ -196,7 +196,7 @@ namespace alpr { // Not a valid plate // Check if this plate has any children, if so, send them back up for processing - for (uint childidx = 0; childidx < plateRegion.children.size(); childidx++) + for (unsigned int childidx = 0; childidx < plateRegion.children.size(); childidx++) { plateQueue.push(plateRegion.children[childidx]); } @@ -218,12 +218,12 @@ namespace alpr if (config->debugGeneral && config->debugShowImages) { - for (uint i = 0; i < response.plateRegions.size(); i++) + for (unsigned int i = 0; i < response.plateRegions.size(); i++) { rectangle(img, response.plateRegions[i].rect, Scalar(0, 0, 255), 2); } - for (uint i = 0; i < response.results.plates.size(); i++) + for (unsigned int i = 0; i < response.results.plates.size(); i++) { for (int z = 0; z < 4; z++) { @@ -290,7 +290,7 @@ namespace alpr std::vector AlprImpl::convertRects(std::vector regionsOfInterest) { std::vector rectRegions; - for (uint i = 0; i < regionsOfInterest.size(); i++) + for (unsigned int i = 0; i < regionsOfInterest.size(); i++) { rectRegions.push_back(cv::Rect(regionsOfInterest[i].x, regionsOfInterest[i].y, regionsOfInterest[i].width, regionsOfInterest[i].height)); } @@ -315,7 +315,7 @@ namespace alpr // Add the regions of interest to the JSON cJSON *rois; cJSON_AddItemToObject(root, "regions_of_interest", rois=cJSON_CreateArray()); - for (uint i=0;itopNPlates.size(); i++) + for (unsigned int i = 0; i < result->topNPlates.size(); i++) { cJSON *candidate_object; candidate_object = cJSON_CreateObject(); diff --git a/src/openalpr/colorfilter.cpp b/src/openalpr/colorfilter.cpp index 9b47ce0..4b8bc28 100644 --- a/src/openalpr/colorfilter.cpp +++ b/src/openalpr/colorfilter.cpp @@ -123,7 +123,7 @@ namespace alpr vector hMeans, sMeans, vMeans; vector hStdDevs, sStdDevs, vStdDevs; - for (uint i = 0; i < contours.size(); i++) + for (unsigned int i = 0; i < contours.size(); i++) { if (hierarchy[i][3] != -1) continue; @@ -376,11 +376,11 @@ namespace alpr float lowestOverallDiff = 1000000000; int bestPercentAgreementIndex = -1; - for (uint i = 0; i < values.size(); i++) + for (unsigned int i = 0; i < values.size(); i++) { int valuesInRange = 0; float overallDiff = 0; - for (uint j = 0; j < values.size(); j++) + for (unsigned int j = 0; j < values.size(); j++) { float diff = abs(values[i] - values[j]); if (diff < maxValDifference) diff --git a/src/openalpr/config.h b/src/openalpr/config.h index 3bdb57e..5815fee 100644 --- a/src/openalpr/config.h +++ b/src/openalpr/config.h @@ -95,9 +95,9 @@ namespace alpr float postProcessMinConfidence; float postProcessConfidenceSkipLevel; - uint postProcessMaxSubstitutions; - uint postProcessMinCharacters; - uint postProcessMaxCharacters; + unsigned int postProcessMaxSubstitutions; + unsigned int postProcessMinCharacters; + unsigned int postProcessMaxCharacters; bool debugGeneral; diff --git a/src/openalpr/detection/detector.cpp b/src/openalpr/detection/detector.cpp index 315f111..8130c29 100644 --- a/src/openalpr/detection/detector.cpp +++ b/src/openalpr/detection/detector.cpp @@ -73,17 +73,17 @@ namespace alpr std::sort(regions.begin(), regions.end(), rectHasLargerArea); // Create new PlateRegions and attach the rectangles to each - for (uint i = 0; i < regions.size(); i++) + for (unsigned int i = 0; i < regions.size(); i++) { PlateRegion newRegion; newRegion.rect = regions[i]; orderedRegions.push_back(newRegion); } - for (uint i = 0; i < orderedRegions.size(); i++) + for (unsigned int i = 0; i < orderedRegions.size(); i++) { bool foundParent = false; - for (uint k = i + 1; k < orderedRegions.size(); k++) + for (unsigned int k = i + 1; k < orderedRegions.size(); k++) { Point center( orderedRegions[i].rect.x + (orderedRegions[i].rect.width / 2), orderedRegions[i].rect.y + (orderedRegions[i].rect.height / 2)); diff --git a/src/openalpr/detection/detectorcpu.cpp b/src/openalpr/detection/detectorcpu.cpp index 92c6d58..52cc66f 100644 --- a/src/openalpr/detection/detectorcpu.cpp +++ b/src/openalpr/detection/detectorcpu.cpp @@ -106,7 +106,7 @@ namespace alpr cout << "LBP Time: " << diffclock(startTime, endTime) << "ms." << endl; } - for( uint i = 0; i < plates.size(); i++ ) + for( unsigned int i = 0; i < plates.size(); i++ ) { plates[i].x = plates[i].x / scale_factor; plates[i].y = plates[i].y / scale_factor; diff --git a/src/openalpr/edges/edgefinder.cpp b/src/openalpr/edges/edgefinder.cpp index 70698bd..3c580d7 100644 --- a/src/openalpr/edges/edgefinder.cpp +++ b/src/openalpr/edges/edgefinder.cpp @@ -106,7 +106,7 @@ namespace alpr // Re-map the textline coordinates to the new crop vector newLines; - for (uint i = 0; i < pipeline_data->textLines.size(); i++) + for (unsigned int i = 0; i < pipeline_data->textLines.size(); i++) { vector textArea = imgTransform.transformSmallPointsToBigImage(pipeline_data->textLines[i].textArea); vector linePolygon = imgTransform.transformSmallPointsToBigImage(pipeline_data->textLines[i].linePolygon); diff --git a/src/openalpr/edges/platecorners.cpp b/src/openalpr/edges/platecorners.cpp index e2c2d1b..d750b73 100644 --- a/src/openalpr/edges/platecorners.cpp +++ b/src/openalpr/edges/platecorners.cpp @@ -87,7 +87,7 @@ namespace alpr Mat imgCorners = Mat(inputImage.size(), inputImage.type()); inputImage.copyTo(imgCorners); - for (uint linenum = 0; linenum < textLines.size(); linenum++) + for (unsigned int linenum = 0; linenum < textLines.size(); linenum++) { for (int i = 0; i < 4; i++) circle(imgCorners, textLines[linenum].textArea[i], 2, Scalar(0, 0, 0)); diff --git a/src/openalpr/edges/platelines.cpp b/src/openalpr/edges/platelines.cpp index 3515c40..8328d8d 100644 --- a/src/openalpr/edges/platelines.cpp +++ b/src/openalpr/edges/platelines.cpp @@ -75,7 +75,7 @@ namespace alpr Mat mask = Mat::zeros(inputImage.size(), CV_8U); - for (uint i = 0; i < textLines.size(); i++) + for (unsigned int i = 0; i < textLines.size(); i++) { vector > polygons; polygons.push_back(textLines[i].textArea); @@ -93,9 +93,9 @@ namespace alpr vector hlines = this->getLines(edges, sensitivity, false); vector vlines = this->getLines(edges, sensitivity, true); - for (uint i = 0; i < hlines.size(); i++) + for (unsigned int i = 0; i < hlines.size(); i++) this->horizontalLines.push_back(hlines[i]); - for (uint i = 0; i < vlines.size(); i++) + for (unsigned int i = 0; i < vlines.size(); i++) this->verticalLines.push_back(vlines[i]); // if debug is enabled, draw the image diff --git a/src/openalpr/edges/textlinecollection.cpp b/src/openalpr/edges/textlinecollection.cpp index 980ee74..eaacae2 100644 --- a/src/openalpr/edges/textlinecollection.cpp +++ b/src/openalpr/edges/textlinecollection.cpp @@ -18,7 +18,7 @@ namespace alpr charHeight = 0; charAngle = 0; - for (uint i = 0; i < textLines.size(); i++) + for (unsigned int i = 0; i < textLines.size(); i++) { charHeight += textLines[i].lineHeight; charAngle += textLines[i].angle; @@ -29,7 +29,7 @@ namespace alpr this->topCharArea = textLines[0].charBoxTop; this->bottomCharArea = textLines[0].charBoxBottom; - for (uint i = 1; i < textLines.size(); i++) + for (unsigned int i = 1; i < textLines.size(); i++) { if (this->topCharArea.isPointBelowLine(textLines[i].charBoxTop.midpoint()) == false) diff --git a/src/openalpr/featurematcher.cpp b/src/openalpr/featurematcher.cpp index b15e4fb..66290c2 100644 --- a/src/openalpr/featurematcher.cpp +++ b/src/openalpr/featurematcher.cpp @@ -44,7 +44,7 @@ namespace alpr FeatureMatcher::~FeatureMatcher() { - for (uint i = 0; i < trainingImgKeypoints.size(); i++) + for (unsigned int i = 0; i < trainingImgKeypoints.size(); i++) trainingImgKeypoints[i].clear(); trainingImgKeypoints.clear(); @@ -110,7 +110,7 @@ namespace alpr { bool already_exists = false; // Quickly run through the matches we've already added and make sure it's not a duplicate... - for (uint q = 0; q < matches12.size(); q++) + for (unsigned int q = 0; q < matches12.size(); q++) { if (matchesKnn[descInd][0].queryIdx == matches12[q].queryIdx) { @@ -155,10 +155,10 @@ namespace alpr Rect crissCrossAreaVertical(0, 0, config->stateIdImageWidthPx, config->stateIdimageHeightPx * 2); Rect crissCrossAreaHorizontal(0, 0, config->stateIdImageWidthPx * 2, config->stateIdimageHeightPx); - for (uint i = 0; i < billMapping.size(); i++) + for (unsigned int i = 0; i < billMapping.size(); i++) { vector matchesForOnePlate; - for (uint j = 0; j < inputMatches.size(); j++) + for (unsigned int j = 0; j < inputMatches.size(); j++) { if (inputMatches[j].imgIdx == (int) i) matchesForOnePlate.push_back(inputMatches[j]); @@ -170,7 +170,7 @@ namespace alpr vector hlines; vector matchIdx; - for (uint j = 0; j < matchesForOnePlate.size(); j++) + for (unsigned int j = 0; j < matchesForOnePlate.size(); j++) { KeyPoint tkp = trainingImgKeypoints[i][matchesForOnePlate[j].trainIdx]; KeyPoint qkp = queryKeypoints[matchesForOnePlate[j].queryIdx]; @@ -187,10 +187,10 @@ namespace alpr int mostIntersectionsIndex = -1; mostIntersections = 0; - for (uint j = 0; j < vlines.size(); j++) + for (unsigned int j = 0; j < vlines.size(); j++) { int intrCount = 0; - for (uint q = 0; q < vlines.size(); q++) + for (unsigned int q = 0; q < vlines.size(); q++) { Point vintr = vlines[j].intersection(vlines[q]); Point hintr = hlines[j].intersection(hlines[q]); @@ -224,7 +224,7 @@ namespace alpr } // Push the non-crisscrosses back on the list - for (uint j = 0; j < matchIdx.size(); j++) + for (unsigned int j = 0; j < matchIdx.size(); j++) { outputMatches.push_back(matchesForOnePlate[matchIdx[j]]); } @@ -243,7 +243,7 @@ namespace alpr vector trainImages; vector plateFiles = getFilesInDir(country_dir.c_str()); - for (uint i = 0; i < plateFiles.size(); i++) + for (unsigned int i = 0; i < plateFiles.size(); i++) { if (hasEnding(plateFiles[i], ".jpg") == false) continue; @@ -316,12 +316,12 @@ namespace alpr // Create and initialize the counts to 0 std::vector bill_match_counts( billMapping.size() ); - for (uint i = 0; i < billMapping.size(); i++) + for (unsigned int i = 0; i < billMapping.size(); i++) { bill_match_counts[i] = 0; } - for (uint i = 0; i < filteredMatches.size(); i++) + for (unsigned int i = 0; i < filteredMatches.size(); i++) { bill_match_counts[filteredMatches[i].imgIdx]++; //if (filteredMatches[i].imgIdx @@ -330,7 +330,7 @@ namespace alpr float max_count = 0; // represented as a percent (0 to 100) int secondmost_count = 0; int maxcount_index = -1; - for (uint i = 0; i < billMapping.size(); i++) + for (unsigned int i = 0; i < billMapping.size(); i++) { if (bill_match_counts[i] > max_count && bill_match_counts[i] >= 4) { @@ -358,7 +358,7 @@ namespace alpr if (drawOnImage) { vector positiveMatches; - for (uint i = 0; i < filteredMatches.size(); i++) + for (unsigned int i = 0; i < filteredMatches.size(); i++) { if (filteredMatches[i].imgIdx == maxcount_index) { @@ -383,7 +383,7 @@ namespace alpr if (this->config->debugStateId) { - for (uint i = 0; i < billMapping.size(); i++) + for (unsigned int i = 0; i < billMapping.size(); i++) { cout << billMapping[i] << " : " << bill_match_counts[i] << endl; } diff --git a/src/openalpr/licenseplatecandidate.cpp b/src/openalpr/licenseplatecandidate.cpp index 5db9504..57fb8bf 100644 --- a/src/openalpr/licenseplatecandidate.cpp +++ b/src/openalpr/licenseplatecandidate.cpp @@ -90,7 +90,7 @@ namespace alpr // Apply a perspective transformation to the TextLine objects // to match the newly deskewed license plate crop vector newLines; - for (uint i = 0; i < pipeline_data->textLines.size(); i++) + for (unsigned int i = 0; i < pipeline_data->textLines.size(); i++) { vector textArea = imgTransform.transformSmallPointsToBigImage(pipeline_data->textLines[i].textArea); vector linePolygon = imgTransform.transformSmallPointsToBigImage(pipeline_data->textLines[i].linePolygon); @@ -105,7 +105,7 @@ namespace alpr } pipeline_data->textLines.clear(); - for (uint i = 0; i < newLines.size(); i++) + for (unsigned int i = 0; i < newLines.size(); i++) pipeline_data->textLines.push_back(newLines[i]); diff --git a/src/openalpr/ocr.cpp b/src/openalpr/ocr.cpp index 31b9199..dc1c133 100644 --- a/src/openalpr/ocr.cpp +++ b/src/openalpr/ocr.cpp @@ -62,7 +62,7 @@ namespace alpr if (pipeline_data->charRegions.size() < config->postProcessMinCharacters) return; - for (uint i = 0; i < pipeline_data->thresholds.size(); i++) + for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++) { // Make it black text on white background bitwise_not(pipeline_data->thresholds[i], pipeline_data->thresholds[i]); @@ -70,7 +70,7 @@ namespace alpr pipeline_data->thresholds[i].size().width, pipeline_data->thresholds[i].size().height, pipeline_data->thresholds[i].channels(), pipeline_data->thresholds[i].step1()); - for (uint j = 0; j < pipeline_data->charRegions.size(); j++) + for (unsigned int j = 0; j < pipeline_data->charRegions.size(); j++) { Rect expandedRegion = expandRect( pipeline_data->charRegions[j], 2, 2, pipeline_data->thresholds[i].cols, pipeline_data->thresholds[i].rows) ; diff --git a/src/openalpr/pipeline_data.cpp b/src/openalpr/pipeline_data.cpp index 13b55b4..46dfac1 100644 --- a/src/openalpr/pipeline_data.cpp +++ b/src/openalpr/pipeline_data.cpp @@ -26,7 +26,7 @@ namespace alpr void PipelineData::clearThresholds() { - for (uint i = 0; i < thresholds.size(); i++) + for (unsigned int i = 0; i < thresholds.size(); i++) { thresholds[i].release(); } diff --git a/src/openalpr/segmentation/charactersegmenter.cpp b/src/openalpr/segmentation/charactersegmenter.cpp index 6ed8667..305a431 100644 --- a/src/openalpr/segmentation/charactersegmenter.cpp +++ b/src/openalpr/segmentation/charactersegmenter.cpp @@ -69,7 +69,7 @@ namespace alpr // cvtColor(img_contours, img_contours, CV_GRAY2RGB); // // vector > allowedContours; - // for (uint i = 0; i < charAnalysis->bestContours.size(); i++) + // for (unsigned int i = 0; i < charAnalysis->bestContours.size(); i++) // { // if (charAnalysis->bestContours.goodIndices[i]) // allowedContours.push_back(charAnalysis->bestContours.contours[i]); @@ -96,7 +96,7 @@ namespace alpr - for (uint lineidx = 0; lineidx < pipeline_data->textLines.size(); lineidx++) + for (unsigned int lineidx = 0; lineidx < pipeline_data->textLines.size(); lineidx++) { this->top = pipeline_data->textLines[lineidx].topLine; this->bottom = pipeline_data->textLines[lineidx].bottomLine; @@ -115,7 +115,7 @@ namespace alpr vector allHistograms; vector lineBoxes; - for (uint i = 0; i < pipeline_data->thresholds.size(); i++) + for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++) { Mat histogramMask = Mat::zeros(pipeline_data->thresholds[i].size(), CV_8U); @@ -139,7 +139,7 @@ namespace alpr if (this->config->debugCharSegmenter) { - for (uint cboxIdx = 0; cboxIdx < charBoxes.size(); cboxIdx++) + for (unsigned int cboxIdx = 0; cboxIdx < charBoxes.size(); cboxIdx++) { rectangle(allHistograms[i], charBoxes[cboxIdx], Scalar(0, 255, 0)); } @@ -148,7 +148,7 @@ namespace alpr displayImage(config, "Char seg histograms", histDashboard); } - for (uint z = 0; z < charBoxes.size(); z++) + for (unsigned int z = 0; z < charBoxes.size(); z++) lineBoxes.push_back(charBoxes[z]); //drawAndWait(&histogramMask); } @@ -156,7 +156,7 @@ namespace alpr float medianCharWidth = avgCharWidth; vector widthValues; // Compute largest char width - for (uint i = 0; i < lineBoxes.size(); i++) + for (unsigned int i = 0; i < lineBoxes.size(); i++) { widthValues.push_back(lineBoxes[i].width); } @@ -175,7 +175,7 @@ namespace alpr if (this->config->debugCharSegmenter) { // Setup the dashboard images to show the cleaning filters - for (uint i = 0; i < pipeline_data->thresholds.size(); i++) + for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++) { Mat cleanImg = Mat::zeros(pipeline_data->thresholds[i].size(), pipeline_data->thresholds[i].type()); Mat boxMask = getCharBoxMask(pipeline_data->thresholds[i], candidateBoxes); @@ -183,7 +183,7 @@ namespace alpr bitwise_and(cleanImg, boxMask, cleanImg); cvtColor(cleanImg, cleanImg, CV_GRAY2BGR); - for (uint c = 0; c < candidateBoxes.size(); c++) + for (unsigned int c = 0; c < candidateBoxes.size(); c++) rectangle(cleanImg, candidateBoxes[c], Scalar(0, 255, 0), 1); imgDbgCleanStages.push_back(cleanImg); } @@ -198,7 +198,7 @@ namespace alpr candidateBoxes = filterMostlyEmptyBoxes(pipeline_data->thresholds, candidateBoxes); - for (uint cbox = 0; cbox < candidateBoxes.size(); cbox++) + for (unsigned int cbox = 0; cbox < candidateBoxes.size(); cbox++) pipeline_data->charRegions.push_back(candidateBoxes[cbox]); if (config->debugTiming) @@ -251,7 +251,7 @@ namespace alpr vector charBoxes; vector allBoxes = get1DHits(histogram.histoImg, pxLeniency); - for (uint i = 0; i < allBoxes.size(); i++) + for (unsigned int i = 0; i < allBoxes.size(); i++) { if (allBoxes[i].width >= config->segmentationMinBoxWidthPx && allBoxes[i].width <= MAX_SEGMENT_WIDTH && allBoxes[i].height > MIN_HISTOGRAM_HEIGHT ) @@ -307,7 +307,7 @@ namespace alpr { columnCount = 0; - for (uint i = 0; i < charBoxes.size(); i++) + for (unsigned int i = 0; i < charBoxes.size(); i++) { if (col >= charBoxes[i].x && col < (charBoxes[i].x + charBoxes[i].width)) columnCount++; @@ -339,7 +339,7 @@ namespace alpr float rowScore = 0; - for (uint boxidx = 0; boxidx < allBoxes.size(); boxidx++) + for (unsigned int boxidx = 0; boxidx < allBoxes.size(); boxidx++) { int w = allBoxes[boxidx].width; if (w >= config->segmentationMinBoxWidthPx && w <= MAX_SEGMENT_WIDTH) @@ -398,7 +398,7 @@ namespace alpr Mat imgBestBoxes(img.size(), img.type()); img.copyTo(imgBestBoxes); cvtColor(imgBestBoxes, imgBestBoxes, CV_GRAY2BGR); - for (uint i = 0; i < bestBoxes.size(); i++) + for (unsigned int i = 0; i < bestBoxes.size(); i++) rectangle(imgBestBoxes, bestBoxes[i], Scalar(0, 255, 0)); this->imgDbgGeneral.push_back(addLabel(histoImg, "All Histograms")); @@ -447,7 +447,7 @@ namespace alpr Mat textLineMask = Mat::zeros(thresholds[0].size(), CV_8U); fillConvexPoly(textLineMask, textLine.linePolygon.data(), textLine.linePolygon.size(), Scalar(255,255,255)); - for (uint i = 0; i < thresholds.size(); i++) + for (unsigned int i = 0; i < thresholds.size(); i++) { vector > contours; vector hierarchy; @@ -456,7 +456,7 @@ namespace alpr thresholds[i].copyTo(thresholdsCopy, textLineMask); findContours(thresholdsCopy, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE); - for (uint c = 0; c < contours.size(); c++) + for (unsigned int c = 0; c < contours.size(); c++) { if (contours[c].size() == 0) continue; @@ -476,7 +476,7 @@ namespace alpr { vector newCharBoxes; - for (uint i = 0; i < charBoxes.size(); i++) + for (unsigned int i = 0; i < charBoxes.size(); i++) { if (i == charBoxes.size() - 1) { @@ -496,7 +496,7 @@ namespace alpr newCharBoxes.push_back(bigRect); if (this->config->debugCharSegmenter) { - for (uint z = 0; z < pipeline_data->thresholds.size(); z++) + for (unsigned int z = 0; z < pipeline_data->thresholds.size(); z++) { Point center(bigRect.x + bigRect.width / 2, bigRect.y + bigRect.height / 2); RotatedRect rrect(center, Size2f(bigRect.width, bigRect.height + (bigRect.height / 2)), 0); @@ -525,7 +525,7 @@ namespace alpr Mat mask = getCharBoxMask(thresholds[0], charRegions); - for (uint i = 0; i < thresholds.size(); i++) + for (unsigned int i = 0; i < thresholds.size(); i++) { bitwise_and(thresholds[i], mask, thresholds[i]); vector > contours; @@ -542,14 +542,14 @@ namespace alpr findContours(tempImg, contours, RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); - for (uint j = 0; j < charRegions.size(); j++) + for (unsigned int j = 0; j < charRegions.size(); j++) { const float MIN_SPECKLE_HEIGHT = ((float)charRegions[j].height) * MIN_SPECKLE_HEIGHT_PERCENT; const float MIN_CONTOUR_AREA = ((float)charRegions[j].area()) * MIN_CONTOUR_AREA_PERCENT; int tallestContourHeight = 0; float totalArea = 0; - for (uint c = 0; c < contours.size(); c++) + for (unsigned int c = 0; c < contours.size(); c++) { if (contours[c].size() == 0) continue; @@ -621,7 +621,7 @@ namespace alpr morphologyEx(thresholds[i], thresholds[i], MORPH_CLOSE, closureElement); // Lastly, draw a clipping line between each character boxes - for (uint j = 0; j < charRegions.size(); j++) + for (unsigned int j = 0; j < charRegions.size(); j++) { line(thresholds[i], Point(charRegions[j].x - 1, charRegions[j].y), Point(charRegions[j].x - 1, charRegions[j].y + charRegions[j].height), Scalar(0, 0, 0)); line(thresholds[i], Point(charRegions[j].x + charRegions[j].width + 1, charRegions[j].y), Point(charRegions[j].x + charRegions[j].width + 1, charRegions[j].y + charRegions[j].height), Scalar(0, 0, 0)); @@ -635,9 +635,9 @@ namespace alpr // Consider it a bad news bear. REmove the whole area. const float MIN_PERCENT_CHUNK_REMOVED = 0.6; - for (uint i = 0; i < thresholds.size(); i++) + for (unsigned int i = 0; i < thresholds.size(); i++) { - for (uint j = 0; j < charRegions.size(); j++) + for (unsigned int j = 0; j < charRegions.size(); j++) { Mat boxChar = Mat::zeros(thresholds[i].size(), CV_8U); rectangle(boxChar, charRegions[j], Scalar(255,255,255), CV_FILLED); @@ -685,12 +685,12 @@ namespace alpr { float MAX_FILLED = 0.95 * 255; - for (uint i = 0; i < charRegions.size(); i++) + for (unsigned int i = 0; i < charRegions.size(); i++) { Mat mask = Mat::zeros(thresholds[0].size(), CV_8U); rectangle(mask, charRegions[i], Scalar(255,255,255), -1); - for (uint j = 0; j < thresholds.size(); j++) + for (unsigned int j = 0; j < thresholds.size(); j++) { if (mean(thresholds[j], mask)[0] > MAX_FILLED) { @@ -719,12 +719,12 @@ namespace alpr vector boxScores(charRegions.size()); - for (uint i = 0; i < charRegions.size(); i++) + for (unsigned int i = 0; i < charRegions.size(); i++) boxScores[i] = 0; - for (uint i = 0; i < thresholds.size(); i++) + for (unsigned int i = 0; i < thresholds.size(); i++) { - for (uint j = 0; j < charRegions.size(); j++) + for (unsigned int j = 0; j < charRegions.size(); j++) { //float minArea = charRegions[j].area() * MIN_AREA_PERCENT; @@ -736,12 +736,12 @@ namespace alpr findContours(tempImg, contours, RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); vector allPointsInBox; - for (uint c = 0; c < contours.size(); c++) + for (unsigned int c = 0; c < contours.size(); c++) { if (contours[c].size() == 0) continue; - for (uint z = 0; z < contours[c].size(); z++) + for (unsigned int z = 0; z < contours[c].size(); z++) allPointsInBox.push_back(contours[c][z]); } @@ -765,7 +765,7 @@ namespace alpr vector newCharRegions; int maxBoxScore = 0; - for (uint i = 0; i < charRegions.size(); i++) + for (unsigned int i = 0; i < charRegions.size(); i++) { if (boxScores[i] > maxBoxScore) maxBoxScore = boxScores[i]; @@ -775,7 +775,7 @@ namespace alpr int MIN_FULL_BOXES = maxBoxScore * 0.49; // Now check each score. If it's below the minimum, remove the charRegion - for (uint i = 0; i < charRegions.size(); i++) + for (unsigned int i = 0; i < charRegions.size(); i++) { if (boxScores[i] > MIN_FULL_BOXES) newCharRegions.push_back(charRegions[i]); @@ -788,7 +788,7 @@ namespace alpr cout << " this box had a score of : " << boxScores[i];; cout << " MIN_FULL_BOXES: " << MIN_FULL_BOXES << endl;; - for (uint z = 0; z < thresholds.size(); z++) + for (unsigned int z = 0; z < thresholds.size(); z++) { rectangle(thresholds[z], charRegions[i], Scalar(0,0,0), -1); @@ -838,7 +838,7 @@ namespace alpr vector leftEdges; vector rightEdges; - for (uint i = 0; i < thresholds.size(); i++) + for (unsigned int i = 0; i < thresholds.size(); i++) { Mat rotated; @@ -944,7 +944,7 @@ namespace alpr cout << "Edge Filter: Entire right region is erased" << endl; } - for (uint i = 0; i < thresholds.size(); i++) + for (unsigned int i = 0; i < thresholds.size(); i++) { bitwise_and(thresholds[i], mask, thresholds[i]); } @@ -957,7 +957,7 @@ namespace alpr Mat invertedMask(mask.size(), mask.type()); bitwise_not(mask, invertedMask); - for (uint z = 0; z < imgDbgCleanStages.size(); z++) + for (unsigned int z = 0; z < imgDbgCleanStages.size(); z++) fillMask(imgDbgCleanStages[z], invertedMask, Scalar(0,0,255)); } } @@ -1028,7 +1028,7 @@ namespace alpr Mat boxMask = Mat::zeros(threshold.size(), CV_8U); rectangle(boxMask, slightlySmallerBox, Scalar(255, 255, 255), -1); - for (uint i = 0; i < contours.size(); i++) + for (unsigned int i = 0; i < contours.size(); i++) { // Only bother with the big boxes if (boundingRect(contours[i]).height < MIN_EDGE_CONTOUR_HEIGHT) @@ -1044,7 +1044,7 @@ namespace alpr int tallestContourHeight = 0; int tallestContourWidth = 0; float tallestContourArea = 0; - for (uint s = 0; s < subContours.size(); s++) + for (unsigned int s = 0; s < subContours.size(); s++) { Rect r = boundingRect(subContours[s]); if (r.height > tallestContourHeight) @@ -1075,7 +1075,7 @@ namespace alpr Mat CharacterSegmenter::getCharBoxMask(Mat img_threshold, vector charBoxes) { Mat mask = Mat::zeros(img_threshold.size(), CV_8U); - for (uint i = 0; i < charBoxes.size(); i++) + for (unsigned int i = 0; i < charBoxes.size(); i++) rectangle(mask, charBoxes[i], Scalar(255, 255, 255), -1); return mask; diff --git a/src/openalpr/segmentation/verticalhistogram.cpp b/src/openalpr/segmentation/verticalhistogram.cpp index b480acb..6840ce6 100644 --- a/src/openalpr/segmentation/verticalhistogram.cpp +++ b/src/openalpr/segmentation/verticalhistogram.cpp @@ -146,7 +146,7 @@ namespace alpr } } - HistogramDirection VerticalHistogram::getHistogramDirection(uint index) + HistogramDirection VerticalHistogram::getHistogramDirection(unsigned int index) { int EXTRA_WIDTH_TO_AVERAGE = 2; @@ -156,7 +156,7 @@ namespace alpr int trailStartIndex = index - EXTRA_WIDTH_TO_AVERAGE; if (trailStartIndex < 0) trailStartIndex = 0; - uint forwardEndIndex = index + EXTRA_WIDTH_TO_AVERAGE; + unsigned int forwardEndIndex = index + EXTRA_WIDTH_TO_AVERAGE; if (forwardEndIndex >= colHeights.size()) forwardEndIndex = colHeights.size() - 1; @@ -166,7 +166,7 @@ namespace alpr } trailingAverage = trailingAverage / ((float) (1 + index - trailStartIndex)); - for (uint i = index; i <= forwardEndIndex; i++) + for (unsigned int i = index; i <= forwardEndIndex; i++) { forwardAverage += colHeights[i]; } diff --git a/src/openalpr/segmentation/verticalhistogram.h b/src/openalpr/segmentation/verticalhistogram.h index 8eea36e..6e2d8d5 100644 --- a/src/openalpr/segmentation/verticalhistogram.h +++ b/src/openalpr/segmentation/verticalhistogram.h @@ -60,7 +60,7 @@ namespace alpr void analyzeImage(cv::Mat inputImage, cv::Mat mask); void findValleys(); - HistogramDirection getHistogramDirection(uint index); + HistogramDirection getHistogramDirection(unsigned int index); }; } diff --git a/src/openalpr/textdetection/characteranalysis.cpp b/src/openalpr/textdetection/characteranalysis.cpp index af60ec8..2ee94ad 100644 --- a/src/openalpr/textdetection/characteranalysis.cpp +++ b/src/openalpr/textdetection/characteranalysis.cpp @@ -60,7 +60,7 @@ namespace alpr pipeline_data->textLines.clear(); - for (uint i = 0; i < pipeline_data->thresholds.size(); i++) + for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++) { TextContours tc(pipeline_data->thresholds[i]); @@ -77,7 +77,7 @@ namespace alpr getTime(&startTime); - for (uint i = 0; i < pipeline_data->thresholds.size(); i++) + for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++) { this->filter(pipeline_data->thresholds[i], allTextContours[i]); @@ -101,7 +101,7 @@ namespace alpr if (plateMask.hasPlateMask) { // Filter out bad contours now that we have an outer box mask... - for (uint i = 0; i < pipeline_data->thresholds.size(); i++) + for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++) { filterByOuterMask(allTextContours[i]); } @@ -109,7 +109,7 @@ namespace alpr int bestFitScore = -1; int bestFitIndex = -1; - for (uint i = 0; i < pipeline_data->thresholds.size(); i++) + for (unsigned int i = 0; i < pipeline_data->thresholds.size(); i++) { int segmentCount = allTextContours[i].getGoodIndicesCount(); @@ -142,7 +142,7 @@ namespace alpr vector > linePolygons = lf.findLines(pipeline_data->crop_gray, bestContours); vector tempTextLines; - for (uint i = 0; i < linePolygons.size(); i++) + for (unsigned int i = 0; i < linePolygons.size(); i++) { vector linePolygon = linePolygons[i]; @@ -162,7 +162,7 @@ namespace alpr std::sort(tempTextLines.begin(), tempTextLines.end(), sort_text_line); // Now that we've filtered a few more contours, re-do the text area. - for (uint i = 0; i < tempTextLines.size(); i++) + for (unsigned int i = 0; i < tempTextLines.size(); i++) { vector updatedTextArea = getCharArea(tempTextLines[i].topLine, tempTextLines[i].bottomLine); vector linePolygon = tempTextLines[i].linePolygon; @@ -214,7 +214,7 @@ namespace alpr if (this->pipeline_data->config->debugCharAnalysis && pipeline_data->textLines.size() > 0) { vector tempDash; - for (uint z = 0; z < pipeline_data->thresholds.size(); z++) + for (unsigned int z = 0; z < pipeline_data->thresholds.size(); z++) { Mat tmp(pipeline_data->thresholds[z].size(), pipeline_data->thresholds[z].type()); pipeline_data->thresholds[z].copyTo(tmp); @@ -227,7 +227,7 @@ namespace alpr this->bestThreshold.copyTo(bestVal); cvtColor(bestVal, bestVal, CV_GRAY2BGR); - for (uint z = 0; z < this->bestContours.size(); z++) + for (unsigned int z = 0; z < this->bestContours.size(); z++) { Scalar dcolor(255,0,0); if (this->bestContours.goodIndices[z]) @@ -246,7 +246,7 @@ namespace alpr { Mat charMask = Mat::zeros(bestThreshold.size(), CV_8U); - for (uint i = 0; i < bestContours.size(); i++) + for (unsigned int i = 0; i < bestContours.size(); i++) { if (bestContours.goodIndices[i] == false) continue; @@ -281,7 +281,7 @@ namespace alpr { //vector goodIndices(contours.size()); - for (uint z = 0; z < textContours.size(); z++) textContours.goodIndices[z] = true; + for (unsigned int z = 0; z < textContours.size(); z++) textContours.goodIndices[z] = true; this->filterByBoxSize(textContours, STARTING_MIN_HEIGHT + (i * HEIGHT_STEP), STARTING_MAX_HEIGHT + (i * HEIGHT_STEP)); @@ -315,7 +315,7 @@ namespace alpr float aspecttolerance=0.25; - for (uint i = 0; i < textContours.size(); i++) + for (unsigned int i = 0; i < textContours.size(); i++) { if (textContours.goodIndices[i] == false) continue; @@ -344,7 +344,7 @@ namespace alpr void CharacterAnalysis::filterContourHoles(TextContours& textContours) { - for (uint i = 0; i < textContours.size(); i++) + for (unsigned int i = 0; i < textContours.size(); i++) { if (textContours.goodIndices[i] == false) continue; @@ -377,7 +377,7 @@ namespace alpr vector parentIDs; vector votes; - for (uint i = 0; i < textContours.size(); i++) + for (unsigned int i = 0; i < textContours.size(); i++) { if (textContours.goodIndices[i] == false) continue; @@ -387,7 +387,7 @@ namespace alpr int voteIndex = -1; int parentID = textContours.hierarchy[i][3]; // check if parentID is already in the lsit - for (uint j = 0; j < parentIDs.size(); j++) + for (unsigned int j = 0; j < parentIDs.size(); j++) { if (parentIDs[j] == parentID) { @@ -410,7 +410,7 @@ namespace alpr int totalVotes = 0; int winningParentId = 0; int highestVotes = 0; - for (uint i = 0; i < parentIDs.size(); i++) + for (unsigned int i = 0; i < parentIDs.size(); i++) { if (votes[i] > highestVotes) { @@ -421,7 +421,7 @@ namespace alpr } // Now filter out all the contours with a different parent ID (assuming the totalVotes > 2) - for (uint i = 0; i < textContours.size(); i++) + for (unsigned int i = 0; i < textContours.size(); i++) { if (textContours.goodIndices[i] == false) continue; @@ -452,11 +452,11 @@ namespace alpr // Create a white mask for the area inside the polygon Mat outerMask = Mat::zeros(img.size(), CV_8U); - for (uint i = 0; i < textLines.size(); i++) + for (unsigned int i = 0; i < textLines.size(); i++) fillConvexPoly(outerMask, textLines[i].linePolygon.data(), textLines[i].linePolygon.size(), Scalar(255,255,255)); // For each contour, determine if enough of it is between the lines to qualify - for (uint i = 0; i < textContours.size(); i++) + for (unsigned int i = 0; i < textContours.size(); i++) { if (textContours.goodIndices[i] == false) continue; @@ -490,7 +490,7 @@ namespace alpr // Get the absolute distance from the top and bottom lines - for (uint i = 0; i < textLines.size(); i++) + for (unsigned int i = 0; i < textLines.size(); i++) { Point closestTopPoint = textLines[i].topLine.closestPointOnSegmentTo(topMiddle); Point closestBottomPoint = textLines[i].bottomLine.closestPointOnSegmentTo(botMiddle); @@ -535,10 +535,10 @@ namespace alpr int totalChars = 0; vector originalindices; - for (uint i = 0; i < textContours.size(); i++) + for (unsigned int i = 0; i < textContours.size(); i++) originalindices.push_back(textContours.goodIndices[i]); - for (uint i=0; i < textContours.size(); i++) + for (unsigned int i=0; i < textContours.size(); i++) { if (textContours.goodIndices[i] == false) continue; @@ -625,12 +625,12 @@ namespace alpr int leftX = MAX; int rightX = MIN; - for (uint i = 0; i < bestContours.size(); i++) + for (unsigned int i = 0; i < bestContours.size(); i++) { if (bestContours.goodIndices[i] == false) continue; - for (uint z = 0; z < bestContours.contours[i].size(); z++) + for (unsigned int z = 0; z < bestContours.contours[i].size(); z++) { if (bestContours.contours[i][z].x < leftX) leftX = bestContours.contours[i][z].x; diff --git a/src/openalpr/textdetection/linefinder.cpp b/src/openalpr/textdetection/linefinder.cpp index 6a5ee3e..c1b2213 100644 --- a/src/openalpr/textdetection/linefinder.cpp +++ b/src/openalpr/textdetection/linefinder.cpp @@ -46,7 +46,7 @@ namespace alpr vector charPoints; - for (uint i = 0; i < contours.contours.size(); i++) + for (unsigned int i = 0; i < contours.contours.size(); i++) { if (contours.goodIndices[i] == false) continue; @@ -65,7 +65,7 @@ namespace alpr // Create a mask from the bestLine area, and remove all contours with tops that fall inside of it. vector remainingPoints; - for (uint i = 0; i < charPoints.size(); i++) + for (unsigned int i = 0; i < charPoints.size(); i++) { Mat mask = Mat::zeros(Size(contours.width, contours.height), CV_8U); fillConvexPoly(mask, bestLine.data(), bestLine.size(), Scalar(255,255,255)); @@ -103,7 +103,7 @@ namespace alpr vector charheights; - for (uint i = 0; i < charPoints.size(); i++) + for (unsigned int i = 0; i < charPoints.size(); i++) charheights.push_back(charPoints[i].boundingBox.height); float medianCharHeight = median(charheights.data(), charheights.size()); @@ -112,9 +112,9 @@ namespace alpr vector topLines; vector bottomLines; // Iterate through each possible char and find all possible lines for the top and bottom of each char segment - for (uint i = 0; i < charPoints.size() - 1; i++) + for (unsigned int i = 0; i < charPoints.size() - 1; i++) { - for (uint k = i+1; k < charPoints.size(); k++) + for (unsigned int k = i+1; k < charPoints.size(); k++) { int leftCPIndex, rightCPIndex; @@ -168,13 +168,13 @@ namespace alpr int bestScoreDistance = -1; // Line segment distance is used as a tie breaker // Now, among all possible lines, find the one that is the best fit - for (uint i = 0; i < topLines.size(); i++) + for (unsigned int i = 0; i < topLines.size(); i++) { float SCORING_MIN_THRESHOLD = 0.97; float SCORING_MAX_THRESHOLD = 1.03; int curScore = 0; - for (uint charidx = 0; charidx < charPoints.size(); charidx++) + for (unsigned int charidx = 0; charidx < charPoints.size(); charidx++) { float topYPos = topLines[i].getPointAt(charPoints[charidx].top.x); float botYPos = bottomLines[i].getPointAt(charPoints[charidx].bottom.x); diff --git a/src/openalpr/textdetection/platemask.cpp b/src/openalpr/textdetection/platemask.cpp index 4eee470..44faf35 100644 --- a/src/openalpr/textdetection/platemask.cpp +++ b/src/openalpr/textdetection/platemask.cpp @@ -51,14 +51,14 @@ namespace alpr if (pipeline_data->config->debugCharAnalysis) cout << "CharacterAnalysis::findOuterBoxMask" << endl; - for (uint imgIndex = 0; imgIndex < contours.size(); imgIndex++) + for (unsigned int imgIndex = 0; imgIndex < contours.size(); imgIndex++) { //vector charContours = filter(thresholds[imgIndex], allContours[imgIndex], allHierarchy[imgIndex]); int charsRecognized = 0; int parentId = -1; bool hasParent = false; - for (uint i = 0; i < contours[imgIndex].goodIndices.size(); i++) + for (unsigned int i = 0; i < contours[imgIndex].goodIndices.size(); i++) { if (contours[imgIndex].goodIndices[i]) charsRecognized++; if (contours[imgIndex].goodIndices[i] && contours[imgIndex].hierarchy[i][3] != -1) @@ -97,9 +97,9 @@ namespace alpr int longestChildIndex = -1; double longestChildLength = 0; // Find the child with the longest permiter/arc length ( just for kicks) - for (uint i = 0; i < contours[winningIndex].size(); i++) + for (unsigned int i = 0; i < contours[winningIndex].size(); i++) { - for (uint j = 0; j < contours[winningIndex].size(); j++) + for (unsigned int j = 0; j < contours[winningIndex].size(); j++) { if (contours[winningIndex].hierarchy[j][3] == winningParentId) { @@ -145,7 +145,7 @@ namespace alpr findContours(mask, contoursSecondRound, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); int biggestContourIndex = -1; double largestArea = 0; - for (uint c = 0; c < contoursSecondRound.size(); c++) + for (unsigned int c = 0; c < contoursSecondRound.size(); c++) { double area = contourArea(contoursSecondRound[c]); if (area > largestArea) diff --git a/src/openalpr/textdetection/textcontours.cpp b/src/openalpr/textdetection/textcontours.cpp index cbff1a6..c74fd56 100644 --- a/src/openalpr/textdetection/textcontours.cpp +++ b/src/openalpr/textdetection/textcontours.cpp @@ -50,7 +50,7 @@ namespace alpr CV_RETR_TREE, // retrieve all contours CV_CHAIN_APPROX_SIMPLE ); // all pixels of each contours - for (uint i = 0; i < contours.size(); i++) + for (unsigned int i = 0; i < contours.size(); i++) goodIndices.push_back(true); this->width = threshold.cols; @@ -58,7 +58,7 @@ namespace alpr } - uint TextContours::size() { + unsigned int TextContours::size() { return contours.size(); } @@ -67,7 +67,7 @@ namespace alpr int TextContours::getGoodIndicesCount() { int count = 0; - for (uint i = 0; i < goodIndices.size(); i++) + for (unsigned int i = 0; i < goodIndices.size(); i++) { if (goodIndices[i]) count++; @@ -80,7 +80,7 @@ namespace alpr std::vector TextContours::getIndicesCopy() { vector copyArray; - for (uint i = 0; i < goodIndices.size(); i++) + for (unsigned int i = 0; i < goodIndices.size(); i++) { bool val = goodIndices[i]; copyArray.push_back(goodIndices[i]); @@ -93,7 +93,7 @@ namespace alpr { if (newIndices.size() == goodIndices.size()) { - for (uint i = 0; i < newIndices.size(); i++) + for (unsigned int i = 0; i < newIndices.size(); i++) goodIndices[i] = newIndices[i]; } else @@ -116,7 +116,7 @@ namespace alpr cvtColor(img_contours, img_contours, CV_GRAY2RGB); vector > allowedContours; - for (uint i = 0; i < this->contours.size(); i++) + for (unsigned int i = 0; i < this->contours.size(); i++) { if (this->goodIndices[i]) allowedContours.push_back(this->contours[i]); diff --git a/src/openalpr/textdetection/textcontours.h b/src/openalpr/textdetection/textcontours.h index c7d2e45..4b14915 100644 --- a/src/openalpr/textdetection/textcontours.h +++ b/src/openalpr/textdetection/textcontours.h @@ -41,7 +41,7 @@ namespace alpr std::vector > contours; std::vector hierarchy; - uint size(); + unsigned int size(); int getGoodIndicesCount(); std::vector getIndicesCopy(); diff --git a/src/openalpr/textdetection/textline.cpp b/src/openalpr/textdetection/textline.cpp index ec9db71..62a3b74 100644 --- a/src/openalpr/textdetection/textline.cpp +++ b/src/openalpr/textdetection/textline.cpp @@ -30,9 +30,9 @@ namespace alpr TextLine::TextLine(std::vector textArea, std::vector linePolygon) { std::vector textAreaInts, linePolygonInts; - for (uint i = 0; i < textArea.size(); i++) + for (unsigned int i = 0; i < textArea.size(); i++) textAreaInts.push_back(Point(round(textArea[i].x), round(textArea[i].y))); - for (uint i = 0; i < linePolygon.size(); i++) + for (unsigned int i = 0; i < linePolygon.size(); i++) linePolygonInts.push_back(Point(round(linePolygon[i].x), round(linePolygon[i].y))); initialize(textAreaInts, linePolygonInts); @@ -56,10 +56,10 @@ namespace alpr if (this->linePolygon.size() > 0) this->linePolygon.clear(); - for (uint i = 0; i < textArea.size(); i++) + for (unsigned int i = 0; i < textArea.size(); i++) this->textArea.push_back(textArea[i]); - for (uint i = 0; i < linePolygon.size(); i++) + for (unsigned int i = 0; i < linePolygon.size(); i++) this->linePolygon.push_back(linePolygon[i]); this->topLine = LineSegment(linePolygon[0].x, linePolygon[0].y, linePolygon[1].x, linePolygon[1].y); diff --git a/src/openalpr/transformation.cpp b/src/openalpr/transformation.cpp index bda2311..2ad393d 100644 --- a/src/openalpr/transformation.cpp +++ b/src/openalpr/transformation.cpp @@ -50,7 +50,7 @@ namespace alpr vector Transformation::transformSmallPointsToBigImage(vector points) { vector bigPoints; - for (uint i = 0; i < points.size(); i++) + for (unsigned int i = 0; i < points.size(); i++) { float bigX = (points[i].x * ((float) regionInBigImage.width / smallImage.cols)); float bigY = (points[i].y * ((float) regionInBigImage.height / smallImage.rows)); diff --git a/src/openalpr/utility.cpp b/src/openalpr/utility.cpp index 4aa844f..cc69969 100644 --- a/src/openalpr/utility.cpp +++ b/src/openalpr/utility.cpp @@ -50,13 +50,13 @@ namespace alpr return expandedRegion; } - Mat drawImageDashboard(vector images, int imageType, uint numColumns) + Mat drawImageDashboard(vector images, int imageType, unsigned int numColumns) { - uint numRows = ceil((float) images.size() / (float) numColumns); + unsigned int numRows = ceil((float) images.size() / (float) numColumns); Mat dashboard(Size(images[0].cols * numColumns, images[0].rows * numRows), imageType); - for (uint i = 0; i < numColumns * numRows; i++) + for (unsigned int i = 0; i < numColumns * numRows; i++) { if (i < images.size()) images[i].copyTo(dashboard(Rect((i%numColumns) * images[i].cols, floor((float) i/numColumns) * images[i].rows, images[i].cols, images[i].rows))); @@ -421,7 +421,7 @@ namespace alpr ss << value; return ss.str(); } - std::string toString(uint value) + std::string toString(unsigned int value) { return toString((int) value); } diff --git a/src/openalpr/utility.h b/src/openalpr/utility.h index 148f704..8b58423 100644 --- a/src/openalpr/utility.h +++ b/src/openalpr/utility.h @@ -77,7 +77,7 @@ namespace alpr std::vector produceThresholds(const cv::Mat img_gray, Config* config); - cv::Mat drawImageDashboard(std::vector images, int imageType, uint numColumns); + cv::Mat drawImageDashboard(std::vector images, int imageType, unsigned int numColumns); void displayImage(Config* config, std::string windowName, cv::Mat frame); void drawAndWait(cv::Mat* frame); @@ -103,7 +103,7 @@ namespace alpr std::string toString(int value); - std::string toString(uint value); + std::string toString(unsigned int value); std::string toString(float value); std::string toString(double value);