Revision 53f28116 vision/src/opencvdetect.cpp

View differences:

vision/src/opencvdetect.cpp
59 59
  // detect blob
60 60
  IplImage input(cv_ptr->image);
61 61

  
62
  IplImage* img;
62
  IplImage *img;
63 63
  IplImage *hsv_img;
64 64
  IplImage *bw_img;
65
  IplImage* i1;
65
  IplImage *i1;
66 66
  CBlobResult blobs;
67 67
  CBlob blobArea;
68 68
  
......
105 105

  
106 106
  // Publish blob image
107 107

  
108
  cv_bridge::CvImage blob_image;
109
  //blob_image.header = img->header;
110
  blob_image.encoding = sensor_msgs::image_encodings::BGR8;
111
  blob_image.image = *(img->imageData);
112

  
113
  /*sensor_msgs::Image blob_image; 
114
  blob_image.height = img->height; 
108
  sensor_msgs::Image blob_image;
109
  blob_image.height = img->height;
115 110
  blob_image.width = img->width;
116
  blob_image.data = *(img->imageData); */
111
  blob_image.encoding = sensor_msgs::image_encodings::BGR8;
112
  blob_image.data.resize(img->imageSize);
113
  copy(img->imageData, img->imageData+img->imageSize, blob_image.data.begin());
117 114
  img_pub.publish(blob_image);  
118 115

  
119 116
  // Clean up
......
122 119
  cvReleaseImage(&hsv_img);
123 120
  cvReleaseImage(&img);
124 121

  
125
  //int comX; 
122
  //int comX;
126 123
  //int comY;
127 124
  //int area;
128 125
  

Also available in: Unified diff