-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimagebasicoperations.cpp
More file actions
30 lines (27 loc) · 932 Bytes
/
Copy pathimagebasicoperations.cpp
File metadata and controls
30 lines (27 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "imagebasicoperations.h"
imageBasicOperations::imageBasicOperations()
{
}
void imageBasicOperations::setImage(Mat selectedImage){
this->selectedImage=selectedImage;
}
void imageBasicOperations::setLabelSize(int labelWidth, int labelHeight){
if(labelHeight >0 && labelWidth >0){
this->labelWidth=labelWidth;
this->labelHeight=labelHeight;
}
else{
this->labelHeight=539;
this->labelWidth=237;
}
}
int imageBasicOperations::getWidthLabel(){
return this->labelWidth;
}
int imageBasicOperations::getHeightLabel(){
return this->labelHeight;
}
QPixmap imageBasicOperations::convertToPixmap(Mat filteredImage){
cvtColor(filteredImage, filteredImage, COLOR_BGR2RGB);
return QPixmap::fromImage(QImage(filteredImage.data, filteredImage.cols, filteredImage.rows,filteredImage.step1(), QImage::Format_RGB888).scaled (labelWidth,labelHeight,Qt::KeepAspectRatio));
}