Change Coordinate system: Absolute to Relative
This commit is contained in:
parent
25bc781e66
commit
f442f88d06
@ -264,19 +264,6 @@ void label_img::removeFocusedObjectBox(QPointF point)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect label_img::getAbsoluteRectFromTwoPoints(QPoint p1, QPoint p2)
|
|
||||||
{
|
|
||||||
int midX = (p1.x() + p2.x()) / 2;
|
|
||||||
int midY = (p1.y() + p2.y()) / 2;
|
|
||||||
int width = abs(p1.x() - p2.x());
|
|
||||||
int height = abs(p1.y() - p2.y());
|
|
||||||
|
|
||||||
QPoint topLeftPoint(midX - width/2, midY - height/2);
|
|
||||||
QPoint bottomRightPoint(midX + width/2, midY + height/2);
|
|
||||||
|
|
||||||
return QRect(topLeftPoint, bottomRightPoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
QRectF label_img::getRelativeRectFromTwoPoints(QPointF p1, QPointF p2)
|
QRectF label_img::getRelativeRectFromTwoPoints(QPointF p1, QPointF p2)
|
||||||
{
|
{
|
||||||
double midX = (p1.x() + p2.x()) / 2.;
|
double midX = (p1.x() + p2.x()) / 2.;
|
||||||
|
@ -48,7 +48,6 @@ public:
|
|||||||
|
|
||||||
QImage crop(QRect);
|
QImage crop(QRect);
|
||||||
|
|
||||||
QRect getAbsoluteRectFromTwoPoints(QPoint , QPoint);
|
|
||||||
QRectF getRelativeRectFromTwoPoints(QPointF , QPointF);
|
QRectF getRelativeRectFromTwoPoints(QPointF , QPointF);
|
||||||
|
|
||||||
QRect cvtRelativeToAbsoluteRectInUi(QRectF);
|
QRect cvtRelativeToAbsoluteRectInUi(QRectF);
|
||||||
|
@ -81,7 +81,6 @@ void MainWindow::on_pushButton_open_files_clicked()
|
|||||||
m_fileList = fileList;
|
m_fileList = fileList;
|
||||||
for(QString& str: m_fileList) str = m_fileDir + "/" + str;
|
for(QString& str: m_fileList) str = m_fileDir + "/" + str;
|
||||||
|
|
||||||
|
|
||||||
load_label_list_data(fileLabelList);
|
load_label_list_data(fileLabelList);
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
Loading…
Reference in New Issue
Block a user