Skip to main content
Participant
December 27, 2011
Question

Automatic Detection of Scale Bar/Insert New Scale Bar

  • December 27, 2011
  • 2 replies
  • 1702 views

Two quick questions.  I have never scripted much, but I have an idea which would help my workflow professionally. 

The first questions is whether there are any professional services which I might be able to contract in order to have a script developed? 

The second question is in regards to whether my scripting idea would even be possible in Photoshop. 

I do research using electron microscopes, and as such in every micrograph I collect there is a scale bar.  Unfortunately, the scale bars are not aesthetically pleasing, and so I bring them into Photoshop.  Typically I will rescale, cut, paste, etc to use the images to tell the story about the data.  One of the things I always do is draw a line trace over the scale bar on the image (typically with my own font and applied stroke) and then adjust it (whether I want to double the scale, etc) to make it look more professional.  On all of my micrographs there is a black information bar with white lettering and a white scale bar (see attached).  Is there any way to write a script that would automatically read the region where the scale bar is located and then draw a new layer with a line the same size (with the line properties desired) using a Fourier transform or some other mathematical algorithm?  If that is possible, the next step would be to read the scale bar size and do a similar function with inserted text.

Thanks,

Matt

This topic has been closed for replies.

2 replies

c.pfaffenbichler
Community Expert
Community Expert
December 29, 2011

Have been approached by anyone of the pros yet?

If not it might be possible to get the size of the white rectangle from a Work Path.

Are the images all grayscale and is the whole bar always the same size and position?

olszta77Author
Participant
December 29, 2011

No, you are the only response I have gotten thusfar.

I have never used Work Paths before, so I am not sure.

The images are grayscale, and the scale bar is always in the same position,

but not the same size (width wise). I take images at many differetn

magnifications, so each image could vary in the length of the scale bar.

Hence, each time I want to make a custom scale bar and cut off that black

banner at the bottom, I need to make a new layer by drawing a line matching

the scale.

Thanks

Matt

Inspiring
December 29, 2011

Two things come to mind.

Some microscopes write the scale and other info to the image's metadata so you may not need to use the existing scale bar to determine the scale.

Creating a scale marker is a built-in feature of Photoshop Extended. You can find it under the Analysis menu. You will have to set the scale but Photoshop makes is easy because it makes the measure tool active while the dialog is open.

c.pfaffenbichler
Community Expert
Community Expert
December 28, 2011

The first questions is whether there are any professional services which I might be able to contract in order to have a script developed?

As far as I know some of the regulars in this Forum offer their services professionaly but you could also ask over at

http://ps-scripts.com/bb/