Ask Your Question

Bitshift operations on Mat (in Java)

asked 2013-04-04 12:00:38 -0500

atduskgreg gravatar image

updated 2013-04-11 01:56:12 -0500

Andrey Pavlenko gravatar image

The Java bindings have Core.bitwise_and(), Core.bitwise_or(), and Core.bitwise_xor(), but what about bit-shifting? Is it possible to bitshift a Mat without iterating through its entries?

I've seen C++ code before that looks like:

Mat mat8uc4 = merge((mat32sc1 >> 16) & 0xFF, (mat32sc1 >> 8) & 0xFF, (mat32sc1 >> 0) & 0xFF,(mat32sc1 >> 24) & 0xFF);

and I want to do the same thing in Java.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-04-11 03:09:44 -0500

Andrey Pavlenko gravatar image

AFAIK, there are no bit-shift operators in C++ for cv::Mat as of 2.4.5.

You can submit a feature request into OpenCV issues tracker or even better contribute this functionality via OpenCV GitHub repo.

edit flag offensive delete link more

Question Tools


Asked: 2013-04-04 12:00:38 -0500

Seen: 1,567 times

Last updated: Apr 11 '13