Ask Your Question
0

doubts in opencv tutorial4 in eclipse

asked Mar 28 '13

ashokreddyvit gravatar image

updated Mar 28 '13

berak gravatar image
 public void onCameraViewStarted(int width, int height) {
        mRgba = new Mat(height, width, CvType.CV_8UC4);
        mIntermediateMat = new Mat(height, width, CvType.CV_8UC4);
        mGrayMat = new Mat(height, width, CvType.CV_8UC1);

can someone explain me what are these CvType.CV_8UC4 and CV_8UC1??? this is from the tutorials provided by opencv for android

Preview: (hide)

1 answer

Sort by » oldest newest most voted
2

answered Mar 28 '13

Basically it describes the format that you are creating.

A matrix of type CV_8UC4 contains

  • 8 bit unsigned integers
  • with 4 channels R G B and intensity

For the C1, this means you want a grayscale image with just a single color channel containing intensities between 0 and 255.

Preview: (hide)

Comments

1

Just in case, I haven't read the Java documentation yet. But just beware about BGR channels ordering if you are trying to use it.

Alexandre Bizeau gravatar imageAlexandre Bizeau (Mar 28 '13)edit
1

Channel order depends on platform and algorithms. All OpenCV algorithms and I/O on desktops are designed for BGR order. But on Android RBGA is used for frame capturing, drawing, conversion to bitmap and some other operations. Pay attention on it.

Question Tools

1 follower

Stats

Asked: Mar 28 '13

Seen: 255 times

Last updated: Mar 28 '13