|
|
Comments and Discussions
|
|
 |

|
First off, like to say thanks for providing the GIL-openCV bindings. I've been working on something similar recently.
I'm not terribly familiar with GIL yet so I have a couple q's about the implementation.
In the top_left_view_from_ipl_image functions, you use "type_from_x_iterator" which provides the view, the xy-locator and the step-iterator types. I think channel_t is suppose to be the pixel type but to get this from iterators I've used
std::iterator_traits::value_type
Same thing or am I misinterpreting something?
--EDIT: actually, planar_rgb_view requires channel_type inputs so that doesn't work. I have to use:
typedef typename boost::gil::type_from_x_iterator::view_t view_t;
typedef typename boost::gil::channel_type::type channel_t;
however.
Also, out of the three you libs you list, which do you prefer?
Cheers,
Chris
|
|
|
|

|
Sorry too late reply
gil proSorry too late reply
gil provides some sample code for usage
I just obey the style of the sample code
In that sample code
type_from_x_iterator::view_t
is used. Thus this is my prefer
|
|
|
|
|

|
Plz use
CiplvBasicImage(IPLIMAGE IplImageIn);
instead of
CiplvBasicImage(IPLIMAGE* pIplImageIn);
Upper function works correctly.
And lower will fixed in next version.
-- modified at 23:26 Saturday 25th November, 2006
|
|
|
|

|
first, thanks a lot for this *very* interesting project!
I downloaded the current version (0.7.6) from sourceforge and compiled it with VC7.1 (stllcv_vs2003). I finally succeeded to compile it with Adobe-GIL,boost,jpglib etc. but i don't have ipl. The Intel IPL is outdated now, replaced by ippi, and i still get an error:
>LINK : fatal error LNK1104: cannot open file 'ipl.lib'
In the sample code, at least one IPL call is done in basicimage..cpp:
iplRotate(iplvImage1.pIplImage, iplvImage2.pIplImage,30.0, 100 ,150 ,IPL_INTER_NN);
Any suggestions? Work-Arounds? (i already commented out the ipl lines, but examples will work strange then)
|
|
|
|
|

|
Subversion enabled
http://stllcv.svn.sourceforge.net/viewvc/stllcv/stllcv/trunk/
|
|
|
|

|
I wrapped OpenCV using adobe::gil
plz see class
iplimage_wrapper
------------------------
#ifdef WIN32
#define _CRT_SECURE_NO_DEPRECATE 1
#pragma warning(disable : 4244) //
#pragma warning(disable : 4996) // MSFT declared it deprecated
#endif
#include
#include "cv.h"
#include "highgui.h"
#include "interleaved_ptr.hpp"
templateclass CiplImageDepth {public: int depth;CiplImageDepth(){depth= sizeof(PIXELTYPE);}};
template<>class CiplImageDepth {public: int depth;CiplImageDepth(){depth= IPL_DEPTH_8U;}};
template<>class CiplImageDepth {public: int depth;CiplImageDepth(){depth= IPL_DEPTH_8S;}};
template<>class CiplImageDepth {public: int depth;CiplImageDepth(){depth= IPL_DEPTH_16U;}};
template<>class CiplImageDepth {public: int depth;CiplImageDepth(){depth= IPL_DEPTH_16S;}};
template<>class CiplImageDepth {public: int depth;CiplImageDepth(){depth= IPL_DEPTH_32S;}};
template<>class CiplImageDepth {public: int depth;CiplImageDepth(){depth= IPL_DEPTH_32F;}};
template<>class CiplImageDepth {public: int depth;CiplImageDepth(){depth= IPL_DEPTH_64F;}};
using namespace gil;
templateclass ipl_colormodel_nchannels{public: const int nchannels; ipl_colormodel_nchannels():nchannels(0){} };
template<>class ipl_colormodel_nchannels< gray_t> {public: const int nchannels; ipl_colormodel_nchannels():nchannels(1){} };
template<>class ipl_colormodel_nchannels< bgr_t> {public: const int nchannels; ipl_colormodel_nchannels():nchannels(3){} };
template<>class ipl_colormodel_nchannels< bgra_t> {public: const int nchannels; ipl_colormodel_nchannels():nchannels(4){} };
template < typename Iterator, typename IPLIMAGE = IplImage>
class iplimage_wrapper : public type_from_x_iterator::view_t
{
public:
IPLIMAGE *pIplImage;
int iplDepthDef;
IPLIMAGE* initProc(int width,int height
)
{
ipl_colormodel_nchannels _colormodel_nchannels_;
CiplImageDepth iplImageDepth;
iplDepthDef=iplImageDepth.depth;
pIplImage=
cvCreateImage( cvSize(
width
, height),
iplDepthDef
, _colormodel_nchannels_.nchannels
);
return pIplImage;
}
iplimage_wrapper(int width, int height)
:
type_from_x_iterator::view_t(
interleaved_view(
pIplImage->widthStep /(sizeof(channel_t)*pIplImage->nChannels)
, height
,Iterator( reinterpret_cast( (pIplImage=initProc(width,height) )->imageData ))
,pIplImage->widthStep
)
)
{}
~iplimage_wrapper()
{
cvReleaseImage( &pIplImage );
}
};
template
struct halfdiff_cast_channels {
template Out operator()(const T& in1, const T& in2) const {
return Out((in2-in1)/2);
}
};
template
void x_gradient(const SrcView& src, const DstView& dst) {
typedef typename DstView::channel_t dst_channel_t;
for (int y=0; y<src.height(); ++y) {
typename SrcView::x_iterator src_it = src.row_begin(y);
typename DstView::x_iterator dst_it = dst.row_begin(y);
for (int x=1; x());
}
}
}
int main(int argc, unsigned char* argv[])
{
char winName[]="srcImg";
cvNamedWindow( winName, 1 );
IplImage *piplimg;
#if 1
piplimg=cvLoadImage( "test.jpg", 0 );
cvShowImage( winName, piplimg );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
typedef interleaved_ptr gray8_interleaved_ptr;
typedef type_from_x_iterator::view_t gray8_interleaved_view_t;
gray8_interleaved_view_t gray_view=interleaved_view(piplimg->widthStep ,piplimg->height,
gray8_interleaved_ptr(
reinterpret_cast(piplimg->imageData)
),
sizeof(unsigned char)*piplimg->widthStep
);
iplimage_wrapper iplwrapgray1(piplimg->widthStep ,piplimg->height);
std::copy(gray_view.begin(),gray_view.end(),iplwrapgray1.begin());
cvShowImage( winName, iplwrapgray1.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
x_gradient(gray_view,((gray8_interleaved_view_t)iplwrapgray1));
cvShowImage( winName, iplwrapgray1.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
gray8_interleaved_view_t gray_view1=interleaved_view(iplwrapgray1.width() ,iplwrapgray1.height(),
gray8_interleaved_ptr(
reinterpret_cast(iplwrapgray1.pIplImage->imageData)
),
sizeof(unsigned char)* iplwrapgray1.pIplImage->widthStep);
std::copy(gray_view.begin(),gray_view.end(),gray_view1.begin());
cvShowImage( winName, iplwrapgray1.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
x_gradient(gray_view,gray_view1);
cvShowImage( winName, iplwrapgray1.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
gray8_interleaved_view_t gray_sub_view=subimage_view(gray_view, 20,30, 40,40);
iplimage_wrapper iplwrapgray2(40 ,40);
std::copy(gray_sub_view.begin(),gray_sub_view.end(),iplwrapgray2.begin());
cvShowImage( winName, iplwrapgray2.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
gray8_interleaved_view_t gray_view2=interleaved_view(iplwrapgray2.width() ,iplwrapgray2.height(),
gray8_interleaved_ptr(
reinterpret_cast(iplwrapgray2.pIplImage->imageData)
),
sizeof(unsigned char)* iplwrapgray2.pIplImage->widthStep);
std::copy(gray_sub_view.begin(),gray_sub_view.end(),gray_view2.begin());
cvShowImage( winName, iplwrapgray2.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
cvReleaseImage( &piplimg );
#endif
piplimg=cvLoadImage( "test.jpg");
cvShowImage( winName, piplimg );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
typedef interleaved_ptr bgr8_interleaved_ptr;
typedef type_from_x_iterator::view_t bgr8_interleaved_view_t;
bgr8_interleaved_view_t bgr_view=interleaved_view(piplimg->widthStep/3 ,piplimg->height,
bgr8_interleaved_ptr(
reinterpret_cast(piplimg->imageData)
),
sizeof(unsigned char)*piplimg->widthStep
);
iplimage_wrapper iplwrapbgr1(piplimg->widthStep/3 ,piplimg->height);
std::copy(bgr_view.begin(),bgr_view.end(),iplwrapbgr1.begin());
cvShowImage( winName, iplwrapbgr1.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
x_gradient(bgr_view,((bgr8_interleaved_view_t)iplwrapbgr1));
cvShowImage( winName, iplwrapbgr1.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
bgr8_interleaved_view_t bgr_sub_view=subimage_view(bgr_view, 20,30, 40,40);
iplimage_wrapper iplwrapbgr2(40 ,40);
std::copy(bgr_sub_view.begin(),bgr_sub_view.end(),iplwrapbgr2.begin());
cvShowImage( winName, iplwrapbgr2.pIplImage );
std::cout << "Wait Key Input" << std::endl;
cvWaitKey(0);
cvReleaseImage( &piplimg );
return 0;
}
|
|
|
|

|
and plz add
---------------------------------
/************************************************************************/
/* */
/* Copyright 2006-2007 by Hirotaka Niitsuma */
/* */
/* */
/* This file is part of the STLLCV computer vision library. */
/* ( Version 0.7, 2006-10-31 ) */
/* You may use, modify, and distribute this software according */
/* to the terms stated in the LICENSE file included in */
/* the STLLCV distribution. */
/* */
/* The STLLCV Website is */
/* http://www2s.biglobe.ne.jp/~niitsuma/STLLCV/ */
/* Please direct questions, bug reports, and contributions to */
/* niitsuma@mub.biglobe.ne.jp */
/* */
/* THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
/* */
/************************************************************************/
|
|
|
|

|
Boost community will accept GIL( http://opensource.adobe.com/gil/ ) instead of vigra.
http://lists.boost.org/Archives/boost/2006/10/112316.php
>Having said that, I must say that I like Vigra a lot but I won't reject GIL
>on the ground of the elements in Vigra which can be considered to be better
>or which are missing in GIL.
>However, I do think that if GIL is accepted, it would be invaluable if
>Ullrich could bring in all his expertise and experience into the GIL team,
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
STL like template based coding with the MMX/SSE extension using OpenCV, vigra, and boost.
| Type | Article |
| Licence | |
| First Posted | 30 Oct 2005 |
| Views | 88,012 |
| Bookmarked | 42 times |
|
|