PDA

View Full Version : First Step Tutorial



doliharahap
October 11, 2010, 11:18:17
Hai,
i'm trying to inderstand the First Step Tutorial.

I already followed every step. But when i debug i have error that said my WINVER is higher than 6, i already define this in stdfax.h to 0x0502

then, when i debug i get 102 errors something like this..


1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(293) : error C2061: syntax error : identifier '__RPC__in_opt'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(298) : error C2061: syntax error : identifier '__RPC__out'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(395) : error C2061: syntax error : identifier '__RPC__deref_out_opt'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(500) : error C2061: syntax error : identifier '__RPC__out'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(613) : error C2061: syntax error : identifier '__RPC__deref_out_opt'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(616) : error C2061: syntax error : identifier '__RPC__in_opt'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(710) : error C2061: syntax error : identifier '__RPC__in'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(713) : error C2061: syntax error : identifier '__RPC__inout'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(800) : error C2061: syntax error : identifier '__RPC__in_opt'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(804) : error C2061: syntax error : identifier '__RPC__in_opt'
1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(811) : error C2061: syntax error : identifier '__RPC__in_opt'

is there something bad with my SDK??
could someone explain this to me??

Sorry still new..

Stefan Geissler
October 11, 2010, 11:28:56
Hello,

please let me know your VS and IC version.

doliharahap
October 11, 2010, 11:39:34
Hello,

please let me know your VS and IC version.

hai,

I'm using IC 3.1 and VS2008..

Stefan Geissler
October 11, 2010, 11:41:04
Hello,

in this case, the DShow.h is not necessary. Does the "demoapp" sample compile on your computer?

doliharahap
October 12, 2010, 03:52:56
Hello,

in this case, the DShow.h is not necessary. Does the "demoapp" sample compile on your computer?

DShow.h??
demoapp??

sorry, i don't get what you mean. I just followed the tutorial, and i got this error. Something wrong with my SDK?

Stefan Geissler
October 12, 2010, 10:38:27
Hello,

I guess, your sequence of the include directories is wrong. Please see the attached screenshot of my settings. However, you may need to test different sequences.

Also I found another bug in the documentation.
Wrong

C:\Documents and Settings\username\My Documents\IC Imaging Control 3.1\classlib\($PlatformName)\debug
Correct:

C:\Documents and Settings\username\My Documents\IC Imaging Control 3.1\classlib\$(PlatformName)\debug

doliharahap
October 12, 2010, 17:43:58
Hello,

I guess, your sequence of the include directories is wrong. Please see the attached screenshot of my settings. However, you may need to test different sequences.

Also I found another bug in the documentation.
Wrong

C:\Documents and Settings\username\My Documents\IC Imaging Control 3.1\classlib\($PlatformName)\debug
Correct:

C:\Documents and Settings\username\My Documents\IC Imaging Control 3.1\classlib\$(PlatformName)\debug


oh god..
i just uninstall the Latest SDK from my PC and it WORKS!!

after that i looked your post here, so maybe that's the real problem.
Thanks by the way.

--
Sorry OOT, do you have any idea how to combine the IC SDK with OpenCV?
i mean how to transfer the Image/Frame that i capture use IC SDK to OpenCV?

Stefan Geissler
October 13, 2010, 08:41:36
Hello,

good to read the problem solved.

Forwarding an IC Membuffer to OpenCV is simple.



IplImage* m_pOpenCVImage;

void COpenCVEdgeDetector::ProcessBuffer( smart_ptr<DShowLib::MemBuffer> pBuffer )
{
if( m_pOpenCVImage == NULL )
{
smart_ptr<BITMAPINFOHEADER> pInf = pBuffer->getBitmapInfoHeader();
m_pOpenCVImage = cvCreateImageHeader( imgSize, IPL_DEPTH_8U, pInf->biBitCount / 8 );
}

if( m_pOpenCVImage != NULL )
{
m_pOpenCVImage->imageData = (char*)pBuffer->getPtr();
}
}


This is all.

doliharahap
March 19, 2011, 05:29:56
Hello,

good to read the problem solved.

Forwarding an IC Membuffer to OpenCV is simple.



IplImage* m_pOpenCVImage;

void COpenCVEdgeDetector::ProcessBuffer( smart_ptr<DShowLib::MemBuffer> pBuffer )
{
if( m_pOpenCVImage == NULL )
{
smart_ptr<BITMAPINFOHEADER> pInf = pBuffer->getBitmapInfoHeader();
m_pOpenCVImage = cvCreateImageHeader( imgSize, IPL_DEPTH_8U, pInf->biBitCount / 8 );
}

if( m_pOpenCVImage != NULL )
{
m_pOpenCVImage->imageData = (char*)pBuffer->getPtr();
}
}


This is all.


Hai stephan, sorry for asking in the very old thread.
When i looked at the code above, i assume you use OpenCV library for edge detector, rite?

After you do image processing by using OpenCV library, how do you pass back the IplImage m_pOpenCVImage to IC Control then display the image or frame??

thanks..

Stefan Geissler
March 21, 2011, 08:32:05
Hello,

Since I only pass the pointer to the image data of the IC image buffer to the OpenCV image buffer, IC and OpenCV share the memory of the image. That means, I do need to pass the OpenCV image back to IC.

However, if the images have the same size and you want to copy the image from another OpenCV image to IC, you use memcpy():

memcpy(pBuffer->getPtr(), m_pOpenCVImage->imageData, pInf->bi_ImageSize);
The last parameter is the image size in bytes.

lxr5109
March 23, 2011, 08:13:00
Hello,

good to read the problem solved.

Forwarding an IC Membuffer to OpenCV is simple.



IplImage* m_pOpenCVImage;

void COpenCVEdgeDetector::ProcessBuffer( smart_ptr<DShowLib::MemBuffer> pBuffer )
{
if( m_pOpenCVImage == NULL )
{
smart_ptr<BITMAPINFOHEADER> pInf = pBuffer->getBitmapInfoHeader();
m_pOpenCVImage = cvCreateImageHeader( imgSize, IPL_DEPTH_8U, pInf->biBitCount / 8 );
}

if( m_pOpenCVImage != NULL )
{
m_pOpenCVImage->imageData = (char*)pBuffer->getPtr();
}
}


This is all.

The code is really what I am looking for. I just want to create an IplImage object with the data from IC.
And I have found that someone said the converted Image is rotated by 180.
I suppose it is because of the organization of the image date. By default, the organization of the IplImage is top-left, while Windows BMP is bottom-left.
I have tried to set m_pOpenCVImage->origin to 1 and solved the problem.
But I don't know the details about the problem, or if the method is propriety.
Could you give me some information? Thanks a lot.

Best Regards,
lxr5109

Stefan Geissler
March 23, 2011, 08:43:11
Hello

I have tried to set m_pOpenCVImage->origin to 1 and solved the problem.
But I don't know the details about the problem, or if the method is propriety.
Could you give me some information?
The images in IC image buffers are stored bottom up.