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

Firewire with DeinterlaceEdgeDetect

juriman
Beginner
399 Views
Hello,
I have as source a firewire cam and I want a deinterlaced (edge detect) live stream.
As input a get a YUY2 buffer (Y0 U0 Y1 V0) with the size of 829440 bytes (720 * 576 * 2).
The output buffer has to be 768 * 576, so the ROI is 720 * 576.

When i use the ippiDeinterlaceEdgeDetect_8u_C1R function, the colors are wrong. I think its because of the input have to be RGB(?).
So I want to convert the input with ippiYUV422ToRGB_8u_C2C3R, then use the deinterlacing function and then re-convert.

Here is my Code (Delphi):
[delphi]// Get pointer
pSrc := PIpp8u(pDataI); // 720 * 576
pDst := PIpp8u(pDataO) // 768 * 576
// GetMem pTemp1 := ippiMalloc_8u_C3(720, 576, @tempStep1 ); pTemp1 := ippiMalloc_8u_C3(720, 576, @tempStep2 ); // Convert YUY2 -> RGB
roiSize.height:=576; roiSize.width:=720; ippiYUV422ToRGB_8u_C2C3R(pSrc,720*2,pTemp1,tempStep1,roiSize); // Deinterlace
roiSize.width:=720*3; res:=ippiDeinterlaceEdgeDetect_8u_C1R(pTemp1,tempStep1, pTemp2,tempStep2, roiSize,1, 1); // Convert RGB -> YUY2
roiSize.width:=720; ippiRGBToYUV422_8u_C3C2R(pTemp2,tempStep2,pDst,768*2,roiSize); // FreeMem
ippiFree(pTemp1); ippiFree(pTemp2);[/delphi]
The program crashes in the deinterlacing function: access voilation at adress 0x....
I'm quite sure there is something wrong with the rio size or/and the steps. Its a little bit confusing for me.

Can anyone see the failure???
0 Kudos
1 Solution
Vladimir_Dudnik
Employee
399 Views

Please note that C1 in the name of IPP function mean single channel image. This function work on one color plane (for example Y plane). You need to split your image to planesbefore call this function for each plane.

Vladimir

View solution in original post

0 Kudos
3 Replies
juriman
Beginner
399 Views
Oh, I have a Copy&Paste failure in line 7. No It runs.
But the color are wrong.

Attachments:
1.jpg: how it is now
2.jpg: how i has to be

//Edit
I have replaced the deinterlacing funnction with the copy funktion
ippiCopy_8u_C1R(pTemp1, tempStep1, pTemp2, tempStep2, roiSize);
and now the colors are right.

So the new question is:
What color format need ippiDeinterlaceEdgeDetect_8u_C1R?
0 Kudos
Vladimir_Dudnik
Employee
400 Views

Please note that C1 in the name of IPP function mean single channel image. This function work on one color plane (for example Y plane). You need to split your image to planesbefore call this function for each plane.

Vladimir
0 Kudos
juriman
Beginner
399 Views

It works. Thank you!
I tought it doesn't matter, because the other deinterlacing functions worked without splitting.
0 Kudos
Reply