Exact (pixel) area image resampling
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I am trying to resample an image with certain boundary conditions and I am sure that there is a suitable matlab algorithm, but yet I'm unable to find it or use it correctly. I have found a good illustration for my problem at pages 24-26 of the following presentation:
Situation:
I have a CCD (intensity) image with 2048*2048 pixels. I call this image I(x,y). This image is projected on a new grid, called I'(x',y') using a certain coordinate transform. I have calculated the coordinates (x,y)=f(x',y') for all 4 (new) pixel corners in the old (')-Matrix. I end up with four pairs of coordinates in the old I'-image which are incommensurate with the pixel coordinates. These corners span a new pixel in the old, measured matrix I (pixel edges are approximately straight lines) that for large values (x',y') is strongly distorted. Furthermore more than 4 "old" pixel might be covered by this new pixel. That's why a simple rectangular pixel approximation fails.
Problem:
The intensity values of the pixels in I(x,y) represent photon numbers and must be preserved, e.g. sum(sum(I)) == sum(sum(I')). I read this is called "exact area image resampling".
I have tried the image transform algorithms as decribed here
but it is clearly not intensity-conserving, maybe due to the fact, that none of the algorithms assumes real-space extended pixels but only points. The above mentioned presentation suggest delaunay-triangulation and Matlab does have some built-in functions for that.
Question:
What I'm looking for is an algorithm that yields the I'-matrix intensity as the sum of area-weigthed pixel values. I wanted to include a possibly finer resampling by artificially shrinking the new pixel size but this is a secondary issue.
Thank you in advance for your replies, Stefan
Example for pixel (x'=1000,y'=1000) is represented by the corner coordinates in the new matrix
coordinates = [1104.3 ,1104.3;1104.4 ,1105.5;1105.7, 1105.7;1105.5,1104.4];
plot(coordinates(:,1),coordinates(:,2),'o-'), grid on,
set(gca,'XLim',[1103 1107], 'YLim', [1103 1107],'XTick',[1104 1105 1106],'YTick',[1104 1105 1106])
0 comentarios
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!