Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Erroneous histogram calculation on Multicore

Kishor_D_
New Contributor I
554 Views
Hi,
I tried DMIP Histogram Node .
It is giving correct results for histogram of an image for single core platform(P4).

This I verified by summing all histogram value and came equal to size(height*width) of an image

But same code ,I compiled on (i7 ,Dual core ) platform and executed ,histogram values are not matching.

I feel its because DMIP would carrying out histogram operation parallely on different cores.

Can someone justify?
Any quick help would be greatly appreciated.

Thanks in advance ,
Kishor
0 Kudos
1 Solution
Igor_B_Intel1
Employee
554 Views

Hi,
Need to use HistogramStore object instead of Store object for correct histogram accumulation. That why you observe wrong results in multi core environtment.

Igor S. Belyakov

View solution in original post

0 Kudos
5 Replies
Ying_H_Intel
Employee
554 Views
Hi Kishor,

Could you please provide a test case for the problem? You may use private to attach the file if it is confidential.

Best Regards,
Ying
0 Kudos
Kishor_D_
New Contributor I
554 Views
We have tested for various images like, lena.jpg, barbara.jpg, woman.jpg, cameraman.jpg.
Test platforms are :
1. Intel P4
2. Intel dual-core
3.Intel i-7 (2600)

code:


// Node creation
Image *A=&img1;
Image *D=&dst;
// Source nodes
SrcNode *in1=new SrcNode();
in1->Init(A);

//
Scalar nLevels(256);
Scalar lowerLevel(0);
Scalar upperLevel(256);

HistogramNode *hgNode = new HistogramNode();
hgNode->Init(nLevels,lowerLevel,upperLevel);

Store *hgStoreNode = new Store(1,sizeof(int)*256);


DstStoreNode *out= new DstStoreNode();

out->Init(hgStoreNode);

Graph *g = new Graph();
g->Add(in1);
g->Add(hgNode);
g->Add(out);

g->Link(0,0,1,0);
g->Link(1,0,2,0);

g->Compile(img->width,img->height);
g->Execute();


int *histo;

histo=(int*)hgStoreNode->BufferPtr();
0 Kudos
Kishor_D_
New Contributor I
554 Views
We have tested it for lena.jpg, camra.jpg, woman.jpg.

Test Platforms:
1. Intel P4
2. Intel dual-core
3. Intel i-7(2660)

Sample code:


//Node creation
Image *A=&img1;
Image *D=&dst;
// Source nodes
SrcNode *in1=new SrcNode();
in1->Init(A);

///
Scalar nLevels(256);
Scalar lowerLevel(0);
Scalar upperLevel(256);

HistogramNode *hgNode = new HistogramNode();
hgNode->Init(nLevels,lowerLevel,upperLevel);

Store *hgStoreNode = new Store(1,sizeof(int)*256);


DstStoreNode *out= new DstStoreNode();

out->Init(hgStoreNode);

Graph *g = new Graph();
g->Add(in1);
g->Add(hgNode);
g->Add(out);

g->Link(0,0,1,0);
g->Link(1,0,2,0);

g->Compile();
g->Execute();


int * histo=(int*)hgStoreNode->BufferPtr();
0 Kudos
Igor_B_Intel1
Employee
555 Views

Hi,
Need to use HistogramStore object instead of Store object for correct histogram accumulation. That why you observe wrong results in multi core environtment.

Igor S. Belyakov

0 Kudos
Kishor_D_
New Contributor I
554 Views
Thanks Igor,

We tried it using HistogramStore object. It's working fine.
0 Kudos
Reply