Finding image resolution? - resolution

The picture that I need to use is 240mm x 240mm, with 120 pixels in each direction. Apparently this resolution is somehow good enough for an-in-depth MRI brain scan, so my college lab is asking me to calculate it's resolution. I know that the formula for resolution is meters/number of pixels, but I calculated 2mm for the resolution, and I do not think that is correct. What am I doing wrong?
edit:
The question asks what the image resolution in pixel size is.

You can calculate it as follows:
120 pixels per 240 mm is 0.5 pixel per mm. (120/240)
Resolution is defined as dots per inch (DPI).
0.5 pixel per mm is 12.7 pixels per inch (0.5 x 25.4 mm)
So your resolution is 12.7 DPI.
Not much but apparently good enough for MRI.

Related

OpenCV camera calibration - Intrinsic matrix values are off

I used OpenCV's camera calibration function for calibrating my camera. I captured around 50 images with different angles and pattern near image borders.
Cx and Cy value in intrinsic matrix is around 300 px off. Is it alright? My average reprojection error is around 0.08 though.
Cx and Cy are the coordinates (in pixels) of the principal point in your image. Usually a good approximation is (image_width/2, image_height/2).
An average reprojection error of 0.08 pixel seems quite good.

What is the resolution of an image in ImageNet dataset?

Does anyone know the resolution of an image in the ImageNet dataset?
I'm sorry, but I couldn't find it on their website or in any of the papers.
The images vary in dimensions and resolution. Many applications resize / crop all of the images to 256x256 pixels.
The average image resolution on ImageNet is 469x387 pixels. Normally it's applied a pre-processing that samples them to 256x256 as #Prune said, but it depends on the task at hand.
In a brief check of a random ImageNet 2012 folder (Fish)...
The largest image is 4288 x 2848 pixels.
The smallest image is 75 x 56 pixels.
This is representative of the aspect ratio range.
It depends of the picture but you can resize them. The smaller dimension of the picture should be at least 256 px and the aspect ratio should be intact.
224 X 224 is used by most of the networks.
There is a detailed answer to this in the following article: https://towardsdatascience.com/compression-in-the-imagenet-dataset-34c56d14d463
Essentially, most common image size is 500x500, however, there is a large distribution of image sizes. Typically, either the width or the height of an image is 500 pixels, if not both. Aspect ratios of 1:1, 4:3, 3:2 (and 3:4 and 2:3) are most common.

What is the real definition of resolution?

I read everywhere that resolution is defined by the number of pixels on a screen.
But if you imagine 1000 x 1000 pixels on a screen the size of 20 skyscrapers and compare it to 999 x 999 pixels on a box of matches, the resolution would make the skyscrapers screen look 'low-res' and the box of matches screen look 'high-res'. Instinctively, I would say that the box of matches screen is higher resolution than the skyscrapers screen.
Am I wrong to say this? Is resolution definitely defined by the total number of pixels instead of the dots per inch?
Indeed, in the context of displays, the term resolution says nothing about pixel density. As stated in Wikipedia's article on Display Resolution:
The term "display resolution" is usually used to mean pixel dimensions, the number of pixels in each dimension (e.g. 1920 × 1080), which does not tell anything about the pixel density of the display on which the image is actually formed: broadcast television resolution properly refers to the pixel density, the number of pixels per unit distance or area, not total number of pixels. In digital measurement, the display resolution would be given in pixels per inch (PPI)
Definition of resolution varies according with the context. Every thing has a measurement unit.
When you talk about screens(Monitors), screen has pixels not dots thats why its resolution is measured in Pixels.
And When you talk about printing or video it is all about dots per inch. In your case, Box of Match is not a screen, its on printed paper.
For eg: you might have heard people saying DPI's(not resolution) while scanning documents.
So don't get yourself confused with the definition of resolution that is meant for different context.

Preparing the images for retina-ready (web)

I have a question that have been on my mind for several time now: how should I prepare the images that I am going to use on a website to be retina-ready?
Yes, I have been spending hours on the interweb on this topic, but so far I haven't find the one 'ultimate answer'.
In this thread for example (link: image size for retina display), it is only mentioned that I need to double the dimensions. But how about the resolution?
Real life situation: an image is created using Photoshop (or whatever your fix) at dimension 400px x 200px, with resolution of 72 ppi.How should I modify this image?
800 x 400px at 72 ppi (just resize it, times two)
800 x 400px at 144 ppi (dimensions and resolution times two)
400 x 200px at 144 ppi (just double the resolution)
400 x 200px at 246 ppi (same dimension, higher resolution --I got the number 246 from some tutorial in designing ipad wallpaper)
...et cetera... ??
The target is to select the images and display them on both non-retina and retina displays (i.e. 'normal' computers / laptops, macs (both versions, retina and non), iDevices, Androids, et cetera)
Looking forward for any feedbacks :-)
You could use Retina.js to replace the image with a higher resolution version, but only if the users device is equipped with a retina display.
The question you link is correct. You need to double the size of the image to double the resolution.
What you are getting confused over is the PPI. PPI is Pixels Per Inch, it is simply a measure of how big a picture is, same as display dimensions.
One is not independent of the other.
An image of 400x200 will take up as much screen space on a 72 ppi display as a 800x400 image on a 144 ppi display. The difference is simply that the 144 ppi device is able to fit more pixels in one inch of screen space than the 72 ppi.
So, by doubling the resolution of a 72ppi image, you are indeed insuring that it looks the same/takes the same amount of screen space.
There's a new responsive images HTML5 standard. As of July 2014 it's only in beta builds of browsers yet. But the Picturefill polyfill is already available.
This article explains different use-cases quite well. But what you want here is to simply provide an alternative image for high-resolution (e.g. 'retina') displays:
<img srcset="small.jpg 1x, large.jpg 2x"
src="small.jpg"
alt="A rad wolf" />

Representing known units in proportion as pixels

This question probably has a very simple answer/formula but math is not a strong point for me. If I have the proportions of a real world object, how can I take the units and proportionally represent that object in pixels?
Let's use the example of a North American hockey rink
The rink itself is 200ft x 85ft so its aspect ratio would be 40:17. Let's say I scale it so that the entire rink will be 1000px x 425px. Now, where my brain decides to stop working is figuring out how many pixels will represent a single foot.
We know the center of the ice should be exactly 100ft from either end of the rink. At this scale (or any scale), what is the formula to figure out how many pixels is equal to 100ft? or how many pixels is equal to one foot?
If 1000 pixels == 200 feet, then pixels per foot == 1000 / 200 = 5.0.
The other axis is the same: 425 / 85 == 5.0 (since you maintained your aspect ratio at 2.35).
It's easiest to think about "per" as the "/" sign, so "pixels per foot" translates into "pixels / feet", which is "1000 pixels / 200 feet"; doing the division yelds 5.0 pixels per foot.
(So the 100 foot half a hockey rink would be 100 feet X 5 pixels, or 500 pixels).

Resources