Ask Your Question
2

Bitshift operations on Mat (in Java)

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

atduskgreg gravatar image

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

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
1

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

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

Stats

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

Seen: 1,925 times

Last updated: Apr 11 '13