Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension - BBox Angle (not an issue) #7

Open
arasharchor opened this issue Nov 27, 2016 · 5 comments
Open

Extension - BBox Angle (not an issue) #7

arasharchor opened this issue Nov 27, 2016 · 5 comments

Comments

@arasharchor
Copy link

Hi,

I am trying to annotate the images with bboxes with different rotations, but this tool doesn't support it as far as I have seen. Is there any way to add this feature to the future version? that is really useful.
Also in Pacal VOC, there are a few more options in annotations e.g. orientations (left,right...), truncated,.. How to add these options to the tool? I would like to contribute, but I don't know from where I should start.

Best,
Majid

@tzutalin
Copy link
Owner

@smajida ,
The original source code is from https://github.com/tzutalin/labelImg

It's cool to add more features to the tool !!! We can add more features or options as you mentioned, it must be helpful to other people. If you would like to contribute, you can try to clone labbelImg and add the feature and send a PR to that repository.

@arasharchor
Copy link
Author

@tzutalin
It seems both GUI tools are doing roughly the same thing.
Could you tell me what the differences are between "labelImg" and "ImageNet_Utils"? Is "ImagNet_Utils" the older version of LabelImg which you suggest me to contribute to "labellmg"?

@arasharchor arasharchor changed the title Extenstion - BBox Angle (not an issue) Extension - BBox Angle (not an issue) Nov 27, 2016
@tzutalin
Copy link
Owner

@smajida ,
labellmg is a git submodule of ImageNet_Utils. ImageNet_Utils provides other command lines to download images from ImageNet or convert format utils. labelImg is the source code of GUI tools. Usually, there are some changes in LablelImg, I will sync the changes to ImageNet_Utils. If you have any changes about labellmg, you should change it directly.

@arasharchor
Copy link
Author

arasharchor commented Mar 9, 2017

@tzutalin
There are two ways of creating rotated bounding boxes:

1- the user creates a bounding box with no rotation with his/her mouse, then using "wheel" in the mouse he/she will rotate bounding box to fit object which for this case I am writing a code, but I am stuck.

2-To annotate fast, just user selects diagonal of object, by clicking first the top left corner of the object, then the bottom right corner which is done in https://github.com/smajida/FastAnnotationTool

for the first case:

 void paintEvent(QPaintEvent* event){
    QPainter painter(this);

    // xc and yc are the center of the widget's rect.
    qreal xc = width() * 0.5;
    qreal yc = height() * 0.5;

    painter.setPen(Qt::black);

    // draw the cross lines.
    painter.drawLine(xc, rect().top(), xc, rect().bottom());
    painter.drawLine(rect().left(), yc, rect().right(), yc);

    painter.setBrush(Qt::white);
    painter.setPen(Qt::blue);

    // Draw a 13x17 rectangle rotated to 45 degrees around its center-point
    // in the center of the canvas.

    // translates the coordinate system by xc and yc
    painter.translate(xc, yc);

    // then rotate the coordinate system by 45 degrees
    painter.rotate(45);

    // we need to move the rectangle that we draw by rx and ry so it's in the center.
    qreal rx = -(13 * 0.5);
    qreal ry = -(17 * 0.5);
    painter.drawRect(QRect(rx, ry, 13, 17));

@jamesthesken
Copy link

Is this now implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants