Digital image processing must not know the point (2)

Source: Internet
Author: User
Tags color representation ming scale image

"Pick up front 12345"

VI, the meaning of some data inside Iplimage:

An image


Of course, this shows one more box.

Data for the image itself:


Basic data inside the Iplimage

Src->depth Image Depth 8

number of channels for src->nchannels images 3

Src->width image width pixel 154

height of src->height image pixels

Src->widthstep The number of bytes of the image in the row = Width*nchannels = 154*3

Bit depth If it corresponds to a data inside a cvmat , It should be:cv_8uc3

See that the width is 154 pixels. High is ten pixels

So the words that create an image like this should be:

Cvcreatemat (200,154,CV_8UC3);

If it is iplimage , it should be created

Cvcreateimage (Cvsize (154,200), 8, 3); Iplimage *src = cvloadimage ("pic.jpg", 1);//


Seven, the color of a pixel why is usually 8 bits deep, 3 channels?

Open PS, and then open the color picker. You will find that red can be described as: the currently selected color, there is an intuitive color representation method, and then by theHSB,Lab,RGB,CMYKfour different color spaces, includingRGBtwo forms are used to describe one: the obvious,RGBThere is also a#6b3522.

The color picker uses a method similar to the HSV description to see the contrast chart. From:

Http://www.360doc.com/content/13/1105/14/10724725_326803150.shtml


Why the 8 -bit?

For RGB This color mode, red is RGB(255,0,0), Red is RGB( 0,0,0) so between the red and the red, we divide it into two parts. 0 for Red No,255 for Red add to the foot.

This is probably a condition:RGB inside the middle red.


This method is divided from red to black . The larger the value, the more red.

Of course you can also define a kind of like your name is Li Ming, there is a color space Li Ming, Li Ming said my world is red and black. On this one channel. Then he said, too much, too many , the number of the definition of 3 kinds of colors, which is black, one is the middle red, there is a red. So this is his color space.

He described the color space 0,1,2 in a total of 3 numbers.

But the universe, this is not enough, so we have more than a few children, we have RGB Three color space divided into each color from black to red, from black to green, from black to blue are divided into three parts. The blue green is not moving, red from 0 to 255 is The case, the green is also in the three, Blue is also the same . So for this way of dividing into 8 bits, let's sort the colors and get 256*256*256 colors .

But the problem is again, it seems that the points are really good. But why not 7 -bit or 4 -bit or ten -bit to divide a color gradient. The potential for more color. That makes sense. Then analyze it from a different angle.

"This should be a long-running process. The color does begin to be divided into a gradient or a few . As for why the last became the third. It could be because if exactly one byte is 8 bits. the 8 -bit can represent the state of the four. And the gamut is plentiful enough for us to see, and the two hit it off. "

Eight, so why is a byte 8 bits?

Baidu inside netizens for this explanation is very pit, MO letter.

https://www.zhihu.com/question/20870588

Detailed look here, just remember a word historical reasons can be, because of the history of the setting, as well as the degree of popularity, coupled with the use of industrialization, a lot of things if out of business can not run, if coupled with the business of flying the same run. "For example, everyone is now noisy in the so-called cloud technology, Cloud technology sold on two points, cloud storage, cloud computing, is nothing more than some places, including storage, large enough, take, fast enough, so you can sell storage. The calculation is that some processors are powerful enough to handle quickly so that they can be sold. Because we don't know where the point of storage or computation is, we add a concept called cloud. In fact, this thing has a predecessor, the predecessor of cloud computing in the country is a predecessor called Grid Computing, but also distributed to various places to process data, the results are delivered. But at that time is the use of scientific research, and did not do business promotion, its name is not as good as cloud computing, poor promotion, without force support, so yellow. "Put 8 as a 2 -bit, plus its own conversion easy." So it's logical to become octal to represent a byte.

And the concept of byte, from the familiar A-65 0-48 a-97, the ASCII Code, an American word plus a variety of characters is 127 or - a ah? In short, 2 of the 7 Square is expressed, so a byte has been 7 , is 7 a bit can represent exactly one word. So maybe add some translation reasons, eventually become the name of the byte, but in fact, it is 1 words can be expressed in 7 bits.

Plus historical reasons a word is expressed in 8 bits.

In addition to translation reasons, a byte is represented by 8 bits.

"About the word why translation byte byte Why is the word, purely fiction, to help understand, embarrassing embarrassment"

What we want to do is to be familiar with these two RGB Representations,RGB(255,0,0) and #ff0000. and will be converted. and can see a color, after constant debugging, basically make a color.

The combination of this number is the superposition of energy, when a place at the same time to accept the red and yellow blue color of the time is white, with the decrease in energy, and finally become black. So if the color is deep, the value will be small, if the color is bright, go to Dali. What color will be added to the inside.

Give a few examples,

Practice it yourself, such as writing red, green, blue, yellow, pink, gray, and then quickly writing out the color of the main hue of your mouse pad. If it's black, write a purple one. Anyway, a little practice.

Since 8 can say, then from red to black into 16384 part, that is , said, the line is not OK, of course. What's the use of dividing the number of pieces?

Reference

Http://wenda.hexun.com/question/34986.html

Part of the digital-to-analog converter in

analog - to - digital converters (ADCs):both

Each digital camera has some kind of mold - Converts the analog signal captured by the sensor into a digital signal that forms the final image. Most DSLR cameras use 12 bit or 14 bit ADC Span style= "font-family: Song Body" >.

here, ADC 12 ADC 4,096 14 bit ADC Each pixel can capture 16,384 level gray scale.

So it seems, 14 bit ADC 12 bit 4 times! However, the extra 2 14 " Span style= "font-family: Arial" > bit ADC You can get a finer level of transition )

So, the digital ADC allows you to get better picture quality, but this improvement is only noticeable in shadow and smooth gradient transitions (such as sunset photos).

It's not going to be much, just to say more details, you find the pages of your book are white, but are the whites the same? It's not all the same, so what's the difference? If you're in a black and white picture, you can only tell you are white. However, if you are in grayscale, you will find some chromatic aberration, if the number of copies of the more, then the details of the more detailed description, sometimes you do not know what the difference between #FFCCCC and #FFCCCB . "In fact, I think you just don't know who to tell you who it is, and you may think that the next color will be brighter in different light situations." "So usually we use a byte of 8 bits to describe the value of a channel." Using 256*256*256 to Express all the colors we can see is actually pretty much enough.

Tomorrow afternoon seems not, if tomorrow afternoon, want to talk about the color map of gray-scale image binary. Because I found such a problem when I was searching. But the answer is not good.






Digital image processing must not know the point (2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.