: Calculate specific areas size in image I'd like to calculate what area size share do the brown spots take within the area marked with pink lines. See the image here: In case you wonder what
I'd like to calculate what area size share do the brown spots take within the area marked with pink lines. See the image here:
In case you wonder what that is - it's an E.coli bacteria colony (don't worry, nothing dangerous) :)
Anyway, I'd like to measure the area that brown spots take, I guess Photoshop will do (not very experienced with it though).
My line of thinking for doing this is:
Crop the image to areas that are outlined with pink color (would get two images in this case). This is fairly easy and I would know how to do it (selection + crop image to selection).
Make the image black&white, so the background is white and the spots are black (it should be easier then to calculate the size of the spots).
Calculate/measure the size of the black spots. If I get this number, I can easily divide it by the size of the image and get the percentage of the area that these spots cover :)
What would be the steps to do that in Photoshop (if it's possible at all)? Or would you recommend some other program?
More posts by @XinRu324
2 Comments
Sorted by latest first Latest Oldest Best
We can ask this question to be a related Graphic design issue by re-formulate the question "how can I draw any drawings with scale 1:1 based on a photograph?".
Of course if you know exactly how the photograph represent the real dimension so it will be easier to know some more geometric information like length volumes and areas from a photograph. that's what we called proportions .. if you know any dimension in the photo you can concludes and predict the other dimensions. so proportions is a comparative relations between two geometric shapes.
let's say you have an image like the one below.
Definitely the cube is very huge comparing to the man that approximately we already know how tall he is. the cube is almost 2 times taller and 1.5 times wider and 1 time deeper. so if that man is 1.7m taller (relative to his head) so we can predict the width, height and depth of that cube.
what I need to tell you is you have to re-photograph your subject and add somthing you can predict its dimensions. like a penny or a small scale.
That's exactly what archaeologist scientist do when they excavate something in field. In the image below there is a scale in the floor represent exact dimension between hols and you can predict the diameter of each hole from that image.
in the next example you can see the egg of a "Violet-green Swallow" you can now figure out how small it is when it is compared to a penny.
The question is ... how to know the exact dimension from an image like the the two above? the answer in a small graphic design proceed (trace and scale and measure the area)
Simply we will trace your pink lines (object A) and something we can measure (Object B) (let's say a small scale or a penny) and scale both traced lines based on object (B) and then we can know the exact area of object (A).
here you are some tips when you gonna shoot your subject to get areas from:
make sure to not shoot your subject in a perspective projection, as much as you can take your shoot perpendicular to the subject.
take the shoot with a lens that have long focal lens and zoom to your object to decrease the "Fish-eye" distortion effect occurred in low focal length lenses.
put a ruler scale or penny or anything you can measure beside you object.
put a grid background underneath your subject to correct the lens distortion in Adobe Photoshop.
take three or four shoots to take the average area for more accuracy.
Trace the result photographs in any vector based software like Adobe Illustrator or Inkscape. trace both the object that have unknown dimensions and the know one.
Scale your traced objects based on the known object.
from the info panel you can know your unknown object dimensions.
A camera produces a image that loses any scale information. That is because the projection is flat. Objects at different distances appear sized differently. Likewise certain objects can appear the same.
Image 1: The projection loses sense of scale
This said its possible to know the size, if you have a pair of images (and multiple points in different depths to measure) and a reference measurement in the image.
It is also possible that you just want to compare sizes. In this case the petri dish size is known. Then it can be done if the camera is perpendicular to sample, or sample is perspective corrected right (but this incurs a hard to estimate error).
Image 2: Head on view of a petri dish, image source.
Computing area by relation on perpendicular surface.
If you can photograph like head on like image 2. Then you can just measure the pixel area of the entire circle, and compare that to your marked area. Since the dimensions of the petri dish are known you get a simple relation.
Arp * (Apm /App ) = Arm
Where Arp is the real area of the petri dish (πr 2) in whatever units you want,
Apm is the pixel area of your region in pixels (pm = pixel measurement),
App is the pixel area of your petri dish floor (pm = pixel petri dish) and finally Am the are you wanted to measure.
You can get Photoshop to report number of selected pixels in the extended version of histogram view. This is the area of the selection in pixels.
Image 3: Dummy measurement, gets me an area of ~ 0.15*2800 = 420 mm2 for a petri dish with 60 mm diameter . No measurement confidence calculation done.
Please note due to scale loss effect above you can not use image are for measurement as the distance to target and size/off axis alignment of image is unknown. Measuring both areas ensures a measurement error that is better behaved even if the camera is slightly of axis for said sample.
For fun
For a fun deepening understanding in aultomatic 3D correction see The Fundamental Matrix Song
PS: Not entirely Graphics design. After edit definitely no longer Graphics design.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.