本文整理汇总了C++中remap函数的典型用法代码示例。如果您正苦于以下问题:C++ remap函数的具体用法?C++ remap怎么用?C++ remap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remap函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cvCreateMat
void FrameProcessor::processStereoFrame(const Mat & frameL, const Mat & frameR, Mat & pointCloud){
Mat disparityMap, disparityMapNormalized;
Mat frameTransposedL, frameTransposedR, frameRemappedL, frameRemappedR, frameGrayscaleL, frameGrayscaleR;
Mat rotMatL = cvCreateMat(2,3,CV_32FC1);
Mat rotMatR = cvCreateMat(2,3,CV_32FC1);
// Compute rotation matrix
CvPoint2D32f centerL = cvPoint2D32f( frameL.cols/2, frameL.rows/2 );
rotMatL = getRotationMatrix2D( centerL, 90, 1 );
CvPoint2D32f centerR = cvPoint2D32f( frameR.cols/2, frameR.rows/2 );
rotMatR = getRotationMatrix2D( centerR, 90, 1 );
warpAffine(frameL, frameTransposedL, rotMatL, frameL.size() );
warpAffine(frameR, frameTransposedR, rotMatR, frameR.size() );
//transpose(frameL, frameTransposedL);
//transpose(frameR, frameTransposedR);
remap(frameTransposedL, frameRemappedL, rmap[0][0], rmap[0][1], CV_INTER_LINEAR);
remap(frameTransposedR, frameRemappedR, rmap[1][0], rmap[1][1], CV_INTER_LINEAR);
//imshow("LiveFeedL",frameTransposedL);
//imshow("LiveFeedR",frameTransposedR);
cvtColor(frameRemappedL, frameGrayscaleL, CV_RGB2GRAY);
cvtColor(frameRemappedR, frameGrayscaleR, CV_RGB2GRAY);
BlockMatcher( frameGrayscaleL, frameGrayscaleR, disparityMap, CV_32F);
normalize(disparityMap, disparityMapNormalized, 0, 255, CV_MINMAX, CV_8U);
imshow("Disparity", disparityMapNormalized);
reprojectImageTo3D( disparityMap, pointCloud, Q, false);
}
开发者ID:evil0sheep,项目名称:stereotouch,代码行数:41,代码来源:FrameProcessor.cpp
示例2: main
int main(int argc, char** argv) {
ros::init(argc, argv, "image_undistort_node");
nodelet::Loader nodelet;
nodelet::M_string remap(ros::names::getRemappings());
nodelet::V_string nargv;
std::string nodelet_name = ros::this_node::getName();
ROS_INFO_STREAM("Started " << nodelet_name << " nodelet.");
nodelet.load(nodelet_name, "image_undistort/ImageUndistortNodelet", remap,
nargv);
ros::spin();
return 0;
}
开发者ID:ethz-asl,项目名称:image_undistort,代码行数:12,代码来源:image_undistort_node.cpp
示例3: paddr
vaddr_t
VmMap::remap(paddr_t paddr, size_t siz)
{
//OUTDEBUG("[ VmMap ]");
vaddr_t vaddr = this->getFreeVAddr(paddr, siz);
cout << kernel::Console::HEX
<< "[ VmMap ] VmMap::remap() remapping paddr(0x" << (int) (paddr)
<< ") vaddr(0x" << (int) (vaddr) << ") SIZ[" << kernel::Console::DEC
<< (int) (siz) << "]\n";
vaddr = remap(paddr, vaddr, siz);
return vaddr;
}
开发者ID:GravisZro,项目名称:kiddie,代码行数:12,代码来源:VmMap.cpp
示例4: remap
void blockOopClass::remap(nmethod* nm, frame* fr) {
// the receiver's enclosing nmethod has been recompiled; update the
// map and scope pointer
// frame* home = scope(); // caller ensures liveness
// Map* oldMap = map();
Map* newMap = nm->blockMapFor(this);
// assert(oldMap != newMap, "maps should be different");
// can be equal for receiver block, or could have been remapped in
// one of the sending vframes
if (!newMap) ShouldNotReachHere(); // should have found new block map
remap(newMap, fr);
}
开发者ID:ardeujho,项目名称:self,代码行数:12,代码来源:blockOop.cpp
示例5: getColour
static byte getColour(byte cpuUsage, byte inMin, byte inMax, byte outMin, byte outMax)
{
return remap(
limitVal(
cpuUsage,
inMin,
inMax),
inMin,
inMax,
outMin,
outMax
);
}
开发者ID:Testudoed,项目名称:AVR-USB-RGB-LED-Controller,代码行数:13,代码来源:backend.c
示例6: indexMap
ivector stringIndexer::
indexMap(stringIndexer & A) {
int i;
ivector remap(size);
for (i = 0; i < size; i++) {
if (A.htab.count(unh[i])) {
remap[i] = A.htab[unh[i]];
} else {
remap[i] = 0;
}
}
return remap;
}
开发者ID:codeaudit,项目名称:BIDMach,代码行数:13,代码来源:tparse.cpp
示例7: ptr
bool
ConsumerToConsumer::call_remap_with_VK_PSEUDO_KEY(EventType eventType)
{
Params_KeyboardSpecialEventCallback::auto_ptr ptr(Params_KeyboardSpecialEventCallback::alloc(eventType,
FlagStatus::makeFlags(),
ConsumerKeyCode::VK_PSEUDO_KEY,
false));
if (! ptr) return false;
Params_KeyboardSpecialEventCallback& params = *ptr;
RemapConsumerParams rp(params);
return remap(rp);
}
开发者ID:Bilalh,项目名称:KeyRemap4MacBook,代码行数:13,代码来源:ConsumerToConsumer.cpp
示例8: integral
Probability DefaultDensityStructure::survivalProbabilityImpl(Time t) const {
static GaussChebyshevIntegration integral(48);
// this stores the address of the method to integrate (so that
// we don't have to insert its full expression inside the
// integral below--it's long enough already)
Real (DefaultDensityStructure::*f)(Time) const =
&DefaultDensityStructure::defaultDensityImpl;
// the Gauss-Chebyshev quadratures integrate over [-1,1],
// hence the remapping (and the Jacobian term t/2)
Probability P = 1.0 - integral(remap(bind(f,this,_1), t)) * t/2.0;
//QL_ENSURE(P >= 0.0, "negative survival probability");
return std::max<Real>(P, 0.0);
}
开发者ID:21hub,项目名称:QuantLib,代码行数:13,代码来源:defaultdensitystructure.cpp
示例9: remap
/*
* Remaps a property value from 'form' to 'to'. This is done for all
* logical cores.
*/
static void
remap(lcore_t *lc,
unsigned from,
unsigned to,
getter_fn get,
setter_fn set)
{
if (lc) {
if (get(lc) == from)
set(lc, to);
remap(lc->next, from, to, get, set);
}
}
开发者ID:hemantagr,项目名称:pktgen-dpdk,代码行数:17,代码来源:wr_coremap.c
示例10: __strlen
size_t __strlen(char* c) {
size_t len = 0;
do {
if (len % 0x1000 == 0) {
c = (char*)remap((puint_t)c);
}
if (*c++ == '\0')
break;
else
++len;
} while (true);
return len;
}
开发者ID:Enerccio,项目名称:Cthulhu-OS,代码行数:13,代码来源:paging.c
示例11: __CONTEXT
recChannel_t::~recChannel_t(void)
{
__CONTEXT("recChannel_t::~recChannel_t");
IBaseFilter * pFilter = NULL;
if (camInfo->getKind() == TEST)
{
looper->EndThread();
}
unmap();
camList->lookUp(sourceId)->setFree(true);
pControl->Stop();
looper->EndThread();
delete looper;
delete pSender;
remap();
int hr = 0;
// Enumerate the filters in the graph.
IEnumFilters *pEnum = NULL;
hr = pGraph->EnumFilters(&pEnum);
if (SUCCEEDED(hr))
{
IBaseFilter *pFilter = NULL;
while (S_OK == pEnum->Next(1, &pFilter, NULL))
{
pGraph->RemoveFilter(pFilter);
pFilter->Release();
pEnum->Reset();
}
pEnum->Release();
}
pControl->Release();
pEvent->Release();
pGraph->Release();
channelList->remove(getId());
rtpSession->deleteSender (getId(), "Channel deleted");
#ifdef _WINDOWS
EndThread();
TerminateThread(hThread,0);
#endif
}
开发者ID:cchatterj,项目名称:isabel,代码行数:51,代码来源:recchanel.cpp
示例12: ptr
bool
KeyToKey::call_remap_with_VK_PSEUDO_KEY(EventType eventType)
{
Params_KeyboardEventCallBack::auto_ptr ptr(Params_KeyboardEventCallBack::alloc(eventType,
FlagStatus::makeFlags(),
KeyCode::VK_PSEUDO_KEY,
CommonData::getcurrent_keyboardType(),
false));
if (! ptr) return false;
Params_KeyboardEventCallBack& params = *ptr;
RemapParams rp(params);
return remap(rp);
}
开发者ID:Bilalh,项目名称:KeyRemap4MacBook,代码行数:14,代码来源:KeyToKey.cpp
示例13: main
/** Main node entry point. */
int main(int argc, char **argv)
{
ros::init(argc, argv, "camera1394_node");
nodelet::Loader nodelet;
nodelet::M_string remap(ros::names::getRemappings());
nodelet::V_string nargv;
nodelet.load("camera1394_node", "camera1394/driver", remap, nargv);
ros::spin();
return 0;
}
开发者ID:silverbullet1,项目名称:bbauv,代码行数:15,代码来源:node.cpp
示例14: main
int main(int argc, char **argv)
{
ros::init(argc, argv, "localizer_node");
nodelet::Loader nodelet;
nodelet::M_string remap(ros::names::getRemappings());
nodelet::V_string nargv;
nodelet.load("localizer", "localizer/LocalizerNodelet", remap, nargv);
ros::spin();
return 0;
}
开发者ID:DenisBavcar,项目名称:vicos_ros,代码行数:14,代码来源:localizer_node.cpp
示例15: main
int main(int argc, char** argv) {
ros::init(argc, argv, "zed_wrapper_node");
nodelet::Loader nodelet;
nodelet::M_string remap(ros::names::getRemappings());
nodelet::V_string nargv;
nodelet.load(ros::this_node::getName(),
"zed_wrapper/ZEDWrapperNodelet",
remap, nargv);
ros::spin();
return 0;
}
开发者ID:DapengChalmers,项目名称:ZSLAM_TX2,代码行数:14,代码来源:zed_wrapper_node.cpp
示例16: CV_Assert
void MoreAccurateMotionWobbleSuppressor::suppress(int idx, const Mat &frame, Mat &result)
{
CV_Assert(motions_ && stabilizationMotions_);
if (idx % period_ == 0)
{
result = frame;
return;
}
int k1 = idx / period_ * period_;
int k2 = std::min(k1 + period_, frameCount_ - 1);
Mat S1 = (*stabilizationMotions_)[idx];
Mat_<float> ML = S1 * getMotion(k1, idx, *motions2_) * getMotion(k1, idx, *motions_).inv() * S1.inv();
Mat_<float> MR = S1 * getMotion(idx, k2, *motions2_).inv() * getMotion(idx, k2, *motions_) * S1.inv();
mapx_.create(frame.size());
mapy_.create(frame.size());
float xl, yl, zl, wl;
float xr, yr, zr, wr;
for (int y = 0; y < frame.rows; ++y)
{
for (int x = 0; x < frame.cols; ++x)
{
xl = ML(0,0)*x + ML(0,1)*y + ML(0,2);
yl = ML(1,0)*x + ML(1,1)*y + ML(1,2);
zl = ML(2,0)*x + ML(2,1)*y + ML(2,2);
xl /= zl; yl /= zl;
wl = float(idx - k1);
xr = MR(0,0)*x + MR(0,1)*y + MR(0,2);
yr = MR(1,0)*x + MR(1,1)*y + MR(1,2);
zr = MR(2,0)*x + MR(2,1)*y + MR(2,2);
xr /= zr; yr /= zr;
wr = float(k2 - idx);
mapx_(y,x) = (wr * xl + wl * xr) / (wl + wr);
mapy_(y,x) = (wr * yl + wl * yr) / (wl + wr);
}
}
if (result.data == frame.data)
result = Mat(frame.size(), frame.type());
remap(frame, result, mapx_, mapy_, INTER_LINEAR, BORDER_REPLICATE);
}
开发者ID:silasxue,项目名称:Video-Stabilization-with-GPU,代码行数:50,代码来源:wobble_suppression.cpp
示例17: onTrackbar2
//------------------------------------------------------------------------------
static void onTrackbar2(int, void*)
{
create_perspecive_undistortion_LUT( mapx_persp2, mapy_persp2, &o2, sf );
mapx_persp_right = Mat(mapx_persp2); // to copy the data
mapy_persp_right = Mat(mapy_persp2); // to copy the data
/*hconcat(mapx_persp_right,mapx_persp_left,mapx_persp_right);
hconcat(mapy_persp_right,mapy_persp_left,mapy_persp_right);*/
remap(src2, dst_persp2, mapx_persp_right, mapy_persp_right, CV_INTER_LINEAR, BORDER_CONSTANT, Scalar(0,0,0) );
imshow( "rectified image2", dst_persp2 );
}
开发者ID:Domino2015,项目名称:ComputerVision_DRC,代码行数:15,代码来源:fisheye_v5.cpp
示例18: imread
void CameraCalibration::DrawRectifiedImage(const int c_idx, const int img_idx) const
{
view[c_idx]->ActivateScissorAndClear();
Mat img = imread(data_path+"/"+calib_params[c_idx].ImageList.at(img_idx), 0);
Mat canvas(ImageSize.width, ImageSize.height, CV_8UC3);
Mat rimg;
if(!c_idx)
{
remap(img, rimg, rect_params->LeftRMAP[0], rect_params->LeftRMAP[1], CV_INTER_LINEAR);
cvtColor(rimg, canvas, CV_GRAY2RGB);
Rect vroi(cvRound(rect_params->LeftRoi.x), cvRound(rect_params->LeftRoi.y),
cvRound(rect_params->LeftRoi.width), cvRound(rect_params->LeftRoi.height));
rectangle(canvas, vroi, Scalar(0,0,255), 3, 8);
}else
{
remap(img, rimg, rect_params->RightRMAP[0], rect_params->RightRMAP[1], CV_INTER_LINEAR);
cvtColor(rimg, canvas, CV_GRAY2RGB);
Rect vroi(cvRound(rect_params->RightRoi.x), cvRound(rect_params->RightRoi.y),
cvRound(rect_params->RightRoi.width), cvRound(rect_params->RightRoi.height));
rectangle(canvas, vroi, Scalar(0,0,255), 3, 8);
}
if(!rect_params->isVerticalStereo)
for(int j=0; j<canvas.rows; j+=16)
line(canvas, Point(0, j), Point(canvas.cols, j), Scalar(0, 255, 0), 1, 8);
else
for(int j=0; j<canvas.cols; j+=16)
line(canvas, Point(j, 0), Point(j, canvas.rows), Scalar(0, 255, 0), 1, 8);
gl_img_tex->Upload(canvas.ptr<unsigned char>(), GL_RGB, GL_UNSIGNED_BYTE);
gl_img_tex->RenderToViewportFlipY();
}
开发者ID:ZYTTAE,项目名称:CameraCalibration,代码行数:37,代码来源:CameraCalibrator.cpp
示例19: main
int main(int argc, char **argv)
{
ros::init(argc, argv, "tracker_mbt");
nodelet::Loader nodelet;
nodelet::M_string remap(ros::names::getRemappings());
nodelet::V_string nargv;
nodelet.load
(ros::this_node::getName (), "visp_tracker/Tracker", remap, nargv);
ros::spin();
return 0;
}
开发者ID:HRZaheri,项目名称:vision_visp,代码行数:15,代码来源:tracker.cpp
示例20: init_tool
bool init_tool(int argc, const char** argv, Options* opts) {
*opts = Options::parse_options(argc, argv);
if(!Options::has_required(*opts))
return false;
COLOR_ENABLED = !opts->has_opt("no-color");
FORCE_SCALE = opts->has_opt("force-scale");
SMOOTH = opts->has_opt("smooth");
SCALE_ENERGY = opts->has_opt("energy");
PRINT_SCALE = opts->has_opt("print-scale");
REPORT_PROGRESS = opts->has_opt("progress");
VLOG = std::ofstream(opts->get_opt<std::string>("vlog", "vlog.log"));
crf.label_alphabet = &alphabet_synth;
baseline_crf.label_alphabet = &alphabet_synth;
build_data(*opts);
pre_process(alphabet_synth, corpus_synth);
pre_process(alphabet_test, corpus_test);
alphabet_synth.optimize();
remap(alphabet_synth, corpus_synth);
alphabet_test.optimize();
remap(alphabet_test, corpus_test);
auto testSize = opts->get_opt<unsigned>("test-corpus-size", 10);
for(auto i = testSize; i < corpus_test.size(); i++)
corpus_eval.add(corpus_test.input(i), corpus_test.label(i));
corpus_test.set_max_size(testSize);
INFO("Synth sequences = " << corpus_synth.size());
INFO("Test sequences = " << corpus_test.size());
INFO("Eval sequences = " << corpus_eval.size());
return true;
}
开发者ID:ivanzamanov,项目名称:mini-crf,代码行数:36,代码来源:tool.cpp
注:本文中的remap函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论