open pdf file in asp net c# : Add text to pdf using preview control SDK platform web page wpf azure web browser 14-Quantization0-part450

Chapter 14
Review of Quantization
14.1 Tone-Transfer Curve
The second operationof the digitization process converts the e continuouslyvalued
irradiance of each sample atthe detector(i.e., the e brightness)to an integer, i.e.,
the sampled image is quantized. The e entire processof measuring and quantizing
thebrightnessesissignificantlyaffectedbydetectorcharacteristicssuchasdynamic
rangeandlinearity.Thedynamicrangeofadetectorimageistherangeofbrightness
(irradiance)overwhichachangeintheinputsignalproducesadetectablechangein
theoutput. Theinputandoutputquantitiesneednotbeidentical;the e inputmay
be measured in
W
mm2
and the outputin opticaldensity. The e effectofthedetector
onthemeasurementmaybedescribedbyatransfercharacteristicortone-transfer
curve(TTC),i.e.,aplotoftheoutputvs. inputforthedetector. Theshapeofthe
transfercharacteristicmaybeusedasafigureofmeritforthemeasurementprocess.
Adetectorislinearifthe TTCisa straightline, i.e.,if an incrementalchange e in
inputfromanylevelproducesafixedincrementalchangeintheoutput. Ofcourse,
all realdetectorshave e a limited dynamic range, i.e., they will not respond at all
tolightintensitybelowsomeminimumvalueandtheirresponsewillnotchangefor
intensitiesabovesomemaximum. Allrealisticdetectorsarethereforenonlinear,but
theremaybesomeregionsoverwhichtheyaremore-or-lesslinear,withnonlinear
regionsateitherend. Acommonsuchexampleisphotographicfilm;theTTCisthe
H-D curvewhichplotsrecordedopticaldensityoftheemulsionvs. thelogarithmof
theinputirradiance[
W
mm2
].Anotherveryimportantexampleindigitalimagingisthe
videocamera,whoseTTCmapsinputlightintensitytooutputvoltage.Thetransfer
characteristicofavideocameraisapproximatelyapowerlaw:
V
out
=c
1
B
γ
in
+V
0
whereV
0
isthethresholdvoltageforadarkinputandγ(gamma)istheexponentof
thepowerlaw. Thevalueofγ γ dependsonthespecificdetector: typicalvaluesare
γ
=
1.7foravidiconcameraandγ
=
1foranimageorthicon.
281
Add text to pdf using preview - insert text into PDF content in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
XDoc.PDF for .NET, providing C# demo code for inserting text to PDF file
adding text to pdf document; add text box to pdf file
Add text to pdf using preview - VB.NET PDF insert text library: insert text into PDF content in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Providing Demo Code for Adding and Inserting Text to PDF File Page in VB.NET Program
adding text to a pdf file; how to add text fields to pdf
282
CHAPTER14REVIEWOFQUANTIZATION
Nonlineartone-transfercurveofquantizer,showingalinearregion.
14.2 Quantization
Quantizationconvertscontinuouslyvaluedmeasuredirradianceatasampletoamem-
ber of a discrete set of gray levels or digital counts, e.g.,the sample f[x,y] e.g.,
f[0,0]=1.234567890···
W
mm2
,isconvertedtoanintegerbetween0andsomemax-
imumvalue(e.g.,255)byananalog-to-digitalconversion(A/DconverterorADC).
Thenumberoflevelsisdeterminedbynumberofbitsavailableforquantizationinthe
ADC.AquantizerwithmbitsdefinesM=2
m
levels.Themostcommonquantizers
havem=8bits(onebyte);suchsystemscanspecify256differentgraylevels(usually
numberedfrom[0,255],where0isusuallyassignedto“black”and255to“white”.
Imagesdigitizedto12oreven16bitsarebecomingmorecommon,andhave4096
and65536levels,respectively.
The resolution, or step size b, of the quantizeris the difference e in brightness
between adjacentgraylevels. Itmakeslittle e senseto quantizewitha resolutionb
whichislessthantheuncertaintyingraylevelduetonoiseinthedetectorsystem.
Thustheeffectivenumberoflevelsisoftenlessthanthemaximumpossible.
Conversionfromacontinuousrangetodiscretelevelsrequiresathresholdingop-
eration(e.g.,truncationorrounding). Somerangeofinputbrightnesseswillmapto
asingleoutputlevel,e.g.,allmeasuredirradiancesbetween0.76and0.77
W
mm2
might
maptograylevel59.Thresholdconversionisanonlinearoperation,i.e.,thethresh-
oldofasumoftwoinputsisnotnecessarilythesumofthethresholdedoutputs.The
conceptoflinearoperatorswillbediscussedextensivelylater,butweshouldsayat
thispointthatthenonlinearityduetoquantizationmakesitinappropriatetoanalyze
thecompletedigitalimagingsystem(digitizer,processor,anddisplay)bycommon
linearmethods.Thisproblemisusuallyignored,asisappropriateforlargenumbers
ofquantizedlevelsthatarecloselyspacedsothatthedigitizedimageappearscon-
tinuous. Becausethebrightnessresolutionoftheeye-brainislimited,quantizingto
How to C#: Preview Document Content Using XDoc.Word
C# DLLs for Word File Preview. Add references: RasterEdge.Imaging.Basic.dll. using RasterEdge.Imaging.Basic; using RasterEdge.XDoc.Word; Get Preview From File.
add text to pdf without acrobat; how to add text fields in a pdf
How to C#: Preview Document Content Using XDoc.PowerPoint
Add necessary XDoc.PowerPoint DLL libraries into your created C# application as references. using RasterEdge.XDoc.PowerPoint; Get Preview From File.
how to input text in a pdf; adding text to pdf in acrobat
14.2QUANTIZATION
283
only50levelsissatisfactoryformanyimages;inotherwords,6bitsofdataisoften
sufficientforimagestobeviewedbyhumans.
Thequantizationoperationisperformedbydigitalcomparatorsorsample-and-
hold circuits. The e simplestquantizer convertsananalog inputvoltage to a 1-bit
digitaloutputandcanbeconstructedfromanidealdifferentialamplifier,wherethe
outputvoltageV
out
isproportionaltothedifferenceoftwovoltagesV
in
andV
ref
:
V
out
=α(V
in
−V
ref
)
V
ref
isa reference voltage provided by a known source. If α islarge enoughtto
approximate∞,thentheoutputvoltagewillbe+∞ifV
in
>V
ref
and−∞ifV
in
<
V
ref
. We e assign the digital value e “1” toa positive outputand “0” to a negative
output. Aquantizerwithbetterresolutioncanbeconstructedbycascadingseveral
suchdigitalcomparatorswithequallyspacedreferencevoltages.Adigitaltranslator
convertsthe comparatorsignalstothebinarycode. A 2-bitADCisshowninthe
figure:
Comparatorand2-BitADC.Thecomparatorisa“thresholder;”itsoutputis“high”
if V
in
>V
ref
and“low”otherwise. TheADCconsistsof4comparatorswhose
referencevoltagesaresetatdifferentvaluesbytheresistor-laddervoltagedivider.
Thetranslatorconvertsthe4thresholdedlevelstoabinary-codedsignal.
Inmostsystems,thestepsizebetweenadjacentquantizedlevelsisfixed(“uniform
quantization”):
b=
f
max
−f
min
2
m
−1
wheref
max
andf
min
aretheextremaofthemeasuredirradiancesoftheimagesamples
andmisthenumberofbitsofthequantizer.
Ifthedarkestandbrightestsamplesofa continuous-toneimage havemeasured
irradiancesf
min
andf
max
respectively,andtheimageistobequantizedusingmbits
(2
m
graylevels),thenwemaydefineasetofuniformlyspacedlevelsf
q
thatspanthe
C# WinForms Viewer: Load, View, Convert, Annotate and Edit PDF
Supported PDF Processing Features by Using RasterEdge WinForms Viewer for C#.NET. Overview. Highlight PDF text. • Add text to PDF document in preview.
adding a text field to a pdf; how to add a text box to a pdf
C# WPF Viewer: Load, View, Convert, Annotate and Edit PDF
Features about PDF Processing Features by Using RasterEdge WPF Viewer for C#.NET. Overview. Highlight PDF text in preview. • Add text to PDF document.
add text field to pdf acrobat; how to insert pdf into email text
284
CHAPTER14REVIEWOFQUANTIZATION
dynamicrangevia:
f
q
[x,y]=Q
½
f[x,y]−f
min
b
¾
=Q
½
f[x,y]−f
min
f
max
−f
min
·2
m
−1
¾
whereQ{}representsthenonlineartruncationorroundingoperation,e.g.,Q{3.657}=
3ifQistruncationor4ifQisrounding. TheformofQdeterminesthelocationof
thedecisionlevelswherethequantizerjumpsfromoneleveltothenext. Theimage
irradiancesarereconstructedbyassigningallpixelswithaparticulargraylevelf
q
to
thesameirradiancevalueE[x,y],whichmightbedefinedby“inverting”thequan-
tizationrelation.Thereconstructionlevelisoftenplacedbetweenthedecisionlevels
byaddingafactor
b
2
:
ˆ
E[x,y]=
µ
f
q
[x,y]·
E
max
−E
min
2
m
−1
+E
min
+
b
2
Usually(of course),
ˆ
E[x,y] 6= E[x,y] due e to the quantization, i.e., there e will be
quantizationerror. Thegoalofoptimumquantizationistoadjustthequantization
schemetoreconstructthesetofimageirradianceswhichmostcloselyapproximates
theensembleoforiginalvalues.Thecriterionwhichdefinesthegoodnessoffitandthe
statisticsoftheoriginalirradianceswilldeterminetheparametersofthequantizer,
e.g.,thesetofthresholdsbetweenthelevels.
Thequantizerjustdescribedismemoryless,i.e.,thequantizationlevelforapixel
iscomputedindependentlythatforanyotherpixel. Theschematicofamemoryless
quantizerisshownbelow. Aswillbediscussed,aquantizerwithmemorymayhave
significantadvantages.
14.3 Quantization Error (“Noise”)
The grayvalueof thequantizedimage isan integervalue whichisrelated tothe
inputirradianceatthatsample. Foruniformquantization,wherethestepsbetween
adjacentlevelsarethesamesize,theconstantofproportionalityisthedifferencein
irradiancebetweenadjacentquantizedlevels. Thedifferencebetweenthetrueinput
irradiance(orbrightness)andthecorrespondingirradianceofthedigitallevelisthe
quantizationerroratthatpixel:
[n·∆x,m·∆y]≡f[n·∆x,m·∆y]−f
q
[n·∆x,m·∆y].
Notethatthequantizationerrorisbipolaringeneral,i.e.,itmaytake on positive
ornegative values. Itoften isuseful to describe the statisticalproperties of the
quantizationerror, which willbe e afunction of boththetype of quantizerandthe
inputimage. However,ifthedifference e betweenquantizationsteps(i.e.,thewidth
ofaquantizationlevel)isb,isconstant,thequantizationerrorformostimagesmay
beapproximatedasauniformdistributionwithmeanvalueh [n]i=0andvariance
h(
1
[n])
2
i=
b
2
12
. Theerrordistributionwillbedemonstratedfortwo1-D256-sample
C# PDF insert image Library: insert images into PDF in C#.net, ASP
Using this C# .NET image adding library control for PDF document, you can easily and quickly add an image, picture or logo to any position of
how to add text to pdf file; add text to pdf using preview
VB.NET PDF insert image library: insert images into PDF in vb.net
try with this sample VB.NET code to add an image As String = Program.RootPath + "\\" 1.pdf" Dim doc New PDFDocument(inputFilePath) ' Get a text manager from
add text to pdf document online; how to enter text into a pdf
14.3QUANTIZATIONERROR(“NOISE”)
285
images. Thefirstisasectionofacosinesampledat256pointsandquantizedto64
levelsseparatedbyb=1:
Illustrationofthestatisticsofquantizationnoise: (a)f[n]=63cos
£
n
256
¤
for
0≤n≤255;(b)afterquantizationbyroundingtonearestinteger;(c)quantization
errorε[n]≡f[n]−f
q
[n],showingthat −
1
2
≤ε≤+
1
2
;(d)histogramof256samples
ofquantizationerror,showingthatthestatisticsareapproximatelyuniform.
Thehistogramoftheerror
1
[n]=f
1
[n]−Q{f
1
[n]}isapproximatelyuniformover
the interval −
1
2
1
< +
1
2
. The e computed statistics of the errorare h
1
[n]i =
−5.1·10
−4
=
0andvarianceish
2
1
[n]i=0.08
=
1
12
.
The second imageiscomprisedof 256 samplesof Gaussian-distributedrandom
noiseintheinterval[0,63]thatagainisquantizedto64levels.Thehistogramofthe
error
2
[n]againisapproximatelyuniformlydistributedintheinterval[−0.5,+0.5]
withmean4.09·10
−2
=
0andvarianceσ
2
=h
2
2
[n]i
=
0.09
=
1
12
.
How to C#: Preview Document Content Using XDoc.excel
C# DLLs: Preview Excel Document without Microsoft Office Installed. Add necessary references: using RasterEdge.XDoc.Excel; Get Preview From File.
how to add text to pdf file with reader; adding text to a pdf form
C# PDF Page Insert Library: insert pages into PDF file in C#.net
XDoc.PDF, offers easy & mature APIs for developers to add & insert after the last page or after any desired page of current PDF document) using C# .NET
how to add text to pdf document; how to add text to a pdf document
286
CHAPTER14REVIEWOFQUANTIZATION
Illustrationofthestatisticsofquantizationnoise: (a)f[n]isGaussiannoisewith
measuredµ=27.7,σ=10.9for0≤n≤255;(b)afterquantizationbyroundingto
nearestinteger;(c)quantizationerror ε[n]≡f[n]−f
q
[n],showingthat
1
2
≤ε≤+
1
2
;(d)histogramof256samplesofquantizationerror,showingthatthe
statisticsareSTILLapproximatelyuniform.
Thetotalquantizationerroristhesumofthequantizationerroroverallpixelsin
theimage:
=
X
i
X
j
[n·∆x,m·∆y].
Animage withlarge bipolarerrorvaluesthusmay have e a smalltotalerror. The
mean-squarederror(averageofthesquarederror)isabetterdescriptorofthefidelity
ofthequantization:
2
=
1
N
X
i
X
j
¡
2
[n·∆x,m·∆y]
¢
,
C# PDF replace text Library: replace text in PDF content in C#.net
C#.NET DLLs: Replace Text in PDF in C#.NET. Add necessary references: RasterEdge. Imaging.Basic.dll. RasterEdge.XDoc.Raster.Core.dll. RasterEdge.XDoc.PDF.dll.
add text field to pdf; add text to pdf file reader
14.3QUANTIZATIONERROR(“NOISE”)
287
whereN isthenumberpixelsintheimage. Ifthe e irradianceismeasuredin
W
mm2
,
2
will have e units of
¡
W
mm2
¢
2
. The e root-mean-squared (RMS)error has the e same
dimensionsastheerror:
RMSError≡
2
=
s
1
N
X
i
X
j
2
[n·∆x,m·∆y].
ItshouldbeobviousthattheRMSerrorforoneimageisafunctionofthequantizer
used,andthattheRMSerrorfromonequantizerwilldifferfordifferentimages. It
shouldalsobeobviousthatitisdesirabletominimizetheRMSerrorinanimage.
Thebrute-forcemethodforminimizingquantizationerroristoaddmorebitstothe
ADC,whichincreasesthecostofthequantizerandthememoryrequiredtostorethe
image.
Wenowextendthediscussiontoconsidertheconceptsofsignalbandwidthand
digital data rate, which in turn require an understanding of signal-to-noise ratio
(SNR)anditsrelationshiptoquantization.Recallthatthevarianceσ
2
ofasignalis
ameasureofthespreadofitsamplitudeaboutthemeanvalue.
σ
2
f
=
Z
+∞
−∞
[f[x]−hf[x]i]
2
dx
=⇒
1
X
0
Z
+
X
0
2
X
0
2
[f[x]−hf[x]i]
2
dx
Thesignal-to-noisepowerratioofananalogsignalismostrigorouslydefinedasthe
dimensionlessratioofthevariancesofthesignalandnoise:
SNR≡
σ
2
f
σ2
n
ThusalargeSNRmeansthatthereisalargervariationofthesignalamplitudethan
ofthenoise amplitude. ThisdefinitionofSNR astheratio ofvariancesmayvary
overalargerange—easilyseveralordersofmagnitude—sothatthenumericalvalues
maybecomeunwieldy. TherangeofSNRmaybecompressedbyexpressingitona
logarithmicscalewithdimensionlessunitsofbels:
SNR=log
10
σ
2
f
σ
2
n
¸
=2log
10
σ
f
σ
n
¸
[bels]
288
CHAPTER14REVIEWOFQUANTIZATION
ThisdefinitionofSNRisevenmorecommonlyexpressedinunitsoftenthsofabel
sothattheintegervalueismoreprecise.Theresultingmetricisintermsofdecibels:
SNR=10 log
10
σ
2
f
σ
2
n
¸
=10 log
10
"
µ
σ
f
σ
n
2
#
=20 log
10
σ
f
σ
n
¸
[decibels]
Underthisdefinition,SNR=10dBifthesignalvarianceistentimeslargerthanthe
noisevarianceand20dB ifthestandarddeviationistentimeslargerthanthatof
thenoise.
The variancesobviouslydependonthestatistics(thehistograms)of the signal
andnoise. Thevariancesdependonlyontherangeofgrayvaluesandnotontheir
“arrangement”(i.e.,numerical“order”or“pictorial”appearanceintheimage. Since
thenoiseoftenisdeterminedbythemeasurementequipment,asinglemeasurement
ofthenoisevarianceoftenisusedformanysignalamplitudes. However,thesignal
variancemustbemeasuredeachtime. Considerthevariancesofsomecommon1-D
signals.
14.3.1 Example: Varianceof aSinusoid
ThevarianceofasinusoidwithamplitudeA
0
iseasilycomputedbydirectintegration:
f[x]=A
0
cos
x
X
0
¸
σ
2
f
=
1
X
0
Z
+
X
0
2
X
0
2
(f[x]−hf[x]i)
2
dx=
1
X
0
Z
+
X
0
2
X
0
2
µ
A
0
cos
x
X
0
¸¶
2
dx
=
A
2
0
X
0
Z
+
X
0
2
X
0
2
1
2
µ
1+cos
x
X
0
¸¶
dx=
A
2
0
2X
0
(X
0
+0)
=
σ
2
f
=
A2
0
2
forsinusoidwithamplitudeA
0
Notethatthevariancedoesnotdependontheperiod(i.e.,onthespatialfrequency)
orontheinitialphase—itisafunctionofthehistogramofthevaluesinaperiod
and notofthe “ordered”values. Italsodoesnotdependonany“bias”(additive
constant)inthesignal.Thestandarddeviationofthesinusoidisjustthesquareroot
ofthevariance:
σ
f
=
A
0
2
forsinusoidwithamplitudeA
0
14.3QUANTIZATIONERROR(“NOISE”)
289
14.3.2 Example:Varianceofa SquareWave:
Thevarianceofasquarewavewiththesameamplitudealsoiseasilyevaluatedby
integrationofthethresholdedsinusoid:
f[x]=A
0
SGN
cos
x
X
0
¸¸
σ
2
f
=
1
X
0
Z
+
X
0
2
X
0
2
[f[x]−hf[x]i]
2
dx=
1
X
0
Ã
Z
+
X
0
4
X
0
4
[−A
0
]
2
dx+
Z
+
3X
0
4
+
X
0
4
[+A
0
]
2
dx
!
=
1
X
0
µ
A
2
0
X
0
2
+A
2
0
X
0
2
=A
2
0
σ
2
f
=A
2
0
forsquarewavewithamplitudeA
0
σ
f
=A
0
forsquarewavewithamplitudeA
0
Notethatthevarianceofthesquarewaveislargerthanthatofthesinewavewith
thesameamplitude:
σ
f
forsquarewavewithamplitudeA
0
f
forsinusoidwithamplitudeA
0
whichmakesintuitivesense,becausetheamplitudeofthesquarewaveismoreoften
“distant”fromitsmeanthanthesinusoidis.
14.3.3 Varianceof “Noise”froma Gaussian Distribution
AsetofamplitudesselectedatrandomfromaGaussainprobabilitydistributionis
called(convenientlyenough)“Gaussiannoise.”Themostcommondefinitionofthe
statisticaldistributionis:
p[n]=
1
2πσ
2
exp
"
(x−µ)
2
2
#
Thisprobabilitydistributionfunctionhasunitarea,asrequired. TheGaussiandis-
tributionisspecifiedbythetwoparametersµ,themeanvalue of the distribution,
andσ
2
,itsvariance. Thestandarddeviationσ isameasureofthe “width” ofthe
distributionandsoinfluencestherangeofoutputamplitudes.
290
CHAPTER14REVIEWOFQUANTIZATION
Histogramof8192samplestakenfromtheGaussiandistribution
p[n]=
1
exp
h
¡
n−4
2
¢
2
i
14.3.4 Approximations toSNR
Sincethevariancedependsonthestatisticsofthesignal,itiscommon(thoughless
rigorous)toapproximatethevariancebythesquareofthedynamicrange,whichis
the“peak-to-peaksignalamplitude”f
max
−f
min
≡∆f.Inmostcases,(∆f)
2
islarger
(andoftenmuchlarger)thanσ
2
f
.Intheexamplesofthesinusoidandthesquarewave
alreadyconsidered,theapproximationsare:
SinusoidwithamplitudeA
0
=⇒σ
2
f
=
A
2
0
2
, (∆f)
2
=(2A
0
)
2
=4A
2
0
=8σ
2
f
SquarewavewithamplitudeA
0
=⇒σ
2
f
=A
2
0
, (∆f)
2
=(2A
0
)
2
=4A
2
0
=4σ
2
f
FortheexampleofGaussiannoisewithvarianceσ
2
=1andmeanµ,thedynamic
range∆f ofthenoisetechnicallyisinfinite,butitsextremaoftenbeapproximated
basedontheobservationthatfewamplitudesexistoutsideoffourstandarddeviations,
sothatf
max
=µ+4σ,f
min
=µ−4σ,leadingto∆f
=8σ.Theestimateofthevariance
ofthesignalisthen(∆f)
2
=
64σ
2
f
,whichis(obviously)64timeslargerthantheactual
variance. Becausethisestimateofthesignalvarianceistoolarge,theestimatesof
theSNRthusobtainedwillbetoooptimistic.
Often,thesignalandnoiseofimagesaremeasuredbyphotoelectricdetectorsas
differencesinelectricalpotentialinvolts;thesignaldynamicrangeisV
f
=V
max
−V
min
,
Documents you may be interested
Documents you may be interested