Ask Your Question

kauv's profile - activity

2016-07-14 01:25:49 -0500 received badge  Enthusiast
2016-07-13 03:33:38 -0500 commented question socketdata to image

yep i tried sending rows and cols through the socket and also hardcoding the rows and cols value on the server side.It didn't work .I also tried with different types such as CV_8uc1,CV_8uc2,cv_8uc4.It still results in segmentation fault 11

2016-07-12 14:27:42 -0500 asked a question socketdata to image

Hi

I've implemented a client server app which receives an image on the c++ server. The data is fetched and has to be saved as an image but the problem the server keeps on throwing segmentation fault 11.

uint32_t len;
int lengthbytes = 0;
lengthbytes = recv(newsockfd, (char *)&len, sizeof(len), 0);
printf("%d",len);
int bytes=0;
uchar sockData[len];
for (int i = 0; i < len; i += bytes)
{
    if ((bytes = recv(newsockfd, sockData +i, len  - i, 0)) == -1)
    {
        error("recv failed");
    }

}
Mat img(690,250,CV_8UC3,sockData);
imwrite("/Users/koushikv/Desktop/openCVSampleProject/datasent.png", img);

I think the main problem occurs in the Mat img (690,250,CV_8uC3,sockData) since i've given an arbitary rows, cols and type CV_8uc3. I don't know how to create a image from the socketdata without these parameters .Can someone please help me with this issue? To be clear, i need to convert the uchar socketdata to mat and save the image.

Thank you

2016-07-11 04:31:40 -0500 commented question C/C++ client server bind

yes ::bind worked.I don't understand why bind didn't work in the first place.Anyways thank you :)

2016-07-11 04:06:29 -0500 asked a question C/C++ client server bind

Hi,

I've successfully added openCV to my project and i wanted to implement client-server system. The socket function doesn't throw an error but the bind method does

if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr))<0)

stating "invalid operands to binary expression "__bind<int &amp;,sockaddr="" *,unsigned="" long="">' and 'int'".

I found the bind function is not the same.There seems to be another bind function when i added the openCV library which seems to be overlapping.Can someone please help me with this issue?

Thank you

2016-07-10 04:58:57 -0500 received badge  Editor (source)
2016-07-09 18:31:57 -0500 asked a question OCRTesseract C++

Hi,

Using the end to end text extraction sample as reference and used the same code in my project string output; vector<rect> boxes; vector<string> words; vector<float> confidences; ocr->run(group_img, output, &boxes, &words, &confidences, cv::text::OCR_LEVEL_WORD);

        output.erase(remove(output.begin(), output.end(), '\n'), output.end());
        cout << "OCR output = \"" << output << "\" lenght = " << output.size() << endl;

and the trained data was given as input in the create method

Ptr<cv::text::ocrtesseract> ocr = cv::text::OCRTesseract::create("/Users/koushikv/Desktop/openCVSampleProject/tessdata/",NULL,NULL,3,3);

But the output is empty.Can someone please help me with this issue? Thank you