Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef JSK_RECOGNITION_UTILS_CV_UTILS_H_
00037 #define JSK_RECOGNITION_UTILS_CV_UTILS_H_
00038
00039 #include <opencv2/opencv.hpp>
00040 #include <jsk_recognition_msgs/HistogramWithRangeBin.h>
00041
00042 namespace jsk_recognition_utils
00043 {
00051 cv::MatND computeHistogram(const cv::Mat& input_image, int bin_size,
00052 float min_value, float max_value,
00053 const cv::Mat& mask_image);
00054
00059 std::vector<jsk_recognition_msgs::HistogramWithRangeBin>
00060 cvMatNDToHistogramWithRangeBinArray(const cv::MatND& cv_hist, float min_value, float max_value);
00061
00066 cv::MatND
00067 HistogramWithRangeBinArrayTocvMatND(
00068 const std::vector<jsk_recognition_msgs::HistogramWithRangeBin>& histogram);
00069
00074 bool compareHistogramWithRangeBin(const jsk_recognition_msgs::HistogramWithRangeBin& left,
00075 const jsk_recognition_msgs::HistogramWithRangeBin& right);
00076
00082 void sortHistogramWithRangeBinArray(std::vector<jsk_recognition_msgs::HistogramWithRangeBin>& bins);
00083
00089 std::vector<jsk_recognition_msgs::HistogramWithRangeBin>
00090 topNHistogramWithRangeBins(const std::vector<jsk_recognition_msgs::HistogramWithRangeBin>& bins,
00091 double top_n_rate);
00092
00097 void
00098 drawHistogramWithRangeBin(cv::Mat& image,
00099 const jsk_recognition_msgs::HistogramWithRangeBin& bin,
00100 float min_width_value,
00101 float max_width_value,
00102 float max_height_value,
00103 cv::Scalar color);
00104
00109 void labelToRGB(const cv::Mat src, cv::Mat& dst);
00110
00111
00116 cv::Rect boundingRectOfMaskImage(const cv::Mat& image);
00117
00122 bool isBGR(const std::string& encoding);
00123 bool isRGB(const std::string& encoding);
00124 bool isBGRA(const std::string& encoding);
00125 bool isRGBA(const std::string& encoding);
00126
00127 }
00128
00129 #endif