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

LUT Intensity Transformation

Andreoli__Carlo
Beginner
344 Views
Hi, i'm having some problem using th LUT transformation. I'm developing on visual studio express 2008, using ipp 6.1 and microsoft CLR
i used quite the same code with opencv and it function so maybe i have some problem getting the image information, what i do is:

[cpp]Imaging::BitmapData^ bmpData =this->buffer->LockBits(
System::Drawing::Rectangle(Point(0,0),this->buffer->Size),
Imaging::ImageLockMode::ReadOnly,
this->buffer->PixelFormat);

Imaging::BitmapData^ bmpData2 =this->buffer2->LockBits(
System::Drawing::Rectangle(Point(0,0),this->buffer2->Size),
Imaging::ImageLockMode::WriteOnly,
this->buffer2->PixelFormat);
Ipp8u* pPixelData = (Ipp8u*) bmpData->Scan0.ToPointer();
IppiSize roiSz;
roiSz.width = this->buffer->Width;
roiSz.height = this->buffer->Height;
Ipp8u* pPixelDataDst = (Ipp8u*) bmpData2->Scan0.ToPointer();

/* setting various lut trasformation
............
*/

ippiLUT_8u_C3R(pPixelData,
bmpData->Stride,
pPixelDataDst,
bmpData2->Stride,
roiSz,
lutval,
lutval2,
numblevel
);[/cpp]
my question is...."is these thing good?"

1) Ipp8u* pPixelData = (Ipp8u*) bmpData->Scan0.ToPointer();


i attach a simple example on how it doesn't function :(

thank in advance, Andreoli Carlo
0 Kudos
3 Replies
Ying_H_Intel
Employee
344 Views
Hi Andreoli,

You may try to change the
numblevel[0] = 257;
numblevel[1] = 257;
numblevel[2] = 257;
and see ifitworks?
(as the setting inLUT sampleof ippiDemo.exe. (It'ssource code areipp-samplesimage-processingimage-processing-functions)

Regards,
Ying
0 Kudos
Ying_H_Intel
Employee
344 Views

Or modify at least pLevel or pValue.
for example,

for (int i = 1; i <= 255; i++ ) {

redvals = i;

grnvals = this->trackBar1->Value;

bluvals = this->trackBar2->Value;

}

Because according to the manual,
<* Pixels in the pSrc image that are not in the range [pLevels[0], pLevels[nLevels-1]) are copied to the pDst image without any transformation. *>

If you has
numblevel[1] = 256;
numblevel[2] = 256;

and

for (int i = 0; i <= 255; i++ ) {

redvals = i;

grnvals = this->trackBar1->Value;

bluvals = this->trackBar2->Value;

}

Then the grn and blu's pLevels[0]=pLevels[1]=....=pLevels[255]= (trackBar value). Thus

the pixel =(trackBar value) map to =(trackBar value)

the pixel !=(trackBar value) map to orig pSrc.the result image isalways same as Src image, which is not you wanted, isn't?

Regards,
Ying

0 Kudos
Andreoli__Carlo
Beginner
344 Views
Quoting - Ying H (Intel)

Or modify at least pLevel or pValue.
for example,

for (int i = 1; i <= 255; i++ ) {

redvals = i;

grnvals = this->trackBar1->Value;

bluvals = this->trackBar2->Value;

}

Because according to the manual,
<* Pixels in the pSrc image that are not in the range [pLevels[0], pLevels[nLevels-1]) are copied to the pDst image without any transformation. *>

If you has
numblevel[1] = 256;
numblevel[2] = 256;

and

for (int i = 0; i <= 255; i++ ) {

redvals = i;

grnvals = this->trackBar1->Value;

bluvals = this->trackBar2->Value;

}

Then the grn and blu's pLevels[0]=pLevels[1]=....=pLevels[255]= (trackBar value). Thus

the pixel =(trackBar value) map to =(trackBar value)

the pixel !=(trackBar value) map to orig pSrc.the result image isalways same as Src image, which is not you wanted, isn't?

Regards,
Ying


Thank you man, with this i get it :)
0 Kudos
Reply