ICC world cup live score

click here for LIVE

Wednesday, October 6, 2010

How to Read Image Histograms

How to Read Image Histograms

  Reading histograms is an important skill to acquire in the world of digital photography. Most images from digital cameras will require some amount of post processing, particularly if you shoot raw format. And most of the processing can be done by viewing the aesthetics of the image as you go, but having the ability to read and manipulate a histogram will increase your productivity and output quality.

So what exactly is a histogram? And how the heck do you "read" one? Take this, for example:

At a glance, it doesn't tell you much. But there are certain things that you can take from the histogram. No, it doesn't tell you that it belongs to a photo of a deserted trailer half buried in the middle of the desert. It doesn't tell you if the image is in focus or if your composition is good. It only tells you the tonal values of the pixels contained in the image — blacks on the left, whites on the right.

For this article, I'll be looking at a black and white image and histogram in order to simplify things. Color histograms work on the same concepts, but with 3 channels rather than one.

MID CONTRAST AND BRIGHTNESS

This is pretty much a straight b/w conversion with no contrast or brightness adjustments. It doesn't look too bad, but it isn't terribly dynamic either. And if you look at the histogram, you'll see that the pixels fall into a centered group with a little breathing room on the shadows and highlights. We'll use this one as our baseline to compare against. The other histograms will show this in a transparent green.

LOW CONTRAST

You can visually recognize the lower contrast in this image, and that correlates to a change in the histogram distribution. The pixels near the black and white points have moved in toward a neutral gray, which gives the appearance of lower contrast. The whole thing has basically been squeezed to the center.

HIGH CONTRAST

Again, you can visually recognize the higher contrast in this image, and the histogram changed too. The pixels near center have basically migrated outward toward the blacks and whites, thus giving us more contrast. This time we're squashing pixels from the middle outward.

LOW BRIGHTNESS

Lower brightness is just a shift of tones toward the black region. You can see that the entire histogram has been pushed to the left. Also notice that the tonal range has been decreased, as shown by a narrower histogram.

HIGH BRIGHTNESS

Higher brightness is a shift in tones toward the white region. Here you can see that the entire histogram has been pushed to the right. Also notice that the tonal range has been increased, as shown by a wider histogram.

THE FINAL IMAGE

You can see that I went with a high contrast, high brightness image for my final path. The histogram shows this with the wide tonal range and a heavy concentration of pixels in the highlights.

CAN YOU SEE IT NOW?

This chart shows a combination of contrast and brightness adjustments on the example photo. As you move from left to right (low brightness to high brightness), you can see the histograms shift to the right. As you move from bottom to top (low contrast to high contrast), you can see the histograms widen.

Click the image for a larger version

The reason I've posted this article is because I want to get into the topic of manipulating the histogram during post processing — using it to guide you in what adjustments to apply. So the next article will look at how some of the basic adjustments affect the histogram and the image. We've already covered contrast and brightness adjustments here, but there are a few others we'll need to utilize.


ADC-DAC Interfacing

ADC-DAC Interfacing


Analog signals are very common inputs to embedded systems .Most transducers and sensors such as temperature ,pressure ,velocity ,humidity are analog. Therefore we need to convert these analog signals in to digital so that 8051 can read it.

 

 ANALOG DIGITAL TO CONVERTER - ADC

Commonly used ADC device – ADC804
 

ABOUT IC

  PinOut
 
• CS – Chip Select , active low
 • RD – Read Digital data from ADC, H-L edge triggered
 • WR -- Start conversion, L-H pulse edge triggered
 • INTR -- end of conversion, Goes low to indicate conversion done
 • Data bits -- D0-D7

 • CLK IN & CLK R
–  CLK IN is an input pin connected to an external clock source when an external clock is used for timing. However, ADC804 has an internal clock  

   generator.
   To use the internal clock generator of the ADC804, the CLK IN and CLK R pins are connected to a capacitor and a resistor. In that case, the  

   clock frequency is determined by the equation.
 

   f = 1/1.1RC
   R=10K and C=150pF f=606Hz
   the conversion time is 110us. 

 

 Input Voltage range

Vref/2

(Volts)

Vin

(Volts)

Step size (mV)

Open (2.5)

0 to 5

5/256 = 19.53

2.56

0 to 5.12

5.12/256 =20

1.28

0 to 2.56

2.56/256 = 10

0.5

0 to 1

1/256=3.90

• Default 0-5V. Can be changed by setting different value for Vref/2 pin.
   Vin=Vin(+) – Vin (-)

• Range = 0 to 2x Vref/2.
    for Vin = 2x Vref/2. we get 256 as a digital output on D0-D7. (Refer Table)

•Step Size a Smallest change
– (2 x Vref/2)/ 256 for ADC804

for eg for  step size 10mv ,digital output on D0-D7 changes by one count for every 10mv change of  the input analog voltage.

 Data Out
 Dout = Vin / Step Size

for input vtg. of 2.56 volts (Vref=1.28 volts)  and stepsize of 10mv Dout =2560/10 =256  or FF that is full scale output.

Conversion Time
 
Greater than 110us for ADC804 

Resolution
 
8 bits for ADC804

 

INTERFACING ADC804 TO 8051


Signals to be interfaced (on the ADC804)
– D0-D7, RD, WR, INTR, CS
 Can do both Memory mapping and IO mapping
 

Memory Mapping (timing is critical)
– Connect D0-D7 of ADC804 to the data bus of the 8051 system
– Connect RD, WR of the ADC804 to the 8051 system (ensure polarity)
– Connect CS of ADC804 to an appropriate address decoder output
– Connect INTR of ADC804 to an external interrupt Pin on the 8051 (INT0 or INT1) 

IO Mapping (easiest - I prefer )
– Connect D0-D7, RD, WR, CS, INTR to some port bits on the 8051 (12 in all).

 

 

Algorithm
• Make CS=0 and send a low-to-high to pin WR to start the conversion.
• Keep monitoring INTR
– If INTR =0, the conversion is finished and we can go to the next step.
– If INTR=1, keep polling until it goes low.
• After INTR=0, we make CS=0 and send a high-to-low pulse to RD to get the data out of the ADC804 chip.

 

ASSEMBLY LANGUEGE       (A51)

 

 

 

 

 

 

 

 

ADC_IO:

mov P1, #0xff ; To configure as input

 

AGAIN

clr p3.7 ;Chip select

setb P3.6 ;RD=1

clr P3.5 ;WR=0

setb P3.5 ;WR=1- low to high transition

 

WAIT:

 jb P3.4, WAIT ;wait for INTR

clr p3.7 ;generate cs to ADC

clr P3.6 ;RD=0 -High to low transition

mov A, P1 ;read digital o/p

sjmp AGAIN

 

 

 

 

INTERFACING ADC804 TO 8051

 

ADC808/809 Chip with 8 analog channel. This means this kind of chip allows to monitor 8 different transducers.
• ADC804 has only ONE analog input: Vin(+).

• ALE: Latch in the address 
• Start : Start of conversion (same as WR in 804)

• OE: output enable (same as RD in 804)

• EOC: End of Conversion (same as INTR in 804)


 

Channel

C B A

IN0

000

IN1

001

IN2

010

IN3

011

IN4

100

IN5

101

IN6

110

IN7

111



 

 

 

 

 

 

 

 

 

 

 

 

 

Algorithm

Notice that the ADC808/809 that there is no self-clocking and the clock must be provided from an external source to the CLK pin. (you can use programmable clock oscillator to enable or disable clock by programmable bit. )
 

• Select an analog channel by provide bits to A, B, C.
• Enable clock

• Activate ALE with a low-to-high pulse.
• Activate SC with a high-to-low pulse (start conversion) The conversion is begun on the falling edge of the start conversion pulse. you can use circuit like

• Monitor EOC Pin .After conversion this pin goes high.
• Activate OE with a high-to-low pulse to read data out of the ADC chip.

 

Tuesday, October 5, 2010

reference guide for 8051 and its applications

reference guide for 8051 and its applications reference guide for 8051 and its applications reference guide for 8051 and its applications reference guide for 8051 and its applications reference guide for 8051 and its applications reference guide for 8051 and its applications reference guide for 8051 and its applications 





Complete.pdf
View  Download

lab programs cycle 2

  • cycle 2 programs.docx - on Oct 5, 2010 9:01 PM by santhoshreddy pendru
    29k Download
  • executed programs.zip - on Oct 5, 2010 9:02 PM by santhoshreddy pendru
    252k Download
  • C codes.zip - on Oct 5, 2010 9:02 PM by santhoshreddy pendru
    10k Download