Merge branch 'master' of https://github.com/Itseez/opencv
This commit is contained in:
commit
040409aac5
@ -659,7 +659,7 @@ if(HAVE_CUDA)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cufft_LIBRARY})
|
||||
endif()
|
||||
foreach(p ${CUDA_LIBS_PATH})
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} -L${p})
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CMAKE_LIBRARY_PATH_FLAG}${p})
|
||||
endforeach()
|
||||
endif()
|
||||
# ----------------------------------------------------------------------------
|
||||
|
@ -84,14 +84,10 @@ macro(ocv_check_environment_variables)
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(ocv_path_join result_var P1 P2)
|
||||
string(REGEX REPLACE "^[/]+" "" P2 "${P2}")
|
||||
if("${P1}" STREQUAL "")
|
||||
if("${P2}" STREQUAL "")
|
||||
set(${result_var} ".")
|
||||
else()
|
||||
set(${result_var} "${P2}")
|
||||
endif()
|
||||
macro(ocv_path_join result_var P1 P2_)
|
||||
string(REGEX REPLACE "^[/]+" "" P2 "${P2_}")
|
||||
if("${P1}" STREQUAL "" OR "${P1}" STREQUAL ".")
|
||||
set(${result_var} "${P2}")
|
||||
elseif("${P1}" STREQUAL "/")
|
||||
set(${result_var} "/${P2}")
|
||||
elseif("${P2}" STREQUAL "")
|
||||
@ -99,6 +95,11 @@ macro(ocv_path_join result_var P1 P2)
|
||||
else()
|
||||
set(${result_var} "${P1}/${P2}")
|
||||
endif()
|
||||
string(REGEX REPLACE "([/\\]?)[\\.][/\\]" "\\1" ${result_var} "${${result_var}}")
|
||||
if("${${result_var}}" STREQUAL "")
|
||||
set(${result_var} ".")
|
||||
endif()
|
||||
#message(STATUS "'${P1}' '${P2_}' => '${${result_var}}'")
|
||||
endmacro()
|
||||
|
||||
# rename modules target to world if needed
|
||||
|
@ -61,7 +61,7 @@ class PatternMaker:
|
||||
|
||||
def save(self):
|
||||
c = canvas(self.g,width="%d%s"%(self.width,self.units),height="%d%s"%(self.height,self.units),viewBox="0 0 %d %d"%(self.width,self.height))
|
||||
c.inkview(self.output)
|
||||
c.save(self.output)
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -89,6 +89,8 @@ the extension of the opened file, ".xml" for XML files and ".yml" or ".yaml" for
|
||||
*/
|
||||
typedef struct CvFileStorage CvFileStorage;
|
||||
typedef struct CvFileNode CvFileNode;
|
||||
typedef struct CvMat CvMat;
|
||||
typedef struct CvMatND CvMatND;
|
||||
|
||||
//! @} core_c
|
||||
|
||||
@ -1238,6 +1240,17 @@ inline String::String(const FileNode& fn): cstr_(0), len_(0) { read(fn, *this, *
|
||||
|
||||
//! @endcond
|
||||
|
||||
|
||||
CV_EXPORTS void cvStartWriteRawData_Base64(::CvFileStorage * fs, const char* name, int len, const char* dt);
|
||||
|
||||
CV_EXPORTS void cvWriteRawData_Base64(::CvFileStorage * fs, const void* _data, int len);
|
||||
|
||||
CV_EXPORTS void cvEndWriteRawData_Base64(::CvFileStorage * fs);
|
||||
|
||||
CV_EXPORTS void cvWriteMat_Base64(::CvFileStorage* fs, const char* name, const ::CvMat* mat);
|
||||
|
||||
CV_EXPORTS void cvWriteMatND_Base64(::CvFileStorage* fs, const char* name, const ::CvMatND* mat);
|
||||
|
||||
} // cv
|
||||
|
||||
#endif // __OPENCV_CORE_PERSISTENCE_HPP__
|
||||
#endif // __OPENCV_CORE_PERSISTENCE_HPP__
|
@ -231,7 +231,11 @@ public:
|
||||
//! conversion to another data type
|
||||
template<typename _Tp2> operator Point3_<_Tp2>() const;
|
||||
//! conversion to cv::Vec<>
|
||||
#if OPENCV_ABI_COMPATIBILITY > 300
|
||||
template<typename _Tp2> operator Vec<_Tp2, 3>() const;
|
||||
#else
|
||||
operator Vec<_Tp, 3>() const;
|
||||
#endif
|
||||
|
||||
//! dot product
|
||||
_Tp dot(const Point3_& pt) const;
|
||||
@ -1326,11 +1330,19 @@ Point3_<_Tp>::operator Point3_<_Tp2>() const
|
||||
return Point3_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y), saturate_cast<_Tp2>(z));
|
||||
}
|
||||
|
||||
#if OPENCV_ABI_COMPATIBILITY > 300
|
||||
template<typename _Tp> template<typename _Tp2> inline
|
||||
Point3_<_Tp>::operator Vec<_Tp2, 3>() const
|
||||
{
|
||||
return Vec<_Tp2, 3>(x, y, z);
|
||||
}
|
||||
#else
|
||||
template<typename _Tp> inline
|
||||
Point3_<_Tp>::operator Vec<_Tp, 3>() const
|
||||
{
|
||||
return Vec<_Tp, 3>(x, y, z);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point3_<_Tp>& Point3_<_Tp>::operator = (const Point3_& pt)
|
||||
|
@ -817,10 +817,10 @@ AutoBuffer<_Tp, fixed_size>::allocate(size_t _size)
|
||||
return;
|
||||
}
|
||||
deallocate();
|
||||
sz = _size;
|
||||
if(_size > fixed_size)
|
||||
{
|
||||
ptr = new _Tp[_size];
|
||||
sz = _size;
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -574,6 +574,153 @@ TEST(Core_InputOutput, FileStorageKey)
|
||||
EXPECT_NO_THROW(f << "key1" << "value1");
|
||||
EXPECT_NO_THROW(f << "_key2" << "value2");
|
||||
EXPECT_NO_THROW(f << "key_3" << "value3");
|
||||
const std::string expected = "%YAML:1.0\nkey1: value1\n_key2: value2\nkey_3: value3\n";
|
||||
const std::string expected = "%YAML 1.0\n---\nkey1: value1\n_key2: value2\nkey_3: value3\n";
|
||||
ASSERT_STREQ(f.releaseAndGetString().c_str(), expected.c_str());
|
||||
}
|
||||
|
||||
TEST(Core_InputOutput, filestorage_yml_compatibility)
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
|
||||
class CV_Base64IOTest : public cvtest::BaseTest
|
||||
{
|
||||
private:
|
||||
std::string file_name;
|
||||
|
||||
struct data_t
|
||||
{
|
||||
uchar u1, u2;
|
||||
int i1, i2, i3;
|
||||
double d1, d2;
|
||||
int i4;
|
||||
};
|
||||
|
||||
public:
|
||||
CV_Base64IOTest(std::string const & test_file_name)
|
||||
: file_name(test_file_name) {}
|
||||
~CV_Base64IOTest() {}
|
||||
protected:
|
||||
void run(int)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::vector<data_t> rawdata;
|
||||
|
||||
cv::Mat _em_out, _em_in;
|
||||
cv::Mat _2d_out, _2d_in;
|
||||
cv::Mat _nd_out, _nd_in;
|
||||
|
||||
{ /* init */
|
||||
|
||||
/* normal mat */
|
||||
_2d_out = cv::Mat(100, 100, CV_8UC3, cvScalar(1U, 2U, 127U));
|
||||
for (int i = 0; i < _2d_out.rows; ++i)
|
||||
for (int j = 0; j < _2d_out.cols; ++j)
|
||||
_2d_out.at<cv::Vec3b>(i, j)[1] = (i + j) % 256;
|
||||
|
||||
/* 4d mat */
|
||||
const int Size[] = {4, 4, 4, 4};
|
||||
cv::Mat _4d(4, Size, CV_64FC4, cvScalar(0.888, 0.111, 0.666, 0.444));
|
||||
const cv::Range ranges[] = {
|
||||
cv::Range(0, 2),
|
||||
cv::Range(0, 2),
|
||||
cv::Range(1, 2),
|
||||
cv::Range(0, 2) };
|
||||
_nd_out = _4d(ranges);
|
||||
|
||||
/* raw data */
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
data_t tmp;
|
||||
tmp.u1 = 1;
|
||||
tmp.u2 = 2;
|
||||
tmp.i1 = 1;
|
||||
tmp.i2 = 2;
|
||||
tmp.i3 = 3;
|
||||
tmp.d1 = 0.1;
|
||||
tmp.d2 = 0.2;
|
||||
tmp.i4 = i;
|
||||
rawdata.push_back(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
{ /* write */
|
||||
cv::FileStorage fs(file_name, cv::FileStorage::WRITE);
|
||||
CvMat holder = _2d_out;
|
||||
cv::cvWriteMat_Base64(*fs, "normal_2d_mat", &holder);
|
||||
CvMatND holder_nd = _nd_out;
|
||||
cv::cvWriteMatND_Base64(*fs, "normal_nd_mat", &holder_nd);
|
||||
holder = _em_out;
|
||||
cv::cvWriteMat_Base64(*fs, "empty_2d_mat", &holder);
|
||||
|
||||
cv::cvStartWriteRawData_Base64(*fs, "rawdata", static_cast<int>(rawdata.size()), "2u3i2di");
|
||||
for (int i = 0; i < 10; i++)
|
||||
cv::cvWriteRawData_Base64(*fs, rawdata.data() + i * 100, 100);
|
||||
cv::cvEndWriteRawData_Base64(*fs);
|
||||
|
||||
fs.release();
|
||||
}
|
||||
|
||||
{ /* read */
|
||||
cv::FileStorage fs(file_name, cv::FileStorage::READ);
|
||||
|
||||
/* mat */
|
||||
fs["empty_2d_mat"] >> _em_in;
|
||||
fs["normal_2d_mat"] >> _2d_in;
|
||||
fs["normal_nd_mat"] >> _nd_in;
|
||||
|
||||
/* raw data */
|
||||
std::vector<data_t>(1000).swap(rawdata);
|
||||
cvReadRawData(*fs, fs["rawdata"].node, rawdata.data(), "2u3i2di");
|
||||
|
||||
fs.release();
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
// TODO: Solve this bug in `cvReadRawData`
|
||||
//EXPECT_EQ(rawdata[i].u1, 1);
|
||||
//EXPECT_EQ(rawdata[i].u2, 2);
|
||||
//EXPECT_EQ(rawdata[i].i1, 1);
|
||||
//EXPECT_EQ(rawdata[i].i2, 2);
|
||||
//EXPECT_EQ(rawdata[i].i3, 3);
|
||||
//EXPECT_EQ(rawdata[i].d1, 0.1);
|
||||
//EXPECT_EQ(rawdata[i].d2, 0.2);
|
||||
//EXPECT_EQ(rawdata[i].i4, i);
|
||||
}
|
||||
|
||||
EXPECT_EQ(_em_in.rows , _em_out.rows);
|
||||
EXPECT_EQ(_em_in.cols , _em_out.cols);
|
||||
EXPECT_EQ(_em_in.dims , _em_out.dims);
|
||||
EXPECT_EQ(_em_in.depth(), _em_out.depth());
|
||||
EXPECT_TRUE(_em_in.empty());
|
||||
|
||||
EXPECT_EQ(_2d_in.rows , _2d_in.rows);
|
||||
EXPECT_EQ(_2d_in.cols , _2d_in.cols);
|
||||
EXPECT_EQ(_2d_in.dims , _2d_in.dims);
|
||||
EXPECT_EQ(_2d_in.depth(), _2d_in.depth());
|
||||
for(int i = 0; i < _2d_in.rows; ++i)
|
||||
for (int j = 0; j < _2d_in.cols; ++j)
|
||||
EXPECT_EQ(_2d_in.at<cv::Vec3b>(i, j), _2d_out.at<cv::Vec3b>(i, j));
|
||||
|
||||
EXPECT_EQ(_nd_in.rows , _nd_in.rows);
|
||||
EXPECT_EQ(_nd_in.cols , _nd_in.cols);
|
||||
EXPECT_EQ(_nd_in.dims , _nd_in.dims);
|
||||
EXPECT_EQ(_nd_in.depth(), _nd_in.depth());
|
||||
EXPECT_EQ(cv::countNonZero(cv::mean(_nd_in != _nd_out)), 0);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TEST(Core_InputOutput, filestorage_yml_base64)
|
||||
{
|
||||
CV_Base64IOTest test("base64_test_tmp_file.yml"); test.safe_run();
|
||||
}
|
||||
|
||||
TEST(Core_InputOutput, filestorage_xml_base64)
|
||||
{
|
||||
CV_Base64IOTest test("base64_test_tmp_file.xml"); test.safe_run();
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ TEST(CommandLineParser, testFailure)
|
||||
parser.get<bool>("h");
|
||||
EXPECT_FALSE(parser.check());
|
||||
}
|
||||
|
||||
TEST(CommandLineParser, testHas_noValues)
|
||||
{
|
||||
const char* argv[] = {"<bin>", "-h", "--info"};
|
||||
@ -218,4 +219,17 @@ TEST(CommandLineParser, positional_regression_5074_equal_sign)
|
||||
EXPECT_TRUE(parser.check());
|
||||
}
|
||||
|
||||
|
||||
TEST(AutoBuffer, allocate_test)
|
||||
{
|
||||
AutoBuffer<int, 5> abuf(2);
|
||||
EXPECT_EQ(2, abuf.size());
|
||||
|
||||
abuf.allocate(4);
|
||||
EXPECT_EQ(4, abuf.size());
|
||||
|
||||
abuf.allocate(6);
|
||||
EXPECT_EQ(6, abuf.size());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -84,7 +84,7 @@ enum ImwriteFlags {
|
||||
IMWRITE_JPEG_RST_INTERVAL = 4, //!< JPEG restart interval, 0 - 65535, default is 0 - no restart.
|
||||
IMWRITE_JPEG_LUMA_QUALITY = 5, //!< Separate luma quality level, 0 - 100, default is 0 - don't use.
|
||||
IMWRITE_JPEG_CHROMA_QUALITY = 6, //!< Separate chroma quality level, 0 - 100, default is 0 - don't use.
|
||||
IMWRITE_PNG_COMPRESSION = 16, //!< For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer compression time. Default value is 3.
|
||||
IMWRITE_PNG_COMPRESSION = 16, //!< For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer compression time. Default value is 3. Also strategy is changed to IMWRITE_PNG_STRATEGY_DEFAULT (Z_DEFAULT_STRATEGY).
|
||||
IMWRITE_PNG_STRATEGY = 17, //!< One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_DEFAULT.
|
||||
IMWRITE_PNG_BILEVEL = 18, //!< Binary level PNG, 0 or 1, default is 0.
|
||||
IMWRITE_PXM_BINARY = 32, //!< For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1.
|
||||
|
@ -370,22 +370,23 @@ bool PngEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
}
|
||||
|
||||
int compression_level = -1; // Invalid value to allow setting 0-9 as valid
|
||||
int compression_strategy = Z_RLE; // Default strategy
|
||||
int compression_strategy = IMWRITE_PNG_STRATEGY_RLE; // Default strategy
|
||||
bool isBilevel = false;
|
||||
|
||||
for( size_t i = 0; i < params.size(); i += 2 )
|
||||
{
|
||||
if( params[i] == CV_IMWRITE_PNG_COMPRESSION )
|
||||
if( params[i] == IMWRITE_PNG_COMPRESSION )
|
||||
{
|
||||
compression_strategy = IMWRITE_PNG_STRATEGY_DEFAULT; // Default strategy
|
||||
compression_level = params[i+1];
|
||||
compression_level = MIN(MAX(compression_level, 0), Z_BEST_COMPRESSION);
|
||||
}
|
||||
if( params[i] == CV_IMWRITE_PNG_STRATEGY )
|
||||
if( params[i] == IMWRITE_PNG_STRATEGY )
|
||||
{
|
||||
compression_strategy = params[i+1];
|
||||
compression_strategy = MIN(MAX(compression_strategy, 0), Z_FIXED);
|
||||
}
|
||||
if( params[i] == CV_IMWRITE_PNG_BILEVEL )
|
||||
if( params[i] == IMWRITE_PNG_BILEVEL )
|
||||
{
|
||||
isBilevel = params[i+1] != 0;
|
||||
}
|
||||
|
@ -229,6 +229,8 @@ struct ColumnSum<int, uchar> :
|
||||
|
||||
#if CV_SSE2
|
||||
bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2);
|
||||
#elif CV_NEON
|
||||
bool haveNEON = checkHardwareSupport(CV_CPU_NEON);
|
||||
#endif
|
||||
|
||||
if( width != (int)sum.size() )
|
||||
@ -256,8 +258,11 @@ struct ColumnSum<int, uchar> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
if(haveNEON)
|
||||
{
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
}
|
||||
#endif
|
||||
for( ; i < width; i++ )
|
||||
SUM[i] += Sp[i];
|
||||
@ -303,20 +308,23 @@ struct ColumnSum<int, uchar> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-8; i+=8 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-8; i+=8 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
|
||||
uint32x4_t v_s0d = cv_vrndq_u32_f32(vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
uint32x4_t v_s01d = cv_vrndq_u32_f32(vmulq_f32(vcvtq_f32_s32(v_s01), v_scale));
|
||||
uint32x4_t v_s0d = cv_vrndq_u32_f32(vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
uint32x4_t v_s01d = cv_vrndq_u32_f32(vmulq_f32(vcvtq_f32_s32(v_s01), v_scale));
|
||||
|
||||
uint16x8_t v_dst = vcombine_u16(vqmovn_u32(v_s0d), vqmovn_u32(v_s01d));
|
||||
vst1_u8(D + i, vqmovn_u16(v_dst));
|
||||
uint16x8_t v_dst = vcombine_u16(vqmovn_u32(v_s0d), vqmovn_u32(v_s01d));
|
||||
vst1_u8(D + i, vqmovn_u16(v_dst));
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
for( ; i < width; i++ )
|
||||
@ -351,16 +359,19 @@ struct ColumnSum<int, uchar> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width-8; i+=8 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
for( ; i <= width-8; i+=8 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
|
||||
uint16x8_t v_dst = vcombine_u16(vqmovun_s32(v_s0), vqmovun_s32(v_s01));
|
||||
vst1_u8(D + i, vqmovn_u16(v_dst));
|
||||
uint16x8_t v_dst = vcombine_u16(vqmovun_s32(v_s0), vqmovun_s32(v_s01));
|
||||
vst1_u8(D + i, vqmovn_u16(v_dst));
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -404,6 +415,8 @@ struct ColumnSum<int, short> :
|
||||
|
||||
#if CV_SSE2
|
||||
bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2);
|
||||
#elif CV_NEON
|
||||
bool haveNEON = checkHardwareSupport(CV_CPU_NEON);
|
||||
#endif
|
||||
|
||||
if( width != (int)sum.size() )
|
||||
@ -411,6 +424,7 @@ struct ColumnSum<int, short> :
|
||||
sum.resize(width);
|
||||
sumCount = 0;
|
||||
}
|
||||
|
||||
SUM = &sum[0];
|
||||
if( sumCount == 0 )
|
||||
{
|
||||
@ -430,8 +444,11 @@ struct ColumnSum<int, short> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
if(haveNEON)
|
||||
{
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
}
|
||||
#endif
|
||||
for( ; i < width; i++ )
|
||||
SUM[i] += Sp[i];
|
||||
@ -475,18 +492,21 @@ struct ColumnSum<int, short> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-8; i+=8 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-8; i+=8 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
|
||||
int32x4_t v_s0d = cv_vrndq_s32_f32(vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
int32x4_t v_s01d = cv_vrndq_s32_f32(vmulq_f32(vcvtq_f32_s32(v_s01), v_scale));
|
||||
vst1q_s16(D + i, vcombine_s16(vqmovn_s32(v_s0d), vqmovn_s32(v_s01d)));
|
||||
int32x4_t v_s0d = cv_vrndq_s32_f32(vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
int32x4_t v_s01d = cv_vrndq_s32_f32(vmulq_f32(vcvtq_f32_s32(v_s01), v_scale));
|
||||
vst1q_s16(D + i, vcombine_s16(vqmovn_s32(v_s0d), vqmovn_s32(v_s01d)));
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
for( ; i < width; i++ )
|
||||
@ -520,15 +540,18 @@ struct ColumnSum<int, short> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width-8; i+=8 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
for( ; i <= width-8; i+=8 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
|
||||
vst1q_s16(D + i, vcombine_s16(vqmovn_s32(v_s0), vqmovn_s32(v_s01)));
|
||||
vst1q_s16(D + i, vcombine_s16(vqmovn_s32(v_s0), vqmovn_s32(v_s01)));
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -570,8 +593,11 @@ struct ColumnSum<int, ushort> :
|
||||
int* SUM;
|
||||
bool haveScale = scale != 1;
|
||||
double _scale = scale;
|
||||
|
||||
#if CV_SSE2
|
||||
bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2);
|
||||
bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2);
|
||||
#elif CV_NEON
|
||||
bool haveNEON = checkHardwareSupport(CV_CPU_NEON);
|
||||
#endif
|
||||
|
||||
if( width != (int)sum.size() )
|
||||
@ -579,6 +605,7 @@ struct ColumnSum<int, ushort> :
|
||||
sum.resize(width);
|
||||
sumCount = 0;
|
||||
}
|
||||
|
||||
SUM = &sum[0];
|
||||
if( sumCount == 0 )
|
||||
{
|
||||
@ -590,16 +617,19 @@ struct ColumnSum<int, ushort> :
|
||||
#if CV_SSE2
|
||||
if(haveSSE2)
|
||||
{
|
||||
for( ; i < width-4; i+=4 )
|
||||
for( ; i <= width-4; i+=4 )
|
||||
{
|
||||
__m128i _sum = _mm_loadu_si128((const __m128i*)(SUM+i));
|
||||
__m128i _sp = _mm_loadu_si128((const __m128i*)(Sp+i));
|
||||
_mm_storeu_si128((__m128i*)(SUM+i), _mm_add_epi32(_sum, _sp));
|
||||
_mm_storeu_si128((__m128i*)(SUM+i),_mm_add_epi32(_sum, _sp));
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
if(haveNEON)
|
||||
{
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
}
|
||||
#endif
|
||||
for( ; i < width; i++ )
|
||||
SUM[i] += Sp[i];
|
||||
@ -642,18 +672,21 @@ struct ColumnSum<int, ushort> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-8; i+=8 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-8; i+=8 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
|
||||
uint32x4_t v_s0d = cv_vrndq_u32_f32(vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
uint32x4_t v_s01d = cv_vrndq_u32_f32(vmulq_f32(vcvtq_f32_s32(v_s01), v_scale));
|
||||
vst1q_u16(D + i, vcombine_u16(vqmovn_u32(v_s0d), vqmovn_u32(v_s01d)));
|
||||
uint32x4_t v_s0d = cv_vrndq_u32_f32(vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
uint32x4_t v_s01d = cv_vrndq_u32_f32(vmulq_f32(vcvtq_f32_s32(v_s01), v_scale));
|
||||
vst1q_u16(D + i, vcombine_u16(vqmovn_u32(v_s0d), vqmovn_u32(v_s01d)));
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
for( ; i < width; i++ )
|
||||
@ -686,15 +719,18 @@ struct ColumnSum<int, ushort> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width-8; i+=8 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
for( ; i <= width-8; i+=8 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
|
||||
vst1q_u16(D + i, vcombine_u16(vqmovun_s32(v_s0), vqmovun_s32(v_s01)));
|
||||
vst1q_u16(D + i, vcombine_u16(vqmovun_s32(v_s0), vqmovun_s32(v_s01)));
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -738,6 +774,8 @@ struct ColumnSum<int, int> :
|
||||
|
||||
#if CV_SSE2
|
||||
bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2);
|
||||
#elif CV_NEON
|
||||
bool haveNEON = checkHardwareSupport(CV_CPU_NEON);
|
||||
#endif
|
||||
|
||||
if( width != (int)sum.size() )
|
||||
@ -745,6 +783,7 @@ struct ColumnSum<int, int> :
|
||||
sum.resize(width);
|
||||
sumCount = 0;
|
||||
}
|
||||
|
||||
SUM = &sum[0];
|
||||
if( sumCount == 0 )
|
||||
{
|
||||
@ -764,8 +803,11 @@ struct ColumnSum<int, int> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
if(haveNEON)
|
||||
{
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
}
|
||||
#endif
|
||||
for( ; i < width; i++ )
|
||||
SUM[i] += Sp[i];
|
||||
@ -803,15 +845,18 @@ struct ColumnSum<int, int> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-4; i+=4 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-4; i+=4 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
|
||||
int32x4_t v_s0d = cv_vrndq_s32_f32(vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
vst1q_s32(D + i, v_s0d);
|
||||
int32x4_t v_s0d = cv_vrndq_s32_f32(vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
vst1q_s32(D + i, v_s0d);
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
for( ; i < width; i++ )
|
||||
@ -838,12 +883,15 @@ struct ColumnSum<int, int> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width-4; i+=4 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
for( ; i <= width-4; i+=4 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
|
||||
vst1q_s32(D + i, v_s0);
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(D + i, v_s0);
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -887,7 +935,9 @@ struct ColumnSum<int, float> :
|
||||
double _scale = scale;
|
||||
|
||||
#if CV_SSE2
|
||||
bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2);
|
||||
bool haveSSE2 = checkHardwareSupport(CV_CPU_SSE2);
|
||||
#elif CV_NEON
|
||||
bool haveNEON = checkHardwareSupport(CV_CPU_NEON);
|
||||
#endif
|
||||
|
||||
if( width != (int)sum.size() )
|
||||
@ -899,26 +949,27 @@ struct ColumnSum<int, float> :
|
||||
SUM = &sum[0];
|
||||
if( sumCount == 0 )
|
||||
{
|
||||
memset((void *)SUM, 0, sizeof(int) * width);
|
||||
|
||||
memset((void*)SUM, 0, width*sizeof(int));
|
||||
for( ; sumCount < ksize - 1; sumCount++, src++ )
|
||||
{
|
||||
const int* Sp = (const int*)src[0];
|
||||
i = 0;
|
||||
|
||||
#if CV_SSE2
|
||||
if(haveSSE2)
|
||||
{
|
||||
for( ; i < width-4; i+=4 )
|
||||
for( ; i <= width-4; i+=4 )
|
||||
{
|
||||
__m128i _sum = _mm_loadu_si128((const __m128i*)(SUM+i));
|
||||
__m128i _sp = _mm_loadu_si128((const __m128i*)(Sp+i));
|
||||
_mm_storeu_si128((__m128i*)(SUM+i), _mm_add_epi32(_sum, _sp));
|
||||
_mm_storeu_si128((__m128i*)(SUM+i),_mm_add_epi32(_sum, _sp));
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
if(haveNEON)
|
||||
{
|
||||
for( ; i <= width - 4; i+=4 )
|
||||
vst1q_s32(SUM + i, vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i)));
|
||||
}
|
||||
#endif
|
||||
|
||||
for( ; i < width; i++ )
|
||||
@ -956,17 +1007,20 @@ struct ColumnSum<int, float> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-8; i+=8 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
float32x4_t v_scale = vdupq_n_f32((float)_scale);
|
||||
for( ; i <= width-8; i+=8 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
|
||||
vst1q_f32(D + i, vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
vst1q_f32(D + i + 4, vmulq_f32(vcvtq_f32_s32(v_s01), v_scale));
|
||||
vst1q_f32(D + i, vmulq_f32(vcvtq_f32_s32(v_s0), v_scale));
|
||||
vst1q_f32(D + i + 4, vmulq_f32(vcvtq_f32_s32(v_s01), v_scale));
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -995,16 +1049,19 @@ struct ColumnSum<int, float> :
|
||||
}
|
||||
}
|
||||
#elif CV_NEON
|
||||
for( ; i <= width-8; i+=8 )
|
||||
if(haveNEON)
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
for( ; i <= width-8; i+=8 )
|
||||
{
|
||||
int32x4_t v_s0 = vaddq_s32(vld1q_s32(SUM + i), vld1q_s32(Sp + i));
|
||||
int32x4_t v_s01 = vaddq_s32(vld1q_s32(SUM + i + 4), vld1q_s32(Sp + i + 4));
|
||||
|
||||
vst1q_f32(D + i, vcvtq_f32_s32(v_s0));
|
||||
vst1q_f32(D + i + 4, vcvtq_f32_s32(v_s01));
|
||||
vst1q_f32(D + i, vcvtq_f32_s32(v_s0));
|
||||
vst1q_f32(D + i + 4, vcvtq_f32_s32(v_s01));
|
||||
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
vst1q_s32(SUM + i, vsubq_s32(v_s0, vld1q_s32(Sm + i)));
|
||||
vst1q_s32(SUM + i + 4, vsubq_s32(v_s01, vld1q_s32(Sm + i + 4)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1268,6 +1268,52 @@ static PyObject *pycvCreateTrackbar(PyObject*, PyObject *args)
|
||||
ERRWRAP2(createTrackbar(trackbar_name, window_name, value, count, OnChange, Py_BuildValue("OO", on_change, Py_None)));
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static void OnButtonChange(int state, void *param)
|
||||
{
|
||||
PyGILState_STATE gstate;
|
||||
gstate = PyGILState_Ensure();
|
||||
|
||||
PyObject *o = (PyObject*)param;
|
||||
PyObject *args;
|
||||
if(PyTuple_GetItem(o, 1) != NULL)
|
||||
{
|
||||
args = Py_BuildValue("(iO)", state, PyTuple_GetItem(o,1));
|
||||
}
|
||||
else
|
||||
{
|
||||
args = Py_BuildValue("(i)", state);
|
||||
}
|
||||
|
||||
PyObject *r = PyObject_Call(PyTuple_GetItem(o, 0), args, NULL);
|
||||
if (r == NULL)
|
||||
PyErr_Print();
|
||||
Py_DECREF(args);
|
||||
PyGILState_Release(gstate);
|
||||
}
|
||||
|
||||
static PyObject *pycvCreateButton(PyObject*, PyObject *args, PyObject *kw)
|
||||
{
|
||||
const char* keywords[] = {"buttonName", "onChange", "userData", "buttonType", "initialButtonState", NULL};
|
||||
PyObject *on_change;
|
||||
PyObject *userdata = NULL;
|
||||
char* button_name;
|
||||
int button_type = 0;
|
||||
bool initial_button_state = false;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|Oii", (char**)keywords, &button_name, &on_change, &userdata, &button_type, &initial_button_state))
|
||||
return NULL;
|
||||
if (!PyCallable_Check(on_change)) {
|
||||
PyErr_SetString(PyExc_TypeError, "onChange must be callable");
|
||||
return NULL;
|
||||
}
|
||||
if (userdata == NULL) {
|
||||
userdata = Py_None;
|
||||
}
|
||||
|
||||
ERRWRAP2(createButton(button_name, OnButtonChange, Py_BuildValue("OO", on_change, userdata), button_type, initial_button_state));
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1300,6 +1346,7 @@ static int convert_to_char(PyObject *o, char *dst, const char *name = "no_name")
|
||||
static PyMethodDef special_methods[] = {
|
||||
#ifdef HAVE_OPENCV_HIGHGUI
|
||||
{"createTrackbar", pycvCreateTrackbar, METH_VARARGS, "createTrackbar(trackbarName, windowName, value, count, onChange) -> None"},
|
||||
{"createButton", (PyCFunction)pycvCreateButton, METH_VARARGS | METH_KEYWORDS, "createButton(buttonName, onChange [, userData, buttonType, initialButtonState]) -> None"},
|
||||
{"setMouseCallback", (PyCFunction)pycvSetMouseCallback, METH_VARARGS | METH_KEYWORDS, "setMouseCallback(windowName, onMouse [, param]) -> None"},
|
||||
#endif
|
||||
{NULL, NULL},
|
||||
|
@ -65,60 +65,71 @@ namespace cv
|
||||
//! @addtogroup videoio
|
||||
//! @{
|
||||
|
||||
// Camera API
|
||||
enum { CAP_ANY = 0, // autodetect
|
||||
CAP_VFW = 200, // platform native
|
||||
CAP_V4L = 200,
|
||||
CAP_V4L2 = CAP_V4L,
|
||||
CAP_FIREWARE = 300, // IEEE 1394 drivers
|
||||
CAP_FIREWIRE = CAP_FIREWARE,
|
||||
CAP_IEEE1394 = CAP_FIREWARE,
|
||||
CAP_DC1394 = CAP_FIREWARE,
|
||||
CAP_CMU1394 = CAP_FIREWARE,
|
||||
CAP_QT = 500, // QuickTime
|
||||
CAP_UNICAP = 600, // Unicap drivers
|
||||
CAP_DSHOW = 700, // DirectShow (via videoInput)
|
||||
CAP_PVAPI = 800, // PvAPI, Prosilica GigE SDK
|
||||
CAP_OPENNI = 900, // OpenNI (for Kinect)
|
||||
CAP_OPENNI_ASUS = 910, // OpenNI (for Asus Xtion)
|
||||
CAP_ANDROID = 1000, // Android - not used
|
||||
CAP_XIAPI = 1100, // XIMEA Camera API
|
||||
CAP_AVFOUNDATION = 1200, // AVFoundation framework for iOS (OS X Lion will have the same API)
|
||||
CAP_GIGANETIX = 1300, // Smartek Giganetix GigEVisionSDK
|
||||
CAP_MSMF = 1400, // Microsoft Media Foundation (via videoInput)
|
||||
CAP_WINRT = 1410, // Microsoft Windows Runtime using Media Foundation
|
||||
CAP_INTELPERC = 1500, // Intel Perceptual Computing SDK
|
||||
CAP_OPENNI2 = 1600, // OpenNI2 (for Kinect)
|
||||
CAP_OPENNI2_ASUS = 1610, // OpenNI2 (for Asus Xtion and Occipital Structure sensors)
|
||||
CAP_GPHOTO2 = 1700, // gPhoto2 connection
|
||||
CAP_GSTREAMER = 1800, // GStreamer
|
||||
CAP_FFMPEG = 1900, // FFMPEG
|
||||
CAP_IMAGES = 2000 // OpenCV Image Sequence (e.g. img_%02d.jpg)
|
||||
/** @brief Capture API backends.
|
||||
|
||||
Select preferred API for a capture object.
|
||||
To be used in the constructor VideoCapture::VideoCapture or VideoCapture::open
|
||||
|
||||
@note Backends are available only if they have been built with your OpenCV binaries.<br>
|
||||
Check in <tt>cvconfig.h</tt> to know which APIs are currently available (e.g. <tt>HAVE_MSMF, HAVE_VFW, HAVE_LIBV4L</tt>).
|
||||
To enable/disable APIs, you have to:
|
||||
1. re-configure OpenCV using the appropriates CMake switches
|
||||
(e.g. <tt>-DWITH_MSMF=ON -DWITH_VFW=ON ... </tt>) or checking related switch in cmake-gui
|
||||
2. rebuild OpenCV itself
|
||||
*/
|
||||
enum { CAP_ANY = 0, //!< Auto detect
|
||||
CAP_VFW = 200, //!< Video For Windows (platform native)
|
||||
CAP_V4L = 200, //!< V4L/V4L2 capturing support via libv4l
|
||||
CAP_V4L2 = CAP_V4L, //!< Same as CAP_V4L
|
||||
CAP_FIREWIRE = 300, //!< IEEE 1394 drivers
|
||||
CAP_FIREWARE = CAP_FIREWIRE, //!< Same as CAP_FIREWIRE
|
||||
CAP_IEEE1394 = CAP_FIREWIRE, //!< Same as CAP_FIREWIRE
|
||||
CAP_DC1394 = CAP_FIREWIRE, //!< Same as CAP_FIREWIRE
|
||||
CAP_CMU1394 = CAP_FIREWIRE, //!< Same as CAP_FIREWIRE
|
||||
CAP_QT = 500, //!< QuickTime
|
||||
CAP_UNICAP = 600, //!< Unicap drivers
|
||||
CAP_DSHOW = 700, //!< DirectShow (via videoInput)
|
||||
CAP_PVAPI = 800, //!< PvAPI, Prosilica GigE SDK
|
||||
CAP_OPENNI = 900, //!< OpenNI (for Kinect)
|
||||
CAP_OPENNI_ASUS = 910, //!< OpenNI (for Asus Xtion)
|
||||
CAP_ANDROID = 1000, //!< Android - not used
|
||||
CAP_XIAPI = 1100, //!< XIMEA Camera API
|
||||
CAP_AVFOUNDATION = 1200, //!< AVFoundation framework for iOS (OS X Lion will have the same API)
|
||||
CAP_GIGANETIX = 1300, //!< Smartek Giganetix GigEVisionSDK
|
||||
CAP_MSMF = 1400, //!< Microsoft Media Foundation (via videoInput)
|
||||
CAP_WINRT = 1410, //!< Microsoft Windows Runtime using Media Foundation
|
||||
CAP_INTELPERC = 1500, //!< Intel Perceptual Computing SDK
|
||||
CAP_OPENNI2 = 1600, //!< OpenNI2 (for Kinect)
|
||||
CAP_OPENNI2_ASUS = 1610, //!< OpenNI2 (for Asus Xtion and Occipital Structure sensors)
|
||||
CAP_GPHOTO2 = 1700, //!< gPhoto2 connection
|
||||
CAP_GSTREAMER = 1800, //!< GStreamer
|
||||
CAP_FFMPEG = 1900, //!< FFMPEG
|
||||
CAP_IMAGES = 2000 //!< OpenCV Image Sequence (e.g. img_%02d.jpg)
|
||||
};
|
||||
|
||||
// generic properties (based on DC1394 properties)
|
||||
enum { CAP_PROP_POS_MSEC =0,
|
||||
CAP_PROP_POS_FRAMES =1,
|
||||
CAP_PROP_POS_AVI_RATIO =2,
|
||||
CAP_PROP_FRAME_WIDTH =3,
|
||||
CAP_PROP_FRAME_HEIGHT =4,
|
||||
CAP_PROP_FPS =5,
|
||||
CAP_PROP_FOURCC =6,
|
||||
CAP_PROP_FRAME_COUNT =7,
|
||||
CAP_PROP_FORMAT =8,
|
||||
CAP_PROP_MODE =9,
|
||||
CAP_PROP_BRIGHTNESS =10,
|
||||
CAP_PROP_CONTRAST =11,
|
||||
CAP_PROP_SATURATION =12,
|
||||
CAP_PROP_HUE =13,
|
||||
CAP_PROP_GAIN =14,
|
||||
CAP_PROP_EXPOSURE =15,
|
||||
CAP_PROP_CONVERT_RGB =16,
|
||||
CAP_PROP_WHITE_BALANCE_BLUE_U =17,
|
||||
CAP_PROP_RECTIFICATION =18,
|
||||
//! generic properties (based on DC1394 properties)
|
||||
enum { CAP_PROP_POS_MSEC =0, //!< Current position of the video file in milliseconds.
|
||||
CAP_PROP_POS_FRAMES =1, //!< 0-based index of the frame to be decoded/captured next.
|
||||
CAP_PROP_POS_AVI_RATIO =2, //!< Relative position of the video file: 0=start of the film, 1=end of the film.
|
||||
CAP_PROP_FRAME_WIDTH =3, //!< Width of the frames in the video stream.
|
||||
CAP_PROP_FRAME_HEIGHT =4, //!< Height of the frames in the video stream.
|
||||
CAP_PROP_FPS =5, //!< Frame rate.
|
||||
CAP_PROP_FOURCC =6, //!< 4-character code of codec. see VideoWriter::fourcc .
|
||||
CAP_PROP_FRAME_COUNT =7, //!< Number of frames in the video file.
|
||||
CAP_PROP_FORMAT =8, //!< Format of the %Mat objects returned by VideoCapture::retrieve().
|
||||
CAP_PROP_MODE =9, //!< Backend-specific value indicating the current capture mode.
|
||||
CAP_PROP_BRIGHTNESS =10, //!< Brightness of the image (only for cameras).
|
||||
CAP_PROP_CONTRAST =11, //!< Contrast of the image (only for cameras).
|
||||
CAP_PROP_SATURATION =12, //!< Saturation of the image (only for cameras).
|
||||
CAP_PROP_HUE =13, //!< Hue of the image (only for cameras).
|
||||
CAP_PROP_GAIN =14, //!< Gain of the image (only for cameras).
|
||||
CAP_PROP_EXPOSURE =15, //!< Exposure (only for cameras).
|
||||
CAP_PROP_CONVERT_RGB =16, //!< Boolean flags indicating whether images should be converted to RGB.
|
||||
CAP_PROP_WHITE_BALANCE_BLUE_U =17, //!< Currently unsupported.
|
||||
CAP_PROP_RECTIFICATION =18, //!< Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently).
|
||||
CAP_PROP_MONOCHROME =19,
|
||||
CAP_PROP_SHARPNESS =20,
|
||||
CAP_PROP_AUTO_EXPOSURE =21, // DC1394: exposure control done by camera, user can adjust refernce level using this feature
|
||||
CAP_PROP_AUTO_EXPOSURE =21, //!< DC1394: exposure control done by camera, user can adjust reference level using this feature.
|
||||
CAP_PROP_GAMMA =22,
|
||||
CAP_PROP_TEMPERATURE =23,
|
||||
CAP_PROP_TRIGGER =24,
|
||||
@ -139,40 +150,43 @@ enum { CAP_PROP_POS_MSEC =0,
|
||||
};
|
||||
|
||||
|
||||
// Generic camera output modes.
|
||||
// Currently, these are supported through the libv4l interface only.
|
||||
enum { CAP_MODE_BGR = 0, // BGR24 (default)
|
||||
CAP_MODE_RGB = 1, // RGB24
|
||||
CAP_MODE_GRAY = 2, // Y8
|
||||
CAP_MODE_YUYV = 3 // YUYV
|
||||
//! @brief Generic camera output modes.
|
||||
//! @note Currently, these are supported through the libv4l interface only.
|
||||
enum { CAP_MODE_BGR = 0, //!< BGR24 (default)
|
||||
CAP_MODE_RGB = 1, //!< RGB24
|
||||
CAP_MODE_GRAY = 2, //!< Y8
|
||||
CAP_MODE_YUYV = 3 //!< YUYV
|
||||
};
|
||||
|
||||
|
||||
// DC1394 only
|
||||
// modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
|
||||
// every feature can have only one mode turned on at a time
|
||||
enum { CAP_PROP_DC1394_OFF = -4, //turn the feature off (not controlled manually nor automatically)
|
||||
CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user
|
||||
/** @brief DC1394 only
|
||||
|
||||
modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
|
||||
every feature can have only one mode turned on at a time
|
||||
*/
|
||||
enum { CAP_PROP_DC1394_OFF = -4, //!< turn the feature off (not controlled manually nor automatically).
|
||||
CAP_PROP_DC1394_MODE_MANUAL = -3, //!< set automatically when a value of the feature is set by the user.
|
||||
CAP_PROP_DC1394_MODE_AUTO = -2,
|
||||
CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,
|
||||
CAP_PROP_DC1394_MAX = 31
|
||||
};
|
||||
|
||||
|
||||
// OpenNI map generators
|
||||
//! OpenNI map generators
|
||||
enum { CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,
|
||||
CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,
|
||||
CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR
|
||||
CAP_OPENNI_IR_GENERATOR = 1 << 29,
|
||||
CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR + CAP_OPENNI_IR_GENERATOR
|
||||
};
|
||||
|
||||
// Properties of cameras available through OpenNI interfaces
|
||||
//! Properties of cameras available through OpenNI interfaces
|
||||
enum { CAP_PROP_OPENNI_OUTPUT_MODE = 100,
|
||||
CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm
|
||||
CAP_PROP_OPENNI_BASELINE = 102, // in mm
|
||||
CAP_PROP_OPENNI_FOCAL_LENGTH = 103, // in pixels
|
||||
CAP_PROP_OPENNI_REGISTRATION = 104, // flag that synchronizes the remapping depth map to image map
|
||||
// by changing depth generator's view point (if the flag is "on") or
|
||||
// sets this view point to its normal one (if the flag is "off").
|
||||
CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, //!< In mm
|
||||
CAP_PROP_OPENNI_BASELINE = 102, //!< In mm
|
||||
CAP_PROP_OPENNI_FOCAL_LENGTH = 103, //!< In pixels
|
||||
CAP_PROP_OPENNI_REGISTRATION = 104, //!< Flag that synchronizes the remapping depth map to image map
|
||||
//!< by changing depth generator's view point (if the flag is "on") or
|
||||
//!< sets this view point to its normal one (if the flag is "off").
|
||||
CAP_PROP_OPENNI_REGISTRATION_ON = CAP_PROP_OPENNI_REGISTRATION,
|
||||
CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,
|
||||
CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106,
|
||||
@ -183,28 +197,31 @@ enum { CAP_PROP_OPENNI_OUTPUT_MODE = 100,
|
||||
CAP_PROP_OPENNI2_MIRROR = 111
|
||||
};
|
||||
|
||||
// OpenNI shortcats
|
||||
//! OpenNI shortcuts
|
||||
enum { CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
|
||||
CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE,
|
||||
CAP_OPENNI_DEPTH_GENERATOR_PRESENT = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
|
||||
CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE,
|
||||
CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH,
|
||||
CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION,
|
||||
CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION
|
||||
CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,
|
||||
CAP_OPENNI_IR_GENERATOR_PRESENT = CAP_OPENNI_IR_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
|
||||
};
|
||||
|
||||
// OpenNI data given from depth generator
|
||||
enum { CAP_OPENNI_DEPTH_MAP = 0, // Depth values in mm (CV_16UC1)
|
||||
CAP_OPENNI_POINT_CLOUD_MAP = 1, // XYZ in meters (CV_32FC3)
|
||||
CAP_OPENNI_DISPARITY_MAP = 2, // Disparity in pixels (CV_8UC1)
|
||||
CAP_OPENNI_DISPARITY_MAP_32F = 3, // Disparity in pixels (CV_32FC1)
|
||||
CAP_OPENNI_VALID_DEPTH_MASK = 4, // CV_8UC1
|
||||
//! OpenNI data given from depth generator
|
||||
enum { CAP_OPENNI_DEPTH_MAP = 0, //!< Depth values in mm (CV_16UC1)
|
||||
CAP_OPENNI_POINT_CLOUD_MAP = 1, //!< XYZ in meters (CV_32FC3)
|
||||
CAP_OPENNI_DISPARITY_MAP = 2, //!< Disparity in pixels (CV_8UC1)
|
||||
CAP_OPENNI_DISPARITY_MAP_32F = 3, //!< Disparity in pixels (CV_32FC1)
|
||||
CAP_OPENNI_VALID_DEPTH_MASK = 4, //!< CV_8UC1
|
||||
|
||||
// Data given from RGB image generator
|
||||
CAP_OPENNI_BGR_IMAGE = 5,
|
||||
CAP_OPENNI_GRAY_IMAGE = 6
|
||||
CAP_OPENNI_BGR_IMAGE = 5, //!< Data given from RGB image generator
|
||||
CAP_OPENNI_GRAY_IMAGE = 6, //!< Data given from RGB image generator
|
||||
|
||||
CAP_OPENNI_IR_IMAGE = 7 //!< Data given from IR image generator
|
||||
};
|
||||
|
||||
// Supported output modes of OpenNI image generator
|
||||
//! Supported output modes of OpenNI image generator
|
||||
enum { CAP_OPENNI_VGA_30HZ = 0,
|
||||
CAP_OPENNI_SXGA_15HZ = 1,
|
||||
CAP_OPENNI_SXGA_30HZ = 2,
|
||||
@ -213,202 +230,202 @@ enum { CAP_OPENNI_VGA_30HZ = 0,
|
||||
};
|
||||
|
||||
|
||||
// GStreamer
|
||||
enum { CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200 // default is 1
|
||||
//! GStreamer
|
||||
enum { CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200 //!< Default is 1
|
||||
};
|
||||
|
||||
|
||||
// PVAPI
|
||||
enum { CAP_PROP_PVAPI_MULTICASTIP = 300, // ip for anable multicast master mode. 0 for disable multicast
|
||||
CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, // FrameStartTriggerMode: Determines how a frame is initiated
|
||||
CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, // Horizontal sub-sampling of the image
|
||||
CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, // Vertical sub-sampling of the image
|
||||
CAP_PROP_PVAPI_BINNINGX = 304, // Horizontal binning factor
|
||||
CAP_PROP_PVAPI_BINNINGY = 305, // Vertical binning factor
|
||||
CAP_PROP_PVAPI_PIXELFORMAT = 306 // Pixel format
|
||||
//! PVAPI
|
||||
enum { CAP_PROP_PVAPI_MULTICASTIP = 300, //!< IP for enable multicast master mode. 0 for disable multicast.
|
||||
CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, //!< FrameStartTriggerMode: Determines how a frame is initiated.
|
||||
CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, //!< Horizontal sub-sampling of the image.
|
||||
CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, //!< Vertical sub-sampling of the image.
|
||||
CAP_PROP_PVAPI_BINNINGX = 304, //!< Horizontal binning factor.
|
||||
CAP_PROP_PVAPI_BINNINGY = 305, //!< Vertical binning factor.
|
||||
CAP_PROP_PVAPI_PIXELFORMAT = 306 //!< Pixel format.
|
||||
};
|
||||
|
||||
// PVAPI: FrameStartTriggerMode
|
||||
enum { CAP_PVAPI_FSTRIGMODE_FREERUN = 0, // Freerun
|
||||
CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1, // SyncIn1
|
||||
CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2, // SyncIn2
|
||||
CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3, // FixedRate
|
||||
CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4 // Software
|
||||
//! PVAPI: FrameStartTriggerMode
|
||||
enum { CAP_PVAPI_FSTRIGMODE_FREERUN = 0, //!< Freerun
|
||||
CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1, //!< SyncIn1
|
||||
CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2, //!< SyncIn2
|
||||
CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3, //!< FixedRate
|
||||
CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4 //!< Software
|
||||
};
|
||||
|
||||
// PVAPI: DecimationHorizontal, DecimationVertical
|
||||
enum { CAP_PVAPI_DECIMATION_OFF = 1, // Off
|
||||
CAP_PVAPI_DECIMATION_2OUTOF4 = 2, // 2 out of 4 decimation
|
||||
CAP_PVAPI_DECIMATION_2OUTOF8 = 4, // 2 out of 8 decimation
|
||||
CAP_PVAPI_DECIMATION_2OUTOF16 = 8 // 2 out of 16 decimation
|
||||
//! PVAPI: DecimationHorizontal, DecimationVertical
|
||||
enum { CAP_PVAPI_DECIMATION_OFF = 1, //!< Off
|
||||
CAP_PVAPI_DECIMATION_2OUTOF4 = 2, //!< 2 out of 4 decimation
|
||||
CAP_PVAPI_DECIMATION_2OUTOF8 = 4, //!< 2 out of 8 decimation
|
||||
CAP_PVAPI_DECIMATION_2OUTOF16 = 8 //!< 2 out of 16 decimation
|
||||
};
|
||||
|
||||
// PVAPI: PixelFormat
|
||||
enum { CAP_PVAPI_PIXELFORMAT_MONO8 = 1, // Mono8
|
||||
CAP_PVAPI_PIXELFORMAT_MONO16 = 2, // Mono16
|
||||
CAP_PVAPI_PIXELFORMAT_BAYER8 = 3, // Bayer8
|
||||
CAP_PVAPI_PIXELFORMAT_BAYER16 = 4, // Bayer16
|
||||
CAP_PVAPI_PIXELFORMAT_RGB24 = 5, // Rgb24
|
||||
CAP_PVAPI_PIXELFORMAT_BGR24 = 6, // Bgr24
|
||||
CAP_PVAPI_PIXELFORMAT_RGBA32 = 7, // Rgba32
|
||||
CAP_PVAPI_PIXELFORMAT_BGRA32 = 8, // Bgra32
|
||||
//! PVAPI: PixelFormat
|
||||
enum { CAP_PVAPI_PIXELFORMAT_MONO8 = 1, //!< Mono8
|
||||
CAP_PVAPI_PIXELFORMAT_MONO16 = 2, //!< Mono16
|
||||
CAP_PVAPI_PIXELFORMAT_BAYER8 = 3, //!< Bayer8
|
||||
CAP_PVAPI_PIXELFORMAT_BAYER16 = 4, //!< Bayer16
|
||||
CAP_PVAPI_PIXELFORMAT_RGB24 = 5, //!< Rgb24
|
||||
CAP_PVAPI_PIXELFORMAT_BGR24 = 6, //!< Bgr24
|
||||
CAP_PVAPI_PIXELFORMAT_RGBA32 = 7, //!< Rgba32
|
||||
CAP_PVAPI_PIXELFORMAT_BGRA32 = 8, //!< Bgra32
|
||||
};
|
||||
|
||||
// Properties of cameras available through XIMEA SDK interface
|
||||
enum { CAP_PROP_XI_DOWNSAMPLING = 400, // Change image resolution by binning or skipping.
|
||||
CAP_PROP_XI_DATA_FORMAT = 401, // Output data format.
|
||||
CAP_PROP_XI_OFFSET_X = 402, // Horizontal offset from the origin to the area of interest (in pixels).
|
||||
CAP_PROP_XI_OFFSET_Y = 403, // Vertical offset from the origin to the area of interest (in pixels).
|
||||
CAP_PROP_XI_TRG_SOURCE = 404, // Defines source of trigger.
|
||||
CAP_PROP_XI_TRG_SOFTWARE = 405, // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
|
||||
CAP_PROP_XI_GPI_SELECTOR = 406, // Selects general purpose input
|
||||
CAP_PROP_XI_GPI_MODE = 407, // Set general purpose input mode
|
||||
CAP_PROP_XI_GPI_LEVEL = 408, // Get general purpose level
|
||||
CAP_PROP_XI_GPO_SELECTOR = 409, // Selects general purpose output
|
||||
CAP_PROP_XI_GPO_MODE = 410, // Set general purpose output mode
|
||||
CAP_PROP_XI_LED_SELECTOR = 411, // Selects camera signalling LED
|
||||
CAP_PROP_XI_LED_MODE = 412, // Define camera signalling LED functionality
|
||||
CAP_PROP_XI_MANUAL_WB = 413, // Calculates White Balance(must be called during acquisition)
|
||||
CAP_PROP_XI_AUTO_WB = 414, // Automatic white balance
|
||||
CAP_PROP_XI_AEAG = 415, // Automatic exposure/gain
|
||||
CAP_PROP_XI_EXP_PRIORITY = 416, // Exposure priority (0.5 - exposure 50%, gain 50%).
|
||||
CAP_PROP_XI_AE_MAX_LIMIT = 417, // Maximum limit of exposure in AEAG procedure
|
||||
CAP_PROP_XI_AG_MAX_LIMIT = 418, // Maximum limit of gain in AEAG procedure
|
||||
CAP_PROP_XI_AEAG_LEVEL = 419, // Average intensity of output signal AEAG should achieve(in %)
|
||||
CAP_PROP_XI_TIMEOUT = 420, // Image capture timeout in milliseconds
|
||||
CAP_PROP_XI_EXPOSURE = 421, // Exposure time in microseconds
|
||||
CAP_PROP_XI_EXPOSURE_BURST_COUNT = 422, // Sets the number of times of exposure in one frame.
|
||||
CAP_PROP_XI_GAIN_SELECTOR = 423, // Gain selector for parameter Gain allows to select different type of gains.
|
||||
CAP_PROP_XI_GAIN = 424, // Gain in dB
|
||||
CAP_PROP_XI_DOWNSAMPLING_TYPE = 426, // Change image downsampling type.
|
||||
CAP_PROP_XI_BINNING_SELECTOR = 427, // Binning engine selector.
|
||||
CAP_PROP_XI_BINNING_VERTICAL = 428, // Vertical Binning - number of vertical photo-sensitive cells to combine together.
|
||||
CAP_PROP_XI_BINNING_HORIZONTAL = 429, // Horizontal Binning - number of horizontal photo-sensitive cells to combine together.
|
||||
CAP_PROP_XI_BINNING_PATTERN = 430, // Binning pattern type.
|
||||
CAP_PROP_XI_DECIMATION_SELECTOR = 431, // Decimation engine selector.
|
||||
CAP_PROP_XI_DECIMATION_VERTICAL = 432, // Vertical Decimation - vertical sub-sampling of the image - reduces the vertical resolution of the image by the specified vertical decimation factor.
|
||||
CAP_PROP_XI_DECIMATION_HORIZONTAL = 433, // Horizontal Decimation - horizontal sub-sampling of the image - reduces the horizontal resolution of the image by the specified vertical decimation factor.
|
||||
CAP_PROP_XI_DECIMATION_PATTERN = 434, // Decimation pattern type.
|
||||
CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR = 587, // Selects which test pattern generator is controlled by the TestPattern feature.
|
||||
CAP_PROP_XI_TEST_PATTERN = 588, // Selects which test pattern type is generated by the selected generator.
|
||||
CAP_PROP_XI_IMAGE_DATA_FORMAT = 435, // Output data format.
|
||||
CAP_PROP_XI_SHUTTER_TYPE = 436, // Change sensor shutter type(CMOS sensor).
|
||||
CAP_PROP_XI_SENSOR_TAPS = 437, // Number of taps
|
||||
CAP_PROP_XI_AEAG_ROI_OFFSET_X = 439, // Automatic exposure/gain ROI offset X
|
||||
CAP_PROP_XI_AEAG_ROI_OFFSET_Y = 440, // Automatic exposure/gain ROI offset Y
|
||||
CAP_PROP_XI_AEAG_ROI_WIDTH = 441, // Automatic exposure/gain ROI Width
|
||||
CAP_PROP_XI_AEAG_ROI_HEIGHT = 442, // Automatic exposure/gain ROI Height
|
||||
CAP_PROP_XI_BPC = 445, // Correction of bad pixels
|
||||
CAP_PROP_XI_WB_KR = 448, // White balance red coefficient
|
||||
CAP_PROP_XI_WB_KG = 449, // White balance green coefficient
|
||||
CAP_PROP_XI_WB_KB = 450, // White balance blue coefficient
|
||||
CAP_PROP_XI_WIDTH = 451, // Width of the Image provided by the device (in pixels).
|
||||
CAP_PROP_XI_HEIGHT = 452, // Height of the Image provided by the device (in pixels).
|
||||
CAP_PROP_XI_REGION_SELECTOR = 589, // Selects Region in Multiple ROI which parameters are set by width, height, ... ,region mode
|
||||
CAP_PROP_XI_REGION_MODE = 595, // Activates/deactivates Region selected by Region Selector
|
||||
CAP_PROP_XI_LIMIT_BANDWIDTH = 459, // Set/get bandwidth(datarate)(in Megabits)
|
||||
CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH = 460, // Sensor output data bit depth.
|
||||
CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH = 461, // Device output data bit depth.
|
||||
CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH = 462, // bitdepth of data returned by function xiGetImage
|
||||
CAP_PROP_XI_OUTPUT_DATA_PACKING = 463, // Device output data packing (or grouping) enabled. Packing could be enabled if output_data_bit_depth > 8 and packing capability is available.
|
||||
CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE = 464, // Data packing type. Some cameras supports only specific packing type.
|
||||
CAP_PROP_XI_IS_COOLED = 465, // Returns 1 for cameras that support cooling.
|
||||
CAP_PROP_XI_COOLING = 466, // Start camera cooling.
|
||||
CAP_PROP_XI_TARGET_TEMP = 467, // Set sensor target temperature for cooling.
|
||||
CAP_PROP_XI_CHIP_TEMP = 468, // Camera sensor temperature
|
||||
CAP_PROP_XI_HOUS_TEMP = 469, // Camera housing tepmerature
|
||||
CAP_PROP_XI_HOUS_BACK_SIDE_TEMP = 590, // Camera housing back side tepmerature
|
||||
CAP_PROP_XI_SENSOR_BOARD_TEMP = 596, // Camera sensor board temperature
|
||||
CAP_PROP_XI_CMS = 470, // Mode of color management system.
|
||||
CAP_PROP_XI_APPLY_CMS = 471, // Enable applying of CMS profiles to xiGetImage (see XI_PRM_INPUT_CMS_PROFILE, XI_PRM_OUTPUT_CMS_PROFILE).
|
||||
CAP_PROP_XI_IMAGE_IS_COLOR = 474, // Returns 1 for color cameras.
|
||||
CAP_PROP_XI_COLOR_FILTER_ARRAY = 475, // Returns color filter array type of RAW data.
|
||||
CAP_PROP_XI_GAMMAY = 476, // Luminosity gamma
|
||||
CAP_PROP_XI_GAMMAC = 477, // Chromaticity gamma
|
||||
CAP_PROP_XI_SHARPNESS = 478, // Sharpness Strenght
|
||||
CAP_PROP_XI_CC_MATRIX_00 = 479, // Color Correction Matrix element [0][0]
|
||||
CAP_PROP_XI_CC_MATRIX_01 = 480, // Color Correction Matrix element [0][1]
|
||||
CAP_PROP_XI_CC_MATRIX_02 = 481, // Color Correction Matrix element [0][2]
|
||||
CAP_PROP_XI_CC_MATRIX_03 = 482, // Color Correction Matrix element [0][3]
|
||||
CAP_PROP_XI_CC_MATRIX_10 = 483, // Color Correction Matrix element [1][0]
|
||||
CAP_PROP_XI_CC_MATRIX_11 = 484, // Color Correction Matrix element [1][1]
|
||||
CAP_PROP_XI_CC_MATRIX_12 = 485, // Color Correction Matrix element [1][2]
|
||||
CAP_PROP_XI_CC_MATRIX_13 = 486, // Color Correction Matrix element [1][3]
|
||||
CAP_PROP_XI_CC_MATRIX_20 = 487, // Color Correction Matrix element [2][0]
|
||||
CAP_PROP_XI_CC_MATRIX_21 = 488, // Color Correction Matrix element [2][1]
|
||||
CAP_PROP_XI_CC_MATRIX_22 = 489, // Color Correction Matrix element [2][2]
|
||||
CAP_PROP_XI_CC_MATRIX_23 = 490, // Color Correction Matrix element [2][3]
|
||||
CAP_PROP_XI_CC_MATRIX_30 = 491, // Color Correction Matrix element [3][0]
|
||||
CAP_PROP_XI_CC_MATRIX_31 = 492, // Color Correction Matrix element [3][1]
|
||||
CAP_PROP_XI_CC_MATRIX_32 = 493, // Color Correction Matrix element [3][2]
|
||||
CAP_PROP_XI_CC_MATRIX_33 = 494, // Color Correction Matrix element [3][3]
|
||||
CAP_PROP_XI_DEFAULT_CC_MATRIX = 495, // Set default Color Correction Matrix
|
||||
CAP_PROP_XI_TRG_SELECTOR = 498, // Selects the type of trigger.
|
||||
CAP_PROP_XI_ACQ_FRAME_BURST_COUNT = 499, // Sets number of frames acquired by burst. This burst is used only if trigger is set to FrameBurstStart
|
||||
CAP_PROP_XI_DEBOUNCE_EN = 507, // Enable/Disable debounce to selected GPI
|
||||
CAP_PROP_XI_DEBOUNCE_T0 = 508, // Debounce time (x * 10us)
|
||||
CAP_PROP_XI_DEBOUNCE_T1 = 509, // Debounce time (x * 10us)
|
||||
CAP_PROP_XI_DEBOUNCE_POL = 510, // Debounce polarity (pol = 1 t0 - falling edge, t1 - rising edge)
|
||||
CAP_PROP_XI_LENS_MODE = 511, // Status of lens control interface. This shall be set to XI_ON before any Lens operations.
|
||||
CAP_PROP_XI_LENS_APERTURE_VALUE = 512, // Current lens aperture value in stops. Examples: 2.8, 4, 5.6, 8, 11
|
||||
CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE = 513, // Lens current focus movement value to be used by XI_PRM_LENS_FOCUS_MOVE in motor steps.
|
||||
CAP_PROP_XI_LENS_FOCUS_MOVE = 514, // Moves lens focus motor by steps set in XI_PRM_LENS_FOCUS_MOVEMENT_VALUE.
|
||||
CAP_PROP_XI_LENS_FOCUS_DISTANCE = 515, // Lens focus distance in cm.
|
||||
CAP_PROP_XI_LENS_FOCAL_LENGTH = 516, // Lens focal distance in mm.
|
||||
CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517, // Selects the current feature which is accessible by XI_PRM_LENS_FEATURE.
|
||||
CAP_PROP_XI_LENS_FEATURE = 518, // Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR.
|
||||
CAP_PROP_XI_DEVICE_MODEL_ID = 521, // Return device model id
|
||||
CAP_PROP_XI_DEVICE_SN = 522, // Return device serial number
|
||||
CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529, // The alpha channel of RGB32 output image format.
|
||||
CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530, // Buffer size in bytes sufficient for output image returned by xiGetImage
|
||||
CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531, // Current format of pixels on transport layer.
|
||||
CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ = 532, // Sensor clock frequency in Hz.
|
||||
CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX = 533, // Sensor clock frequency index. Sensor with selected frequencies have possibility to set the frequency only by this index.
|
||||
CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT = 534, // Number of output channels from sensor used for data transfer.
|
||||
CAP_PROP_XI_FRAMERATE = 535, // Define framerate in Hz
|
||||
CAP_PROP_XI_COUNTER_SELECTOR = 536, // Select counter
|
||||
CAP_PROP_XI_COUNTER_VALUE = 537, // Counter status
|
||||
CAP_PROP_XI_ACQ_TIMING_MODE = 538, // Type of sensor frames timing.
|
||||
CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, // Calculate and return available interface bandwidth(int Megabits)
|
||||
CAP_PROP_XI_BUFFER_POLICY = 540, // Data move policy
|
||||
CAP_PROP_XI_LUT_EN = 541, // Activates LUT.
|
||||
CAP_PROP_XI_LUT_INDEX = 542, // Control the index (offset) of the coefficient to access in the LUT.
|
||||
CAP_PROP_XI_LUT_VALUE = 543, // Value at entry LUTIndex of the LUT
|
||||
CAP_PROP_XI_TRG_DELAY = 544, // Specifies the delay in microseconds (us) to apply after the trigger reception before activating it.
|
||||
CAP_PROP_XI_TS_RST_MODE = 545, // Defines how time stamp reset engine will be armed
|
||||
CAP_PROP_XI_TS_RST_SOURCE = 546, // Defines which source will be used for timestamp reset. Writing this parameter will trigger settings of engine (arming)
|
||||
CAP_PROP_XI_IS_DEVICE_EXIST = 547, // Returns 1 if camera connected and works properly.
|
||||
CAP_PROP_XI_ACQ_BUFFER_SIZE = 548, // Acquisition buffer size in buffer_size_unit. Default bytes.
|
||||
CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT = 549, // Acquisition buffer size unit in bytes. Default 1. E.g. Value 1024 means that buffer_size is in KiBytes
|
||||
CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE = 550, // Acquisition transport buffer size in bytes
|
||||
CAP_PROP_XI_BUFFERS_QUEUE_SIZE = 551, // Queue of field/frame buffers
|
||||
CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT = 552, // Number of buffers to commit to low level
|
||||
CAP_PROP_XI_RECENT_FRAME = 553, // GetImage returns most recent frame
|
||||
CAP_PROP_XI_DEVICE_RESET = 554, // Resets the camera to default state.
|
||||
CAP_PROP_XI_COLUMN_FPN_CORRECTION = 555, // Correction of column FPN
|
||||
CAP_PROP_XI_ROW_FPN_CORRECTION = 591, // Correction of row FPN
|
||||
CAP_PROP_XI_SENSOR_MODE = 558, // Current sensor mode. Allows to select sensor mode by one integer. Setting of this parameter affects: image dimensions and downsampling.
|
||||
CAP_PROP_XI_HDR = 559, // Enable High Dynamic Range feature.
|
||||
CAP_PROP_XI_HDR_KNEEPOINT_COUNT = 560, // The number of kneepoints in the PWLR.
|
||||
CAP_PROP_XI_HDR_T1 = 561, // position of first kneepoint(in % of XI_PRM_EXPOSURE)
|
||||
CAP_PROP_XI_HDR_T2 = 562, // position of second kneepoint (in % of XI_PRM_EXPOSURE)
|
||||
CAP_PROP_XI_KNEEPOINT1 = 563, // value of first kneepoint (% of sensor saturation)
|
||||
CAP_PROP_XI_KNEEPOINT2 = 564, // value of second kneepoint (% of sensor saturation)
|
||||
CAP_PROP_XI_IMAGE_BLACK_LEVEL = 565, // Last image black level counts. Can be used for Offline processing to recall it.
|
||||
CAP_PROP_XI_HW_REVISION = 571, // Returns hardware revision number.
|
||||
CAP_PROP_XI_DEBUG_LEVEL = 572, // Set debug level
|
||||
CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION = 573, // Automatic bandwidth calculation,
|
||||
CAP_PROP_XI_FFS_FILE_ID = 594, // File number.
|
||||
CAP_PROP_XI_FFS_FILE_SIZE = 580, // Size of file.
|
||||
CAP_PROP_XI_FREE_FFS_SIZE = 581, // Size of free camera FFS.
|
||||
CAP_PROP_XI_USED_FFS_SIZE = 582, // Size of used camera FFS.
|
||||
CAP_PROP_XI_FFS_ACCESS_KEY = 583, // Setting of key enables file operations on some cameras.
|
||||
CAP_PROP_XI_SENSOR_FEATURE_SELECTOR = 585, // Selects the current feature which is accessible by XI_PRM_SENSOR_FEATURE_VALUE.
|
||||
CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586, // Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR.
|
||||
//! Properties of cameras available through XIMEA SDK interface
|
||||
enum { CAP_PROP_XI_DOWNSAMPLING = 400, //!< Change image resolution by binning or skipping.
|
||||
CAP_PROP_XI_DATA_FORMAT = 401, //!< Output data format.
|
||||
CAP_PROP_XI_OFFSET_X = 402, //!< Horizontal offset from the origin to the area of interest (in pixels).
|
||||
CAP_PROP_XI_OFFSET_Y = 403, //!< Vertical offset from the origin to the area of interest (in pixels).
|
||||
CAP_PROP_XI_TRG_SOURCE = 404, //!< Defines source of trigger.
|
||||
CAP_PROP_XI_TRG_SOFTWARE = 405, //!< Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
|
||||
CAP_PROP_XI_GPI_SELECTOR = 406, //!< Selects general purpose input.
|
||||
CAP_PROP_XI_GPI_MODE = 407, //!< Set general purpose input mode.
|
||||
CAP_PROP_XI_GPI_LEVEL = 408, //!< Get general purpose level.
|
||||
CAP_PROP_XI_GPO_SELECTOR = 409, //!< Selects general purpose output.
|
||||
CAP_PROP_XI_GPO_MODE = 410, //!< Set general purpose output mode.
|
||||
CAP_PROP_XI_LED_SELECTOR = 411, //!< Selects camera signalling LED.
|
||||
CAP_PROP_XI_LED_MODE = 412, //!< Define camera signalling LED functionality.
|
||||
CAP_PROP_XI_MANUAL_WB = 413, //!< Calculates White Balance(must be called during acquisition).
|
||||
CAP_PROP_XI_AUTO_WB = 414, //!< Automatic white balance.
|
||||
CAP_PROP_XI_AEAG = 415, //!< Automatic exposure/gain.
|
||||
CAP_PROP_XI_EXP_PRIORITY = 416, //!< Exposure priority (0.5 - exposure 50%, gain 50%).
|
||||
CAP_PROP_XI_AE_MAX_LIMIT = 417, //!< Maximum limit of exposure in AEAG procedure.
|
||||
CAP_PROP_XI_AG_MAX_LIMIT = 418, //!< Maximum limit of gain in AEAG procedure.
|
||||
CAP_PROP_XI_AEAG_LEVEL = 419, //!< Average intensity of output signal AEAG should achieve(in %).
|
||||
CAP_PROP_XI_TIMEOUT = 420, //!< Image capture timeout in milliseconds.
|
||||
CAP_PROP_XI_EXPOSURE = 421, //!< Exposure time in microseconds.
|
||||
CAP_PROP_XI_EXPOSURE_BURST_COUNT = 422, //!< Sets the number of times of exposure in one frame.
|
||||
CAP_PROP_XI_GAIN_SELECTOR = 423, //!< Gain selector for parameter Gain allows to select different type of gains.
|
||||
CAP_PROP_XI_GAIN = 424, //!< Gain in dB.
|
||||
CAP_PROP_XI_DOWNSAMPLING_TYPE = 426, //!< Change image downsampling type.
|
||||
CAP_PROP_XI_BINNING_SELECTOR = 427, //!< Binning engine selector.
|
||||
CAP_PROP_XI_BINNING_VERTICAL = 428, //!< Vertical Binning - number of vertical photo-sensitive cells to combine together.
|
||||
CAP_PROP_XI_BINNING_HORIZONTAL = 429, //!< Horizontal Binning - number of horizontal photo-sensitive cells to combine together.
|
||||
CAP_PROP_XI_BINNING_PATTERN = 430, //!< Binning pattern type.
|
||||
CAP_PROP_XI_DECIMATION_SELECTOR = 431, //!< Decimation engine selector.
|
||||
CAP_PROP_XI_DECIMATION_VERTICAL = 432, //!< Vertical Decimation - vertical sub-sampling of the image - reduces the vertical resolution of the image by the specified vertical decimation factor.
|
||||
CAP_PROP_XI_DECIMATION_HORIZONTAL = 433, //!< Horizontal Decimation - horizontal sub-sampling of the image - reduces the horizontal resolution of the image by the specified vertical decimation factor.
|
||||
CAP_PROP_XI_DECIMATION_PATTERN = 434, //!< Decimation pattern type.
|
||||
CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR = 587, //!< Selects which test pattern generator is controlled by the TestPattern feature.
|
||||
CAP_PROP_XI_TEST_PATTERN = 588, //!< Selects which test pattern type is generated by the selected generator.
|
||||
CAP_PROP_XI_IMAGE_DATA_FORMAT = 435, //!< Output data format.
|
||||
CAP_PROP_XI_SHUTTER_TYPE = 436, //!< Change sensor shutter type(CMOS sensor).
|
||||
CAP_PROP_XI_SENSOR_TAPS = 437, //!< Number of taps.
|
||||
CAP_PROP_XI_AEAG_ROI_OFFSET_X = 439, //!< Automatic exposure/gain ROI offset X.
|
||||
CAP_PROP_XI_AEAG_ROI_OFFSET_Y = 440, //!< Automatic exposure/gain ROI offset Y.
|
||||
CAP_PROP_XI_AEAG_ROI_WIDTH = 441, //!< Automatic exposure/gain ROI Width.
|
||||
CAP_PROP_XI_AEAG_ROI_HEIGHT = 442, //!< Automatic exposure/gain ROI Height.
|
||||
CAP_PROP_XI_BPC = 445, //!< Correction of bad pixels.
|
||||
CAP_PROP_XI_WB_KR = 448, //!< White balance red coefficient.
|
||||
CAP_PROP_XI_WB_KG = 449, //!< White balance green coefficient.
|
||||
CAP_PROP_XI_WB_KB = 450, //!< White balance blue coefficient.
|
||||
CAP_PROP_XI_WIDTH = 451, //!< Width of the Image provided by the device (in pixels).
|
||||
CAP_PROP_XI_HEIGHT = 452, //!< Height of the Image provided by the device (in pixels).
|
||||
CAP_PROP_XI_REGION_SELECTOR = 589, //!< Selects Region in Multiple ROI which parameters are set by width, height, ... ,region mode.
|
||||
CAP_PROP_XI_REGION_MODE = 595, //!< Activates/deactivates Region selected by Region Selector.
|
||||
CAP_PROP_XI_LIMIT_BANDWIDTH = 459, //!< Set/get bandwidth(datarate)(in Megabits).
|
||||
CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH = 460, //!< Sensor output data bit depth.
|
||||
CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH = 461, //!< Device output data bit depth.
|
||||
CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH = 462, //!< bitdepth of data returned by function xiGetImage.
|
||||
CAP_PROP_XI_OUTPUT_DATA_PACKING = 463, //!< Device output data packing (or grouping) enabled. Packing could be enabled if output_data_bit_depth > 8 and packing capability is available.
|
||||
CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE = 464, //!< Data packing type. Some cameras supports only specific packing type.
|
||||
CAP_PROP_XI_IS_COOLED = 465, //!< Returns 1 for cameras that support cooling.
|
||||
CAP_PROP_XI_COOLING = 466, //!< Start camera cooling.
|
||||
CAP_PROP_XI_TARGET_TEMP = 467, //!< Set sensor target temperature for cooling.
|
||||
CAP_PROP_XI_CHIP_TEMP = 468, //!< Camera sensor temperature.
|
||||
CAP_PROP_XI_HOUS_TEMP = 469, //!< Camera housing temperature.
|
||||
CAP_PROP_XI_HOUS_BACK_SIDE_TEMP = 590, //!< Camera housing back side temperature.
|
||||
CAP_PROP_XI_SENSOR_BOARD_TEMP = 596, //!< Camera sensor board temperature.
|
||||
CAP_PROP_XI_CMS = 470, //!< Mode of color management system.
|
||||
CAP_PROP_XI_APPLY_CMS = 471, //!< Enable applying of CMS profiles to xiGetImage (see XI_PRM_INPUT_CMS_PROFILE, XI_PRM_OUTPUT_CMS_PROFILE).
|
||||
CAP_PROP_XI_IMAGE_IS_COLOR = 474, //!< Returns 1 for color cameras.
|
||||
CAP_PROP_XI_COLOR_FILTER_ARRAY = 475, //!< Returns color filter array type of RAW data.
|
||||
CAP_PROP_XI_GAMMAY = 476, //!< Luminosity gamma.
|
||||
CAP_PROP_XI_GAMMAC = 477, //!< Chromaticity gamma.
|
||||
CAP_PROP_XI_SHARPNESS = 478, //!< Sharpness Strength.
|
||||
CAP_PROP_XI_CC_MATRIX_00 = 479, //!< Color Correction Matrix element [0][0].
|
||||
CAP_PROP_XI_CC_MATRIX_01 = 480, //!< Color Correction Matrix element [0][1].
|
||||
CAP_PROP_XI_CC_MATRIX_02 = 481, //!< Color Correction Matrix element [0][2].
|
||||
CAP_PROP_XI_CC_MATRIX_03 = 482, //!< Color Correction Matrix element [0][3].
|
||||
CAP_PROP_XI_CC_MATRIX_10 = 483, //!< Color Correction Matrix element [1][0].
|
||||
CAP_PROP_XI_CC_MATRIX_11 = 484, //!< Color Correction Matrix element [1][1].
|
||||
CAP_PROP_XI_CC_MATRIX_12 = 485, //!< Color Correction Matrix element [1][2].
|
||||
CAP_PROP_XI_CC_MATRIX_13 = 486, //!< Color Correction Matrix element [1][3].
|
||||
CAP_PROP_XI_CC_MATRIX_20 = 487, //!< Color Correction Matrix element [2][0].
|
||||
CAP_PROP_XI_CC_MATRIX_21 = 488, //!< Color Correction Matrix element [2][1].
|
||||
CAP_PROP_XI_CC_MATRIX_22 = 489, //!< Color Correction Matrix element [2][2].
|
||||
CAP_PROP_XI_CC_MATRIX_23 = 490, //!< Color Correction Matrix element [2][3].
|
||||
CAP_PROP_XI_CC_MATRIX_30 = 491, //!< Color Correction Matrix element [3][0].
|
||||
CAP_PROP_XI_CC_MATRIX_31 = 492, //!< Color Correction Matrix element [3][1].
|
||||
CAP_PROP_XI_CC_MATRIX_32 = 493, //!< Color Correction Matrix element [3][2].
|
||||
CAP_PROP_XI_CC_MATRIX_33 = 494, //!< Color Correction Matrix element [3][3].
|
||||
CAP_PROP_XI_DEFAULT_CC_MATRIX = 495, //!< Set default Color Correction Matrix.
|
||||
CAP_PROP_XI_TRG_SELECTOR = 498, //!< Selects the type of trigger.
|
||||
CAP_PROP_XI_ACQ_FRAME_BURST_COUNT = 499, //!< Sets number of frames acquired by burst. This burst is used only if trigger is set to FrameBurstStart.
|
||||
CAP_PROP_XI_DEBOUNCE_EN = 507, //!< Enable/Disable debounce to selected GPI.
|
||||
CAP_PROP_XI_DEBOUNCE_T0 = 508, //!< Debounce time (x * 10us).
|
||||
CAP_PROP_XI_DEBOUNCE_T1 = 509, //!< Debounce time (x * 10us).
|
||||
CAP_PROP_XI_DEBOUNCE_POL = 510, //!< Debounce polarity (pol = 1 t0 - falling edge, t1 - rising edge).
|
||||
CAP_PROP_XI_LENS_MODE = 511, //!< Status of lens control interface. This shall be set to XI_ON before any Lens operations.
|
||||
CAP_PROP_XI_LENS_APERTURE_VALUE = 512, //!< Current lens aperture value in stops. Examples: 2.8, 4, 5.6, 8, 11.
|
||||
CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE = 513, //!< Lens current focus movement value to be used by XI_PRM_LENS_FOCUS_MOVE in motor steps.
|
||||
CAP_PROP_XI_LENS_FOCUS_MOVE = 514, //!< Moves lens focus motor by steps set in XI_PRM_LENS_FOCUS_MOVEMENT_VALUE.
|
||||
CAP_PROP_XI_LENS_FOCUS_DISTANCE = 515, //!< Lens focus distance in cm.
|
||||
CAP_PROP_XI_LENS_FOCAL_LENGTH = 516, //!< Lens focal distance in mm.
|
||||
CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517, //!< Selects the current feature which is accessible by XI_PRM_LENS_FEATURE.
|
||||
CAP_PROP_XI_LENS_FEATURE = 518, //!< Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR.
|
||||
CAP_PROP_XI_DEVICE_MODEL_ID = 521, //!< Return device model id.
|
||||
CAP_PROP_XI_DEVICE_SN = 522, //!< Return device serial number.
|
||||
CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529, //!< The alpha channel of RGB32 output image format.
|
||||
CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530, //!< Buffer size in bytes sufficient for output image returned by xiGetImage.
|
||||
CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531, //!< Current format of pixels on transport layer.
|
||||
CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ = 532, //!< Sensor clock frequency in Hz.
|
||||
CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX = 533, //!< Sensor clock frequency index. Sensor with selected frequencies have possibility to set the frequency only by this index.
|
||||
CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT = 534, //!< Number of output channels from sensor used for data transfer.
|
||||
CAP_PROP_XI_FRAMERATE = 535, //!< Define framerate in Hz.
|
||||
CAP_PROP_XI_COUNTER_SELECTOR = 536, //!< Select counter.
|
||||
CAP_PROP_XI_COUNTER_VALUE = 537, //!< Counter status.
|
||||
CAP_PROP_XI_ACQ_TIMING_MODE = 538, //!< Type of sensor frames timing.
|
||||
CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, //!< Calculate and return available interface bandwidth(int Megabits).
|
||||
CAP_PROP_XI_BUFFER_POLICY = 540, //!< Data move policy.
|
||||
CAP_PROP_XI_LUT_EN = 541, //!< Activates LUT.
|
||||
CAP_PROP_XI_LUT_INDEX = 542, //!< Control the index (offset) of the coefficient to access in the LUT.
|
||||
CAP_PROP_XI_LUT_VALUE = 543, //!< Value at entry LUTIndex of the LUT.
|
||||
CAP_PROP_XI_TRG_DELAY = 544, //!< Specifies the delay in microseconds (us) to apply after the trigger reception before activating it.
|
||||
CAP_PROP_XI_TS_RST_MODE = 545, //!< Defines how time stamp reset engine will be armed.
|
||||
CAP_PROP_XI_TS_RST_SOURCE = 546, //!< Defines which source will be used for timestamp reset. Writing this parameter will trigger settings of engine (arming).
|
||||
CAP_PROP_XI_IS_DEVICE_EXIST = 547, //!< Returns 1 if camera connected and works properly.
|
||||
CAP_PROP_XI_ACQ_BUFFER_SIZE = 548, //!< Acquisition buffer size in buffer_size_unit. Default bytes.
|
||||
CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT = 549, //!< Acquisition buffer size unit in bytes. Default 1. E.g. Value 1024 means that buffer_size is in KiBytes.
|
||||
CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE = 550, //!< Acquisition transport buffer size in bytes.
|
||||
CAP_PROP_XI_BUFFERS_QUEUE_SIZE = 551, //!< Queue of field/frame buffers.
|
||||
CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT = 552, //!< Number of buffers to commit to low level.
|
||||
CAP_PROP_XI_RECENT_FRAME = 553, //!< GetImage returns most recent frame.
|
||||
CAP_PROP_XI_DEVICE_RESET = 554, //!< Resets the camera to default state.
|
||||
CAP_PROP_XI_COLUMN_FPN_CORRECTION = 555, //!< Correction of column FPN.
|
||||
CAP_PROP_XI_ROW_FPN_CORRECTION = 591, //!< Correction of row FPN.
|
||||
CAP_PROP_XI_SENSOR_MODE = 558, //!< Current sensor mode. Allows to select sensor mode by one integer. Setting of this parameter affects: image dimensions and downsampling.
|
||||
CAP_PROP_XI_HDR = 559, //!< Enable High Dynamic Range feature.
|
||||
CAP_PROP_XI_HDR_KNEEPOINT_COUNT = 560, //!< The number of kneepoints in the PWLR.
|
||||
CAP_PROP_XI_HDR_T1 = 561, //!< Position of first kneepoint(in % of XI_PRM_EXPOSURE).
|
||||
CAP_PROP_XI_HDR_T2 = 562, //!< Position of second kneepoint (in % of XI_PRM_EXPOSURE).
|
||||
CAP_PROP_XI_KNEEPOINT1 = 563, //!< Value of first kneepoint (% of sensor saturation).
|
||||
CAP_PROP_XI_KNEEPOINT2 = 564, //!< Value of second kneepoint (% of sensor saturation).
|
||||
CAP_PROP_XI_IMAGE_BLACK_LEVEL = 565, //!< Last image black level counts. Can be used for Offline processing to recall it.
|
||||
CAP_PROP_XI_HW_REVISION = 571, //!< Returns hardware revision number.
|
||||
CAP_PROP_XI_DEBUG_LEVEL = 572, //!< Set debug level.
|
||||
CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION = 573, //!< Automatic bandwidth calculation.
|
||||
CAP_PROP_XI_FFS_FILE_ID = 594, //!< File number.
|
||||
CAP_PROP_XI_FFS_FILE_SIZE = 580, //!< Size of file.
|
||||
CAP_PROP_XI_FREE_FFS_SIZE = 581, //!< Size of free camera FFS.
|
||||
CAP_PROP_XI_USED_FFS_SIZE = 582, //!< Size of used camera FFS.
|
||||
CAP_PROP_XI_FFS_ACCESS_KEY = 583, //!< Setting of key enables file operations on some cameras.
|
||||
CAP_PROP_XI_SENSOR_FEATURE_SELECTOR = 585, //!< Selects the current feature which is accessible by XI_PRM_SENSOR_FEATURE_VALUE.
|
||||
CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586, //!< Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR.
|
||||
};
|
||||
|
||||
|
||||
// Properties of cameras available through AVFOUNDATION interface
|
||||
//! Properties of cameras available through AVFOUNDATION interface
|
||||
enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001,
|
||||
CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,
|
||||
CAP_PROP_IOS_DEVICE_FLASH = 9003,
|
||||
@ -417,7 +434,7 @@ enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001,
|
||||
};
|
||||
|
||||
|
||||
// Properties of cameras available through Smartek Giganetix Ethernet Vision interface
|
||||
//! Properties of cameras available through Smartek Giganetix Ethernet Vision interface
|
||||
/* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */
|
||||
enum { CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,
|
||||
CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,
|
||||
@ -436,36 +453,39 @@ enum { CAP_PROP_INTELPERC_PROFILE_COUNT = 11001,
|
||||
CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007
|
||||
};
|
||||
|
||||
// Intel PerC streams
|
||||
//! Intel PerC streams
|
||||
enum { CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29,
|
||||
CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28,
|
||||
CAP_INTELPERC_GENERATORS_MASK = CAP_INTELPERC_DEPTH_GENERATOR + CAP_INTELPERC_IMAGE_GENERATOR
|
||||
};
|
||||
|
||||
enum { CAP_INTELPERC_DEPTH_MAP = 0, // Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth.
|
||||
CAP_INTELPERC_UVDEPTH_MAP = 1, // Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates.
|
||||
CAP_INTELPERC_IR_MAP = 2, // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.
|
||||
enum { CAP_INTELPERC_DEPTH_MAP = 0, //!< Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth.
|
||||
CAP_INTELPERC_UVDEPTH_MAP = 1, //!< Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates.
|
||||
CAP_INTELPERC_IR_MAP = 2, //!< Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.
|
||||
CAP_INTELPERC_IMAGE = 3
|
||||
};
|
||||
|
||||
enum { VIDEOWRITER_PROP_QUALITY = 1, // Quality (0..100%) of the videostream encoded
|
||||
VIDEOWRITER_PROP_FRAMEBYTES = 2, // (Read-only): Size of just encoded video frame
|
||||
VIDEOWRITER_PROP_NSTRIPES = 3 // Number of stripes for parallel encoding. -1 for auto detection
|
||||
enum { VIDEOWRITER_PROP_QUALITY = 1, //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.
|
||||
VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
|
||||
VIDEOWRITER_PROP_NSTRIPES = 3 //!< Number of stripes for parallel encoding. -1 for auto detection.
|
||||
};
|
||||
|
||||
// gPhoto2 properties, if propertyId is less than 0 then work on widget with that __additive inversed__ camera setting ID
|
||||
// Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE.
|
||||
// @see CvCaptureCAM_GPHOTO2 for more info
|
||||
enum { CAP_PROP_GPHOTO2_PREVIEW = 17001, // Capture only preview from liveview mode.
|
||||
CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, // Readonly, returns (const char *).
|
||||
CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, // Trigger, only by set. Reload camera settings.
|
||||
CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, // Reload all settings on set.
|
||||
CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, // Collect messages with details.
|
||||
CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, // Readonly, returns (const char *).
|
||||
CAP_PROP_SPEED = 17007, // Exposure speed. Can be readonly, depends on camera program.
|
||||
CAP_PROP_APERTURE = 17008, // Aperture. Can be readonly, depends on camera program.
|
||||
CAP_PROP_EXPOSUREPROGRAM = 17009, // Camera exposure program.
|
||||
CAP_PROP_VIEWFINDER = 17010 // Enter liveview mode.
|
||||
/** @brief gPhoto2 properties
|
||||
|
||||
if propertyId is less than 0 then work on widget with that __additive inversed__ camera setting ID
|
||||
Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE.
|
||||
@see CvCaptureCAM_GPHOTO2 for more info
|
||||
*/
|
||||
enum { CAP_PROP_GPHOTO2_PREVIEW = 17001, //!< Capture only preview from liveview mode.
|
||||
CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, //!< Readonly, returns (const char *).
|
||||
CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, //!< Trigger, only by set. Reload camera settings.
|
||||
CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, //!< Reload all settings on set.
|
||||
CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, //!< Collect messages with details.
|
||||
CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, //!< Readonly, returns (const char *).
|
||||
CAP_PROP_SPEED = 17007, //!< Exposure speed. Can be readonly, depends on camera program.
|
||||
CAP_PROP_APERTURE = 17008, //!< Aperture. Can be readonly, depends on camera program.
|
||||
CAP_PROP_EXPOSUREPROGRAM = 17009, //!< Camera exposure program.
|
||||
CAP_PROP_VIEWFINDER = 17010 //!< Enter liveview mode.
|
||||
};
|
||||
|
||||
//enum {
|
||||
@ -537,13 +557,13 @@ public:
|
||||
img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...)
|
||||
|
||||
@param apiPreference preferred Capture API to use. Can be used to enforce a specific reader
|
||||
implementation if multiple are available: e.g. CAP_FFMPEG or CAP_IMAGES
|
||||
implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES
|
||||
*/
|
||||
CV_WRAP VideoCapture(const String& filename, int apiPreference);
|
||||
|
||||
/** @overload
|
||||
@param index = camera_id + domain_offset (CAP_*). id of the video capturing device to open. If there is a single
|
||||
camera connected, just pass 0. Advanced Usage: to open Camera 1 using the MS Media Foundation API: index = 1 + CAP_MSMF
|
||||
camera connected, just pass 0. Advanced Usage: to open Camera 1 using the MS Media Foundation API: index = 1 + cv::CAP_MSMF
|
||||
*/
|
||||
CV_WRAP VideoCapture(int index);
|
||||
|
||||
@ -560,7 +580,7 @@ public:
|
||||
|
||||
/** @overload
|
||||
@param index = camera_id + domain_offset (CAP_*). id of the video capturing device to open. If there is a single
|
||||
camera connected, just pass 0. Advanced Usage: to open Camera 1 using the MS Media Foundation API: index = 1 + CAP_MSMF
|
||||
camera connected, just pass 0. Advanced Usage: to open Camera 1 using the MS Media Foundation API: index = 1 + cv::CAP_MSMF
|
||||
*/
|
||||
CV_WRAP virtual bool open(int index);
|
||||
|
||||
@ -628,28 +648,26 @@ public:
|
||||
/** @brief Sets a property in the VideoCapture.
|
||||
|
||||
@param propId Property identifier. It can be one of the following:
|
||||
- **CAP_PROP_POS_MSEC** Current position of the video file in milliseconds.
|
||||
- **CAP_PROP_POS_FRAMES** 0-based index of the frame to be decoded/captured next.
|
||||
- **CAP_PROP_POS_AVI_RATIO** Relative position of the video file: 0 - start of the
|
||||
film, 1 - end of the film.
|
||||
- **CAP_PROP_FRAME_WIDTH** Width of the frames in the video stream.
|
||||
- **CAP_PROP_FRAME_HEIGHT** Height of the frames in the video stream.
|
||||
- **CAP_PROP_FPS** Frame rate.
|
||||
- **CAP_PROP_FOURCC** 4-character code of codec.
|
||||
- **CAP_PROP_FRAME_COUNT** Number of frames in the video file.
|
||||
- **CAP_PROP_FORMAT** Format of the Mat objects returned by retrieve() .
|
||||
- **CAP_PROP_MODE** Backend-specific value indicating the current capture mode.
|
||||
- **CAP_PROP_BRIGHTNESS** Brightness of the image (only for cameras).
|
||||
- **CAP_PROP_CONTRAST** Contrast of the image (only for cameras).
|
||||
- **CAP_PROP_SATURATION** Saturation of the image (only for cameras).
|
||||
- **CAP_PROP_HUE** Hue of the image (only for cameras).
|
||||
- **CAP_PROP_GAIN** Gain of the image (only for cameras).
|
||||
- **CAP_PROP_EXPOSURE** Exposure (only for cameras).
|
||||
- **CAP_PROP_CONVERT_RGB** Boolean flags indicating whether images should be converted
|
||||
to RGB.
|
||||
- **CAP_PROP_WHITE_BALANCE** Currently unsupported
|
||||
- **CAP_PROP_RECTIFICATION** Rectification flag for stereo cameras (note: only supported
|
||||
by DC1394 v 2.x backend currently)
|
||||
- cv::CAP_PROP_POS_MSEC @copydoc cv::CAP_PROP_POS_MSEC
|
||||
- cv::CAP_PROP_POS_FRAMES @copydoc CAP_PROP_POS_FRAMES
|
||||
- cv::CAP_PROP_POS_AVI_RATIO @copydoc cv::CAP_PROP_POS_AVI_RATIO
|
||||
- cv::CAP_PROP_FRAME_WIDTH @copydoc cv::CAP_PROP_FRAME_WIDTH
|
||||
- cv::CAP_PROP_FRAME_HEIGHT @copydoc cv::CAP_PROP_FRAME_HEIGHT
|
||||
- cv::CAP_PROP_FPS @copydoc cv::CAP_PROP_FPS
|
||||
- cv::CAP_PROP_FOURCC @copydoc cv::CAP_PROP_FOURCC
|
||||
- cv::CAP_PROP_FRAME_COUNT @copydoc cv::CAP_PROP_FRAME_COUNT
|
||||
- cv::CAP_PROP_FORMAT @copydoc cv::CAP_PROP_FORMAT
|
||||
- cv::CAP_PROP_MODE @copydoc cv::CAP_PROP_MODE
|
||||
- cv::CAP_PROP_BRIGHTNESS @copydoc cv::CAP_PROP_BRIGHTNESS
|
||||
- cv::CAP_PROP_CONTRAST @copydoc cv::CAP_PROP_CONTRAST
|
||||
- cv::CAP_PROP_SATURATION @copydoc cv::CAP_PROP_SATURATION
|
||||
- cv::CAP_PROP_HUE @copydoc cv::CAP_PROP_HUE
|
||||
- cv::CAP_PROP_GAIN @copydoc cv::CAP_PROP_GAIN
|
||||
- cv::CAP_PROP_EXPOSURE @copydoc cv::CAP_PROP_EXPOSURE
|
||||
- cv::CAP_PROP_CONVERT_RGB @copydoc cv::CAP_PROP_CONVERT_RGB
|
||||
- cv::CAP_PROP_WHITE_BALANCE_BLUE_U @copydoc cv::CAP_PROP_WHITE_BALANCE_BLUE_U
|
||||
- cv::CAP_PROP_WHITE_BALANCE_RED_V @copydoc cv::CAP_PROP_WHITE_BALANCE_RED_V
|
||||
- cv::CAP_PROP_RECTIFICATION @copydoc cv::CAP_PROP_RECTIFICATION
|
||||
@param value Value of the property.
|
||||
*/
|
||||
CV_WRAP virtual bool set(int propId, double value);
|
||||
@ -657,29 +675,26 @@ public:
|
||||
/** @brief Returns the specified VideoCapture property
|
||||
|
||||
@param propId Property identifier. It can be one of the following:
|
||||
- **CAP_PROP_POS_MSEC** Current position of the video file in milliseconds or video
|
||||
capture timestamp.
|
||||
- **CAP_PROP_POS_FRAMES** 0-based index of the frame to be decoded/captured next.
|
||||
- **CAP_PROP_POS_AVI_RATIO** Relative position of the video file: 0 - start of the
|
||||
film, 1 - end of the film.
|
||||
- **CAP_PROP_FRAME_WIDTH** Width of the frames in the video stream.
|
||||
- **CAP_PROP_FRAME_HEIGHT** Height of the frames in the video stream.
|
||||
- **CAP_PROP_FPS** Frame rate.
|
||||
- **CAP_PROP_FOURCC** 4-character code of codec.
|
||||
- **CAP_PROP_FRAME_COUNT** Number of frames in the video file.
|
||||
- **CAP_PROP_FORMAT** Format of the Mat objects returned by retrieve() .
|
||||
- **CAP_PROP_MODE** Backend-specific value indicating the current capture mode.
|
||||
- **CAP_PROP_BRIGHTNESS** Brightness of the image (only for cameras).
|
||||
- **CAP_PROP_CONTRAST** Contrast of the image (only for cameras).
|
||||
- **CAP_PROP_SATURATION** Saturation of the image (only for cameras).
|
||||
- **CAP_PROP_HUE** Hue of the image (only for cameras).
|
||||
- **CAP_PROP_GAIN** Gain of the image (only for cameras).
|
||||
- **CAP_PROP_EXPOSURE** Exposure (only for cameras).
|
||||
- **CAP_PROP_CONVERT_RGB** Boolean flags indicating whether images should be converted
|
||||
to RGB.
|
||||
- **CAP_PROP_WHITE_BALANCE** Currently not supported
|
||||
- **CAP_PROP_RECTIFICATION** Rectification flag for stereo cameras (note: only supported
|
||||
by DC1394 v 2.x backend currently)
|
||||
- cv::CAP_PROP_POS_MSEC @copydoc cv::CAP_PROP_POS_MSEC
|
||||
- cv::CAP_PROP_POS_FRAMES @copydoc CAP_PROP_POS_FRAMES
|
||||
- cv::CAP_PROP_POS_AVI_RATIO @copydoc cv::CAP_PROP_POS_AVI_RATIO
|
||||
- cv::CAP_PROP_FRAME_WIDTH @copydoc cv::CAP_PROP_FRAME_WIDTH
|
||||
- cv::CAP_PROP_FRAME_HEIGHT @copydoc cv::CAP_PROP_FRAME_HEIGHT
|
||||
- cv::CAP_PROP_FPS @copydoc cv::CAP_PROP_FPS
|
||||
- cv::CAP_PROP_FOURCC @copydoc cv::CAP_PROP_FOURCC
|
||||
- cv::CAP_PROP_FRAME_COUNT @copydoc cv::CAP_PROP_FRAME_COUNT
|
||||
- cv::CAP_PROP_FORMAT @copydoc cv::CAP_PROP_FORMAT
|
||||
- cv::CAP_PROP_MODE @copydoc cv::CAP_PROP_MODE
|
||||
- cv::CAP_PROP_BRIGHTNESS @copydoc cv::CAP_PROP_BRIGHTNESS
|
||||
- cv::CAP_PROP_CONTRAST @copydoc cv::CAP_PROP_CONTRAST
|
||||
- cv::CAP_PROP_SATURATION @copydoc cv::CAP_PROP_SATURATION
|
||||
- cv::CAP_PROP_HUE @copydoc cv::CAP_PROP_HUE
|
||||
- cv::CAP_PROP_GAIN @copydoc cv::CAP_PROP_GAIN
|
||||
- cv::CAP_PROP_EXPOSURE @copydoc cv::CAP_PROP_EXPOSURE
|
||||
- cv::CAP_PROP_CONVERT_RGB @copydoc cv::CAP_PROP_CONVERT_RGB
|
||||
- cv::CAP_PROP_WHITE_BALANCE_BLUE_U @copydoc cv::CAP_PROP_WHITE_BALANCE_BLUE_U
|
||||
- cv::CAP_PROP_WHITE_BALANCE_RED_V @copydoc cv::CAP_PROP_WHITE_BALANCE_RED_V
|
||||
- cv::CAP_PROP_RECTIFICATION @copydoc cv::CAP_PROP_RECTIFICATION
|
||||
|
||||
@note When querying a property that is not supported by the backend used by the VideoCapture
|
||||
class, value 0 is returned.
|
||||
@ -692,7 +707,7 @@ public:
|
||||
img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...)
|
||||
|
||||
@param apiPreference preferred Capture API to use. Can be used to enforce a specific reader
|
||||
implementation if multiple are available: e.g. CAP_FFMPEG or CAP_IMAGES
|
||||
implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES
|
||||
|
||||
The methods first call VideoCapture::release to close the already opened file or camera.
|
||||
*/
|
||||
@ -767,8 +782,8 @@ public:
|
||||
/** @brief Sets a property in the VideoWriter.
|
||||
|
||||
@param propId Property identifier. It can be one of the following:
|
||||
- **VIDEOWRITER_PROP_QUALITY** Quality (0..100%) of the videostream encoded. Can be adjusted dynamically in some codecs.
|
||||
- **VIDEOWRITER_PROP_NSTRIPES** Number of stripes for parallel encoding
|
||||
- cv::VIDEOWRITER_PROP_QUALITY @copydoc cv::VIDEOWRITER_PROP_QUALITY
|
||||
- cv::VIDEOWRITER_PROP_NSTRIPES @copydoc cv::VIDEOWRITER_PROP_NSTRIPES
|
||||
@param value Value of the property.
|
||||
*/
|
||||
CV_WRAP virtual bool set(int propId, double value);
|
||||
@ -776,9 +791,9 @@ public:
|
||||
/** @brief Returns the specified VideoWriter property
|
||||
|
||||
@param propId Property identifier. It can be one of the following:
|
||||
- **VIDEOWRITER_PROP_QUALITY** Current quality of the encoded videostream.
|
||||
- **VIDEOWRITER_PROP_FRAMEBYTES** (Read-only) Size of just encoded video frame; note that the encoding order may be different from representation order.
|
||||
- **VIDEOWRITER_PROP_NSTRIPES** Number of stripes for parallel encoding
|
||||
- cv::VIDEOWRITER_PROP_QUALITY @copydoc cv::VIDEOWRITER_PROP_QUALITY
|
||||
- cv::VIDEOWRITER_PROP_FRAMEBYTES @copydoc VIDEOWRITER_PROP_FRAMEBYTES
|
||||
- cv::VIDEOWRITER_PROP_NSTRIPES @copydoc cv::VIDEOWRITER_PROP_NSTRIPES
|
||||
|
||||
@note When querying a property that is not supported by the backend used by the VideoWriter
|
||||
class, value 0 is returned.
|
||||
|
@ -200,7 +200,8 @@ enum
|
||||
// OpenNI map generators
|
||||
CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,
|
||||
CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,
|
||||
CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR,
|
||||
CV_CAP_OPENNI_IR_GENERATOR = 1 << 29,
|
||||
CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_OPENNI_IR_GENERATOR,
|
||||
|
||||
// Properties of cameras available through OpenNI interfaces
|
||||
CV_CAP_PROP_OPENNI_OUTPUT_MODE = 100,
|
||||
@ -222,10 +223,12 @@ enum
|
||||
|
||||
CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,
|
||||
CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE,
|
||||
CV_CAP_OPENNI_DEPTH_GENERATOR_PRESENT = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,
|
||||
CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE,
|
||||
CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,
|
||||
CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION,
|
||||
CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,
|
||||
CV_CAP_OPENNI_IR_GENERATOR_PRESENT = CV_CAP_OPENNI_IR_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,
|
||||
|
||||
// Properties of cameras available through GStreamer interface
|
||||
CV_CAP_GSTREAMER_QUEUE_LENGTH = 200, // default is 1
|
||||
@ -454,7 +457,10 @@ enum
|
||||
|
||||
// Data given from RGB image generator.
|
||||
CV_CAP_OPENNI_BGR_IMAGE = 5,
|
||||
CV_CAP_OPENNI_GRAY_IMAGE = 6
|
||||
CV_CAP_OPENNI_GRAY_IMAGE = 6,
|
||||
|
||||
// Data given from IR image generator.
|
||||
CV_CAP_OPENNI_IR_IMAGE = 7
|
||||
};
|
||||
|
||||
// Supported output modes of OpenNI image generator
|
||||
|
@ -971,7 +971,8 @@ bool CvCapture_FFMPEG::grabFrame()
|
||||
{
|
||||
//picture_pts = picture->best_effort_timestamp;
|
||||
if( picture_pts == AV_NOPTS_VALUE_ )
|
||||
picture_pts = packet.pts != AV_NOPTS_VALUE_ && packet.pts != 0 ? packet.pts : packet.dts;
|
||||
picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ && picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
|
||||
|
||||
frame_number++;
|
||||
valid = true;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ bool CvCapture_Images::grabFrame()
|
||||
}
|
||||
|
||||
cvReleaseImage(&frame);
|
||||
frame = cvLoadImage(str, CV_LOAD_IMAGE_ANYDEPTH | CV_LOAD_IMAGE_ANYCOLOR);
|
||||
frame = cvLoadImage(str, CV_LOAD_IMAGE_UNCHANGED);
|
||||
if( frame )
|
||||
currentframe++;
|
||||
|
||||
|
@ -65,8 +65,10 @@
|
||||
|
||||
#define CV_STREAM_TIMEOUT 2000
|
||||
|
||||
#define CV_DEPTH_STREAM 0
|
||||
#define CV_COLOR_STREAM 1
|
||||
#define CV_DEPTH_STREAM 0
|
||||
#define CV_COLOR_STREAM 1
|
||||
#define CV_IR_STREAM 2
|
||||
#define CV_MAX_NUM_STREAMS 3
|
||||
|
||||
#include "OpenNI.h"
|
||||
#include "PS1080.h"
|
||||
@ -109,10 +111,9 @@ protected:
|
||||
IplImage iplHeader;
|
||||
};
|
||||
|
||||
static const int outputMapsTypesCount = 7;
|
||||
static const int outputMapsTypesCount = 8;
|
||||
|
||||
static openni::VideoMode defaultColorOutputMode();
|
||||
static openni::VideoMode defaultDepthOutputMode();
|
||||
static openni::VideoMode defaultStreamOutputMode(int stream);
|
||||
|
||||
IplImage* retrieveDepthMap();
|
||||
IplImage* retrievePointCloudMap();
|
||||
@ -121,13 +122,17 @@ protected:
|
||||
IplImage* retrieveValidDepthMask();
|
||||
IplImage* retrieveBGRImage();
|
||||
IplImage* retrieveGrayImage();
|
||||
IplImage* retrieveIrImage();
|
||||
|
||||
openni::Status toggleStream(int stream, bool toggle);
|
||||
bool readCamerasParams();
|
||||
|
||||
double getDepthGeneratorProperty(int propIdx) const;
|
||||
bool setDepthGeneratorProperty(int propIdx, double propVal);
|
||||
double getImageGeneratorProperty(int propIdx) const;
|
||||
bool setImageGeneratorProperty(int propIdx, double propVal);
|
||||
double getIrGeneratorProperty(int propIdx) const;
|
||||
bool setIrGeneratorProperty(int propIdx, double propVal);
|
||||
double getCommonProperty(int propIdx) const;
|
||||
bool setCommonProperty(int propIdx, double propVal);
|
||||
|
||||
@ -137,9 +142,9 @@ protected:
|
||||
openni::Recorder recorder;
|
||||
|
||||
// Data generators with its metadata
|
||||
openni::VideoStream depth, color, **streams;
|
||||
openni::VideoFrameRef depthFrame, colorFrame;
|
||||
cv::Mat depthImage, colorImage;
|
||||
openni::VideoStream streams[CV_MAX_NUM_STREAMS];
|
||||
openni::VideoFrameRef streamFrames[CV_MAX_NUM_STREAMS];
|
||||
cv::Mat streamImages[CV_MAX_NUM_STREAMS];
|
||||
|
||||
int maxBufferSize, maxTimeDuration; // for approx sync
|
||||
bool isCircleBuffer;
|
||||
@ -157,9 +162,6 @@ protected:
|
||||
// The value for pixels without a valid disparity measurement
|
||||
int noSampleValue;
|
||||
|
||||
int currentStream;
|
||||
|
||||
int numStream;
|
||||
std::vector<OutputMap> outputMaps;
|
||||
};
|
||||
|
||||
@ -177,27 +179,28 @@ bool CvCapture_OpenNI2::isOpened() const
|
||||
return isContextOpened;
|
||||
}
|
||||
|
||||
openni::VideoMode CvCapture_OpenNI2::defaultColorOutputMode()
|
||||
openni::VideoMode CvCapture_OpenNI2::defaultStreamOutputMode(int stream)
|
||||
{
|
||||
openni::VideoMode mode;
|
||||
mode.setResolution(640, 480);
|
||||
mode.setFps(30);
|
||||
mode.setPixelFormat(openni::PIXEL_FORMAT_RGB888);
|
||||
return mode;
|
||||
}
|
||||
|
||||
openni::VideoMode CvCapture_OpenNI2::defaultDepthOutputMode()
|
||||
{
|
||||
openni::VideoMode mode;
|
||||
mode.setResolution(640, 480);
|
||||
mode.setFps(30);
|
||||
mode.setPixelFormat(openni::PIXEL_FORMAT_DEPTH_1_MM);
|
||||
switch (stream)
|
||||
{
|
||||
case CV_DEPTH_STREAM:
|
||||
mode.setPixelFormat(openni::PIXEL_FORMAT_DEPTH_1_MM);
|
||||
break;
|
||||
case CV_COLOR_STREAM:
|
||||
mode.setPixelFormat(openni::PIXEL_FORMAT_RGB888);
|
||||
break;
|
||||
case CV_IR_STREAM:
|
||||
mode.setPixelFormat(openni::PIXEL_FORMAT_GRAY16);
|
||||
break;
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
CvCapture_OpenNI2::CvCapture_OpenNI2( int index )
|
||||
{
|
||||
numStream = 2;
|
||||
const char* deviceURI = openni::ANY_DEVICE;
|
||||
openni::Status status;
|
||||
int deviceType = DEVICE_DEFAULT;
|
||||
@ -215,13 +218,6 @@ CvCapture_OpenNI2::CvCapture_OpenNI2( int index )
|
||||
index %= 10;
|
||||
}
|
||||
|
||||
// Asus XTION and Occipital Structure Sensor do not have an image generator
|
||||
if (deviceType == DEVICE_ASUS_XTION)
|
||||
numStream = 1;
|
||||
|
||||
if( deviceType > DEVICE_MAX )
|
||||
return;
|
||||
|
||||
// Initialize and configure the context.
|
||||
status = openni::OpenNI::initialize();
|
||||
|
||||
@ -247,72 +243,22 @@ CvCapture_OpenNI2::CvCapture_OpenNI2( int index )
|
||||
return;
|
||||
}
|
||||
|
||||
//device.setDepthColorSyncEnabled(true);
|
||||
|
||||
|
||||
status = depth.create(device, openni::SENSOR_DEPTH);
|
||||
if (status == openni::STATUS_OK)
|
||||
status = toggleStream(CV_DEPTH_STREAM, true);
|
||||
// Asus XTION and Occipital Structure Sensor do not have an image generator
|
||||
if (deviceType != DEVICE_ASUS_XTION)
|
||||
status = openni::Status(status | toggleStream(CV_COLOR_STREAM, true));
|
||||
if (status != openni::STATUS_OK)
|
||||
{
|
||||
if (depth.isValid())
|
||||
{
|
||||
CV_Assert(depth.setVideoMode(defaultDepthOutputMode()) == openni::STATUS_OK); // xn::DepthGenerator supports VGA only! (Jan 2011)
|
||||
}
|
||||
|
||||
status = depth.start();
|
||||
if (status != openni::STATUS_OK)
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Couldn't start depth stream: %s\n", openni::OpenNI::getExtendedError()));
|
||||
depth.destroy();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Couldn't find depth stream:: %s\n", openni::OpenNI::getExtendedError()));
|
||||
openni::OpenNI::shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
streams = new openni::VideoStream*[numStream];
|
||||
streams[CV_DEPTH_STREAM] = &depth;
|
||||
|
||||
// create a color object
|
||||
status = color.create(device, openni::SENSOR_COLOR);
|
||||
if (status == openni::STATUS_OK)
|
||||
{
|
||||
// Set map output mode.
|
||||
if (color.isValid())
|
||||
{
|
||||
CV_Assert(color.setVideoMode(defaultColorOutputMode()) == openni::STATUS_OK);
|
||||
}
|
||||
status = color.start();
|
||||
if (status != openni::STATUS_OK)
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Couldn't start color stream: %s\n", openni::OpenNI::getExtendedError()));
|
||||
color.destroy();
|
||||
return;
|
||||
}
|
||||
streams[CV_COLOR_STREAM] = &color;
|
||||
}
|
||||
else if (numStream == 2)
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Couldn't find color stream: %s\n", openni::OpenNI::getExtendedError()));
|
||||
return;
|
||||
}
|
||||
|
||||
if( !readCamerasParams() )
|
||||
if (!readCamerasParams())
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Could not read cameras parameters\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
// if( deviceType == DEVICE_ASUS_XTION )
|
||||
// {
|
||||
// //ps/asus specific
|
||||
// imageGenerator.SetIntProperty("InputFormat", 1 /*XN_IO_IMAGE_FORMAT_YUV422*/);
|
||||
// imageGenerator.SetPixelFormat(XN_PIXEL_FORMAT_RGB24);
|
||||
// depthGenerator.SetIntProperty("RegistrationType", 1 /*XN_PROCESSING_HARDWARE*/);
|
||||
// }
|
||||
|
||||
|
||||
outputMaps.resize( outputMapsTypesCount );
|
||||
|
||||
@ -321,9 +267,74 @@ CvCapture_OpenNI2::CvCapture_OpenNI2( int index )
|
||||
setProperty(CV_CAP_PROP_OPENNI_REGISTRATION, 1.0);
|
||||
}
|
||||
|
||||
openni::Status CvCapture_OpenNI2::toggleStream(int stream, bool toggle)
|
||||
{
|
||||
openni::Status status;
|
||||
|
||||
// for logging
|
||||
static const char* stream_names[CV_MAX_NUM_STREAMS] = {
|
||||
"depth",
|
||||
"color",
|
||||
"IR"
|
||||
};
|
||||
|
||||
static const openni::SensorType stream_sensor_types[CV_MAX_NUM_STREAMS] = {
|
||||
openni::SENSOR_DEPTH,
|
||||
openni::SENSOR_COLOR,
|
||||
openni::SENSOR_IR
|
||||
};
|
||||
|
||||
if (toggle) // want to open stream
|
||||
{
|
||||
// already opened
|
||||
if (streams[stream].isValid())
|
||||
return openni::STATUS_OK;
|
||||
|
||||
// open stream
|
||||
status = streams[stream].create(device, stream_sensor_types[stream]);
|
||||
if (status == openni::STATUS_OK)
|
||||
{
|
||||
// set video mode
|
||||
status = streams[stream].setVideoMode(defaultStreamOutputMode(stream)); // xn::DepthGenerator supports VGA only! (Jan 2011)
|
||||
if (status != openni::STATUS_OK)
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Couldn't set %s stream output mode: %s\n",
|
||||
stream_names[stream],
|
||||
openni::OpenNI::getExtendedError()));
|
||||
streams[stream].destroy();
|
||||
return status;
|
||||
}
|
||||
|
||||
// start stream
|
||||
status = streams[stream].start();
|
||||
if (status != openni::STATUS_OK)
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Couldn't start %s stream: %s\n",
|
||||
stream_names[stream],
|
||||
openni::OpenNI::getExtendedError()));
|
||||
streams[stream].destroy();
|
||||
return status;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Couldn't find %s stream:: %s\n",
|
||||
stream_names[stream],
|
||||
openni::OpenNI::getExtendedError()));
|
||||
return status;
|
||||
}
|
||||
}
|
||||
else if (streams[stream].isValid()) // want to close stream
|
||||
{
|
||||
streams[stream].stop();
|
||||
streams[stream].destroy();
|
||||
}
|
||||
|
||||
return openni::STATUS_OK;
|
||||
}
|
||||
|
||||
CvCapture_OpenNI2::CvCapture_OpenNI2(const char * filename)
|
||||
{
|
||||
numStream = 2;
|
||||
openni::Status status;
|
||||
|
||||
isContextOpened = false;
|
||||
@ -348,6 +359,13 @@ CvCapture_OpenNI2::CvCapture_OpenNI2(const char * filename)
|
||||
return;
|
||||
}
|
||||
|
||||
status = openni::Status(toggleStream(CV_DEPTH_STREAM, true) | toggleStream(CV_COLOR_STREAM, true));
|
||||
if (status != openni::STATUS_OK)
|
||||
{
|
||||
openni::OpenNI::shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
if( !readCamerasParams() )
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::CvCapture_OpenNI2 : Could not read cameras parameters\n"));
|
||||
@ -361,17 +379,20 @@ CvCapture_OpenNI2::CvCapture_OpenNI2(const char * filename)
|
||||
|
||||
CvCapture_OpenNI2::~CvCapture_OpenNI2()
|
||||
{
|
||||
this->depthFrame.release();
|
||||
this->colorFrame.release();
|
||||
this->depth.stop();
|
||||
this->color.stop();
|
||||
for (int i = 0; i < CV_MAX_NUM_STREAMS; ++i)
|
||||
{
|
||||
streamFrames[i].release();
|
||||
streams[i].stop();
|
||||
streams[i].destroy();
|
||||
}
|
||||
device.close();
|
||||
openni::OpenNI::shutdown();
|
||||
}
|
||||
|
||||
bool CvCapture_OpenNI2::readCamerasParams()
|
||||
{
|
||||
double pixelSize = 0;
|
||||
if (depth.getProperty<double>(XN_STREAM_PROPERTY_ZERO_PLANE_PIXEL_SIZE, &pixelSize) != openni::STATUS_OK)
|
||||
if (streams[CV_DEPTH_STREAM].getProperty<double>(XN_STREAM_PROPERTY_ZERO_PLANE_PIXEL_SIZE, &pixelSize) != openni::STATUS_OK)
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::readCamerasParams : Could not read pixel size!\n"));
|
||||
return false;
|
||||
@ -382,13 +403,13 @@ bool CvCapture_OpenNI2::readCamerasParams()
|
||||
|
||||
// focal length of IR camera in pixels for VGA resolution
|
||||
int zeroPlanDistance; // in mm
|
||||
if (depth.getProperty(XN_STREAM_PROPERTY_ZERO_PLANE_DISTANCE, &zeroPlanDistance) != openni::STATUS_OK)
|
||||
if (streams[CV_DEPTH_STREAM].getProperty(XN_STREAM_PROPERTY_ZERO_PLANE_DISTANCE, &zeroPlanDistance) != openni::STATUS_OK)
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::readCamerasParams : Could not read virtual plane distance!\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (depth.getProperty<double>(XN_STREAM_PROPERTY_EMITTER_DCMOS_DISTANCE, &baseline) != openni::STATUS_OK)
|
||||
if (streams[CV_DEPTH_STREAM].getProperty<double>(XN_STREAM_PROPERTY_EMITTER_DCMOS_DISTANCE, &baseline) != openni::STATUS_OK)
|
||||
{
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::readCamerasParams : Could not read base line!\n"));
|
||||
return false;
|
||||
@ -419,6 +440,10 @@ double CvCapture_OpenNI2::getProperty( int propIdx ) const
|
||||
{
|
||||
propValue = getDepthGeneratorProperty( purePropIdx );
|
||||
}
|
||||
else if ((propIdx & CV_CAP_OPENNI_GENERATORS_MASK) == CV_CAP_OPENNI_IR_GENERATOR)
|
||||
{
|
||||
propValue = getIrGeneratorProperty(purePropIdx);
|
||||
}
|
||||
else
|
||||
{
|
||||
propValue = getCommonProperty( purePropIdx );
|
||||
@ -443,6 +468,10 @@ bool CvCapture_OpenNI2::setProperty( int propIdx, double propValue )
|
||||
{
|
||||
isSet = setDepthGeneratorProperty( purePropIdx, propValue );
|
||||
}
|
||||
else if ((propIdx & CV_CAP_OPENNI_GENERATORS_MASK) == CV_CAP_OPENNI_IR_GENERATOR)
|
||||
{
|
||||
isSet = setIrGeneratorProperty(purePropIdx, propValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
isSet = setCommonProperty( purePropIdx, propValue );
|
||||
@ -458,12 +487,6 @@ double CvCapture_OpenNI2::getCommonProperty( int propIdx ) const
|
||||
|
||||
switch( propIdx )
|
||||
{
|
||||
// There is a set of properties that correspond to depth generator by default
|
||||
// (is they are pass without particular generator flag). Two reasons of this:
|
||||
// 1) We can assume that depth generator is the main one for depth sensor.
|
||||
// 2) In the initial vertions of OpenNI integration to OpenCV the value of
|
||||
// flag CV_CAP_OPENNI_DEPTH_GENERATOR was 0 (it isn't zero now).
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT :
|
||||
case CV_CAP_PROP_FRAME_WIDTH :
|
||||
case CV_CAP_PROP_FRAME_HEIGHT :
|
||||
case CV_CAP_PROP_FPS :
|
||||
@ -477,7 +500,9 @@ double CvCapture_OpenNI2::getCommonProperty( int propIdx ) const
|
||||
propValue = const_cast<CvCapture_OpenNI2 *>(this)->device.getDepthColorSyncEnabled();
|
||||
case CV_CAP_PROP_OPENNI2_MIRROR:
|
||||
{
|
||||
bool isMirroring = color.getMirroringEnabled() && depth.getMirroringEnabled();
|
||||
bool isMirroring = false;
|
||||
for (int i = 0; i < CV_MAX_NUM_STREAMS; ++i)
|
||||
isMirroring |= streams[i].getMirroringEnabled();
|
||||
propValue = isMirroring ? 1.0 : 0.0;
|
||||
break;
|
||||
}
|
||||
@ -497,8 +522,11 @@ bool CvCapture_OpenNI2::setCommonProperty( int propIdx, double propValue )
|
||||
case CV_CAP_PROP_OPENNI2_MIRROR:
|
||||
{
|
||||
bool mirror = propValue > 0.0 ? true : false;
|
||||
isSet = color.setMirroringEnabled(mirror) == openni::STATUS_OK;
|
||||
isSet = depth.setMirroringEnabled(mirror) == openni::STATUS_OK;
|
||||
for (int i = 0; i < CV_MAX_NUM_STREAMS; ++i)
|
||||
{
|
||||
if (streams[i].isValid())
|
||||
isSet |= streams[i].setMirroringEnabled(mirror) == openni::STATUS_OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
// There is a set of properties that correspond to depth generator by default
|
||||
@ -509,6 +537,7 @@ bool CvCapture_OpenNI2::setCommonProperty( int propIdx, double propValue )
|
||||
case CV_CAP_PROP_OPENNI2_SYNC:
|
||||
isSet = device.setDepthColorSyncEnabled(propValue > 0.0) == openni::STATUS_OK;
|
||||
break;
|
||||
|
||||
default:
|
||||
CV_Error( CV_StsBadArg, cv::format("Such parameter (propIdx=%d) isn't supported for setting.\n", propIdx) );
|
||||
}
|
||||
@ -519,29 +548,28 @@ bool CvCapture_OpenNI2::setCommonProperty( int propIdx, double propValue )
|
||||
double CvCapture_OpenNI2::getDepthGeneratorProperty( int propIdx ) const
|
||||
{
|
||||
double propValue = 0;
|
||||
if( !depth.isValid() )
|
||||
if( !streams[CV_DEPTH_STREAM].isValid() )
|
||||
return propValue;
|
||||
|
||||
openni::VideoMode mode;
|
||||
|
||||
switch( propIdx )
|
||||
{
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT :
|
||||
CV_DbgAssert(depth.isValid());
|
||||
propValue = 1.;
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT:
|
||||
propValue = streams[CV_DEPTH_STREAM].isValid();
|
||||
break;
|
||||
case CV_CAP_PROP_FRAME_WIDTH :
|
||||
propValue = depth.getVideoMode().getResolutionX();
|
||||
propValue = streams[CV_DEPTH_STREAM].getVideoMode().getResolutionX();
|
||||
break;
|
||||
case CV_CAP_PROP_FRAME_HEIGHT :
|
||||
propValue = depth.getVideoMode().getResolutionY();
|
||||
propValue = streams[CV_DEPTH_STREAM].getVideoMode().getResolutionY();
|
||||
break;
|
||||
case CV_CAP_PROP_FPS :
|
||||
mode = depth.getVideoMode();
|
||||
mode = streams[CV_DEPTH_STREAM].getVideoMode();
|
||||
propValue = mode.getFps();
|
||||
break;
|
||||
case CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH :
|
||||
propValue = depth.getMaxPixelValue();
|
||||
propValue = streams[CV_DEPTH_STREAM].getMaxPixelValue();
|
||||
break;
|
||||
case CV_CAP_PROP_OPENNI_BASELINE :
|
||||
propValue = baseline;
|
||||
@ -553,10 +581,10 @@ double CvCapture_OpenNI2::getDepthGeneratorProperty( int propIdx ) const
|
||||
propValue = device.getImageRegistrationMode();
|
||||
break;
|
||||
case CV_CAP_PROP_POS_MSEC :
|
||||
propValue = (double)depthFrame.getTimestamp();
|
||||
propValue = (double)streamFrames[CV_DEPTH_STREAM].getTimestamp();
|
||||
break;
|
||||
case CV_CAP_PROP_POS_FRAMES :
|
||||
propValue = depthFrame.getFrameIndex();
|
||||
propValue = streamFrames[CV_DEPTH_STREAM].getFrameIndex();
|
||||
break;
|
||||
default :
|
||||
CV_Error( CV_StsBadArg, cv::format("Depth generator does not support such parameter (propIdx=%d) for getting.\n", propIdx) );
|
||||
@ -569,17 +597,20 @@ bool CvCapture_OpenNI2::setDepthGeneratorProperty( int propIdx, double propValue
|
||||
{
|
||||
bool isSet = false;
|
||||
|
||||
CV_Assert( depth.isValid() );
|
||||
|
||||
switch( propIdx )
|
||||
{
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT:
|
||||
if (isContextOpened)
|
||||
isSet = toggleStream(CV_DEPTH_STREAM, propValue > 0.0) == openni::STATUS_OK;
|
||||
break;
|
||||
case CV_CAP_PROP_OPENNI_REGISTRATION:
|
||||
{
|
||||
CV_Assert(streams[CV_DEPTH_STREAM].isValid());
|
||||
if( propValue != 0.0 ) // "on"
|
||||
{
|
||||
// if there isn't image generator (i.e. ASUS XtionPro doesn't have it)
|
||||
// then the property isn't avaliable
|
||||
if ( color.isValid() )
|
||||
if ( streams[CV_COLOR_STREAM].isValid() )
|
||||
{
|
||||
openni::ImageRegistrationMode mode = propValue != 0.0 ? openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR : openni::IMAGE_REGISTRATION_OFF;
|
||||
if( !device.getImageRegistrationMode() == mode )
|
||||
@ -619,30 +650,29 @@ bool CvCapture_OpenNI2::setDepthGeneratorProperty( int propIdx, double propValue
|
||||
double CvCapture_OpenNI2::getImageGeneratorProperty( int propIdx ) const
|
||||
{
|
||||
double propValue = 0.;
|
||||
if( !color.isValid() )
|
||||
if( !streams[CV_COLOR_STREAM].isValid() )
|
||||
return propValue;
|
||||
|
||||
openni::VideoMode mode;
|
||||
switch( propIdx )
|
||||
{
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT :
|
||||
CV_DbgAssert( color.isValid() );
|
||||
propValue = 1.;
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT:
|
||||
propValue = streams[CV_COLOR_STREAM].isValid();
|
||||
break;
|
||||
case CV_CAP_PROP_FRAME_WIDTH :
|
||||
propValue = color.getVideoMode().getResolutionX();
|
||||
propValue = streams[CV_COLOR_STREAM].getVideoMode().getResolutionX();
|
||||
break;
|
||||
case CV_CAP_PROP_FRAME_HEIGHT :
|
||||
propValue = color.getVideoMode().getResolutionY();
|
||||
propValue = streams[CV_COLOR_STREAM].getVideoMode().getResolutionY();
|
||||
break;
|
||||
case CV_CAP_PROP_FPS :
|
||||
propValue = color.getVideoMode().getFps();
|
||||
propValue = streams[CV_COLOR_STREAM].getVideoMode().getFps();
|
||||
break;
|
||||
case CV_CAP_PROP_POS_MSEC :
|
||||
propValue = (double)colorFrame.getTimestamp();
|
||||
propValue = (double)streamFrames[CV_COLOR_STREAM].getTimestamp();
|
||||
break;
|
||||
case CV_CAP_PROP_POS_FRAMES :
|
||||
propValue = (double)colorFrame.getFrameIndex();
|
||||
propValue = (double)streamFrames[CV_COLOR_STREAM].getFrameIndex();
|
||||
break;
|
||||
default :
|
||||
CV_Error( CV_StsBadArg, cv::format("Image generator does not support such parameter (propIdx=%d) for getting.\n", propIdx) );
|
||||
@ -654,14 +684,18 @@ double CvCapture_OpenNI2::getImageGeneratorProperty( int propIdx ) const
|
||||
bool CvCapture_OpenNI2::setImageGeneratorProperty(int propIdx, double propValue)
|
||||
{
|
||||
bool isSet = false;
|
||||
if( !color.isValid() )
|
||||
return isSet;
|
||||
|
||||
switch( propIdx )
|
||||
{
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT:
|
||||
if (isContextOpened)
|
||||
isSet = toggleStream(CV_COLOR_STREAM, propValue > 0.0) == openni::STATUS_OK;
|
||||
break;
|
||||
case CV_CAP_PROP_OPENNI_OUTPUT_MODE :
|
||||
{
|
||||
openni::VideoMode mode = color.getVideoMode();
|
||||
if (!streams[CV_COLOR_STREAM].isValid())
|
||||
return isSet;
|
||||
openni::VideoMode mode = streams[CV_COLOR_STREAM].getVideoMode();
|
||||
|
||||
switch( cvRound(propValue) )
|
||||
{
|
||||
@ -689,7 +723,7 @@ bool CvCapture_OpenNI2::setImageGeneratorProperty(int propIdx, double propValue)
|
||||
CV_Error( CV_StsBadArg, "Unsupported image generator output mode.\n");
|
||||
}
|
||||
|
||||
openni::Status status = color.setVideoMode( mode );
|
||||
openni::Status status = streams[CV_COLOR_STREAM].setVideoMode( mode );
|
||||
if( status != openni::STATUS_OK )
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::setImageGeneratorProperty : %s\n", openni::OpenNI::getExtendedError()));
|
||||
else
|
||||
@ -703,6 +737,96 @@ bool CvCapture_OpenNI2::setImageGeneratorProperty(int propIdx, double propValue)
|
||||
return isSet;
|
||||
}
|
||||
|
||||
double CvCapture_OpenNI2::getIrGeneratorProperty(int propIdx) const
|
||||
{
|
||||
double propValue = 0.;
|
||||
if (!streams[CV_IR_STREAM].isValid())
|
||||
return propValue;
|
||||
|
||||
openni::VideoMode mode;
|
||||
switch (propIdx)
|
||||
{
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT:
|
||||
propValue = streams[CV_IR_STREAM].isValid();
|
||||
break;
|
||||
case CV_CAP_PROP_FRAME_WIDTH:
|
||||
propValue = streams[CV_IR_STREAM].getVideoMode().getResolutionX();
|
||||
break;
|
||||
case CV_CAP_PROP_FRAME_HEIGHT:
|
||||
propValue = streams[CV_IR_STREAM].getVideoMode().getResolutionY();
|
||||
break;
|
||||
case CV_CAP_PROP_FPS:
|
||||
propValue = streams[CV_IR_STREAM].getVideoMode().getFps();
|
||||
break;
|
||||
case CV_CAP_PROP_POS_MSEC:
|
||||
propValue = (double)streamFrames[CV_IR_STREAM].getTimestamp();
|
||||
break;
|
||||
case CV_CAP_PROP_POS_FRAMES:
|
||||
propValue = (double)streamFrames[CV_IR_STREAM].getFrameIndex();
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsBadArg, cv::format("Image generator does not support such parameter (propIdx=%d) for getting.\n", propIdx));
|
||||
}
|
||||
|
||||
return propValue;
|
||||
}
|
||||
|
||||
bool CvCapture_OpenNI2::setIrGeneratorProperty(int propIdx, double propValue)
|
||||
{
|
||||
bool isSet = false;
|
||||
|
||||
switch (propIdx)
|
||||
{
|
||||
case CV_CAP_PROP_OPENNI_GENERATOR_PRESENT:
|
||||
if (isContextOpened)
|
||||
isSet = toggleStream(CV_IR_STREAM, propValue > 0.0) == openni::STATUS_OK;
|
||||
break;
|
||||
case CV_CAP_PROP_OPENNI_OUTPUT_MODE:
|
||||
{
|
||||
if (!streams[CV_IR_STREAM].isValid())
|
||||
return isSet;
|
||||
openni::VideoMode mode = streams[CV_IR_STREAM].getVideoMode();
|
||||
|
||||
switch (cvRound(propValue))
|
||||
{
|
||||
case CV_CAP_OPENNI_VGA_30HZ:
|
||||
mode.setResolution(640, 480);
|
||||
mode.setFps(30);
|
||||
break;
|
||||
case CV_CAP_OPENNI_SXGA_15HZ:
|
||||
mode.setResolution(1280, 960);
|
||||
mode.setFps(15);
|
||||
break;
|
||||
case CV_CAP_OPENNI_SXGA_30HZ:
|
||||
mode.setResolution(1280, 960);
|
||||
mode.setFps(30);
|
||||
break;
|
||||
case CV_CAP_OPENNI_QVGA_30HZ:
|
||||
mode.setResolution(320, 240);
|
||||
mode.setFps(30);
|
||||
break;
|
||||
case CV_CAP_OPENNI_QVGA_60HZ:
|
||||
mode.setResolution(320, 240);
|
||||
mode.setFps(60);
|
||||
break;
|
||||
default:
|
||||
CV_Error(CV_StsBadArg, "Unsupported image generator output mode.\n");
|
||||
}
|
||||
|
||||
openni::Status status = streams[CV_IR_STREAM].setVideoMode(mode);
|
||||
if (status != openni::STATUS_OK)
|
||||
CV_Error(CV_StsError, cv::format("CvCapture_OpenNI2::setImageGeneratorProperty : %s\n", openni::OpenNI::getExtendedError()));
|
||||
else
|
||||
isSet = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
CV_Error(CV_StsBadArg, cv::format("Image generator does not support such parameter (propIdx=%d) for setting.\n", propIdx));
|
||||
}
|
||||
|
||||
return isSet;
|
||||
}
|
||||
|
||||
bool CvCapture_OpenNI2::grabFrame()
|
||||
{
|
||||
if( !isOpened() )
|
||||
@ -710,14 +834,22 @@ bool CvCapture_OpenNI2::grabFrame()
|
||||
|
||||
bool isGrabbed = false;
|
||||
|
||||
openni::Status status = openni::OpenNI::waitForAnyStream(streams, numStream, ¤tStream, CV_STREAM_TIMEOUT);
|
||||
int numActiveStreams = 0;
|
||||
openni::VideoStream* streamPtrs[CV_MAX_NUM_STREAMS];
|
||||
for (int i = 0; i < CV_MAX_NUM_STREAMS; ++i) {
|
||||
streamPtrs[numActiveStreams++] = &streams[i];
|
||||
}
|
||||
|
||||
int currentStream;
|
||||
openni::Status status = openni::OpenNI::waitForAnyStream(streamPtrs, numActiveStreams, ¤tStream, CV_STREAM_TIMEOUT);
|
||||
if( status != openni::STATUS_OK )
|
||||
return false;
|
||||
|
||||
if( depth.isValid() )
|
||||
depth.readFrame(&depthFrame);
|
||||
if (color.isValid())
|
||||
color.readFrame(&colorFrame);
|
||||
for (int i = 0; i < CV_MAX_NUM_STREAMS; ++i)
|
||||
{
|
||||
if (streams[i].isValid())
|
||||
streams[i].readFrame(&streamFrames[i]);
|
||||
}
|
||||
isGrabbed = true;
|
||||
|
||||
return isGrabbed;
|
||||
@ -736,25 +868,25 @@ inline void getDepthMapFromMetaData(const openni::VideoFrameRef& depthMetaData,
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrieveDepthMap()
|
||||
{
|
||||
if( !depth.isValid() )
|
||||
if( !streamFrames[CV_DEPTH_STREAM].isValid() )
|
||||
return 0;
|
||||
|
||||
getDepthMapFromMetaData( depthFrame, outputMaps[CV_CAP_OPENNI_DEPTH_MAP].mat, noSampleValue, shadowValue );
|
||||
getDepthMapFromMetaData(streamFrames[CV_DEPTH_STREAM], outputMaps[CV_CAP_OPENNI_DEPTH_MAP].mat, noSampleValue, shadowValue );
|
||||
|
||||
return outputMaps[CV_CAP_OPENNI_DEPTH_MAP].getIplImagePtr();
|
||||
}
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrievePointCloudMap()
|
||||
{
|
||||
if( !depthFrame.isValid() )
|
||||
if( !streamFrames[CV_DEPTH_STREAM].isValid() )
|
||||
return 0;
|
||||
|
||||
cv::Mat depthImg;
|
||||
getDepthMapFromMetaData(depthFrame, depthImg, noSampleValue, shadowValue);
|
||||
getDepthMapFromMetaData(streamFrames[CV_DEPTH_STREAM], depthImg, noSampleValue, shadowValue);
|
||||
|
||||
const int badPoint = INVALID_PIXEL_VAL;
|
||||
const float badCoord = INVALID_COORDINATE_VAL;
|
||||
int cols = depthFrame.getWidth(), rows = depthFrame.getHeight();
|
||||
int cols = streamFrames[CV_DEPTH_STREAM].getWidth(), rows = streamFrames[CV_DEPTH_STREAM].getHeight();
|
||||
cv::Mat pointCloud_XYZ( rows, cols, CV_32FC3, cv::Scalar::all(badPoint) );
|
||||
|
||||
float worldX, worldY, worldZ;
|
||||
@ -762,7 +894,7 @@ IplImage* CvCapture_OpenNI2::retrievePointCloudMap()
|
||||
{
|
||||
for (int x = 0; x < cols; x++)
|
||||
{
|
||||
openni::CoordinateConverter::convertDepthToWorld(depth, x, y, depthImg.at<unsigned short>(y, x), &worldX, &worldY, &worldZ);
|
||||
openni::CoordinateConverter::convertDepthToWorld(streams[CV_DEPTH_STREAM], x, y, depthImg.at<unsigned short>(y, x), &worldX, &worldY, &worldZ);
|
||||
|
||||
if (depthImg.at<unsigned short>(y, x) == badPoint) // not valid
|
||||
pointCloud_XYZ.at<cv::Point3f>(y, x) = cv::Point3f(badCoord, badCoord, badCoord);
|
||||
@ -803,11 +935,11 @@ static void computeDisparity_32F( const openni::VideoFrameRef& depthMetaData, cv
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrieveDisparityMap()
|
||||
{
|
||||
if (!depthFrame.isValid())
|
||||
if (!streamFrames[CV_DEPTH_STREAM].isValid())
|
||||
return 0;
|
||||
|
||||
cv::Mat disp32;
|
||||
computeDisparity_32F(depthFrame, disp32, baseline, depthFocalLength_VGA, noSampleValue, shadowValue);
|
||||
computeDisparity_32F(streamFrames[CV_DEPTH_STREAM], disp32, baseline, depthFocalLength_VGA, noSampleValue, shadowValue);
|
||||
|
||||
disp32.convertTo( outputMaps[CV_CAP_OPENNI_DISPARITY_MAP].mat, CV_8UC1 );
|
||||
|
||||
@ -816,21 +948,21 @@ IplImage* CvCapture_OpenNI2::retrieveDisparityMap()
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrieveDisparityMap_32F()
|
||||
{
|
||||
if (!depthFrame.isValid())
|
||||
if (!streamFrames[CV_DEPTH_STREAM].isValid())
|
||||
return 0;
|
||||
|
||||
computeDisparity_32F(depthFrame, outputMaps[CV_CAP_OPENNI_DISPARITY_MAP_32F].mat, baseline, depthFocalLength_VGA, noSampleValue, shadowValue);
|
||||
computeDisparity_32F(streamFrames[CV_DEPTH_STREAM], outputMaps[CV_CAP_OPENNI_DISPARITY_MAP_32F].mat, baseline, depthFocalLength_VGA, noSampleValue, shadowValue);
|
||||
|
||||
return outputMaps[CV_CAP_OPENNI_DISPARITY_MAP_32F].getIplImagePtr();
|
||||
}
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrieveValidDepthMask()
|
||||
{
|
||||
if (!depthFrame.isValid())
|
||||
if (!streamFrames[CV_DEPTH_STREAM].isValid())
|
||||
return 0;
|
||||
|
||||
cv::Mat d;
|
||||
getDepthMapFromMetaData(depthFrame, d, noSampleValue, shadowValue);
|
||||
getDepthMapFromMetaData(streamFrames[CV_DEPTH_STREAM], d, noSampleValue, shadowValue);
|
||||
|
||||
outputMaps[CV_CAP_OPENNI_VALID_DEPTH_MASK].mat = d != CvCapture_OpenNI2::INVALID_PIXEL_VAL;
|
||||
|
||||
@ -850,30 +982,58 @@ inline void getBGRImageFromMetaData( const openni::VideoFrameRef& imageMetaData,
|
||||
cv::cvtColor(bufferImage, bgrImage, cv::COLOR_RGB2BGR);
|
||||
}
|
||||
|
||||
inline void getGrayImageFromMetaData(const openni::VideoFrameRef& imageMetaData, cv::Mat& grayImage)
|
||||
{
|
||||
if (imageMetaData.getVideoMode().getPixelFormat() == openni::PIXEL_FORMAT_GRAY8)
|
||||
{
|
||||
grayImage.create(imageMetaData.getHeight(), imageMetaData.getWidth(), CV_8UC1);
|
||||
grayImage.data = (uchar*)imageMetaData.getData();
|
||||
}
|
||||
else if (imageMetaData.getVideoMode().getPixelFormat() == openni::PIXEL_FORMAT_GRAY16)
|
||||
{
|
||||
grayImage.create(imageMetaData.getHeight(), imageMetaData.getWidth(), CV_16UC1);
|
||||
grayImage.data = (uchar*)imageMetaData.getData();
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_Error(CV_StsUnsupportedFormat, "Unsupported format of grabbed image\n");
|
||||
}
|
||||
}
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrieveBGRImage()
|
||||
{
|
||||
if( !color.isValid() )
|
||||
if( !streamFrames[CV_COLOR_STREAM].isValid() )
|
||||
return 0;
|
||||
|
||||
getBGRImageFromMetaData( colorFrame, outputMaps[CV_CAP_OPENNI_BGR_IMAGE].mat );
|
||||
getBGRImageFromMetaData(streamFrames[CV_COLOR_STREAM], outputMaps[CV_CAP_OPENNI_BGR_IMAGE].mat );
|
||||
|
||||
return outputMaps[CV_CAP_OPENNI_BGR_IMAGE].getIplImagePtr();
|
||||
}
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrieveGrayImage()
|
||||
{
|
||||
if (!colorFrame.isValid())
|
||||
if (!streamFrames[CV_COLOR_STREAM].isValid())
|
||||
return 0;
|
||||
|
||||
CV_Assert(colorFrame.getVideoMode().getPixelFormat() == openni::PIXEL_FORMAT_RGB888); // RGB
|
||||
CV_Assert(streamFrames[CV_COLOR_STREAM].getVideoMode().getPixelFormat() == openni::PIXEL_FORMAT_RGB888); // RGB
|
||||
|
||||
cv::Mat rgbImage;
|
||||
getBGRImageFromMetaData(colorFrame, rgbImage);
|
||||
getBGRImageFromMetaData(streamFrames[CV_COLOR_STREAM], rgbImage);
|
||||
cv::cvtColor( rgbImage, outputMaps[CV_CAP_OPENNI_GRAY_IMAGE].mat, CV_BGR2GRAY );
|
||||
|
||||
return outputMaps[CV_CAP_OPENNI_GRAY_IMAGE].getIplImagePtr();
|
||||
}
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrieveIrImage()
|
||||
{
|
||||
if (!streamFrames[CV_IR_STREAM].isValid())
|
||||
return 0;
|
||||
|
||||
getGrayImageFromMetaData(streamFrames[CV_IR_STREAM], outputMaps[CV_CAP_OPENNI_IR_IMAGE].mat);
|
||||
|
||||
return outputMaps[CV_CAP_OPENNI_IR_IMAGE].getIplImagePtr();
|
||||
}
|
||||
|
||||
IplImage* CvCapture_OpenNI2::retrieveFrame( int outputType )
|
||||
{
|
||||
IplImage* image = 0;
|
||||
@ -907,6 +1067,10 @@ IplImage* CvCapture_OpenNI2::retrieveFrame( int outputType )
|
||||
{
|
||||
image = retrieveGrayImage();
|
||||
}
|
||||
else if( outputType == CV_CAP_OPENNI_IR_IMAGE )
|
||||
{
|
||||
image = retrieveIrImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <DetectionBasedTracker_jni.h>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/objdetect.hpp>
|
||||
|
||||
#include <string>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <jni.h>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/features2d.hpp>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
@ -2,10 +2,10 @@
|
||||
* 3calibration.cpp -- Calibrate 3 cameras in a horizontal line together.
|
||||
*/
|
||||
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -31,7 +31,8 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-missing-declarations")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function -Wno-missing-declarations")
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------
|
||||
@ -57,8 +58,10 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
||||
ocv_target_link_libraries(${the_target} opencv_cudaarithm opencv_cudafilters)
|
||||
endif()
|
||||
|
||||
if(HAVE_opencv_ocl)
|
||||
ocv_target_link_libraries(${the_target} opencv_ocl)
|
||||
if("${srcs}" MATCHES "viz/" AND VTK_USE_FILE)
|
||||
include(${VTK_USE_FILE})
|
||||
ocv_target_link_libraries(${the_target} ${VTK_LIBRARIES})
|
||||
add_definitions(-DUSE_VTK)
|
||||
endif()
|
||||
|
||||
set_target_properties(${the_target} PROPERTIES
|
||||
@ -88,7 +91,9 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
||||
ocv_list_filterout(cpp_samples "/gpu/")
|
||||
endif()
|
||||
|
||||
ocv_list_filterout(cpp_samples "viz")
|
||||
if(NOT TARGET opencv_viz)
|
||||
ocv_list_filterout(cpp_samples "/viz/")
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_IPP_A)
|
||||
ocv_list_filterout(cpp_samples "/ippasync/")
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <fstream>
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
@ -1,11 +1,11 @@
|
||||
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
|
||||
|
||||
#include <opencv2/imgproc/imgproc.hpp> // Gaussian Blur
|
||||
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
|
||||
#include <opencv2/videoio/videoio.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#include <opencv2/objdetect/objdetect.hpp>
|
||||
#include <opencv2/imgproc.hpp> // Gaussian Blur
|
||||
#include <opencv2/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
|
||||
#include <opencv2/videoio.hpp>
|
||||
#include <opencv2/highgui.hpp> // OpenCV window I/O
|
||||
#include <opencv2/features2d.hpp>
|
||||
#include <opencv2/objdetect.hpp>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
|
@ -177,7 +177,7 @@ void detectAndDraw( Mat& img, CascadeClassifier& cascade,
|
||||
resize( gray, smallImg, Size(), fx, fx, INTER_LINEAR );
|
||||
equalizeHist( smallImg, smallImg );
|
||||
|
||||
t = (double)cvGetTickCount();
|
||||
t = (double)getTickCount();
|
||||
cascade.detectMultiScale( smallImg, faces,
|
||||
1.1, 2, 0
|
||||
//|CASCADE_FIND_BIGGEST_OBJECT
|
||||
@ -198,8 +198,8 @@ void detectAndDraw( Mat& img, CascadeClassifier& cascade,
|
||||
faces.push_back(Rect(smallImg.cols - r->x - r->width, r->y, r->width, r->height));
|
||||
}
|
||||
}
|
||||
t = (double)cvGetTickCount() - t;
|
||||
printf( "detection time = %g ms\n", t/((double)cvGetTickFrequency()*1000.) );
|
||||
t = (double)getTickCount() - t;
|
||||
printf( "detection time = %g ms\n", t*1000/getTickFrequency());
|
||||
for ( size_t i = 0; i < faces.size(); i++ )
|
||||
{
|
||||
Rect r = faces[i];
|
||||
|
@ -6,9 +6,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/objdetect.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/videoio/videoio.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/videoio.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/videoio/videoio.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/videoio.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* filestorage_sample demonstrate the usage of the opencv serialization functionality
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
|
@ -14,10 +14,11 @@
|
||||
*
|
||||
*
|
||||
********************************************************************************/
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
|
||||
using namespace cv; // all the new API is put into "cv" namespace. Export its content
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/videoio/videoio.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/videoio.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*this creates a yaml or xml list of files from the command line args
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/photo/photo.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/photo.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
// testOpenCVCam.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "opencv2/videoio/videoio.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/videoio.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "opencv2/videoio/videoio.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/videoio.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/ml/ml.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/ml.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/videoio/videoio.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/videoio.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <ctype.h>
|
||||
|
@ -1,11 +1,8 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@ -23,6 +20,9 @@ int main(int argc, char** argv)
|
||||
|
||||
Mat image = imread(in, IMREAD_GRAYSCALE);
|
||||
|
||||
if( image.empty() )
|
||||
{ return -1; }
|
||||
|
||||
#if 0
|
||||
Canny(image, image, 50, 200, 3); // Apply canny edge
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
@ -66,7 +66,7 @@ int main( int argc, char** argv )
|
||||
return 0;
|
||||
}
|
||||
std::string filename = parser.get<std::string>("@image");
|
||||
if( (src = imread(filename,1)).empty() )
|
||||
if( (src = imread(filename,IMREAD_COLOR)).empty() )
|
||||
{
|
||||
help();
|
||||
return -1;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "opencv2/videoio/videoio.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -21,6 +21,8 @@ static void help()
|
||||
"2.) Data given from RGB image generator\n"
|
||||
" CAP_OPENNI_BGR_IMAGE - color image (CV_8UC3)\n"
|
||||
" CAP_OPENNI_GRAY_IMAGE - gray image (CV_8UC1)\n"
|
||||
"2.) Data given from IR image generator\n"
|
||||
" CAP_OPENNI_IR_IMAGE - gray image (CV_16UC1)\n"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -92,8 +94,8 @@ static void printCommandLineParams()
|
||||
cout << "-mode= image mode: resolution and fps, supported three values: 0 - CAP_OPENNI_VGA_30HZ, 1 - CAP_OPENNI_SXGA_15HZ," << endl;
|
||||
cout << " 2 - CAP_OPENNI_SXGA_30HZ (0 by default). Ignored if rgb image or gray image are not selected to show." << endl;
|
||||
cout << "-m= Mask to set which output images are need. It is a string of size 5. Each element of this is '0' or '1' and" << endl;
|
||||
cout << " determine: is depth map, disparity map, valid pixels mask, rgb image, gray image need or not (correspondently)?" << endl ;
|
||||
cout << " By default -m=01010 i.e. disparity map and rgb image will be shown." << endl ;
|
||||
cout << " determine: is depth map, disparity map, valid pixels mask, rgb image, gray image need or not (correspondently), ir image" << endl ;
|
||||
cout << " By default -m=010100 i.e. disparity map and rgb image will be shown." << endl ;
|
||||
cout << "-r= Filename of .oni video file. The data will grabbed from it." << endl ;
|
||||
}
|
||||
|
||||
@ -101,7 +103,7 @@ static void parseCommandLine( int argc, char* argv[], bool& isColorizeDisp, bool
|
||||
string& filename, bool& isFileReading )
|
||||
{
|
||||
filename.clear();
|
||||
cv::CommandLineParser parser(argc, argv, "{h help||}{cd|1|}{fmd|0|}{mode|0|}{m|01010|}{r||}");
|
||||
cv::CommandLineParser parser(argc, argv, "{h help||}{cd|1|}{fmd|0|}{mode|-1|}{m|010100|}{r||}");
|
||||
if (parser.has("h"))
|
||||
{
|
||||
help();
|
||||
@ -121,14 +123,14 @@ static void parseCommandLine( int argc, char* argv[], bool& isColorizeDisp, bool
|
||||
help();
|
||||
exit(-1);
|
||||
}
|
||||
if (flags % 100000 == 0)
|
||||
if (flags % 1000000 == 0)
|
||||
{
|
||||
cout << "No one output image is selected." << endl;
|
||||
exit(0);
|
||||
}
|
||||
for (int i = 0; i < 5; i++)
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
retrievedImageFlags[4 - i] = (flags % 10 != 0);
|
||||
retrievedImageFlags[5 - i] = (flags % 10 != 0);
|
||||
flags /= 10;
|
||||
}
|
||||
}
|
||||
@ -141,7 +143,7 @@ int main( int argc, char* argv[] )
|
||||
{
|
||||
bool isColorizeDisp, isFixedMaxDisp;
|
||||
int imageMode;
|
||||
bool retrievedImageFlags[5];
|
||||
bool retrievedImageFlags[6];
|
||||
string filename;
|
||||
bool isVideoReading;
|
||||
parseCommandLine( argc, argv, isColorizeDisp, isFixedMaxDisp, imageMode, retrievedImageFlags, filename, isVideoReading );
|
||||
@ -165,7 +167,7 @@ int main( int argc, char* argv[] )
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( !isVideoReading )
|
||||
if( !isVideoReading && imageMode >= 0 )
|
||||
{
|
||||
bool modeRes=false;
|
||||
switch ( imageMode )
|
||||
@ -193,13 +195,35 @@ int main( int argc, char* argv[] )
|
||||
cout << "\nThis image mode is not supported by the device, the default value (CV_CAP_OPENNI_SXGA_15HZ) will be used.\n" << endl;
|
||||
}
|
||||
|
||||
// turn on depth, color and IR if needed
|
||||
if (retrievedImageFlags[0] || retrievedImageFlags[1] || retrievedImageFlags[2])
|
||||
capture.set(CAP_OPENNI_DEPTH_GENERATOR_PRESENT, true);
|
||||
else
|
||||
capture.set(CAP_OPENNI_DEPTH_GENERATOR_PRESENT, false);
|
||||
if (retrievedImageFlags[3] || retrievedImageFlags[4])
|
||||
capture.set(CAP_OPENNI_IMAGE_GENERATOR_PRESENT, true);
|
||||
else
|
||||
capture.set(CAP_OPENNI_IMAGE_GENERATOR_PRESENT, false);
|
||||
if (retrievedImageFlags[5])
|
||||
capture.set(CAP_OPENNI_IR_GENERATOR_PRESENT, true);
|
||||
else
|
||||
capture.set(CAP_OPENNI_IR_GENERATOR_PRESENT, false);
|
||||
|
||||
// Print some avalible device settings.
|
||||
cout << "\nDepth generator output mode:" << endl <<
|
||||
"FRAME_WIDTH " << capture.get( CAP_PROP_FRAME_WIDTH ) << endl <<
|
||||
"FRAME_HEIGHT " << capture.get( CAP_PROP_FRAME_HEIGHT ) << endl <<
|
||||
"FRAME_MAX_DEPTH " << capture.get( CAP_PROP_OPENNI_FRAME_MAX_DEPTH ) << " mm" << endl <<
|
||||
"FPS " << capture.get( CAP_PROP_FPS ) << endl <<
|
||||
"REGISTRATION " << capture.get( CAP_PROP_OPENNI_REGISTRATION ) << endl;
|
||||
if (capture.get(CAP_OPENNI_DEPTH_GENERATOR_PRESENT))
|
||||
{
|
||||
cout << "\nDepth generator output mode:" << endl <<
|
||||
"FRAME_WIDTH " << capture.get(CAP_PROP_FRAME_WIDTH) << endl <<
|
||||
"FRAME_HEIGHT " << capture.get(CAP_PROP_FRAME_HEIGHT) << endl <<
|
||||
"FRAME_MAX_DEPTH " << capture.get(CAP_PROP_OPENNI_FRAME_MAX_DEPTH) << " mm" << endl <<
|
||||
"FPS " << capture.get(CAP_PROP_FPS) << endl <<
|
||||
"REGISTRATION " << capture.get(CAP_PROP_OPENNI_REGISTRATION) << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "\nDevice doesn't contain depth generator or it is not selected." << endl;
|
||||
}
|
||||
|
||||
if( capture.get( CAP_OPENNI_IMAGE_GENERATOR_PRESENT ) )
|
||||
{
|
||||
cout <<
|
||||
@ -210,9 +234,20 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "\nDevice doesn't contain image generator." << endl;
|
||||
if (!retrievedImageFlags[0] && !retrievedImageFlags[1] && !retrievedImageFlags[2])
|
||||
return 0;
|
||||
cout << "\nDevice doesn't contain image generator or it is not selected." << endl;
|
||||
}
|
||||
|
||||
if( capture.get(CAP_OPENNI_IR_GENERATOR_PRESENT) )
|
||||
{
|
||||
cout <<
|
||||
"\nIR generator output mode:" << endl <<
|
||||
"FRAME_WIDTH " << capture.get(CAP_OPENNI_IR_GENERATOR + CAP_PROP_FRAME_WIDTH) << endl <<
|
||||
"FRAME_HEIGHT " << capture.get(CAP_OPENNI_IR_GENERATOR + CAP_PROP_FRAME_HEIGHT) << endl <<
|
||||
"FPS " << capture.get(CAP_OPENNI_IR_GENERATOR + CAP_PROP_FPS) << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "\nDevice doesn't contain IR generator or it is not selected." << endl;
|
||||
}
|
||||
|
||||
for(;;)
|
||||
@ -222,6 +257,7 @@ int main( int argc, char* argv[] )
|
||||
Mat disparityMap;
|
||||
Mat bgrImage;
|
||||
Mat grayImage;
|
||||
Mat irImage;
|
||||
|
||||
if( !capture.grab() )
|
||||
{
|
||||
@ -261,6 +297,13 @@ int main( int argc, char* argv[] )
|
||||
|
||||
if( retrievedImageFlags[4] && capture.retrieve( grayImage, CAP_OPENNI_GRAY_IMAGE ) )
|
||||
imshow( "gray image", grayImage );
|
||||
|
||||
if( retrievedImageFlags[5] && capture.retrieve( irImage, CAP_OPENNI_IR_IMAGE ) )
|
||||
{
|
||||
Mat ir8;
|
||||
irImage.convertTo(ir8, CV_8U, 256.0 / 3500, 0.0);
|
||||
imshow("IR image", ir8);
|
||||
}
|
||||
}
|
||||
|
||||
if( waitKey( 30 ) >= 0 )
|
||||
|
@ -42,9 +42,9 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/videoio/videoio.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/videoio.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
|
@ -1,94 +1,75 @@
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include "opencv2/videoio/videoio_c.h"
|
||||
#include "opencv2/highgui/highgui_c.h"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
using namespace cv;
|
||||
|
||||
static void help( void )
|
||||
{
|
||||
printf("\nThis program illustrates Linear-Polar and Log-Polar image transforms\n"
|
||||
"Usage :\n"
|
||||
"./polar_transforms [[camera number -- Default 0],[AVI path_filename]]\n\n"
|
||||
);
|
||||
"./polar_transforms [[camera number -- Default 0],[path_to_filename]]\n\n");
|
||||
}
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
CvCapture* capture = 0;
|
||||
IplImage* log_polar_img = 0;
|
||||
IplImage* lin_polar_img = 0;
|
||||
IplImage* recovered_img = 0;
|
||||
VideoCapture capture;
|
||||
Mat log_polar_img, lin_polar_img, recovered_log_polar, recovered_lin_polar_img;
|
||||
|
||||
help();
|
||||
cv::CommandLineParser parser(argc, argv, "{help h||}{@input|0|}");
|
||||
if (parser.has("help"))
|
||||
{
|
||||
help();
|
||||
return 0;
|
||||
}
|
||||
|
||||
CommandLineParser parser(argc, argv, "{@input|0|}");
|
||||
std::string arg = parser.get<std::string>("@input");
|
||||
|
||||
if( arg.size() == 1 && isdigit(arg[0]) )
|
||||
capture = cvCaptureFromCAM( arg[0] - '0' );
|
||||
capture.open( arg[0] - '0' );
|
||||
else
|
||||
capture = cvCaptureFromAVI( arg.c_str() );
|
||||
if( !capture )
|
||||
capture.open( arg.c_str() );
|
||||
|
||||
if( !capture.isOpened() )
|
||||
{
|
||||
const char* name = argv[0];
|
||||
fprintf(stderr,"Could not initialize capturing...\n");
|
||||
fprintf(stderr,"Usage: %s <CAMERA_NUMBER> , or \n %s <VIDEO_FILE>\n", name, name);
|
||||
help();
|
||||
return -1;
|
||||
}
|
||||
|
||||
cvNamedWindow( "Linear-Polar", 0 );
|
||||
cvNamedWindow( "Log-Polar", 0 );
|
||||
cvNamedWindow( "Recovered image", 0 );
|
||||
namedWindow( "Linear-Polar", WINDOW_NORMAL );
|
||||
namedWindow( "Log-Polar", WINDOW_NORMAL );
|
||||
namedWindow( "Recovered Linear-Polar", WINDOW_NORMAL );
|
||||
namedWindow( "Recovered Log-Polar", WINDOW_NORMAL );
|
||||
|
||||
cvMoveWindow( "Linear-Polar", 20,20 );
|
||||
cvMoveWindow( "Log-Polar", 700,20 );
|
||||
cvMoveWindow( "Recovered image", 20,700 );
|
||||
moveWindow( "Linear-Polar", 20,20 );
|
||||
moveWindow( "Log-Polar", 700,20 );
|
||||
moveWindow( "Recovered Linear-Polar", 20, 350 );
|
||||
moveWindow( "Recovered Log-Polar", 700, 350 );
|
||||
|
||||
for(;;)
|
||||
{
|
||||
IplImage* frame = 0;
|
||||
Mat frame;
|
||||
capture >> frame;
|
||||
|
||||
frame = cvQueryFrame( capture );
|
||||
if( !frame )
|
||||
if( frame.empty() )
|
||||
break;
|
||||
|
||||
if( !log_polar_img )
|
||||
{
|
||||
log_polar_img = cvCreateImage( cvSize(frame->width,frame->height), IPL_DEPTH_8U, frame->nChannels );
|
||||
lin_polar_img = cvCreateImage( cvSize(frame->width,frame->height), IPL_DEPTH_8U, frame->nChannels );
|
||||
recovered_img = cvCreateImage( cvSize(frame->width,frame->height), IPL_DEPTH_8U, frame->nChannels );
|
||||
}
|
||||
Point2f center( (float)frame.cols / 2, (float)frame.rows / 2 );
|
||||
double M = (double)frame.cols / 8;
|
||||
|
||||
cvLogPolar(frame,log_polar_img,cvPoint2D32f(frame->width >> 1,frame->height >> 1),70, CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS);
|
||||
cvLinearPolar(frame,lin_polar_img,cvPoint2D32f(frame->width >> 1,frame->height >> 1),70, CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS);
|
||||
logPolar(frame,log_polar_img, center, M, INTER_LINEAR + WARP_FILL_OUTLIERS);
|
||||
linearPolar(frame,lin_polar_img, center, M, INTER_LINEAR + WARP_FILL_OUTLIERS);
|
||||
|
||||
#if 0
|
||||
cvLogPolar(log_polar_img,recovered_img,cvPoint2D32f(frame->width >> 1,frame->height >> 1),70, CV_WARP_INVERSE_MAP+CV_INTER_LINEAR);
|
||||
#else
|
||||
cvLinearPolar(lin_polar_img,recovered_img,cvPoint2D32f(frame->width >> 1,frame->height >> 1),70, CV_WARP_INVERSE_MAP+CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS);
|
||||
#endif
|
||||
logPolar(log_polar_img, recovered_log_polar, center, M, WARP_INVERSE_MAP + INTER_LINEAR);
|
||||
linearPolar(lin_polar_img, recovered_lin_polar_img, center, M, WARP_INVERSE_MAP + INTER_LINEAR + WARP_FILL_OUTLIERS);
|
||||
|
||||
cvShowImage("Log-Polar", log_polar_img );
|
||||
cvShowImage("Linear-Polar", lin_polar_img );
|
||||
cvShowImage("Recovered image", recovered_img );
|
||||
imshow("Log-Polar", log_polar_img );
|
||||
imshow("Linear-Polar", lin_polar_img );
|
||||
imshow("Recovered Linear-Polar", recovered_lin_polar_img );
|
||||
imshow("Recovered Log-Polar", recovered_log_polar );
|
||||
|
||||
if( cvWaitKey(10) >= 0 )
|
||||
if( waitKey(10) >= 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
cvReleaseCapture( &capture );
|
||||
cvDestroyWindow("Linear-Polar");
|
||||
cvDestroyWindow("Log-Polar");
|
||||
cvDestroyWindow("Recovered image");
|
||||
|
||||
waitKey(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _EiC
|
||||
main(1,"laplace.c");
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/videoio/videoio.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/videoio.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/video/background_segm.hpp"
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
@ -2,10 +2,10 @@
|
||||
// It loads several images sequentially and tries to find squares in
|
||||
// each image
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
@ -23,8 +23,8 @@ static void help()
|
||||
"Returns sequence of squares detected on the image.\n"
|
||||
"the sequence is stored in the specified memory storage\n"
|
||||
"Call:\n"
|
||||
"./squares\n"
|
||||
"Using OpenCV version %s\n" << CV_VERSION << "\n" << endl;
|
||||
"./squares [file_name (optional)]\n"
|
||||
"Using OpenCV version " << CV_VERSION << "\n" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -140,11 +140,18 @@ static void drawSquares( Mat& image, const vector<vector<Point> >& squares )
|
||||
}
|
||||
|
||||
|
||||
int main(int /*argc*/, char** /*argv*/)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
static const char* names[] = { "../data/pic1.png", "../data/pic2.png", "../data/pic3.png",
|
||||
"../data/pic4.png", "../data/pic5.png", "../data/pic6.png", 0 };
|
||||
help();
|
||||
|
||||
if( argc > 1)
|
||||
{
|
||||
names[0] = argv[1];
|
||||
names[1] = "0";
|
||||
}
|
||||
|
||||
namedWindow( wndname, 1 );
|
||||
vector<vector<Point> > squares;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* easy as CV_PI right?
|
||||
*/
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
*/
|
||||
|
||||
#include <opencv2/imgcodecs.hpp>
|
||||
#include <opencv2/videoio/videoio.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/videoio.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
@ -22,10 +22,10 @@
|
||||
GitHub: https://github.com/Itseez/opencv/
|
||||
************************************************** */
|
||||
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
@ -8,9 +8,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "opencv2/ml/ml.hpp"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/ml.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace cv;
|
||||
|
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
|
@ -5,10 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -24,10 +23,10 @@ int main( int, char** argv )
|
||||
const char* equalized_window = "Equalized Image";
|
||||
|
||||
/// Load image
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ cout<<"Usage: ./Histogram_Demo <path_to_image>"<<endl;
|
||||
{ cout<<"Usage: ./EqualizeHist_Demo <path_to_image>"<<endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@ -27,11 +26,24 @@ void MatchingMethod( int, void* );
|
||||
/**
|
||||
* @function main
|
||||
*/
|
||||
int main( int, char** argv )
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
cout << "Not enough parameters" << endl;
|
||||
cout << "Usage:\n./MatchTemplate_Demo <image_name> <template_name>" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// Load image and template
|
||||
img = imread( argv[1], 1 );
|
||||
templ = imread( argv[2], 1 );
|
||||
img = imread( argv[1], IMREAD_COLOR );
|
||||
templ = imread( argv[2], IMREAD_COLOR );
|
||||
|
||||
if(img.empty() || templ.empty())
|
||||
{
|
||||
cout << "Can't read one of the images" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// Create windows
|
||||
namedWindow( image_window, WINDOW_AUTOSIZE );
|
||||
|
@ -4,9 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -27,7 +27,13 @@ void Hist_and_Backproj(int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Read the image
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ cout<<"Usage: ./calcBackProject_Demo1 <path_to_image>"<<endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// Transform it to HSV
|
||||
cvtColor( src, hsv, COLOR_BGR2HSV );
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -30,7 +30,7 @@ void pickPoint (int event, int x, int y, int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Read the image
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
/// Transform it to HSV
|
||||
cvtColor( src, hsv, COLOR_BGR2HSV );
|
||||
|
||||
|
@ -4,11 +4,10 @@
|
||||
* @author
|
||||
*/
|
||||
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@ -16,12 +15,19 @@ using namespace cv;
|
||||
/**
|
||||
* @function main
|
||||
*/
|
||||
int main( int, char** argv )
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Mat src, dst;
|
||||
|
||||
/// Load image
|
||||
src = imread( argv[1], 1 );
|
||||
String imageName( "../data/lena.jpg" ); // by default
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
imageName = argv[1];
|
||||
}
|
||||
|
||||
src = imread( imageName, IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
|
@ -5,10 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@ -26,13 +25,19 @@ int main( int argc, char** argv )
|
||||
/// Load three images with different environment settings
|
||||
if( argc < 4 )
|
||||
{
|
||||
printf("** Error. Usage: ./compareHist_Demo <image_settings0> <image_setting1> <image_settings2>\n");
|
||||
printf("** Error. Usage: ./compareHist_Demo <image_settings0> <image_settings1> <image_settings2>\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
src_base = imread( argv[1], 1 );
|
||||
src_test1 = imread( argv[2], 1 );
|
||||
src_test2 = imread( argv[3], 1 );
|
||||
src_base = imread( argv[1], IMREAD_COLOR );
|
||||
src_test1 = imread( argv[2], IMREAD_COLOR );
|
||||
src_test2 = imread( argv[3], IMREAD_COLOR );
|
||||
|
||||
if(src_base.empty() || src_test1.empty() || src_test2.empty())
|
||||
{
|
||||
cout << "Can't read one of the images" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// Convert to HSV
|
||||
cvtColor( src_base, hsv_base, COLOR_BGR2HSV );
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -32,7 +30,7 @@ void Dilation( int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load an image
|
||||
src = imread( argv[1] );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -34,7 +32,7 @@ void Morphology_Operations( int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load an image
|
||||
src = imread( argv[1] );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
@ -67,7 +65,6 @@ int main( int, char** argv )
|
||||
*/
|
||||
void Morphology_Operations( int, void* )
|
||||
{
|
||||
|
||||
// Since MORPH_X : 2,3,4,5 and 6
|
||||
int operation = morph_operator + 2;
|
||||
|
||||
|
@ -4,12 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
|
@ -3,13 +3,10 @@
|
||||
* brief Sample code for simple filters
|
||||
* author OpenCV team
|
||||
*/
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
@ -35,7 +32,7 @@ int main( void )
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Load the source image
|
||||
src = imread( "../data/lena.jpg", 1 );
|
||||
src = imread( "../data/lena.jpg", IMREAD_COLOR );
|
||||
|
||||
if( display_caption( "Original Image" ) != 0 ) { return 0; }
|
||||
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -35,10 +33,13 @@ void Threshold_Demo( int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load an image
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
|
||||
/// Convert the image to Gray
|
||||
cvtColor( src, src_gray, COLOR_RGB2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Create a window to display results
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -50,7 +48,7 @@ static void CannyThreshold(int, void*)
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load an image
|
||||
src = imread( argv[1] );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
|
@ -5,10 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -31,7 +30,7 @@ int main( int, char** argv )
|
||||
Mat src, warp_dst, warp_rotate_dst;
|
||||
|
||||
/// Load the image
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
/// Set the dst image the same type and size as src
|
||||
warp_dst = Mat::zeros( src.rows, src.cols, src.type() );
|
||||
|
@ -5,8 +5,8 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
@ -63,7 +63,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
|
||||
// Read the image
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{
|
||||
|
@ -5,10 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -39,7 +38,7 @@ void Probabilistic_Hough( int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Read the image
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ help();
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -26,7 +24,7 @@ int main( int, char** argv )
|
||||
const char* window_name = "Laplace Demo";
|
||||
|
||||
/// Load an image
|
||||
src = imread( argv[1] );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
|
@ -5,10 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -27,7 +26,7 @@ void update_map( void );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load the image
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
/// Create dst, map_x and map_y with the same size as src:
|
||||
dst.create( src.size(), src.type() );
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -26,7 +24,7 @@ int main( int, char** argv )
|
||||
int ddepth = CV_16S;
|
||||
|
||||
/// Load an image
|
||||
src = imread( argv[1] );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -28,7 +26,7 @@ int main( int, char** argv )
|
||||
int c;
|
||||
|
||||
/// Load an image
|
||||
src = imread( argv[1] );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@ -30,7 +28,7 @@ int main ( int, char** argv )
|
||||
int c;
|
||||
|
||||
/// Load an image
|
||||
src = imread( argv[1] );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
if( src.empty() )
|
||||
{ return -1; }
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -28,7 +26,7 @@ void thresh_callback(int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image
|
||||
src = imread(argv[1]);
|
||||
src = imread(argv[1], IMREAD_COLOR);
|
||||
if (src.empty())
|
||||
{
|
||||
cerr << "No image supplied ..." << endl;
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -28,7 +26,7 @@ void thresh_callback(int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -28,7 +26,7 @@ void thresh_callback(int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -28,7 +26,7 @@ void thresh_callback(int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -28,7 +26,7 @@ void thresh_callback(int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
|
||||
/// Convert image to gray and blur it
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
@ -4,11 +4,9 @@
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
@ -3,12 +3,11 @@
|
||||
* @brief Demo code for detecting corners using OpenCV built-in functions
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -40,7 +39,7 @@ void myHarris_function( int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Set some parameters
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -31,7 +29,7 @@ void cornerHarris_demo( int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Create a window and a trackbar
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -32,7 +30,7 @@ void goodFeaturesToTrack_Demo( int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Create Window
|
||||
|
@ -5,11 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@ -32,7 +30,7 @@ void goodFeaturesToTrack_Demo( int, void* );
|
||||
int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
src = imread( argv[1], IMREAD_COLOR );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Create Window
|
||||
|
@ -21,7 +21,7 @@ using namespace std;
|
||||
static void help()
|
||||
{
|
||||
cout << "This is a camera calibration sample." << endl
|
||||
<< "Usage: calibration configurationFile" << endl
|
||||
<< "Usage: camera_calibration [configuration_file -- default ./default.xml]" << endl
|
||||
<< "Near the sample file you'll find the configuration file, which has detailed help of "
|
||||
"how to edit it. It may be any OpenCV supported file format XML/YAML." << endl;
|
||||
}
|
||||
@ -415,7 +415,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
for(size_t i = 0; i < s.imageList.size(); i++ )
|
||||
{
|
||||
view = imread(s.imageList[i], 1);
|
||||
view = imread(s.imageList[i], IMREAD_COLOR);
|
||||
if(view.empty())
|
||||
continue;
|
||||
remap(view, rview, map1, map2, INTER_LINEAR);
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include "ModelRegistration.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
|
||||
// For text
|
||||
int fontFace = cv::FONT_ITALIC;
|
||||
|
@ -2,11 +2,11 @@
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
// OpenCV
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2//core.hpp>
|
||||
#include <opencv2/core/utility.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
#include <opencv2/video/tracking.hpp>
|
||||
// PnP Tutorial
|
||||
#include "Mesh.h"
|
||||
|
@ -1,10 +1,10 @@
|
||||
// C++
|
||||
#include <iostream>
|
||||
// OpenCV
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/calib3d.hpp>
|
||||
#include <opencv2/features2d.hpp>
|
||||
// PnP Tutorial
|
||||
#include "Mesh.h"
|
||||
#include "Model.h"
|
||||
|
@ -4,12 +4,10 @@
|
||||
* @author A. Huaman
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/calib3d.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user