- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all.
I have a question. The code below is image processing for median filter in real-time.
But, after median processing the image comes with a diagonal as shown in Fig 1.
Try to solve this part, fix the below source.
But, the Image is broken. as shown in Fig.2.
So, after processing median filter, I want to get the image without diagonal.
For reference, I was using Intel IPP 7.1.
Please ask for advice.
Thank you.
===============================source code=====================================
IppiSize maskSize = {3, 3};
IppiPoint anchor = {1, 1};
IppiSize sizeSrc = {W_Image, H_Image}; //W_Image : 750, H_Image :800
IppiSize sizeDst = {W_Image, H_Image};
IppiSize szFiltter = {W_Image-2, H_Image-2}; int nStepSrc = (8 * sizeSrc.width + 31) / 32 * 4; //Width a multiple of 4.
int nStepDst = (8 * sizeDst.width + 31) / 32 * 4; // //Width a multiple of 4.
IppStatus status = ippStsNoErr; Ipp8u* pipSrcROI = (Ipp8u*)(((Ipp8u*)m_Pixel) + anchor.y * nStepSrc + anchor.x * sizeof(Ipp8u) * 3);
//m_Pixel : 752H(real 750H) x 800V x 1byte, raw data from image sensor
Ipp8u* pipDstROI = (Ipp8u*)(((Ipp8u*)p) + anchor.y * nStepDst + anchor.x * sizeof(Ipp8u) * 3);
//p :752H(real 750H) x 800V x 1byte, print to Monitor
//Median Processing
status = ippiFilterMedian_8u_C1R(pipSrcROI, nStepSrc, pipDstROI, nStepDst, szFiltter, maskSize, anchor);
for(int j = 0; j < H_Image; j++)
{
for(int i = 0; i < widthbytes; i++) //W_Image : 750, H_Image :800, widthbytes : 752
{
if(i < W_Image) //0~749: Real Raw Data, 750~751 : dummy
{
*(p_2 + (i + (j * widthbytes))) = *(p+(i + (j * W_Image)));
}
else
{
*(p_2 + (i + (j* widthbytes))) = (unsigned char)0;
}
}
}
dc = GetDC(GetDlgItem(hDlgMain, IDC_STATIC_PICTURE));
SetDIBitsToDevice(dc,Rect.left,Rect.top,W_Image,H_Image,0,0,0,H_Image,p_2,BmInfo,DIB_RGB_COLORS);
InvalidateRect(hDlgMain,NULL,FALSE);
ReleaseDC(GetDlgItem(hDlgMain, IDC_STATIC_PICTURE), dc);
=============================================================================
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
0 ~ 749 : real pixel
750 ~751 : dummy pixel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The width is 750pixel. Not a multiple of 4. so, make a multiple of 4. then width is 752 pixel. if not width a multiple of 4, can't be displayed on the monitor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The width is 750pixel. Not a multiple of 4. so, make a multiple of 4. then width is 752 pixel. if not width a multiple of 4, can't be displayed on the monitor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Solved.
int nStepSrc = (8 * sizeSrc.width + 31) / 32 * 4; to int nStepSrc = 750; //750 : real width
int nStepDst = (8 * sizeDst.width + 31) / 32 * 4;to int nStepDst = 750; //750 : real width
Thank you for the advice!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page