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

Gen2: ImageManip rotated/arbitrary cropping, camera controls #16

Merged
merged 20 commits into from Feb 12, 2021

Conversation

alex-luxonis
Copy link
Collaborator

@alex-luxonis alex-luxonis commented Jan 12, 2021

Add types defined similar to some OpenCV ones:

  • Point2f: {float x, y;}
  • Size2f: {float width, height;}
  • RotatedRect: {Point2f center; Size2f size; float angle;}

And for arbitrary cropping, I was thinking on defining a sequence of 4 points in clockwise order forming a quadrilateral, that would get mapped to a rectangle, whose size we specify (so resizing + other warp transforms can be applied). First sequence point would get mapped to the top-left corner of the rectangle.

 0___1       0 ____ 1
 /   \   ->   |    |
/_____\       |____|
3     2      3      2

These are still open to ideas for improvement.

@Luxonis-Brandon Luxonis-Brandon added enhancement New feature or request Gen2 Feature for or issue with Gen2 labels Jan 12, 2021
@Luxonis-Brandon Luxonis-Brandon added this to In progress in Gen2 Phase I Delivery via automation Jan 12, 2021
@themarpe
Copy link
Collaborator

Does the intermediate rectangle size adds any additional benefits compared to just the final output size?

@alex-luxonis alex-luxonis changed the title Gen2: ImageManip rotated/arbitrary cropping Gen2: ImageManip rotated/arbitrary cropping, camera controls Jan 29, 2021
can be used when ImageManip is connected directly to the camera,
and set to process a sequence of NN detections (bounding boxes),
it should be set when there are no detections
@alex-luxonis
Copy link
Collaborator Author

Does the intermediate rectangle size adds any additional benefits compared to just the final output size?

For the rotated rectangle (center, size, angle), it describes the crop area, that can be further resized.
For the quadrilateral (that I renamed it now to warpFourPoints), I removed the size specification, and it is auto-computed based on the points geometry, if the final resize is not specified.

@alex-luxonis alex-luxonis merged commit 47246f4 into gen2_develop Feb 12, 2021
@alex-luxonis alex-luxonis deleted the gen2_imagemanip_rotate branch February 12, 2021 14:24
@Luxonis-Brandon Luxonis-Brandon moved this from In progress to Done in Gen2 Phase I Delivery Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Gen2 Feature for or issue with Gen2
Development

Successfully merging this pull request may close these issues.

None yet

3 participants