xpra icon
Bug tracker and wiki

Opened 5 years ago

Closed 4 years ago

#1108 closed enhancement (fixed)

opencv csc module

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: trivial Milestone: 0.17
Component: encodings Version: trunk
Keywords: Cc:

Description (last modified by Antoine Martin)

Related to #1030: 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.

Change History (2)

comment:1 Changed 5 years ago by Antoine Martin

Status: newassigned

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 wiki/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
Last edited 5 years ago by Antoine Martin (previous) (diff)

comment:2 Changed 4 years ago by Antoine Martin

Description: modified (diff)
Resolution: fixed
Status: assignedclosed

This will do for now.

Note: See TracTickets for help on using tickets.