how to calculate ppi of this camera? - image-processing

My camera is HIKIROBOT MV-CE060-10UC 6MP USB Camera and its lens is HIKIROBOT MVL-HF2528M-6MPE 25MM lens
Camera Resolution : 3072 x 2048 == 6 MP
more details about camera
more details about lens
and the operating distance 370 mm.
My need is find the Dimensions of object using python. I try some method its not give accurate value.
I search in online to calculate the ppi link of website.I follow the steps to calculate ppi but i don't know the diagonal in inches
diagonal image
That website give some examples to calculate the ppi like
They calculate the ppi of computer screen here thay give diagonal inches of screen, but in my case don't know the daigonal inches. What to do ?

Related

Real distance on image sensor

I have captured an image using iPhone rear camera. Now I can measure the distance between two points in the image by pixel, and I can easily convert that distance to inch or millimeter using PPI of that iPhone.
distance_in_inch = distance_in_pixel / PPI
However, I want to know the distance in inch or millimeter on the image sensor?
How can I calculate it?

Difference of a circle in picture with different resolutions by the same phone camera

I shoot a circle through the phone, and obtain the diameter of the circle (the number of pixels in the picture) by image processing. I found that the number of pixels of diameter is different at different resolutions.The following is the table about diameter at different resolution that I record through experiment. **I want to know how phone camera to get photos of different resolution sizes, and the relation between different resolutions.**I am searching for a long time on net. But no use.
The sensor in your camera has a certain size - it may be 29mmx19mm, or 24mm by 16mm (APS-C) or Micro Four Thirds (18mm by 13mm) or Full Frame (36mm by 24mm).
When the light goes through the lens it forms an image of your circle on the sensor and the sensor records it. When you change resolution, the camera uses a different number of pixels to record it but the circle still shows up as the same number of millimetres on the sensor because it is the lens's focal length and the distance to the object that determines the size of the image formed on the sensor.
If you divide the resolution by the diameter, you will see that your circle is forming a picture a constant size on your sensor - 6.25 units in size:
Let's try an example and pretend your camera is full frame. That means that at 640x480 resolution, 640 pixels is 36mm, so your 104 pixel wide circle means that the image formed on your sensor is
104 * 36mm
--- = 5.85mm
640
When you record at 4160 resolution, your 36mm is divided into 4160 pixels, so your 664 pixels make
664 * 36mm
---- = 5.7mm
4160
So basically, what you are seeing is that the size of the image on your sensor is independent of the resolution you record it at - which is correct since the size of the image on the sensor is determined by the focal length of your lens and the distance to the object.

Opencv: Find focal lenth in mm in an analog camera

I have sucessfully calibrated an analog camera using opencv. The ouput focal length and principal points are in pixels.
I know in digital cameras you can easily multiply the size of the pixel in the sensor by the focal length in pixels and get the focal length in mm (or whatever).
How can I do with this analog camera to get the focal length in mm?
The lens manufacturers usually write focal length on the lens. Even the name of the lens contains it, e.g. "canon lens 1.8 50mm".
If not, you can try to measure it manually.
Get lens apart from the camera. Take a small well illuminated object, place it in 1-3 meters in from of lens and sheet of paper back from it. Get sharp and focused image of the object on the paper.
Now measure following:
a - distance from lens to the object;
y - object size;
y' - object image size on the paper;
f = a/(1+y/y') - focus distance.
If your output is in pixels, you must be digitizing the analog input at some point. You just need to figure out the size of the pixel that you are creating.
For example, if you are scanning film in, then you use the pixel size of the scanner.

How does Pixels Per Centimeter relate to zoom and pixelation of an image

I'm working on something where an admin puts in a threshold for PPI of an image, for example 35. If the uploaded image has PPI of greater than 35 then return true or else return false.
So I'm finding out the PPI of an image using imageMagick:
identify -format "%x x %y" myimg.png
This gives me numbers, for example, 5.51 PixelsPerCentimeter and I convert them to PixelsPerInch by 5.51 * 2.35
This all works fine. However, I am curious as to how the PPI relates to the zoom factor of an image.
Questions
Does a low resolution (say, 10 PPI) image mean it can't be zoomed in as much as a high resolution image can (say, 72 PPI)?
Well I'm sure a low resolution can be zoomed in at a high percentage but the image quality won't be as good i.e. it will be pixelated?
Is there a better metric that I should be looking at rather than PPI to determine whether an image is high resolution or low resolution.

Pixels of an image

I have a stupid question:
I have a black circle on white background, something like:
I have a code in Matlab that gets an image with a black circle and returns the number of pixels in the circle.
will I get the same number of pixels in a camera of 5 mega pixel and a camera of 8 mega pixel?
The short answer is: Under most circumstances, No. 8MP should have more pixels than 5MP, However...
That depends on many factors related to the camera and the images that you take:
Focal length of the cameras, and other optics parameters. Consider a fish-eye lens to understand my point.
Distance of the circle from the camera. Obviously, closer objects appear larger.
What the camera does with the pixels from the sensor. For example, 5MP cameras that works in a down-scaled regime, outputting 3MP instead.
its depends on the Resolution is how many pixels you have counted horizontally or vertically when used to describe a stored image.
Higher mega pixel cameras offer the ability to print larger images.
For example a 6mp camera offers a resolution of 3000 x 2000 pixels. If you allow 300dpi (dots per inch) for print quality, this would give you a print of approx 10 in x 7 in. 3000 divided by 300 = 10, 2000 divided by 300 = approx 7
A 3.1mp camera offers a resolution of 2048 x 1536 pixels which gives a print size of 7in x 5in

Resources