Ask Your Question
0

i am new at iopencv

asked Feb 24 '14

shiv.butekar gravatar image

i want to know how a color image is stored in matrix what are the vales of each cell how is bgr combination is being managed how much bytes it take to store the each pixel thaks in advance

Preview: (hide)

Comments

3

oh, read a bit (and welcome, btw ..)

berak gravatar imageberak (Feb 24 '14)edit

1 answer

Sort by » oldest newest most voted
2

answered Feb 24 '14

  1. Google it.
  2. If don't find anything - ask here.

Now on the question: In opencv are couple of formats for data in a matrix. For example CV_8UC3 - 3 channel image with 1 unsigned byte for each (B0,G0,R0,B1,G1,R1,B2....). That is the basic color image format (that you will get from imread function).

If your image is gray scale it will be CV_8UC1. You can convert BGR image to grayscale with cvtColor(src, dist, CV_BGR2GRAY).

For double is CV_64F, for float CV_32F and etc.

Preview: (hide)

Question Tools

Stats

Asked: Feb 24 '14

Seen: 271 times

Last updated: Feb 24 '14