projects
/
opencv
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update the trunk to the OpenCV's CVS (2008-07-14)
[opencv]
/
cxcore
/
include
/
cxcore.hpp
diff --git
a/cxcore/include/cxcore.hpp
b/cxcore/include/cxcore.hpp
index
e9d9021
..
03ce128
100644
(file)
--- a/
cxcore/include/cxcore.hpp
+++ b/
cxcore/include/cxcore.hpp
@@
-85,7
+85,10
@@
public:
void create( CvSize size, int depth, int channels )
{
void create( CvSize size, int depth, int channels )
{
- attach( cvCreateImage( size, depth, channels ));
+ if( !image || !refcount ||
+ image->width != size.width || image->height != size.height ||
+ image->depth != depth || image->nChannels != channels )
+ attach( cvCreateImage( size, depth, channels ));
}
void release() { detach(); }
}
void release() { detach(); }
@@
-258,7
+261,10
@@
public:
void create( int rows, int cols, int type )
{
void create( int rows, int cols, int type )
{
- set( cvCreateMat( rows, cols, type ), false );
+ if( !matrix || !matrix->refcount ||
+ matrix->rows != rows || matrix->cols != cols ||
+ CV_MAT_TYPE(matrix->type) != type )
+ set( cvCreateMat( rows, cols, type ), false );
}
void addref() const
}
void addref() const