mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
change area() emptiness checks to empty()
This commit is contained in:
@@ -502,7 +502,7 @@ bool FeatureEvaluator::setImage( InputArray _image, const std::vector<float>& _s
|
||||
copyVectorToUMat(*scaleData, uscaleData);
|
||||
}
|
||||
|
||||
if (_image.isUMat() && localSize.area() > 0)
|
||||
if (_image.isUMat() && !localSize.empty())
|
||||
{
|
||||
usbuf.create(sbufSize.height*nchannels, sbufSize.width, CV_32S);
|
||||
urbuf.create(sz0, CV_8U);
|
||||
@@ -1076,7 +1076,7 @@ bool CascadeClassifierImpl::ocl_detectMultiScaleNoGrouping( const std::vector<fl
|
||||
std::vector<UMat> bufs;
|
||||
featureEvaluator->getUMats(bufs);
|
||||
Size localsz = featureEvaluator->getLocalSize();
|
||||
if( localsz.area() == 0 )
|
||||
if( localsz.empty() )
|
||||
return false;
|
||||
Size lbufSize = featureEvaluator->getLocalBufSize();
|
||||
size_t localsize[] = { (size_t)localsz.width, (size_t)localsz.height };
|
||||
@@ -1112,7 +1112,7 @@ bool CascadeClassifierImpl::ocl_detectMultiScaleNoGrouping( const std::vector<fl
|
||||
if( haarKernel.empty() )
|
||||
{
|
||||
String opts;
|
||||
if (lbufSize.area())
|
||||
if ( !lbufSize.empty() )
|
||||
opts = format("-D LOCAL_SIZE_X=%d -D LOCAL_SIZE_Y=%d -D SUM_BUF_SIZE=%d -D SUM_BUF_STEP=%d -D NODE_COUNT=%d -D SPLIT_STAGE=%d -D N_STAGES=%d -D MAX_FACES=%d -D HAAR",
|
||||
localsz.width, localsz.height, lbufSize.area(), lbufSize.width, data.maxNodesPerTree, splitstage_ocl, nstages, MAX_FACES);
|
||||
else
|
||||
@@ -1152,7 +1152,7 @@ bool CascadeClassifierImpl::ocl_detectMultiScaleNoGrouping( const std::vector<fl
|
||||
if( lbpKernel.empty() )
|
||||
{
|
||||
String opts;
|
||||
if (lbufSize.area())
|
||||
if ( !lbufSize.empty() )
|
||||
opts = format("-D LOCAL_SIZE_X=%d -D LOCAL_SIZE_Y=%d -D SUM_BUF_SIZE=%d -D SUM_BUF_STEP=%d -D SPLIT_STAGE=%d -D N_STAGES=%d -D MAX_FACES=%d -D LBP",
|
||||
localsz.width, localsz.height, lbufSize.area(), lbufSize.width, splitstage_ocl, nstages, MAX_FACES);
|
||||
else
|
||||
@@ -1308,7 +1308,7 @@ void CascadeClassifierImpl::detectMultiScaleNoGrouping( InputArray _image, std::
|
||||
#ifdef HAVE_OPENCL
|
||||
bool use_ocl = tryOpenCL && ocl::isOpenCLActivated() &&
|
||||
OCL_FORCE_CHECK(_image.isUMat()) &&
|
||||
featureEvaluator->getLocalSize().area() > 0 &&
|
||||
!featureEvaluator->getLocalSize().empty() &&
|
||||
(data.minNodesPerTree == data.maxNodesPerTree) &&
|
||||
!isOldFormatCascade() &&
|
||||
maskGenerator.empty() &&
|
||||
|
||||
@@ -661,7 +661,7 @@ void DetectionBasedTracker::process(const Mat& imageGray)
|
||||
CV_Assert(n > 0);
|
||||
|
||||
Rect r = trackedObjects[i].lastPositions[n-1];
|
||||
if(r.area() == 0) {
|
||||
if(r.empty()) {
|
||||
LOGE("DetectionBasedTracker::process: ERROR: ATTENTION: strange algorithm's behavior: trackedObjects[i].rect() is empty");
|
||||
continue;
|
||||
}
|
||||
@@ -701,7 +701,7 @@ void cv::DetectionBasedTracker::getObjects(std::vector<cv::Rect>& result) const
|
||||
|
||||
for(size_t i=0; i < trackedObjects.size(); i++) {
|
||||
Rect r=calcTrackedObjectPositionToShow((int)i);
|
||||
if (r.area()==0) {
|
||||
if (r.empty()) {
|
||||
continue;
|
||||
}
|
||||
result.push_back(r);
|
||||
@@ -715,7 +715,7 @@ void cv::DetectionBasedTracker::getObjects(std::vector<Object>& result) const
|
||||
|
||||
for(size_t i=0; i < trackedObjects.size(); i++) {
|
||||
Rect r=calcTrackedObjectPositionToShow((int)i);
|
||||
if (r.area()==0) {
|
||||
if (r.empty()) {
|
||||
continue;
|
||||
}
|
||||
result.push_back(Object(r, trackedObjects[i].id));
|
||||
|
||||
@@ -1427,7 +1427,7 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
|
||||
+ equRect.x + equRect.width;
|
||||
}
|
||||
|
||||
if( scanROI.area() > 0 )
|
||||
if( !scanROI.empty() )
|
||||
{
|
||||
//adjust start_height and stop_height
|
||||
startY = cvRound(scanROI.y / ystep);
|
||||
@@ -1442,7 +1442,7 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
|
||||
ystep, sum->step, (const int**)p,
|
||||
(const int**)pq, allCandidates, &mtx ));
|
||||
|
||||
if( findBiggestObject && !allCandidates.empty() && scanROI.area() == 0 )
|
||||
if( findBiggestObject && !allCandidates.empty() && scanROI.empty() )
|
||||
{
|
||||
rectList.resize(allCandidates.size());
|
||||
std::copy(allCandidates.begin(), allCandidates.end(), rectList.begin());
|
||||
|
||||
Reference in New Issue
Block a user