opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.34k stars 5.75k forks source link

ObjectnessBing runs three models (BGR, HSV, I) and writes to disk on every call #2499

Open llschloesser opened 4 years ago

llschloesser commented 4 years ago
System information (version)
Detailed description

The public function bool ObjectnessBING::computeSaliencyImpl(InputArray image, OutputArray objectnessBoundingBox) calls the private function void ObjectnessBING::getObjBndBoxesForSingleImage(Mat img, ValStructVec<float, Vec4i> &finalBoxes, int numDetPerSize) which requires a CV_8UC3 image and then proceeds to run the algorithm three times! on BGR input, HSV input and gray input, before printfing timing results (which are nowhere remotely close to 300Hz, more like 6Hz) and writing proposals to disk. Why? Presumably the user wants to choose between BGR, HSV, and gray, not printf timing to the console and not save results to disk.

The paper mentions the color spaces just once and the differences between running on one or all three are negligible.

My suggestions:

Steps to reproduce

Examine the source code and run the sample.

Issue submission checklist
mshabunin commented 4 years ago

@llschloesser , feel free to propose your changes in Pull Request.