Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® Integrated Performance Primitives
- iipiSqrDistanceSame_Norm normalization

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Hello,

I'm using the image proximity measure iipiSqrDistanceSame_Norm and I don't get how the normalization is done.

I have done the calculations on the sample of the manual by myself and I don't get the same results.han

Could anybody help me?

Thanks in advanced,

kind regards

pepa

nose00

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-10-2009
01:50 PM

12 Views

iipiSqrDistanceSame_Norm normalization

I'm using the image proximity measure iipiSqrDistanceSame_Norm and I don't get how the normalization is done.

I have done the calculations on the sample of the manual by myself and I don't get the same results.han

Could anybody help me?

Thanks in advanced,

kind regards

pepa

4 Replies

Highlighted
##

Hello,

could you please share piece of code demosntrating how do you use IPP function?

Regards,

Vladimir

Vladimir_Dudnik

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-12-2009
11:55 PM

12 Views

Hello,

could you please share piece of code demosntrating how do you use IPP function?

Regards,

Vladimir

Highlighted
##

Hello Vladimir,

here the piece of code. I#m using C#.

float[] source = new float[] {2, 2, 2, 2, 2,

2, 1, 1, 2, 2,

2, 1, 1, 2, 2,

2, 1, 1, 2, 2 };

float[] template = new float[] {1, 1, 2,

1, 1, 2,

1, 1, 2};

float[] dest = new float[5*4];

IppiSize sourceRoi = new IppiSize(5, 4);

IppiSize templateRoi = new IppiSize(3, 3);

int sourceStep = 5*sizeof(float);

int templateStep = 3*sizeof(float);

int destStep = 5*sizeof(float);

fixed(float* pSource = source, pTemplate= tuple, pDest = dest) {

ippResult = ip.ippiSqrDistanceSame_Norm_32f_C1R(pSource, sourceStep, sourceRoi, pTemplate,

tupleStep, templateRoi, pDest, destStep);

}

Result:

0,72 - 0,56 - 0,44 - 0,46 - 1,06

0,44 - 0,29 - 0,10 - 0,17 - 0,87

0,55 - 0,33 - 0,00 - 0,14 - 0,87

0,89 - 0,68 - 0,41 - 0,44 - 1,06

At row 2, column 2 I get the expected 0.00. But for example row 2, column 3,

Formula:

result(2,3) = [tmpl'(0,0)- src'(0.5, 1.5)]^2 + [tmpl'(0,1)- src'(0.5, 2.5)]^2 + [tmpl'(0,2)- src'(0.5, 3.5)]^2 +

[tmpl'(1,0)- src'(0.5, 1.5)]^2 + [tmpl'(1,1)- src'(0.5, 2.5)]^2 + [tmpl'(1,2)- src'(0.5, 3.5)]^2 +

[tmpl'(2,0)- src'(0.5, 1.5)]^2 + [tmpl'(2,1)- src'(0.5, 2.5)]^2 + [tmpl'(2,2)- src'(0.5, 3.5)]^2

tmpl' and src' are the normalized template and source.

I guess, that the point(0.5, 1.5) is rounded to (1,2).

For the row 2, column 3 I don't get 0.14, so I guess I'm not normalizing well. (src'(r,c)= src(r,c)/length

I tried different lengths :

- sqrt(elements^2 of the 3x3 part of the source imgage)

- sqrt(elements^2 of the whole image ??)

and other just to test, but I don't get 0,14

Thanks a lot,

regards pepa

nose00

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-14-2009
01:15 AM

12 Views

Hello Vladimir,

here the piece of code. I#m using C#.

float[] source = new float[] {2, 2, 2, 2, 2,

2, 1, 1, 2, 2,

2, 1, 1, 2, 2,

2, 1, 1, 2, 2 };

float[] template = new float[] {1, 1, 2,

1, 1, 2,

1, 1, 2};

float[] dest = new float[5*4];

IppiSize sourceRoi = new IppiSize(5, 4);

IppiSize templateRoi = new IppiSize(3, 3);

int sourceStep = 5*sizeof(float);

int templateStep = 3*sizeof(float);

int destStep = 5*sizeof(float);

fixed(float* pSource = source, pTemplate= tuple, pDest = dest) {

ippResult = ip.ippiSqrDistanceSame_Norm_32f_C1R(pSource, sourceStep, sourceRoi, pTemplate,

tupleStep, templateRoi, pDest, destStep);

}

Result:

0,72 - 0,56 - 0,44 - 0,46 - 1,06

0,44 - 0,29 - 0,10 - 0,17 - 0,87

0,55 - 0,33 - 0,00 - 0,14 - 0,87

0,89 - 0,68 - 0,41 - 0,44 - 1,06

At row 2, column 2 I get the expected 0.00. But for example row 2, column 3,

Formula:

result(2,3) = [tmpl'(0,0)- src'(0.5, 1.5)]^2 + [tmpl'(0,1)- src'(0.5, 2.5)]^2 + [tmpl'(0,2)- src'(0.5, 3.5)]^2 +

[tmpl'(1,0)- src'(0.5, 1.5)]^2 + [tmpl'(1,1)- src'(0.5, 2.5)]^2 + [tmpl'(1,2)- src'(0.5, 3.5)]^2 +

[tmpl'(2,0)- src'(0.5, 1.5)]^2 + [tmpl'(2,1)- src'(0.5, 2.5)]^2 + [tmpl'(2,2)- src'(0.5, 3.5)]^2

tmpl' and src' are the normalized template and source.

I guess, that the point(0.5, 1.5) is rounded to (1,2).

For the row 2, column 3 I don't get 0.14, so I guess I'm not normalizing well. (src'(r,c)= src(r,c)/length

I tried different lengths :

- sqrt(elements^2 of the 3x3 part of the source imgage)

- sqrt(elements^2 of the whole image ??)

and other just to test, but I don't get 0,14

Thanks a lot,

regards pepa

Highlighted
##

Igor_B_Intel1

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-15-2009
06:03 AM

12 Views

Hi,

SSD values in function with "Same_" suffics are normalized by auto-correlations of source and template images in pixelneighborhood. I manually checked (2,3) pixel and got result(2,3) = 3/sqrt(18*27)=0.14.

Please read "Image Proximity Measures" section in ippiman document for more details.

Igor.

Highlighted
##

*
*

Hi Igor,

thanks a lot for the answer.

Kind regards

Pepa

nose00

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-15-2009
06:18 AM

12 Views

Quoting - Igor Belyakov (Intel)

Hi,

SSD values in function with "Same_" suffics are normalized by auto-correlations of source and template images in pixelneighborhood. I manually checked (2,3) pixel and got result(2,3) = 3/sqrt(18*27)=0.14.

Please read "Image Proximity Measures" section in ippiman document for more details.

Igor.

Hi Igor,

thanks a lot for the answer.

Kind regards

Pepa

For more complete information about compiler optimizations, see our Optimization Notice.