January 25th, 2008, 01:04 PM | #166 |
Major Player
Join Date: Mar 2007
Location: Amsterdam The Netherlands
Posts: 200
|
Hello Jason,
Well the color LUTs wasn't working yet, I thought I would be able to implement them quite easilly, just when I got to the point that is also should be able to extrapolate when it became really complicated ugly code. I thought I would show you the YUV and gamma correction formulas. Code:
R = gamma_correction(input_row[(x * 3) + 0]); G = gamma_correction(input_row[(x * 3) + 1]); B = gamma_correction(input_row[(x * 3) + 2]); rec709_RGB_to_YPbPr(R, G, B, &Y, &Pb, &Pr); output_row[(x << 2) + 0] = 1.0f; output_row[(x << 2) + 1] = (Y * 0.85882352941176465f) + 0.062745098039215685f; output_row[(x << 2) + 2] = (Pb * 0.8784313725490196f) + 0.5f; output_row[(x << 2) + 3] = (Pr * 0.8784313725490196f) + 0.5f; Code:
static inline float rec709_gamma(float L) { if (L < 0.018f) { return 4.5f * L; } else { return 1.099f * powf(L, 0.45f) - 0.099f; } } Code:
static inline void rec709_RGB_to_YPbPr(float R, float G, float B, float *Y, float *Pb, float *Pr) { const float Kr = 0.2126f; const float Kg = 0.7152f; const float Kb = 0.0722f; *Y = Kr * R + Kg * G + Kb * B; *Pb = (B - *Y) / (2.0f - 2.0f * Kb); *Pr = (R - *Y) / (2.0f - 2.0f * Kr); } |
January 25th, 2008, 01:13 PM | #167 | |
Major Player
Join Date: Nov 2007
Location: Athens Greece
Posts: 336
|
Quote:
Welcome to natural CCD saturation:) Being used to CMOS, the difference might be striking. |
|
January 25th, 2008, 01:20 PM | #168 |
Major Player
Join Date: Mar 2007
Location: Amsterdam The Netherlands
Posts: 200
|
Hi John,
I find it strange that there is a difference between CCD and CMOS in regards to color saturation. If both CCD and CMOS are the same size and have the same color filter on them them the same amount of light will fall in each photon well. Maybe you can't have the same filters for CCD and CMOS? Cheers, Take |
January 25th, 2008, 01:36 PM | #169 | |
Major Player
Join Date: Nov 2007
Location: Athens Greece
Posts: 336
|
Quote:
I believe the cmos low saturation is inherent to the technology and the complexity of the sensor pixels. I have seen lots of unprocessed images from cmos sensors and this appears to be universally true. |
|
January 25th, 2008, 01:43 PM | #170 |
Trustee
Join Date: Mar 2003
Location: Virginia Beach, VA
Posts: 1,095
|
Actually there are a number of CMOS manufacturers who get excellent color from their sensors . . . for instance, Micron can get the same level of color-saturation and accuracy from their camera-native RGB image, and so can Canon as what I'm seeing from the Kodak CCD's.
So I don't think it's fair to state that CCD=good color while CMOS=bad color. A lot of it has to-do with the manufacturing process, the pigments used, the color-fastness of the pigments (a trade-off of less saturation for more long-term robustness), and the compatibility of the color pigments with the manufacturing process. Also the pixel size is 5um on the Altasens in order to get 1920x1080 in a 2/3" compatible format. And from seeing the work that Micron has done, small pixels (<5um) does not mean poor color saturation out-of-camera. Thanks, Jason |
January 25th, 2008, 01:47 PM | #171 |
Major Player
Join Date: Nov 2007
Location: Athens Greece
Posts: 336
|
Yes, lots of tiny pixel CCD still get excellent saturation, tiny sensor multimegapixel still cameras etc.
But any time I tried to get low light saturation in a CMOS I had to process a lot. With CCD I think I should even reduce saturation in good light. The saturation is usually natural at mid levels. I do believe a Canon 350d is poor in color performance compared to a D70s. But that's just personal preference. |
January 25th, 2008, 02:02 PM | #172 | |
Trustee
Join Date: Mar 2003
Location: Virginia Beach, VA
Posts: 1,095
|
Quote:
Another thing to realize is the CCD's are clock-constrained . . . for instance, if one wants to have a single camera that can be as "film-like" as far as is possible in the range of frame-rates that one can cover, you can't do that with CCD's at the moment. Also CCD's can get very hot compared to a simliar CMOS, and the hotter they get, the noisier. They also use up a lot of power, which gets dissipated at some point along the line as heat. Various off-chip generated bias voltages, etc. also can cause issues, especially as the sensor head gets hotter and more current must be drawn. So CCD's have their shortcoming as well. |
|
January 25th, 2008, 02:04 PM | #173 |
Major Player
Join Date: Nov 2007
Location: Athens Greece
Posts: 336
|
A part from a Micron 2048xsomething CMOS frame I found on the web:
http://img107.imageshack.us/img107/7257/79093717ls7.jpg It's just not realistic. This could be a bright red car and we will never find out. On the Silicon Imaging site there is a page with LUT tables. There is a "no look" file and a sample: http://www.siliconimaging.com/Digita...ds/no_look.zip I don't believe the camera is desaturating on purpose, so this must be the out of camera saturation. What kind of processing is applied with a look file? Is there saturation processing? |
January 25th, 2008, 02:11 PM | #174 |
Major Player
Join Date: Nov 2007
Location: Athens Greece
Posts: 336
|
Yes, CCD is harder to design, more expensive and problematic to get right with all the extra components and costs a lot more in development and materials. This is also true for most Italian supercars, still, many people will prefer one of those over a BMW with a equivalent engine:)
EDIT: I think the car analogy suits the situation. We all know that a top of the line BMW might be a better tool for most transport applications compared to something with italian engineering. But the italian car still has its market because many people like the sound of the engine, the engineering mentality, the way these things work and look. And even if the specifications might be similar, the italian car can certainly be a lot more engoyable and handle better in extreme scenarios, even though the engineering is much simpler, the technology is not as advanced and it doesn't come with 20 3-letter acronyms of its various systems/technologies. This type of car is a financial nightmare for any automotive company, but engineers and management know there are reasons to maintain the production. |
January 25th, 2008, 02:46 PM | #175 | |
Trustee
Join Date: Mar 2003
Location: Virginia Beach, VA
Posts: 1,095
|
Quote:
In the end I feel that both technologies have their place, with advantages and disadvantages on either side . . . it's not just "marketing" false-hoods that have created the popularity around CMOS as you have described in your other posts. There are advantages, and ways to mitigate the disadvantages. Choice is a good thing. |
|
January 25th, 2008, 02:51 PM | #176 |
Major Player
Join Date: Nov 2007
Location: Athens Greece
Posts: 336
|
Increasing saturation with post look files does come at a cost though. It's better to get more from the camera directly so you avoid boosting noise etc. I made a comparison of the out of camera, neutral (looks undersaturated to me) and film look.
http://img178.imageshack.us/img178/1217/lookcompdz4.jpg |
January 25th, 2008, 03:09 PM | #177 |
Trustee
Join Date: Mar 2003
Location: Virginia Beach, VA
Posts: 1,095
|
Yes, it does, but as noted, it's a "mitigated" loss, meaning that for a little more noise you get the "good" saturation we've been talking about, along with the benefits of flexible frame-rates, low-power, high temp tolerance, all data pipeline (on-board A/D converters), optical format compatibility with 2/3" and S16mm, up to 2K resolution, etc., etc.
Technology is always moving, and tomorrow's CMOS will make today's CCD's look bad and vice versa . . . both technologies will have their respective places for sometime as far as I can see. There is one thing though that I am seeing, and that is a lot more R&D and intellectual property is being applied toward improved CMOS designs than what I'm seeing with CCD . . . I think a lot of this has to-do with the ability for "fabless" firms to design CMOS sensors compared to the difficulties required to create CCD's. As such, I think we will probably see CMOS in the long-run out-pacing CCD design, with the "end-results" being a bit of a "pseudo-CMOS/CCD sensor", that is CMOS designs being created on very high-end mixed-signal processes that are typical of CCD designs. At that point you'll get the advantages of both, with less of the disadvantages of either. |
January 25th, 2008, 03:35 PM | #178 |
Major Player
Join Date: Mar 2007
Location: Amsterdam The Netherlands
Posts: 200
|
As you may have gathered I am not trying to make my camera have a certain look and I am taking a more scientific viewpoint. This is why I have taken so long to get the camera output perfectly linear (within 6%) and also get the colors as exact as possible as well.
This would allow the most consistent image in post and give you the most control over the colors. I think one of the reasons that colors are pretty good already is because of linearity and getting black level correct. I've seen the same thing when calibrating a CRT projector and doing the greyscale tracking using a photosensor and a voltage meter instead of trying to do the same thing by eye. |
January 25th, 2008, 03:43 PM | #179 |
Trustee
Join Date: Mar 2003
Location: Virginia Beach, VA
Posts: 1,095
|
Nope, you're right Take, and I'm sorry for hijacking your thread . . . I didn't want to get into a CCD vs. CMOS discussion, but just wanted to point out you've definitely done some very fine work here, and the images from your software look really nice.
|
January 25th, 2008, 03:45 PM | #180 |
Major Player
Join Date: Mar 2007
Location: Amsterdam The Netherlands
Posts: 200
|
I don't mind the thread hijacking.
|
| ||||||
|
|