/*
* 本段程序实现的功能:
* 1.hsv分割目标物
* 2.矩形拟合.
* 3.计算对角线长度
* 4.大小分类
*/
//#include "svd.h"
#include <iostream>
#include <Eigen/SVD>
#include <Eigen/Dense>
#include <pcl/io/pcd_io.h>
#include <pcl/visualization/cloud_viewer.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <geometry_msgs/Pose.h>
#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sensor_msgs/Image.h>
#include <message_filters/subscriber.h>
#include <message_filters/time_synchronizer.h>
//OpenCV2标准头文件
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<std_msgs/Float32.h>
//#include "siyuansu_zhuanhuan.h"
using namespace message_filters;
using namespace std;
using namespace cv;
using namespace sensor_msgs;
using namespace Eigen;
ros::Publisher pose_publisher;
RotatedRect box_left;
void image_process(cv::Mat cameraImage);
Mat srcImage, cameraImage1;//模板rgb, 目标rgb
Mat srcDepth, cameraDepth; //模板depth,目标depth
bool _initBox=false;
double duijiaoxian(double width,double height)
{
double result=sqrt(width*width+height*height);
cout<<"duijiaoxian: "<<result<<endl;
return result;
}
void chatterCallback(const sensor_msgs::ImageConstPtr& msgcol )
{
cv_bridge::CvImagePtr cv_ptr1; // 声明一个CvImage指针的实例
try
{
cv_ptr1 = cv_bridge::toCvCopy(msgcol, sensor_msgs::image_encodings::BGR8); //将ROS消息中的图象信息提取,生成新cv类型的图象,复制给CvImage指针
}
catch(cv_bridge::Exception& e) //异常处理
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
}
using namespace std;
using namespace Eigen;
using namespace Eigen::internal;
using namespace Eigen::Architecture;
typedef unsigned short UINT16, *PUINT16;
cv::Point getpoint_object(cv::Mat img1);
int rh_min = 0, rs_min =43, rv_min = 46;</
番茄的识别判断大小
于 2021-01-12 12:50:19 首次发布
这篇博客介绍了如何使用iOS平台的技术来实现对番茄的识别和大小判断,成功开发出第一版应用,发布于2021年1月12日。
摘要由CSDN通过智能技术生成