October 28, 2010, 22:10:36
I bought a camera before. The model is DMK 41BU02.
I am programming by C++ in visual studio 2005 with IC Imaging Control 3.06.
I want to change the size of image captured from 1280*960 to 320*240. I tried to save the image by down sample the original image, but it took a lot of computation. I also tried to change the size of image in the file called "LastSelectedDeviceState.xml". However, it does not work. So, can you tell me how I can directly change the size of image captured?
Also how can I change the frame rate and exposure time?
Thanks a lot.
October 29, 2010, 12:08:48
The simple way to resize the image to be saved it to add a resizing frame filter into the frame handler sink.
The "Resize" framefilter is in the attached zip file. Please copy the debug version into the "classlib\debug" and the release version into the "classlib\release" directory.
The sample "ImageResizing" of the zip file should be copied into the "samples\vc6" or "samples\vc8" directory. The project should be converted by Visual Studio correctly. Also the relative paths to include and library should be fine, thus you should be able to run the sample.
However, the trick is, as said above, using a frame filter. The framefilter must be declared in your class:
The the sink and framefilter are created:
// Load the Resizing Filter
pResizeFilter = FilterLoader::createFilter( "Resize","");
if( pResizeFilter.get() != NULL )
pResizeFilter->setParameter( "Enable", true);
m_pSink = FrameHandlerSink::create( pResizeFilter.get() ,DShowLib::eRGB24, 5 );
MessageBox("Failed to load the Resize filter!");
m_pSink = FrameHandlerSink::create( DShowLib::eRGB24, 5 );
m_pSink->setSnapMode( true );
m_cGrabber.setSinkType( m_pSink );
The frame filter is in the sink only. That means, the live display will be original size.
For setting exposure use this function:
// Set exposure using the range interface. For the AF/BF cameras
// the exposure range is 0.00001 to 30.0.
// In order to set 1/2000 seconds, call:
// SetExposureAbsolute( pGrabber, 0.002);
bool SetExposureAbsolute( DShowLib::Grabber *pGrabber, double dExposure )
bool bOK = false;
pExposureRange = NULL;
pExposureAuto = NULL;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
if( pItems != 0 )
// Try to find the exposure item.
tIVCDPropertyItemPtr pExposureItem = pItems->findItem( VCDID_Exposure );
if( pExposureItem != 0 )
// Try to find the value and auto elements
tIVCDPropertyElementPtr pExposureValueElement = pExposureItem->findElement( VCDElement_Value );
tIVCDPropertyElementPtr pExposureAutoElement = pExposureItem->findElement( VCDElement_Auto );
// If an auto element exists, try to acquire a switch interface
if( pExposureAutoElement != 0 )
pExposureAutoElement->getInterfacePtr( pExposureAuto );
pExposureAuto->setSwitch(false); // Disable auto, otherwise we can not set exposure.
// If a value element exists, try to acquire a range interface
if( pExposureValueElement != 0 )
pExposureValueElement->getInterfacePtr( pExposureRange );
double min = pExposureRange->getRangeMin();
double max = pExposureRange->getRangeMax();
if ( dExposure < min )
dExposure = min;
else if( dExposure > max )
dExposure = max;
// Here we set the the exposure value.
bOK = true;
For the frame rate I would like you to have a look into the "Classlibraries Users Guide" of IC Imaging Control.
November 1, 2010, 01:06:37
I solved the problem by your suggestion.
I really appreciate that.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.