How can one change pixel-size of a self-made image in MATLAB?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Aarat
il 28 Lug 2015
Modificato: Walter Roberson
il 29 Lug 2015
Hi, I simulated an image and wanted to analyse how this would look with cameras of different pixel sizes. Could someone please advise me on how i could vary the pixel-dimensions? I tried using resize(), but it merely changes the number of rows and columns in my simulation and still keeps the size of a single pixel intact.
Thank you very much.
0 Commenti
Risposta accettata
Walter Roberson
il 29 Lug 2015
When you generated the image, you had a formula and a quantization spacing. To change the pixel size you will need to regenerate from the formula with a different spacing. If you leave the upper and lower limits the same, the result will be fewer pixels (for larger spacing) or more pixels (if more closely spaced.)
You can display the images using image(). However, no matter what you do on any one system, different number of pixels are going to result in different sized of images on the screen. There is no way on any display you are likely to run into that you would be able to change the pixel size used on the display, except that some systems provide a mechanism to change resolution to one of a small number of sizes. If you are using LCD or similar displays then your pixel size is locked in and cannot really be changed. If you are using CRT then there is a small chance that the actual pixel size could be altered, but it has been a good 20 years since I last saw a display that could do that (maybe longer.)
3 Commenti
Walter Roberson
il 29 Lug 2015
Modificato: Walter Roberson
il 29 Lug 2015
Suppose you have 1/2 * erfc( (x - mu) / (sqrt(2) * sigma)) and you want x to range from A to B. Then you can define
x = linspace(A, B, columns);
and run the calculation. The more columns you use, the closer together adjacent values become -- the resolution becomes higher. So you can change your pixel size by changing the number of columns. But no matter how many columns you use, they still represent the same range of data, from A to B. The distance between x values would be pixel_width = (B-A)/(columns-1);
You can invert the calculation by defining the pixel width and using a bit of algebra:
pixel_width * (columns-1) = (B-A)
(columns - 1) = (B-A) / pixel_width
so
columns = ceiling((B-A) / pixel_width + 1)
If you want a fixed number of columns then you will need to vary your A and B, the range the expression is calculated over. To do that you would need to define whether you wanted A to be fixed, or B to be fixed, or if you wanted the locations to be distributed equally on the sides of some fixed point C (which might be (A+B)/2)
Image Analyst
il 29 Lug 2015
Don't forget to add noise. Smaller pixels collect fewer photons. The Poisson noise, which is proportional to the square root of the number of photons, will be less, but the signal is even less, so your signal to noise ratio is less for a smaller pixel. There may be other noises that are more impactful than the Poisson noise due to photons though. CCD sensors have all kinds of noise - quantization noise, fixed pattern noise, dark current, 1/f noise, etc. I can't get into them all here (and am not an expert on them all anyway). If you want to be super accurate, you will have to model the noise.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Microelectronics, Photonics and Nanotechnology in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!