Ask Your Question

Heshan Sandeepa's profile - activity

2020-04-10 11:49:04 -0600 received badge  Notable Question (source)
2019-08-27 08:24:53 -0600 received badge  Popular Question (source)
2018-06-07 22:41:22 -0600 received badge  Popular Question (source)
2018-06-07 22:36:42 -0600 commented answer What are the suitable datasets for an Offline English handwritten OCR application

Thanks due, i will check that

2017-12-26 08:37:52 -0600 received badge  Popular Question (source)
2017-12-04 12:43:34 -0600 received badge  Popular Question (source)
2017-05-19 03:24:25 -0600 received badge  Famous Question (source)
2017-01-26 11:00:26 -0600 received badge  Popular Question (source)
2017-01-02 18:05:44 -0600 received badge  Notable Question (source)
2016-03-22 09:33:30 -0600 received badge  Notable Question (source)
2016-02-22 22:56:59 -0600 received badge  Popular Question (source)
2016-01-19 10:48:46 -0600 received badge  Famous Question (source)
2016-01-15 07:41:48 -0600 received badge  Enthusiast
2016-01-14 06:41:35 -0600 commented question I want to use OpenCV library in my app with Android Studio(without manager)

were you able to sync the build.gradle successfully ?

2015-09-22 15:47:31 -0600 received badge  Popular Question (source)
2015-06-05 05:50:01 -0600 received badge  Famous Question (source)
2015-03-23 02:36:59 -0600 commented question Age estimation in OpenCV source code

This is not direct action, you need to go through several steps in order to achieve this. ex

  1. Takes the user image 02 . extract the necessary features 03. classify those with the relevant feature database etc. Read some research papers regarding face recognition first.
2015-03-14 09:30:12 -0600 commented answer segmentation fault with CvSVM predict

Hi, I know this is too late. But i choose the text file instead of XML. There by i was able to append training data again and again.

2015-03-14 09:30:11 -0600 commented answer how to remove trackbar from opencv image window?

@paramesh i know this is too late. But i was meant about the Visual C++ button events in forms. Not related to OpenCV codes.

2015-03-14 09:30:11 -0600 commented answer what is the differences between lines and contours

Hi Barry, thank you very much for your effort and time. really appreciate.

2015-03-06 22:22:13 -0600 received badge  Nice Question (source)
2015-01-15 01:39:39 -0600 received badge  Notable Question (source)
2014-12-09 14:11:50 -0600 marked best answer How to calculate HuMoments for a contour/image in opencv using c++

hi,

i tried out the following tutorial.I used opencv 2.4.2 with visual studio 2010 and c++.(http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/moments/moments.html)

there i can calculate moments for each and every contour of the image, like this

vector<Moments> mu(contours.size() );
for( int i = 0; i < contours.size(); i++ )
{
   mu[i] = moments( contours[i], false );
}

then i tried to calculate Hu-Moments in the same way. i tried with various combinations, but didn't got it work. My problems are,

  1. is it possible to calculate Hu-Moments only for a one contour ?
  2. should i calculate Hu-Moments for the whole image?

please can anyone explain this with some examples?

2014-12-09 14:08:25 -0600 marked best answer How to read pixels from MNIST digit database and create the iplimage

hi, i am involved with handwritten OCR application. I use MNIST digit database for training process here. I use following code for read pixels from the database and re-create the image. programs doesnt give any error but it gives meaningless image(totally black images and unclear pixels patterns) as output. can someone explain the reason for that? plz help

here is my code

int reverseInt(int i) {
unsigned char c1, c2, c3, c4;
c1 = i & 255;
c2 = (i >> 8) & 255;
c3 = (i >> 16) & 255;
c4 = (i >> 24) & 255;
return ((int)c1 << 24) + ((int)c2 << 16) + ((int)c3 << 8) + c4;
}

void create_image(CvSize size, int channels, unsigned char* data, int imagenumber) {
string imgname; ostringstream imgstrm;string fullpath;
imgstrm << imagenumber;
imgname=imgstrm.str();
fullpath="D:\\"+imgname+".jpg";

IplImage *imghead=cvCreateImageHeader(size, IPL_DEPTH_16S, channels);
imghead->imageData=(char *)data;
cvSaveImage(fullpath.c_str(),imghead);  
}

int main(){
ifstream file ("D:\\train-images.idx3-ubyte",ios::binary);
if (file.is_open())
{
    int magic_number=0; int number_of_images=0;int r; int c;
    int n_rows=0; int n_cols=0;CvSize size;unsigned char temp=0;

    file.read((char*)&magic_number,sizeof(magic_number)); 
    magic_number= reverseInt(magic_number);

    file.read((char*)&number_of_images,sizeof(number_of_images));
    number_of_images= reverseInt(number_of_images);

    file.read((char*)&n_rows,sizeof(n_rows));
    n_rows= reverseInt(n_rows);
    file.read((char*)&n_cols,sizeof(n_cols));
    n_cols= reverseInt(n_cols);


    for(int i=0;i<number_of_images;++i)
    {
        for(r=0;r<n_rows;++r)
        {
            for(c=0;c<n_cols;++c)
            {                 
                file.read((char*)&temp,sizeof(temp));
            }           
        }
        size.height=r;size.width=c;
        create_image(size,3, &temp, i);
    }
}
return 0;
}

and this is one of result image

image description

2014-12-09 14:04:15 -0600 marked best answer what is the difference of Mat and Iplimage

i am using opencv and c++ for my OCR application. There i am confusing with Mat and Iplimage data structures. i saw following both ways,

  1. IplImage* img = cvLoadImage("C:/MyPic.jpg");
  2. Mat image = imread( argv[1] );

can any one explain what is the c++ code here? Mat or Iplimage?

2014-12-09 13:52:55 -0600 marked best answer Feature extraction of a binary image

i am doing OCR project using c++ and opencv. I have some black and white images of separated handwritten characters. I want to extract unique features from those images in order to classify them using OpenCV.LIBSVM. can any one tell me what are the suitable algorithms for feature extraction in opencv?

2014-12-09 13:52:14 -0600 marked best answer How to calculate the pixel density of a sampled binary image

hi, this may be a very simple matter, but i have conflict with that. I have split a particular binary image(28 x 28) into (4 x 4) samples. Now i want to calculate the pixel densities of each sample(i use those density values as features in a OCR application). As i know density defines the number of pixels in a particular area, like 7 pixels per square inch. Is that the same in here? all of my samples have 4 pixels. Is there are relationship between Moment->m00 and pixel density ? can someone explain this ? plz help

2014-12-09 13:52:05 -0600 marked best answer What kind of features that can be extracted from binary image

I am doing OCR application in c++ and opencv 2.4.4. I use LIBSVM for classification. In order to classification I have extracted some features like HuMoments, Area of Black-pixels, Ratio between black and white pixels, Ratio of image binding box width and height, Number intersections through the image and Number of end points of the image. In addition to those, i have read that we can use histogram based features and image profile based features. But i have no idea what are they. Can anyone give some examples about them or can anyone say that, what are the other kind of features that i can use to make the feature vector more rich.

2014-12-09 13:52:04 -0600 marked best answer How to calculate the Affine Moment Invariants of a binary image

I have involved with OCR application. There i have selected image invariants moments as a feature for classification. It is mentioned that Affine Moment Invariants can be use to make the feature vector more rich and robust. I am trying to find a way to calculate Affine Moment Invariants, but still not able to do that. Does OpenCV provide a method for that ? if not can anyone give me a suggestion about how to do that ?

thank you

2014-12-09 13:50:58 -0600 marked best answer How to scale data in Open CV LibSVM

hi,

i am developing English Handwriting OCR. I use Zone based approach for feature extraction. Here I use 64 X 64 images. So i have 64 features for one sample image. My SVM will be Multi-class SVM because i have 52 classes for both capital and simple letters. Here is the format of feature vector.

Class A image1 0:0.222000 1:0.0250222 ..... 63:0.000052 Class A image2 (some float values) .... Class A image400 (some float values)

likewise i have 400 images for both 52 classes. I have read as scaling data increase the accuracy of the prediction. But i have few things to be make clear. 01. Can i use Open CV LibSVM as a Multi-class SVM ? 02. How can i scale these feature values ? 03. Is there any function to get the matching probability of each test feature vector in Open CV LibSVM(i search the Open CV 2.4.5 documentation, but i couldn't find this)

can anyone explain these? , and also with some few code lines if possible.

Thank you

2014-12-09 13:48:40 -0600 marked best answer what is the differences between lines and contours

hi,

i tried the tutorial of Canny edge detection and Hough Line Transformation. In Canny we can get contours of a image. And using Hough Line Transform we can get lines, but i didn't understand is there any difference between lines and contours or are both same ? plz can anyone explain ?

2014-12-09 13:46:46 -0600 marked best answer SURF detector error in opencv 2.4.2

hi ,

i tried the following tutorial here. link text

that gives me following 2 errors when running the code, i am using opencv 2.4.2 in visual studio 2010.

  1. error LNK1120: 1 unresolved externals
  2. error LNK2019: unresolved external symbol "public: __cdecl cv::SURF::SURF(double,int,int,bool,bool)" (??0SURF@cv@@QEAA@NHH_N0@Z) referenced in function main

can any one tell me what kind of problem is that?

2014-12-09 13:41:54 -0600 marked best answer how to create opencv application in windows c++ forms

hi, i am doing OCR application using opencv 2.4.3 in visual c++ windows forms(visual studio 2010 ultimate and windows 7 64 bit). before that, i did this OCR application as a c++ console application and it works fine. but when i tried to re-create the same application with visual c++ forms, it gives this error.

ERROR: EMM intrinsics not supported in the pure mode!

i have no idea about how to fix this. can someone tell what is the reason for this error and how to fix that.

thank you

2014-11-20 12:17:04 -0600 received badge  Notable Question (source)
2014-11-13 21:24:22 -0600 marked best answer How to find the intersection point of two lines

hi, i tried the HoughLines tutorial to detect the lines of a image. Now i want to find the intersection points between detected lines. Is there any in built function in opencv for this. If not can any one suggest a way how to get the line intersections in opencv? (with simple example if possible) plz help.