Ask Your Question

Spas Hristov's profile - activity

2019-08-09 23:41:26 -0600 received badge  Famous Question (source)
2018-10-12 13:43:40 -0600 received badge  Popular Question (source)
2017-07-06 04:30:02 -0600 received badge  Famous Question (source)
2016-12-31 03:06:24 -0600 received badge  Notable Question (source)
2016-10-20 03:32:06 -0600 received badge  Notable Question (source)
2016-03-27 04:23:22 -0600 received badge  Popular Question (source)
2015-11-30 16:28:09 -0600 received badge  Notable Question (source)
2015-10-12 17:17:29 -0600 received badge  Nice Question (source)
2015-10-12 17:17:17 -0600 received badge  Popular Question (source)
2015-07-19 17:27:04 -0600 received badge  Nice Answer (source)
2015-06-18 08:07:12 -0600 received badge  Nice Answer (source)
2015-04-20 09:24:15 -0600 commented question Amplitude of signal

Basically I have 2 ideal circles detected with hough and 2 real edge maps. Ana I want to find the difference between them. After that I will use that information to "unroll" the image between the real circles to cartesian coordinate system.

2015-04-20 09:23:35 -0600 answered a question Amplitude of signal

Basically I have 2 ideal circles detected with hough and 2 real edge maps. Ana I want to find the difference between them. After that I will use that information to "unroll" the image between the real circles to cartesian coordinate system.

2015-04-20 07:50:16 -0600 asked a question Amplitude of signal

Hi, from maybe a month I'm working on my bachelor thesis, that is based on OpenCV. But now I have one problem...

So here you can see that continuous function. From that 2d image I have to extract the amplitude of that function, but the problem is that there is some noise on the function it self ant in the area around it (lower part of the image).

image description

So now the question is how to get the amplitude of that kind of signal ? I thought about median filtering or erosion/dilatation but I'm afraid, that with the erosion on some places I can destroy the function it self...

p.p image description

2015-03-27 16:43:26 -0600 commented question [OpenGL]Realization of Hough Transform in OpenGL

I was trying to say, that I will try the transformation from the raw image to the hough image with GPU. The problem is that I don't have OpenCL on the target platform, so I will have to do it with OpenGL. I have one idea and I will try to realize it in Monday.

2015-03-27 11:17:23 -0600 asked a question [OpenGL]Realization of Hough Transform in OpenGL

Hi, today I was working on my Hough Transform function, but it came way way too slow, although my efforts to optimize it. The OpenCV version of the function have the same performance.

Not so long ago, I wrote one program, that was using OpenGL rendering to texture and sampling from the same texture. There wasn't problem, because It was reading from pixel (a,b) and after the processing It was writing to the same pixel. I tough that the same idea can be used for Hough Transform, but there is one big problem: if I'm reading from one pixel and I'm writing to other there is possibility, that two threads could read/write to the same pixel.

Now the question: Is there way to increment the value into the OpenGL output, without knowing the exact value ?

p.p. Maybe that isn't the right forum for that question, but that is the only place, that I know that here have people that can help me ;)

2015-03-23 06:34:08 -0600 commented question Link error in core/ocl

cmake -DCMAKE_TOOLCHAIN_FILE=../../arm-gnueabi.toolchain.cmake -D WITH_GTK=ON WITH_OPENCL=NO ../

2015-03-20 13:07:00 -0600 asked a question Link error in core/ocl

Today I was able to run (finaly!!!) the cross compilation but I wasn't able to fix that error:

Linking CXX shared library ../../lib/libopencv_core.so
CMakeFiles/opencv_core.dir/src/ocl.cpp.o: In function `initOpenCLAndLoad':
ocl.cpp:(.text.initOpenCLAndLoad+0x40): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/hristov/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/libdl.a(dlopen.o): In function `dlopen':
(.text+0xc): undefined reference to `__dlopen'
/home/hristov/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/libdl.a(dlsym.o): In function `dlsym':
(.text+0xc): undefined reference to `__dlsym'
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_core.so.3.0.0] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2
hristov@hristov-OptiPlex-755:~/workspace/opencv/build$

I'm not using OpenCL (WITH_OPENCL = OFF) but I'm still getting that error ;? Any ideas ?

p.p. My toolchain file :

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(GCC_COMPILER_VERSION "4.8.3" CACHE STRING "GCC Compiler version")

set(FLOAT_ABI_SUFFIX "hf")

set(CMAKE_C_COMPILER    /home/hristov/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER  /home/hristov/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++)
set(ARM_LINUX_SYSROOT   /home/hristov/workspace/rootfs)


set(CMAKE_CXX_FLAGS           ""                    CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS             ""                    CACHE STRING "c flags")
set(CMAKE_SHARED_LINKER_FLAGS ""                    CACHE STRING "shared linker flags")
set(CMAKE_MODULE_LINKER_FLAGS ""                    CACHE STRING "module linker flags")
set(CMAKE_EXE_LINKER_FLAGS    "-Wl,-z,nocopyreloc"  CACHE STRING "executable linker flags")

set(CMAKE_CXX_FLAGS "-mcpu=armv6 -O3 -mfloat-abi=hard -ftree-vectorize -ftree-vectorizer-verbose=9" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "-mcpu=armv6 -O3 -mfloat-abi=hard -ftree-vectorize -ftree-vectorizer-verbose=9" CACHE STRING "c flags")

set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_MODULE_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS    "-Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_EXE_LINKER_FLAGS}")

if(USE_NEON)
  message(WARNING "You use obsolete variable USE_NEON to enable NEON instruction set. Use -DENABLE_NEON=ON instead." )
  set(ENABLE_NEON TRUE)
elseif(USE_VFPV3)
  message(WARNING "You use obsolete variable USE_VFPV3 to enable VFPV3 instruction set. Use -DENABLE_VFPV3=ON instead." )
  set(ENABLE_VFPV3 TRUE)
endif()

set(CMAKE_FIND_ROOT_PATH ${ARM_LINUX_SYSROOT})

set(CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
2015-03-20 10:18:59 -0600 received badge  Nice Answer (source)
2015-03-20 09:35:31 -0600 answered a question Understanding YUV to BGR color spaces conversion

No. The connection between The RGB and the YUV color space is:

image description

So when you have YUV(0,0,0) in RGB you have : 0,135,0

That is coming from the definition of the YUV color space.

http://www.mikekohn.net/file_formats/...

http://en.wikipedia.org/wiki/YUV

http://softpixel.com/~cwright/program...

2015-03-20 09:15:37 -0600 asked a question Opencv GUI with GTK 2 - SOLVED ! ! !

I'm building OpenCV from source for Raspberry PI. Now I'm able to build OpenCV and my own program. Everything is working, except the highgui. And I have set the flag for GTK and GTK2 in cmake but it looks like that during the compilation GTK 2 isn't found and the lib is build without it. So the question:

How I can check if the GTK2 is found and if is not, how to set manually the path for GTK2 ?

p.p. The error:

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/hristov/workspace/opencv/modules/highgui/src/window.cpp, line 534
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/hristov/workspace/opencv/modules/highgui/src/window.cpp:534: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage

Aborted

p.p.p. Any ideas ?

-- checking for module 'gtk+-2.0'
-- package 'gtk+-2.0' not found

p.p.p.p. I think that there is problem with the pkg-config. It doesn't find any of the packages. I try to set PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH but it still doesn't find anything.

SOLUTION: I found out, that you have to set PKG_CONFIG_PATH to the folder, where are the .pc files. So in my case (for Raspberry Pi with raspbian and cross compilation) is : /you_copy_of_the_root_fs/usr/lib/arm-linux-gnueabihf/pkgconfig/

2015-03-19 05:40:30 -0600 asked a question Croscompile OpenCV for RPi link error ;?

hi, Today I tried to compile OpenCV for Raspberry Pi on my PC, but there is one error, that I can't fix...

little info:

hristov@hristov-OptiPlex-755:~/workspace/opencv-arm$ make
[  1%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/alpha.c.o
[  1%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/buffer.c.o
[  1%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/dec/vp8.c.o
... and so on ...
[  6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/utils/quant_levels.c.o
[  6%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/utils/thread.c.o
Linking C static library ../lib/liblibwebp.a
Error running link command: No such file or directory
make[2]: *** [3rdparty/lib/liblibwebp.a] Error 2
make[1]: *** [3rdparty/libwebp/CMakeFiles/libwebp.dir/all] Error 2
make: *** [all] Error 2
hristov@hristov-OptiPlex-755:~/workspace/opencv-arm$

For toolchain file I'm using the file from /platform/linux/arm-gnueabi.toolchain.cmake but I have made couple of changes in the beginning of the file

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(GCC_COMPILER_VERSION "4.8.3" CACHE STRING "GCC Compiler version")
set(FLOAT_ABI_SUFFIX "hf")

set(CMAKE_C_COMPILER     arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER   arm-linux-gnueabihf-g++)
set(ARM_LINUX_SYSROOT  /home/hristov/workspace/rootfs)

set(CMAKE_CXX_FLAGS           ""                    CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS             ""                    CACHE STRING "c flags")
set(CMAKE_SHARED_LINKER_FLAGS ""                    CACHE STRING "shared linker flags")
set(CMAKE_MODULE_LINKER_FLAGS ""                    CACHE STRING "module linker flags")
set(CMAKE_EXE_LINKER_FLAGS    "-Wl,-z,nocopyreloc"  CACHE STRING "executable linker flags")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi")
set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi")

set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_SHARED_LINKER_FLAGS}")

set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_MODULE_LINKER_FLAGS}")

set(CMAKE_EXE_LINKER_FLAGS    "-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${CMAKE_EXE_LINKER_FLAGS}")

The compilation fails, when it tries to make the ".a" static library file from the object files, but I can't understand what file cannot be found ? Some of the object files or other ?

2015-01-24 02:25:41 -0600 answered a question Gap Filling Contours / Lines

I think, that an erosion and dilatation will do the job. And, as I see, you are using binary image, so you can just check if there is a white/black pixel in the window. BUT I'm not sure that will preserve the edges clear and sharp...

2015-01-21 14:37:15 -0600 received badge  Popular Question (source)
2014-12-09 14:00:52 -0600 marked best answer Standard deviation from discrete values

I want to calculate standard deviation for every pixel in image, that I will get from web camera. So I will have many samples for every pixel.

Is possible to calculate the standard deviation of discrete values, without knowing the probabilities of the values (without keeping the last 100 frames into the memory)?

2014-04-10 08:33:01 -0600 commented question .jgp images

There is build option "WITH JPEG". Do you set it?

2014-02-28 03:13:00 -0600 answered a question Google glass artefacts

Check the input format of the frame, that you get from the cam

2014-02-28 01:56:17 -0600 commented answer How to acquire image with opencv and Windows Form Application
     private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
        timer1->Interval=100; \\Time interval in miliseconds
        timer1->Start();
     }
     private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
            MessageBox::Show("The calculations are complete", "My Application", MessageBoxButtons::OKCancel, MessageBoxIcon::Asterisk);
     }
2014-02-28 01:51:11 -0600 answered a question How to acquire image with opencv and Windows Form Application
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
            timer1->Interval=100; \\Time interval in miliseconds
            timer1->Start();
         }
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
                MessageBox::Show("The calculations are complete", "My Application", MessageBoxButtons::OKCancel, MessageBoxIcon::Asterisk);
         }
};
2014-02-26 05:10:56 -0600 answered a question How to acquire image with opencv and Windows Form Application

First check the interval of the timer. If there is no problem, make a benchmark and see how long takes every line of code in function timer1_Tick. Then we will think about a solution.

2014-02-26 04:25:20 -0600 answered a question how to save current frame and previous frame
 VideoCapture cap(0);
 Mat curr, prev;
 if(!cap)return -1;
 cap>>curr;
 curr.copyTo(prev);
 while(1)
 {
      cap>>curr;
      imwrite("current.png",curr);
      imwrite("previous.png", prev);
      curr.copyTo(prev);
      if(waitKey(5)==27)break; //Esc pressed
 }
2014-02-24 04:58:12 -0600 answered a question i am new at iopencv
  1. Google it.
  2. If don't find anything - ask here.

Now on the question: In opencv are couple of formats for data in a matrix. For example CV_8UC3 - 3 channel image with 1 unsigned byte for each (B0,G0,R0,B1,G1,R1,B2....). That is the basic color image format (that you will get from imread function).

If your image is gray scale it will be CV_8UC1. You can convert BGR image to grayscale with cvtColor(src, dist, CV_BGR2GRAY).

For double is CV_64F, for float CV_32F and etc.

2014-02-24 04:43:15 -0600 commented answer opencv used in web programming

Send me a mail and we will discuss the problem. spas_g_hristov(at)abv.bg

2014-02-21 08:47:50 -0600 answered a question opencv used in web programming

Directly: no. But you can make a program in c++ and run it from php with specific parameters (the name of input image, for example uploaded from the user) and save the result as image somewhere on the server.

2014-02-07 02:55:47 -0600 answered a question Remove jitter in video stabilization

I don't think that KLT is the best algorithm for video stabilization... It's way too slow...

2014-02-07 02:10:19 -0600 asked a question Crazy problem with HighGUI and VS2010

I was working on a program with OpenGL and for the end interface I tried to use OpenCV's GUI, but when I try to open 1 window with imwhow the name of the window is "$*&FU" or something like that and it's changing ... When try to open more that one window it's even worse... From 3 windows it try to open them with one name (although that i give them different names)

image description

Here I try to open 3 different windows with 3 different images (YUV)...

 cv::Mat output_y=cv::Mat(outwin_sy, outwin_sx, CV_8UC1, out_y);
 cv::Mat output_u=cv::Mat(outwin_sy/2, outwin_sx/2, CV_8UC1, out_u);
 cv::Mat output_v=cv::Mat(outwin_sy/2, outwin_sx/2, CV_8UC1, out_v);

 imshow("TestY",output_y); 
 imshow("TestU",output_u);
 imshow("TestV",output_v);
2014-01-21 10:09:20 -0600 asked a question Math behind getPerspectiveTransform

Where can I read about the math behind that function? If I have 4 points, source and destination. How I can find the perspective matrix?

2014-01-16 10:58:18 -0600 commented answer how to recognize poker chips stack from a side view

With that quality of the input video source will be nearly imposable to detect anything ... First try to use better cam (or just take some test shots with high quality DSLR or something from that class).

On high quality will be easier to develop the algorithm of the program, and after that will think for concrete implementation. ;)