Cache the blank Mat, no need to re-generate each time it's needed by loadImage()
This commit is contained in:
parent
a2b69433e2
commit
62c7181906
|
@ -5,7 +5,10 @@ Image::Image () {
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat Image::getBlank () {
|
Mat Image::getBlank () {
|
||||||
return Mat::zeros(height, width, CV_8UC3);
|
if (blank.empty()) {
|
||||||
|
blank = Mat::zeros(height, width, CV_8UC3);
|
||||||
|
}
|
||||||
|
return blank;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat Image::loadImage (string& image_path, uint64_t& x, uint64_t& y, uint64_t& w, uint64_t& h) {
|
Mat Image::loadImage (string& image_path, uint64_t& x, uint64_t& y, uint64_t& w, uint64_t& h) {
|
||||||
|
|
Loading…
Reference in New Issue