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

조회 수: 2 (최근 30일)
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.

채택된 답변

Stephen23
Stephen23 2018년 12월 13일
편집: Stephen23 2018년 12월 13일
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

추가 답변 (1개)

Diarmaid Cualain
Diarmaid Cualain 2018년 12월 18일
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

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by