The Student Room Group

Simple Inversing of a Function

Yeah I know this is trivial, but it's always the trivial stuff I get wrong. I want to know if I did this right. If I didn't, I'd like some correction please :smile:

y=255(x255)γy = 255(\frac{x}{255})^\gamma

x=255(y255)γx = 255(\frac{y}{255})^\gamma

x255=(y255)γ\frac{x}{255} = (\frac{y}{255})^\gamma

ln(x255)=γln(y255)ln(\frac{x}{255}) = \gamma ln(\frac{y}{255})

1γln(x255)=ln(y255)\frac{1}{\gamma} ln(\frac{x}{255}) = ln(\frac{y}{255})

e1γln(x255)=y255e^{\frac{1}{\gamma} ln(\frac{x}{255})} = \frac{y}{255}

x255e1γ=y255\frac{x}{255}e^{\frac{1}{\gamma}} = \frac{y}{255}

y=xe1γy = xe^{\frac{1}{\gamma}}
(edited 13 years ago)
Original post by strawberry
Yeah I know this is trivial, but it's always the trivial stuff I get wrong. I want to know if I did this right. If I didn't, I'd like some correction please :smile:

y=255(x255)γy = 255(\frac{x}{255})^\gamma

x=255(y255)γx = 255(\frac{y}{255})^\gamma

x255=(y255)γ\frac{x}{255} = (\frac{y}{255})^\gamma

ln(x255)=γln(y255)ln(\frac{x}{255}) = \gamma ln(\frac{y}{255})

1γln(x255)=ln(y255)\frac{1}{\gamma} ln(\frac{x}{255}) = ln(\frac{y}{255})

e1γln(x255)=y255e^{\frac{1}{\gamma} ln(\frac{x}{255})} = \frac{y}{255}

x255e1γ=y255\frac{x}{255}e^{\frac{1}{\gamma}} = \frac{y}{255}

y=xe1γy = xe^{\frac{1}{\gamma}}

There's a mistake going from the third line from the bottom to the next line.
That should be:
Unparseable latex formula:

\frac{1}{\gamma}\ln (\frac{x}{255})} = \ln(\frac{y}{255})\implies (\frac{x}{255})^{\frac{1}{ \gamma }} = \frac{y}{255}

.
(edited 13 years ago)
Reply 2
Farhan.Hanif93
x

thanks!

y=255(x255)γy = 255(\frac{x}{255})^\gamma

x=255(y255)γx = 255(\frac{y}{255})^\gamma

x255=(y255)γ\frac{x}{255} = (\frac{y}{255})^\gamma

ln(x255)=γln(y255)ln(\frac{x}{255}) = \gamma ln(\frac{y}{255})

1γln(x255)=ln(y255)\frac{1}{\gamma} ln(\frac{x}{255}) = ln(\frac{y}{255})

e1γln(x255)=y255e^{\frac{1}{\gamma} ln(\frac{x}{255})} = \frac{y}{255}

(x255)1γ=y255(\frac{x}{255})^\frac{1}{\gamma} = \frac{y}{255}

y=255(x255)1γy = 255(\frac{x}{255})^{\frac{1}{\gamma}}
(edited 13 years ago)
Reply 3
The kind of problems you people dismiss as trivial give me aneurysms. Consider yourselves fortunate.
Original post by strawberry
thanks!

y=255(x255)γy = 255(\frac{x}{255})^\gamma

x=255(y255)γx = 255(\frac{y}{255})^\gamma

x255=(y255)γ\frac{x}{255} = (\frac{y}{255})^\gamma

ln(x255)=γln(y255)ln(\frac{x}{255}) = \gamma ln(\frac{y}{255})

1γln(x255)=ln(y255)\frac{1}{\gamma} ln(\frac{x}{255}) = ln(\frac{y}{255})

e1γln(x255)=y255e^{\frac{1}{\gamma} ln(\frac{x}{255})} = \frac{y}{255}

x255(1γ)=y255\frac{x}{255}^(\frac{1}{\gamma}) = \frac{y}{255}

y=255(x255)1γy = 255(\frac{x}{255})^{\frac{1}{\gamma}}

:yep:
Reply 5
Original post by Eldedu
The kind of problems you people dismiss as trivial give me aneurysms. Consider yourselves fortunate.

I meant trivial as in "everybody should be able to do these right the first time".
Reply 6
Original post by strawberry
y=255(x255)1γy = 255(\frac{x}{255})^{\frac{1}{\gamma}}
Doing gamma correction for an 8 bit display, by any chance? :smile:

It's simplest to normalise x and y to the range [0, 1].

That is, let X=x255,Y=y255X = \frac{x}{255}, Y = \frac{y}{255}, then

Y=XγY = X^\gamma

So

X=Y1/γX = Y^{1/\gamma}

so

x255=(y255)1/γ\frac{x}{255} = \left(\frac{y}{255}\right)^{1/\gamma}

so

x=255(y255)1/γ x = 255 \left(\frac{y}{255}\right)^{1/\gamma}

Edit: note that a key check here is to make sure you get the right answers when y = 0 and y = 255.
Reply 7
lol why YES! image processing :smile:
Reply 8
Original post by strawberry
lol why YES! image processing :smile:
I work in the field.
Reply 9
I'm interested in DSP applications and stuff, but more towards the communications side of things, not image processing - though I think it's cool

Quick Reply

Latest