The Imaging Source Community

Go Back   The Imaging Source Community > Image Processing Hardware and Software > IC Imaging Control C++ Class Library

Attention:

IC Imaging Control C++ Class Library Please use this forum for IC Imaging Control C++ Class Library support only. If you need support for the ActiveX or .NET version, please use the appropriate forum.

Reply
 
Thread Tools Display Modes
  #1  
Old May 18, 2006
Unregistered
Guest
 
Posts: n/a
Filter Problem

Hi,

I am trying to set up a small filter chain of two filters. The first one is a color classification filter, which takes an RGB24 image and converts it into a RGB8 image (of course does some color lookup and so on too).
The second one is the binarization filter from the samples.

I have set up the input and output type methods as follows:

Code:
void CColorClassifierFilter::getSupportedInputTypes( DShowLib::FrameTypeInfoArray& arr ) const
{
	// This filter works for 24-bit-color images only
	arr.addFrameType( eRGB24 );

}

bool CColorClassifierFilter::getTransformOutputTypes( const DShowLib::FrameTypeInfo& in_type,					   DShowLib::FrameTypeInfoArray& out_types ) const
{
	
	
	FrameTypeInfo out_type = eRGB8;

	out_type.dim = in_type.dim;
	out_type.buffersize = out_type.dim.cx * out_type.dim.cy;
	
	out_types.push_back( out_type );

	return true;
}
and

Code:
void CBinarizationFilter::getSupportedInputTypes( DShowLib::FrameTypeInfoArray& arr ) const
{
	// This filter works for 8-bit-gray images only
	
	
	arr.push_back( eRGB8 );

}

bool CBinarizationFilter::getTransformOutputTypes( const DShowLib::FrameTypeInfo& in_type, DShowLib::FrameTypeInfoArray& out_types ) const
{
	// We don't change the image type, output = input
	out_types.push_back( in_type );

	return true;
}
When I run them seperatly they work fine. If I hook them together like:

Code:
// Set filter parameters.
	tFrameFilterList filterList;

	// Use .get to extract a plain pointer from the smart pointer.
  	filterList.push_back( &m_binarizationFilter );
	filterList.push_back( &m_ColorClassifierFilter );	



	m_Grabber.setDeviceFrameFilters( filterList );
The program hangs (or is caught in an endless loop) and writes the following error messages to the debugger:

Code:
TffdshowBase::Constructor
TffdshowDecVideo::Constructor
Join filter graph
CheckInputType: , 1024, 768
CheckInputType: , 1024, 768
CheckInputType:  , 1024, 768
CheckInputType:  , 1024, 768
CheckInputType: , 1024, 768
Removed from filter graph
Destructor
or

Code:
TffdshowBase::Constructor
TffdshowDecVideo::Constructor
Join filter graph
CheckInputType: , 1024, 768
CheckInputType: Y800, 1024, 768
Removed from filter graph
Destructor

Any idea what I am doing wrong???
If I change the order of the Filters I get an (expected) exception....

Thanks in advance for any suggestions...

Fabian
Reply With Quote
  #2  
Old May 19, 2006
fab fab is offline
Registered User
 
Join Date: May 2006
Posts: 1
Hi...

I actually got this problem fixed...
Seems like I was a bit overworked yesterday...

Of course the order of the filters DO work the other way round...
The exception I got then, had to do with some idiotic fumbling of mine with pointer indices...
;)

so never mind to delete the whole post since it wouldnt help anyone I guess...
Reply With Quote
  #3  
Old May 19, 2006
Stefan Geissler's Avatar
Stefan Geissler Stefan Geissler is offline
IC Support Engineer
The Imaging Source
 
Join Date: Jan 2003
Location: Bremen, Germany
Posts: 2,755
Fabian,

Thank you for the thread, i think it is interesting and wont delete it!
__________________
Best regards
Stefan
IC Imaging Control Support
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MV Recording filter options brow0833 MontiVision Development Kit 3 May 31, 2006 20:32:16
Version 2.2 released! Marc Cymontkowski MontiVision Development Kit 0 August 6, 2004 11:50:16
loading directx graphs that contain a Sony 1394 Capture filter using IGraphBuilder::RenderFile() Unregistered IC Imaging Control ActiveX 2 November 14, 2002 10:21:07


All times are GMT +1. The time now is 17:52:50.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 1991 - 2010 The Imaging Source Europe GmbH