-
大小: 1.16MB文件類型: .rar金幣: 2下載: 0 次發布日期: 2024-02-06
- 語言: 其他
- 標簽: robomaster??
資源簡介
robomaster機甲大師比賽大神符和裝甲模塊自動識別和射擊開源
代碼片段和文件信息
/*******************************************************************************************************************
Copyright?2017?Dajiang?Innovations?Technology?Co.?Ltd?(DJI)
Permission?is?hereby?granted?free?of?charge?to?any?person?obtaining?a?copy?of?this?software?and?associated?
documentation?files(the?“Software“)?to?deal?in?the?Software?without?restriction?including?without?limitation
the?rights?to?use?copy?modify?merge?publish?distribute?sublicense?and?/?or?sell?copies?of?the?Software?and?
to?permit?persons?to?whom?the?Software?is?furnished?to?do?so?subject?to?the?following?conditions?:?
The?above?copyright?notice?and?this?permission?notice?shall?be?included?in?all?copies?or?substantial?portions?of
the?Software.
THE?SOFTWARE?IS?PROVIDED?“AS?IS“?WITHOUT?WARRANTY?OF?ANY?KIND?EXPRESS?OR?IMPLIED?INCLUDING?BUT?NOT?LIMITED?TO
THE?WARRANTIES?OF?MERCHANTABILITY?FITNESS?FOR?A?PARTICULAR?PURPOSE?AND?NONINFRINGEMENT.IN?NO?EVENT?SHALL?THE
AUTHORS?OR?COPYRIGHT?HOLDERS?BE?LIABLE?FOR?ANY?CLAIM?DAMAGES?OR?OTHER?LIABILITY?WHETHER?IN?AN?ACTION?OF
CONTRACT?TORT?OR?OTHERWISE?ARISING?FROM?OUT?OF?OR?IN?CONNECTION?WITH?THE?SOFTWARE?OR?THE?USE?OR?OTHER?DEALINGS
IN?THE?SOFTWARE.
*******************************************************************************************************************/
#include?“AngleSolver.hpp“
#include?“opencv2/opencv.hpp“
using?namespace?cv;
using?namespace?std;
void?RectPnPSolver::solvePnP4Points(const?std::vector?&?points2d?cv::Mat?&?rot?cv::Mat?&?trans){
????if(width_target?10e-5?||?height_target?10e-5){
????????rot?=?cv::Mat::eye(33CV_64FC1);
????????trans?=?cv::Mat::zeros(31CV_64FC1);
????????return;
????}
????std::vector?point3d;
????double?half_x?=?width_target?/?2.0;
????double?half_y?=?height_target?/?2.0;
????point3d.push_back(Point3f(-half_x?-half_y?0));
????point3d.push_back(Point3f(half_x?-half_y?0));
????point3d.push_back(Point3f(half_x?half_y?0));
????point3d.push_back(Point3f(-half_x?half_y?0));
????cv::Mat?r;
????cv::solvePnP(point3d?points2d?cam_matrix?distortion_coeff?r?trans);
????Rodrigues(r?rot);
}
void?AngleSolver::setRelationPoseCameraPTZ(const?cv::Mat?&?rot_camera_ptz?const?cv::Mat?&?trans_camera_ptz?double?y_offset_barrel_ptz)?{
????rot_camera_ptz.copyTo(rot_camera2ptz);
????trans_camera_ptz.copyTo(trans_camera2ptz);
????offset_y_barrel_ptz?=?y_offset_barrel_ptz;
}
bool?AngleSolver::getAngle(const?cv::RotatedRect?&?rect?double?&?angle_x?double?&?angle_y?double?bullet_speed?double?current_ptz_angle?const?cv::Point2f?&?offset){
????if?(rect.size.height?1)
????????return?false;
????//?get?3D?positon?in?camera?coordinate
//????double?wh_ratio?=?width_target/height_target;
//????RotatedRect?adj_rect(rect.center?Size2f(rect.size.width?rect.size.width/wh_ratio)?rect.angle);
//????vector?target2d;
//????getTarget2dPoinstion(adj_rect?target2d?offset);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????122??2017-04-21?14:22??第一賽季3組算法技術文檔\README.txt
?????文件???????2480??2017-04-21?13:30??第一賽季3組算法技術文檔\RMVision.pro
?????文件???????7738??2017-04-20?17:53??第一賽季3組算法技術文檔\算法代碼\AngleSolver.cpp
?????文件???????5877??2017-04-20?17:54??第一賽季3組算法技術文檔\算法代碼\AngleSolver.hpp
?????文件??????39780??2017-04-20?17:55??第一賽季3組算法技術文檔\算法代碼\ArmorDetector.cpp
?????文件???????8291??2017-04-20?17:55??第一賽季3組算法技術文檔\算法代碼\ArmorDetector.hpp
?????文件??????60311??2016-09-24?16:55??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-2-100-imagelist.xm
?????文件??????91981??2016-10-13?11:23??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-MH-100-imagelist-640.xm
?????文件??????60314??2016-09-25?12:08??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-MH-100-imagelist.xm
?????文件??????60307??2016-10-08?14:33??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-01-640.xm
?????文件??????60297??2016-09-26?21:22??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-01.xm
?????文件??????91967??2016-10-08?16:10??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-02-640.xm
?????文件??????60309??2016-09-26?21:32??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-02.xm
?????文件??????91968??2016-10-08?15:39??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-03-640.xm
?????文件??????82940??2016-09-26?21:52??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-03.xm
?????文件??????91980??2016-10-08?15:20??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-04-640.xm
?????文件??????60309??2016-09-26?21:46??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-04.xm
?????文件??????91992??2016-10-08?19:27??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-05-640.xm
?????文件??????42213??2016-09-26?21:52??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-05.xm
?????文件??????91979??2016-10-18?19:59??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-06-640.xm
?????文件??????73882??2016-10-18?20:09??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-06.xm
?????文件??????91988??2016-10-18?19:44??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-07-640.xm
?????文件??????69358??2016-10-18?20:55??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-07.xm
?????文件??????91985??2016-10-18?19:52??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-08-640.xm
?????文件??????78407??2016-10-18?20:25??第一賽季3組算法技術文檔\算法代碼\calibration-param\camera-RM3-08.xm
?????文件???????2361??2000-01-01?10:17??第一賽季3組算法技術文檔\算法代碼\calibration-param\param_config.xm
?????文件??????19358??2017-04-20?17:55??第一賽季3組算法技術文檔\算法代碼\cmdline.h
?????文件??????18242??2017-04-20?17:55??第一賽季3組算法技術文檔\算法代碼\ImageConsProd.cpp
?????文件???????1803??2017-04-20?17:55??第一賽季3組算法技術文檔\算法代碼\ImageConsProd.hpp
?????文件???????2034??2017-04-20?17:55??第一賽季3組算法技術文檔\算法代碼\LedController.hpp
............此處省略27個文件信息
- 上一篇:國能安全36號 -電力監控系統安全防護評估規范
- 下一篇:蘋果錄屏大師
評論
共有 條評論