PDA

View Full Version : Bad image colors in Dialog Template but okay in Demo and IC Capture



GregE
August 18, 2014, 20:24:34
I'm working with DFK AFU130-L53 camera. C++. I assume the project template code is missing something that's in the Demo and IC Capture so the image display is correct. I've checked all the camera settings when I test and all apps are the same.

Is there a place to download source code for the demo programs or are the IC Dialog and IC Frame Filter Module project templates all there is? The link to IC Imaging Control Samples gives me a Missing Shortcut error. The Class Library documentation refers often to %TOPLEVEL%\Samples\VC71 but I can't find anything.

Thanks,
Greg

Stefan Geissler
August 19, 2014, 09:19:44
Hello

Is there a place to download source code for the demo programs or are the IC Dialog and IC Frame Filter Module project templates all there is? The link to IC Imaging Control Samples gives me a Missing Shortcut error. The Class Library documentation refers often to %TOPLEVEL%\Samples\VC71 but I can't find anything.

%TOPLEVEL% should be your documentens directory. Please have a look into "My Documents\IC Imaging Control 3.3". in there are many samples.

If you have check marked the image processing and show result in the IC Dialogs Wizard, then the image is processed so you get a negativ image. Maybe is this, what you see. This written in the comment in the "listener.cpp" at "DoImageProcessing()" called by frameReady. Simply comment out the lines and you receive a positive image.

It is this function in listener.cpp:


void CListener::DoImageProcessing( smart_ptr<MemBuffer> pBuffer)
{
// Get the bitmap info header from the membuffer. It contains the bits per pixel,
// width and height.
smart_ptr<BITMAPINFOHEADER> pInf = pBuffer->getBitmapInfoHeader();

// Now retrieve a pointer to the image. For organization of the image data, please
// refer to:
// http://www.imagingcontrol.com/ic/docs/html/class/Pixelformat.htm

BYTE* pImageData = pBuffer->getPtr();

// Calculate the size of the image.
int iImageSize = pInf->biWidth * pInf->biHeight * pInf->biBitCount / 8 ;

// Now loop through the data and change every byte. This small sample inverts every pixel.
for( int i = 0; i < iImageSize; i++)
{
pImageData[i] = 255 - pImageData[i];
}

}


"pImageData[i] = 255 - pImageData[i];" changes the colors to negative.

GregE
August 19, 2014, 16:34:20
Thanks, Stefan.

But I only have "classlib" and "redist" folders in my "C:\Users\grege\Documents\IC Imaging Control 3.3" folder. I've installed the SDK and driver for camera.

I'll give your code suggestion a try to fix the negative image.

Greg

Greg

Stefan Geissler
August 19, 2014, 16:52:47
Interesting. Never had this before, there must be somethin really strange on your computer.

There should be a "Samples" directory beside to the "classib" directory. Except you disabled *all* VS versions in during the setup of IC.

GregE
August 20, 2014, 02:06:38
Ah! Found the issue with the samples, Stefan. I had only checked VS13 C++ during the install. The samples are placed under "vc10" so it looks like I should've left install as default which included VS10,VS12 and VS13.

Greg

Stefan Geissler
August 20, 2014, 07:55:37
Hello Greg

Good to read, you found the samples. "vc10" is correct, since the succeeding versions of VS can read the solution and project format without any problems.

Also the setup is not adapted to VS 2013 existing stand alone. I forward this to the programmers.