mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-04 16:25:39 -05:00
Fix crash brightness
This will prevent a crash when the brightness is calculated and the source has no output (yet).
This commit is contained in:
parent
5ae1f38ea8
commit
c551953283
|
|
@ -102,6 +102,10 @@ std::vector<cv::Rect> matchObject(QImage &img, cv::CascadeClassifier &cascade,
|
|||
|
||||
uchar getAvgBrightness(QImage &img)
|
||||
{
|
||||
if (img.isNull()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto i = QImageToMat(img);
|
||||
cv::Mat hsvImage, rgbImage;
|
||||
cv::cvtColor(i, rgbImage, cv::COLOR_RGBA2RGB);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user