Ask Your Question

saurabheights's profile - activity

2016-06-25 10:53:39 -0600 commented answer Conversion from RGB to HSI

Though I am under a lot of work, I will try to submit a PR. Thank you.

2016-06-17 07:50:37 -0600 commented answer Conversion from RGB to HSI

@theodore: Just curious but what crime did HSI model do to not be included in heavenly Opencv library?

2015-12-21 06:22:21 -0600 answered a question How to build an index of a database for image retrieval ?

In file opencv\sources\modules\flann\src\miniflann.cpp, go to line 319:

buildIndex_(void*& index, const Mat& data, const IndexParams& params, const Distance& dist = Distance())
{
   typedef typename Distance::ElementType ElementType;
   if(DataType<ElementType>::type != data.type())
       CV_Error_(CV_StsUnsupportedFormat, ("type=%d\n", data.type()));
   //This is what is **causing the error**
   if(!data.isContinuous())
       CV_Error(CV_StsBadArg, "Only continuous arrays are supported");

   /*The **reason** for the above check was because OpenCv uses flann library. The flann library uses class Matrix<ElementType> for storing Matrix data, but Opencv uses Mat for storing matrix data. Thus we need a way to convert Mat data to Matrix as done below. Here Mat is changed by considering Mat a continuous array, but your Mat is not continuous. You can circumvent this problem by using FLANN library directly and writing your own function to copy Mat(continuous or discontinuous) to Matrix. You can also file for improvement of this feature*/
   ::cvflann::Matrix<ElementType> dataset((ElementType*)data.data, data.rows, data.cols);
   IndexType* _index = new IndexType(dataset, get_params(params), dist);
  _index->buildIndex();
  index = _index;
}
2015-12-11 07:34:21 -0600 received badge  Critic (source)
2015-12-09 04:50:27 -0600 received badge  Enthusiast
2015-12-07 23:53:34 -0600 received badge  Supporter (source)
2015-11-30 05:43:46 -0600 commented answer how to insert a small size image on to a big image

Make sure both images are of same type. You cannot copy grayscale image to color image this way.