diff --git a/label_img.cpp b/label_img.cpp index 923f83f..e0916ea 100644 --- a/label_img.cpp +++ b/label_img.cpp @@ -96,12 +96,14 @@ void label_img::setMousePosition(int x, int y) void label_img::openImage(const QString &qstrImg) { m_inputImg = QImage(qstrImg); + m_inputImg = m_inputImg.convertToFormat(QImage::Format_RGB888); m_inputImgCopy = m_inputImg; m_aspectRatioWidth = static_cast(m_inputImg.width()) / this->width(); m_aspectRatioHeight = static_cast(m_inputImg.height()) / this->height(); m_objBoundingBoxes.clear(); + m_drawObjectBoxColor.clear(); m_objStartPoint = QPoint(); diff --git a/label_img.h b/label_img.h index 6731a88..ee53528 100644 --- a/label_img.h +++ b/label_img.h @@ -73,9 +73,9 @@ private: void drawFocusedObjectBox(QPainter& , Qt::GlobalColor , int thickWidth = 3); void drawObjectBoxes(QPainter& , int thickWidth = 3); - void removeFocusedObjectBox(QPoint point); + void removeFocusedObjectBox(QPoint); - QRect getRectFromTwoPoints(QPoint p1, QPoint p2); + QRect getRectFromTwoPoints(QPoint , QPoint); }; diff --git a/mainwindow.cpp b/mainwindow.cpp index 45bc94a..24d8ed6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -212,6 +212,10 @@ void MainWindow::load_label_list_data(QString qstrLabelListFile) if(inputLabelListFile.is_open()) { + + for(int i = 0 ; i <= ui->tableWidget_label->rowCount(); i++) + ui->tableWidget_label->removeRow(ui->tableWidget_label->currentRow()); + m_labelNameList.clear(); string strLabel; @@ -221,7 +225,7 @@ void MainWindow::load_label_list_data(QString qstrLabelListFile) while(inputLabelListFile >> strLabel) { int nRow = ui->tableWidget_label->rowCount(); - + std::cout << nRow << endl; QString qstrLabel = QString().fromStdString(strLabel); QColor labelColor = label_img::BOX_COLORS[(fileIndex++)%10]; m_labelNameList << qstrLabel; @@ -339,14 +343,6 @@ void MainWindow::mouseReleased() } -void MainWindow::on_horizontalSlider_images_valueChanged(int value) -{ - - // cout<<"kiff"<Qt::StrongFocus - Image Labeling Tool + YoloLabel background-color : rgb(0, 0, 17); @@ -284,10 +284,10 @@ QSlider::handle:horizontal { 0 - 10 + 0 - false + true Qt::Horizontal @@ -635,7 +635,7 @@ QTableView { true - true + false true