# add a scale bar to a microscopy image?

Is there any way to add scale bar to a image for example. I just need to add a bar and a text on top of it to all my images without having to rewrite

Graphics[{Thick, Thick, Yellow, Line[{{100, 100}, {166, 100}}],
Text[Style["10 μ", Yellow, Bold, 25], {120, 110}]}]


for every image.

I just want to put this bar and text at left corner of the images I have.

-
I'm soooo photogenic! –  belisarius Nov 5 '13 at 1:39
But ... do you want to measure the white bar and resize your yellow scale accordingly? –  belisarius Nov 5 '13 at 1:45
Sorry Yes! I do want to change the numneric as the size of the bar varies. But how can I do that in terms of the horizontal pixel of the image. lets say its a 640x480 image. And a 100 pixels in 640 relates to 10 micron. If I change the bar length to 200 it should show 20. –  abhilash sukumari Nov 5 '13 at 1:47

Provided you have this image is in the same directory that your notebook with the name im.jpg, try this:

im = Import[NotebookDirectory[] <> "im.jpg"];
Show[{im},
Epilog ->
Inset[Graphics[{Thick, Thick, Yellow,
Line[{{100, 100}, {166, 100}}],
Text[Style["10 \[Mu]", Yellow, Bold, 25], {120, 110}]}],
Scaled[{0.15, 0.9}]]]


The result is here:

-