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)
|
||||
{
|
||||
double midX = (p1.x() + p2.x()) / 2.;
|
||||
|
@ -48,13 +48,12 @@ public:
|
||||
|
||||
QImage crop(QRect);
|
||||
|
||||
QRect getAbsoluteRectFromTwoPoints(QPoint , QPoint);
|
||||
QRectF getRelativeRectFromTwoPoints(QPointF , QPointF);
|
||||
|
||||
QRect cvtRelativeToAbsoluteRectInUi(QRectF);
|
||||
QRect cvtRelativeToAbsoluteRectInImage(QRectF);
|
||||
|
||||
QPoint cvtRelativeToAbsolutePoint(QPointF);
|
||||
QPoint cvtRelativeToAbsolutePoint(QPointF);
|
||||
QPointF cvtAbsoluteToRelativePoint(QPoint);
|
||||
|
||||
signals:
|
||||
|
@ -81,7 +81,6 @@ void MainWindow::on_pushButton_open_files_clicked()
|
||||
m_fileList = fileList;
|
||||
for(QString& str: m_fileList) str = m_fileDir + "/" + str;
|
||||
|
||||
|
||||
load_label_list_data(fileLabelList);
|
||||
|
||||
init();
|
||||
|
Loading…
Reference in New Issue
Block a user