Ask Your Question

CrazySiberianScientist's profile - activity

2020-10-05 23:09:25 -0600 received badge  Notable Question (source)
2018-01-17 02:53:18 -0600 received badge  Popular Question (source)
2016-01-07 15:50:32 -0600 received badge  Self-Learner (source)
2015-09-01 09:51:34 -0600 received badge  Student (source)
2014-09-24 16:17:46 -0600 commented question Where is cv::Directory in OpenCV 3.0.?

You can see this screenshot https://dl.dropboxusercontent.com/u/80704870/kokoko.png from OpenCV 2.4.8, I use this class since 2.4.4 ver.

2014-09-23 16:31:14 -0600 asked a question Where is cv::Directory in OpenCV 3.0.?

Where is cv::Directory in OpenCV 3.0. library? In oldest libraries I have successfully used class cv::Directory. In OpenCV 3.0. it is not.

2014-03-17 03:22:53 -0600 asked a question OpenCV program for Raspberry PI doesn't write video.

I wrote C++ code for Raspberry PI (OS-Raspbian):

........
cv::VideoWriter outStream("out.mjpeg", CV_FOURCC('M','J','P','G'), 2, cv::Size(320,240), 1);
outStream.write(frame);
outStream.release();
.......

And this doesn't work in current conditions, program doesn't write "out.mjpeg" .The outStream.isOpened() returns 0. I try to use *.avi format and CV_FOURCC('N','O','N','E'), but this still doesn't work. Same code properly works for Windows.

If I use imwrite("out.jpg", frame) RaspberryPI program properly works and write out.jpg

Where is problem?

2014-03-11 04:15:47 -0600 answered a question saving predicted label to a text file
2014-02-13 02:07:52 -0600 answered a question Measuring edge thickness using OpenCV

You can try to use next algorithm: 1. Use FindContours to your image. 2. Divide contour to small segments (e.g. 5px). 3. Use equation of line and her perpendicular from analytical geometry: Ax+Bx=0 between segement and points from contour (in code you can use abs(Ax+Bx) < th (th some threshold e.g. 0.5,1.0...).

I use similar algorithm for calculating wire thickness from video, see screenshot . image description

2014-02-13 00:58:21 -0600 commented answer How to change contrast of image?

This takes 40-43ms.

2014-02-11 13:25:55 -0600 answered a question How to change contrast of image?

I found next solution, this takes 30-33ms in my conditions(see above):

Mat ConBright(Mat img, int contrast, int bright, int dStep=200){
CV_Assert(img.depth() != sizeof(uchar));

unsigned int nSize = img.cols*img.rows*img.channels();
unsigned int nStep = img.cols*img.rows / (dStep*dStep)+1;
unsigned char buf[256];
unsigned int midBright = 0;
uchar* p=img.data;
int is = 0;
for (int i; i < nSize; i+=nStep,is++)
    midBright+=*(p++);
midBright /= (256 * is / 3);

for (size_t i = 0; i < 256; i++)
{
    int a = (((i - midBright) * contrast) / 256) + midBright + bright;
    if (a < 0) buf[i] = 0;
    else if (a > 255) buf[i] = 255;
    else buf[i] = a;
}
Mat oimg(img.rows, img.cols, CV_MAKETYPE(img.depth(), img.channels()));
uchar* po=oimg.data;
p = img.data;
for (int i = 0; i < nSize; ++i)
    *(po++) = buf[*(p++)];
return oimg;
}
2014-02-10 11:39:46 -0600 commented answer How to change contrast of image?

I found solution,but I will paste code tommorow, because this opencv forum show me message:"New users must wait 2 days before answering their own question. You can post an answer tomorrow".

2014-02-10 11:35:35 -0600 commented answer How to change contrast of image?

This is non-effective code from opencv documentation http://docs.opencv.org/doc/tutorials/core/basic_linear_transform/basic_linear_transform.html , that I gave above.

2014-02-09 12:17:01 -0600 asked a question How to change contrast of image?

Hello! I have a problem . I decided to write a function to change the contrast of the image. Original image : RGB 8-bit 1920x1080. Processor of computer , which I use for processing is AMD Phenom II 810 2.6 GHz. To compile in Visual Studio (c + +) I use configuration Release x64. If the algorithm is used as here : http://docs.opencv.org/doc/tutorials/core/basic_linear_transform/basic_linear_transform.html, then the image processing takes 340ms , that's a lot . Next, I decided to write the code in the likeness http://habrahabr.ru/post/139428/ ( taking remarks in the comments ) , the processing time became 240ms , it is lot. Then I tried to use to calculate the "buf ( see article from http://habrahabr.ru/post/139428/) using a thumbnail image of the original ( somewhere in the 10 times ) , the processing time was reduced to 100 ms , but still a lot.

Google doesn't give results about image contrast changing fast algorithm.

2014-02-09 12:16:49 -0600 asked a question How to change contrast of image?

Hello! I have a problem . I decided to write a function to change the contrast of the image. Original image : RGB 8-bit 1920x1080. Processor of computer , which I use for processing is AMD Phenom II 810 2.6 GHz. To compile in Visual Studio (c + +) I use configuration Release x64. If the algorithm is used as here : http://docs.opencv.org/doc/tutorials/core/basic_linear_transform/basic_linear_transform.html, then the image processing takes 340ms , that's a lot . Next, I decided to write the code in the likeness http://habrahabr.ru/post/139428/ ( taking remarks in the comments ) , the processing time became 240ms , it is lot. Then I tried to use to calculate the "buf ( see article from http://habrahabr.ru/post/139428/) using a thumbnail image of the original ( somewhere in the 10 times ) , the processing time was reduced to 100 ms , but still a lot.

Google doesn't give results about image contrast changing fast algorithm.

2013-10-28 04:21:29 -0600 received badge  Editor (source)
2013-10-28 04:20:38 -0600 asked a question Launch Opencv program at Pi Raspberry.

Hello! How to launch some opencv program at Pi Raspberry (OS: raspbian)? At Ubuntu PC I built "libraries by arm-gnueabi.toolchain" (http://docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html) and then copied folder "lib" to RPI. Then I launched some simple opencv program and get some message: /public_f/opencv_p/p0: 1: /public_f/opencv_p/p0: Syntax error: "(" unexpected

What's the problem? How to right build and launch opencv programs at Raspberry Pi without building Opencv library at RPI? Sorry for the my bad English :-[)

2013-08-05 05:25:15 -0600 received badge  Scholar (source)
2013-08-05 05:24:57 -0600 received badge  Supporter (source)
2013-08-05 04:48:08 -0600 asked a question How to use CvBoost?

Hello. I have some matrix MxN(M - count of weak classificators, N - count of results weak classificator at each validation image(positives and negatives):

Example:

1 1 1 1 0 0 0 0

1 1 1 0 0 1 0 0

1 0 1 1 1 0 0 0

1 1 1 1 0 0 0 0

1 1 1 1 1 0 0 0

Which tflag for CvBoost should I choose for right work for CvBoost? How to correctly create responses vector?