Filter löschen
Filter löschen

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

4 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

Stephen23
Stephen23 am 13 Dez. 2018
Bearbeitet: Stephen23 am 13 Dez. 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

Weitere Antworten (1)

Diarmaid Cualain
Diarmaid Cualain am 18 Dez. 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

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by