当前位置: 首页 > news >正文

商丘家居网站建设找谁做百度关键词排名

商丘家居网站建设,找谁做百度关键词排名,做网站得花多钱,用jquery做的网站使用opencv c 来调用caffemodel 使用opencv 得dnn 模块调用 caffemodel得程序,图片自己输入就行,不做过多得解释,看代码清单。 定义手指关节点 const int POSE_PAIRS[20][2] { {0,1}, {1,2}, {2,3}, {3,4}, // thumb {0,5}, {5,6}, {6,7}…

使用opencv c++ 来调用caffemodel

使用opencv 得dnn 模块调用 caffemodel得程序,图片自己输入就行,不做过多得解释,看代码清单。
在这里插入图片描述

在这里插入图片描述

定义手指关节点

const int POSE_PAIRS[20][2] =
{
{0,1}, {1,2}, {2,3}, {3,4}, // thumb
{0,5}, {5,6}, {6,7}, {7,8}, // index
{0,9}, {9,10}, {10,11}, {11,12}, // middle
{0,13}, {13,14}, {14,15}, {15,16}, // ring
{0,17}, {17,18}, {18,19}, {19,20} // small
};

string protoFile = “hand/pose_deploy.prototxt”;
string weightsFile = “hand/pose_iter_102000.caffemodel”;

int nPoints = 22;

代码清单

#include <opencv2/dnn.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>using namespace std;
using namespace cv;
using namespace cv::dnn;
#ifdef _DEBUG
#pragma comment(lib,"opencv_world455d.lib")
#else
#pragma comment(lib,"opencv_world455.lib")
#endifconst int POSE_PAIRS[20][2] =
{{0,1}, {1,2}, {2,3}, {3,4},         // thumb{0,5}, {5,6}, {6,7}, {7,8},         // index{0,9}, {9,10}, {10,11}, {11,12},    // middle{0,13}, {13,14}, {14,15}, {15,16},  // ring{0,17}, {17,18}, {18,19}, {19,20}   // small
};string protoFile = "hand/pose_deploy.prototxt";
string weightsFile = "hand/pose_iter_102000.caffemodel";int nPoints = 22;int main(int argc, char **argv)
{string imageFile = "qianbo2.jpg";// Take arguments from commmand lineif (argc == 2){imageFile = argv[1];}float thresh = 0.01;Mat frame = imread(imageFile);Mat frameCopy = frame.clone();int frameWidth = frame.cols;int frameHeight = frame.rows;float aspect_ratio = frameWidth / (float)frameHeight;int inHeight = 368;int inWidth = (int(aspect_ratio*inHeight) * 8) / 8;cout << "inWidth = " << inWidth << " ; inHeight = " << inHeight << endl;double t = (double)cv::getTickCount();Net net = readNetFromCaffe(protoFile, weightsFile);Mat inpBlob = blobFromImage(frame, 1.0 / 255, Size(inWidth, inHeight), Scalar(0, 0, 0), false, false);net.setInput(inpBlob);Mat output = net.forward();int H = output.size[2];int W = output.size[3];// find the position of the body partsvector<Point> points(nPoints);for (int n = 0; n < nPoints; n++){// Probability map of corresponding body's part.Mat probMap(H, W, CV_32F, output.ptr(0, n));resize(probMap, probMap, Size(frameWidth, frameHeight));Point maxLoc;double prob;minMaxLoc(probMap, 0, &prob, 0, &maxLoc);if (prob > thresh){circle(frameCopy, cv::Point((int)maxLoc.x, (int)maxLoc.y), 8, Scalar(0, 255, 255), -1);cv::putText(frameCopy, cv::format("%d", n), cv::Point((int)maxLoc.x, (int)maxLoc.y), cv::FONT_HERSHEY_COMPLEX, 1, cv::Scalar(0, 0, 255), 2);}points[n] = maxLoc;}int nPairs = sizeof(POSE_PAIRS) / sizeof(POSE_PAIRS[0]);for (int n = 0; n < nPairs; n++){// lookup 2 connected body/hand partsPoint2f partA = points[POSE_PAIRS[n][0]];Point2f partB = points[POSE_PAIRS[n][1]];if (partA.x <= 0 || partA.y <= 0 || partB.x <= 0 || partB.y <= 0)continue;line(frame, partA, partB, Scalar(0, 255, 255), 8);circle(frame, partA, 8, Scalar(0, 0, 255), -1);circle(frame, partB, 8, Scalar(0, 0, 255), -1);}t = ((double)cv::getTickCount() - t) / cv::getTickFrequency();cout << "Time Taken = " << t << endl;imshow("Keypoints", frameCopy);imshow("Skeleton", frame);imwrite("out.jpg", frame);waitKey();return 0;
}
http://www.mmbaike.com/news/80548.html

相关文章:

  • 元氏网站建设品牌公关具体要做些什么
  • jquery+js网站模板免费下载国际新闻视频
  • 企业宣传册模版长沙好的seo外包公司
  • 政务门户网站建设方案seo推广论坛
  • 网站上的支付接口怎么做写一篇软文多少钱
  • 如何做各大网站广告链接惠州百度seo
  • 做传销网站后果严重吗搜索推广公司
  • 学院网站怎么做的最新热搜新闻事件
  • 上海十大营销策划公司武汉seo工厂
  • 小工程承包app排名优化方案
  • 网站后台图片滚动效果怎么做北京cms建站模板
  • python做网站快吗新产品推广方案怎么写
  • 下载网址seo收录排名
  • 做鞋原料网站线上营销方案
  • 做网站的书知乎软文之家
  • 好大夫在线网站官网做提眉的医生互联网营销的优势
  • 中山app开发优化网站界面的工具
  • jsp网站开发难吗谷歌广告怎么投放
  • 国际外贸b2b平台济南seo网站关键词排名
  • 网站建设哪家做的好一点百度推广价格
  • 金鹏建设集团网站哪家网站推广好
  • 手机网站设计方案小程序开发公司哪里强
  • 网站做百度联盟收入已经很低了如何做网站设计
  • 免费域名网站百度关键词点击排名
  • 做电影网站要很大的主机空间吗个人网站建设
  • 网站推荐广告模板最新国内新闻10条
  • 网站icp备案管理系统朋友圈推广广告
  • 怎么用自己主机做网站、免费建站工具
  • 跨境电商平台网站建设seo入门培训学校
  • 丹江口做网站高级搜索百度