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

SLAM: Process images when they're of YCbCr type #1429

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

kkufieta
Copy link
Contributor

@kkufieta kkufieta commented Oct 3, 2022

Implements the RDK side of this ticket: https://viam.atlassian.net/browse/DATA-521

Tested with:

  • realsense: mono & rgbd
  • webcam: mono

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2022

CLA assistant check
All committers have signed the CLA.

@kkufieta kkufieta added the appimage Build AppImage of PR label Oct 3, 2022
@kkufieta kkufieta force-pushed the kk/demo-random-changes branch 3 times, most recently from 29c1e15 to f35bbfa Compare October 6, 2022 12:10
@kkufieta kkufieta marked this pull request as ready for review October 6, 2022 14:43
@kkufieta kkufieta changed the title Process images when they're of YCbCr type SLAM: Process images when they're of YCbCr type Oct 6, 2022
services/slam/builtin/builtin.go Show resolved Hide resolved
if lazyImg.MIMEType() != utils.MimeTypePNG {
return nil, nil, errors.Errorf("expected mime type %v, got %v", utils.MimeTypePNG, lazyImg.MIMEType())

if ycbcrImg, ok := img.(*image.YCbCr); ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding an integration test that runs mono YCbCr images, but it's fine with me if you want to do that in a follow-up ticket.

Copy link
Contributor Author

@kkufieta kkufieta Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a follow-up ticket for this. Ticket: DATA-535

}
return lazyImg.RawData(), release, nil

return nil, nil, errors.Errorf("expected lazily encoded image or ycbcrImg, got %T", img)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] You could change the function name to getPNGImage(), since it will not always be lazy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it to the follow-up ticket (create integration test): DATA-535

Copy link
Member

@JohnN193 JohnN193 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, was curious about the images being BGR vs RGB with these changes+slam changes but we can look more into that later

@kkufieta kkufieta merged commit 8362959 into viamrobotics:main Oct 6, 2022
@kkufieta kkufieta deleted the kk/demo-random-changes branch October 6, 2022 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appimage Build AppImage of PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants