How to get the original Image matrix from the Integral Image of a N*N matrix?

2 vues (au cours des 30 derniers jours)
IF the original image matrix is represented by r=[ 1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 16]. Then it's integral image using the inbuilt 'integralImage' function is given by
0 0 0 0 0
0 1 3 6 10
0 6 14 24 36
0 15 33 54 78
0 28 60 96 136
Excluding first row and first column we get
1 3 6 10
6 14 24 36
15 33 54 78
28 60 96 136
My requirement is to obtain the original image from the given integral image provided.

Réponse acceptée

Stephen23
Stephen23 le 13 Déc 2018
Modifié(e) : Stephen23 le 13 Déc 2018
A simple solution based on the explanation given on the integralImage help page:
>> II = [0,0,0,0,0;0,1,3,6,10;0,6,14,24,36;0,15,33,54,78;0,28,60,96,136]
II =
0 0 0 0 0
0 1 3 6 10
0 6 14 24 36
0 15 33 54 78
0 28 60 96 136
>> II(2:end,2:end)-II(2:end,1:end-1)-II(1:end-1,2:end)+II(1:end-1,1:end-1)
ans =
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

Plus de réponses (1)

Diarmaid Cualain
Diarmaid Cualain le 18 Déc 2018
To supplement stephens answer, you can also use the Matlab function "diff":
>>II = [0,0,0,0,0;0,1,3,6,10;0,6,14,24,36;0,15,33,54,78;0,28,60,96,136]
>>diff(diff(II,1,2),[])
ans =
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

Catégories

En savoir plus sur Geometric Transformation and Image Registration dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by