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

opencv csc module #1108

Closed
totaam opened this issue Feb 1, 2016 · 6 comments
Closed

opencv csc module #1108

totaam opened this issue Feb 1, 2016 · 6 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Feb 1, 2016

Issue migrated from trac ticket # 1108

component: encodings | priority: trivial | resolution: fixed

2016-02-01 20:00:51: antoine created the issue


Related to #1030: [http://opencv.org/] provides simple utility csc functions, including [http: opencv.org ] provides simple utility csc functions, including [CSC](http:--opencv.org-] provides simple utility csc functions, including [../wiki/CSC) via cvtcolor: rgb = cv2.cvtColor(bgr, cv2.COLOR_BGR2RGB)

I'm not sure how we can deal with rowstride, but I think the underlying numpy buffers it uses can help us with that.

It should be quite easy to make a csc module, then we can see what performance we get, how it compares to the leading contenders (#973), how portable it is (builds on win32, not yet on osx), etc.

@totaam
Copy link
Collaborator Author

totaam commented Feb 1, 2016

2016-02-01 23:47:24: antoine changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Feb 1, 2016

2016-02-01 23:47:24: antoine commented


Added a csc_opencv csc module in r11811, minor fixes in r11819.

Notes / limitations / TODO:

  • it's disappointing: just not very fast, even my crappy Cython csc module is faster
  • performance data needs to be added to CSC Performance
  • the code only handles RGB modes to YUV420P at present - not sure we care
  • we claim to be handling odd dimensions and resize the pixel buffers on the fly (looks like a bug in the csc / codec interface, which should be able to handle width and height masks better?) - this step is using numpy copy line-by-line, but it is actually quite fast
  • the code is quite small which is nice, and it should be portable
  • it could handle scaling using cvResize: it even supports different interpolation types (linear, nearest, etc..)

Can easily be tested by forcing CSC with h264:

XPRA_FORCE_CSC_MODE=YUV420P \
XPRA_ENCODING_STRICT_MODE=1 \
xpra --start-child=xterm start :10 -d opencv --csc-modules=opencv

@totaam
Copy link
Collaborator Author

totaam commented Feb 17, 2016

2016-02-17 14:37:38: antoine changed status from assigned to closed

@totaam
Copy link
Collaborator Author

totaam commented Feb 17, 2016

2016-02-17 14:37:38: antoine set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Feb 17, 2016

2016-02-17 14:37:38: antoine edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Feb 17, 2016

2016-02-17 14:37:38: antoine commented


This will do for now.

@totaam totaam closed this as completed Feb 17, 2016
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

1 participant