Ask Your Question

rgadde's profile - activity

2020-08-12 10:51:53 -0500 received badge  Good Question (source)
2020-03-20 04:05:44 -0500 received badge  Famous Question (source)
2016-06-28 13:41:45 -0500 received badge  Notable Question (source)
2015-06-05 15:10:41 -0500 received badge  Popular Question (source)
2014-07-23 17:03:25 -0500 asked a question Combining multiple static libraries in opencv to single shared library

Is there any way we can combine multiple static libraries (.a) files like libopencv_core.a libopencv_imgproc.a etc in to single .so file like libopencv.so?

I tried to combine using this command,

arm-linux-g++ -D_REENTRANT -fPIC -shared -o ./(OUT_DLL) -L/localpath/to/opencv/lib/ -lopencv_features2d -lopencv_flann -lopencv_objdetect -lm -lopencv_ml -lopencv_highgui -lopencv_imgproc -lopencv_core -L/localpath/to/3rdparty/lib/ -llibjpeg -llibtiff -lzlib -llibjasper -llibpng -lpthread -lrt -lIlmImf

to creare libopencv.so. But when I am creating an application with this .so file it gives error saying undefined reference to cv:Mat etc., which suggest my .so file doesnt contain the symbols from .a files.

I also tried un-archiving .a files to .o files and create opencv.so from object files. Seems it almost works, but it gives few errors saying

 `undefined reference to `icvCvt_BGRA2RGBA_16u_C4R(unsigned short const*, int, unsigned short*, int, CvSize)'`,

which are bit strange errors. Please help. Note: I am compiling using arm-g++

2013-05-30 06:31:26 -0500 received badge  Nice Question (source)
2013-04-02 09:19:40 -0500 commented answer How can I speed up filter2D

@sammy Thanks a lot.It was really useful. To address my problem, I am using 16 gabor filters(different orientations) multiple times to detect edges in an image and as well to suppress noise link. I think I can't use either separable filters or convolve the filters as I was using gabor filters. But I found a discussion in mathworks forum, which I thought might be useful. Also,I am on ARMv6 processor which doesn't support NEON optimization. I think I need to find an alternate algorithm for reducing the processing time.

2013-04-02 08:36:25 -0500 received badge  Supporter (source)
2013-04-01 08:00:59 -0500 commented question How can I speed up filter2D

@Daniil Osokin Thanks for the comment. I think in my case I can't use TBB. I am trying to use my code on ARM 11 processor which has single core. Please, correct me if I am wrong

2013-04-01 07:40:24 -0500 commented question How can I speed up filter2D

@berak I am using 16 gabor filters. I wish I could use latest version of opencv. Problem is I am not able to cross compile opencv 2.4 on ARM6. I tried my best. I already have opencv2.1 libraries so, I downgraded my code too :(.

2013-03-29 17:29:57 -0500 received badge  Student (source)
2013-03-29 17:00:51 -0500 asked a question How can I speed up filter2D

Hi,

My algorithm calls filter2D around 256 times. Because of this the processing time of the overall algorithm is high. I tried all other ways to minimize the number of convolutions(by scaling image etc). Is there any alternative function or something for reducing the time of filter2D(without using gpu etc).

2013-03-18 13:02:12 -0500 received badge  Self-Learner (source)
2013-03-18 13:01:17 -0500 answered a question undefined reference to `cvDFT'

Got the solution, I am not linking the cxcore, lapack and rt library at the end. Final command should be

arm-linux-g++ sample.o -o sample -L/home/zwang/ravi/opencv_include21/lib -L./ -lLensFinder -L./ -lTwoX -lcxcore -lopencv_lapack -lrt . Thanks for your support @berak and @StevenPuttemans

2013-03-15 14:42:43 -0500 commented question undefined reference to `cvDFT'

@berek. It belongs to cxcore module. I am linking to the correct cxcore (I can find a function in cxcore.h with cvMulSpectrums and cvGetOptimalSize etc) . I also found the remaining undefined references belong to opencv too. I think I am missing some options while building libraries. Anymore suggestions please.

2013-03-15 09:41:46 -0500 asked a question undefined reference to `cvDFT'

I am working with Opencv-2.1 on arm-linux. I am using arm-linux-g++ compiler. I ran in to a strange error during linking. Before talking about the error, I will post my make commands

CC = arm-linux-g++
COMPILEFLAGS = -Wall -fPIC -c -O2 -I./

OUT_DLL = libLensFinder.so
DLL_FLAGS = -shared -o
OBJS = SegmentRegions.o
OBJS2 = EdgeDetection.o
OBJS3 = AnalyseRegions.o
OBJS4 = global.o
LINK_FLAGS = -L./ -lLensFinder
LINK_FLAGS_2 = -L./ -lTwoX
INCPATH    = -I/home/zwang/ravi/opencv_include21/opencv/  -I.

all : 
$(CC) $(COMPILEFLAGS) $(INCPATH) global.cpp -o global.o
$(CC) $(COMPILEFLAGS) $(INCPATH) EdgeDetection.cpp -o EdgeDetection.o
$(CC) $(COMPILEFLAGS) $(INCPATH) SegmentRegions.cpp -o SegmentRegions.o
$(CC) $(COMPILEFLAGS) $(INCPATH) AnalyseRegions.cpp -o AnalyseRegions.o
$(CC) $(OBJS) $(OBJS2) $(OBJS3) $(OBJS4) $(DLL_FLAGS) ./$(OUT_DLL) -L/home/zwang/ravi/opencv_include21/lib -lcvaux -lcxcore -lhighgui -lcv -lml -lcxts -lrt

$(CC) $(COMPILEFLAGS) $(INCPATH) sample.cpp
#$(CC) $(LINK_FLAGS) sample.o -o sample 
$(CC) $(LINK_FLAGS) $(LINK_FLAGS_2) sample.o -o sample

Everything works fine till the end. During the last command i.e., while creating executable file I am getting the following error.

arm-linux-g++ -L./ -lLensFinder -L./ -lTwoX sample.o -o sample
.//libLensFinder.so: undefined reference to `spotrs_'
.//libLensFinder.so: undefined reference to `cvGetOptimalDFTSize'
.//libLensFinder.so: undefined reference to `dgels_'
.//libLensFinder.so: undefined reference to `dgelsd_'
.//libLensFinder.so: undefined reference to `dgesdd_'
.//libLensFinder.so: undefined reference to `cvMulSpectrums'
.//libLensFinder.so: undefined reference to `sgesdd_'
.//libLensFinder.so: undefined reference to `sgetri_'
.//libLensFinder.so: undefined reference to `cvDFT'
.//libLensFinder.so: undefined reference to `dgesv_'
.//libLensFinder.so: undefined reference to `dgetrf_'
.//libLensFinder.so: undefined reference to `dsyevr_'
.//libLensFinder.so: undefined reference to `sgels_'
.//libLensFinder.so: undefined reference to `spotrf_'
.//libLensFinder.so: undefined reference to `sgetrf_'
.//libLensFinder.so: undefined reference to `dpotrf_'
.//libLensFinder.so: undefined reference to `dpotri_'
.//libLensFinder.so: undefined reference to `sgesv_'
.//libLensFinder.so: undefined reference to `ssyevr_'
.//libLensFinder.so: undefined reference to `dpotrs_'
.//libLensFinder.so: undefined reference to `sgelsd_'
.//libLensFinder.so: undefined reference to `spotri_'
.//libLensFinder.so: undefined reference to `dgetri_'
collect2: ld returned 1 exit status
make: *** [all] Error 1

Two of the undefined references are cvMulSpectrums' andcvGetOptimalDFTSize', which I guess is due to opencv. And I have no clue on other undefined reference. I think I have linked every library. But still can't understand how to solve this. Any suggestions? FYI, the code is working on visual studio.

2013-03-13 16:40:36 -0500 commented question filter2D in opencv-2.1 and opencv-2.4.3

Found the solution. Will post in 23 hrs, as this forum is not letting me to post

2013-03-13 16:38:35 -0500 received badge  Scholar (source)
2013-03-13 10:05:20 -0500 commented answer filter2D in opencv-2.1 and opencv-2.4.3

@steven Thanks for the answer. I am not much concerned about the BORDER_REFLECT even, the output is not the same for both versions(No change in documentation for filter2d for both versions).

img.convertTo(img,CV_32F); Point anchor(-1,-1); filterkernel.convertTo(filterkernel,CV_32F); filter2D(img, result, -1,flippedkernel , anchor, 0, BORDER_REFLECT_101);

2013-03-13 08:36:13 -0500 commented question filter2D in opencv-2.1 and opencv-2.4.3

@steven Even I don't like downgrading. It's pain. But, I am in kind of situation where I "have to" use OPENCV - 2.1

2013-03-12 15:59:23 -0500 asked a question filter2D in opencv-2.1 and opencv-2.4.3

Hi,

Due to some reason I have to downgrade my opencv from 2.4.3 to 2.1. I observed that filter2D is not functioning properly in case of 2.1. Also the border type BORDER_REFLECT is giving error in some cases. The output for both the versions is different. Please suggest me an alternative for filter2d in opencv-2.1

2013-03-06 11:17:46 -0500 commented answer Problem with #include_next when cross compiling with arm-linux-g++

The first one is for gcc and second one for g++ . I think the path is not included properly. Can you please help me in including the path!

2013-03-06 11:16:07 -0500 commented answer Problem with #include_next when cross compiling with arm-linux-g++

-I/home/zwang/OpenCV-2.4.3/3rdparty/openexr/IlmImf -I/home/zwang/OpenCV-2.4.3/3rdparty/openexr/Imath -I/home/zwang/OpenCV-2.4.3/3rdparty/openexr/IlmThread -I/home/zwang/OpenCV-2.4.3/3rdparty/openexr/Iex -I/home/zwang/OpenCV-2.4.3/3rdparty/openexr/Half -I/home/zwang/OpenCV-2.4.3/build_4/3rdparty/openexr -I/home/zwang/OpenCV-2.4.3/build_4 -isystem /usr/local/arm/4.3.1-eabi-armv6/usr/include -o CMakeFiles/IlmImf.dir/Half/half.cpp.o -c /home/zwang/OpenCV-2.4.3/3rdparty/openexr/Half/half.cpp

2013-03-06 10:31:08 -0500 commented answer Problem with #include_next when cross compiling with arm-linux-g++

Thanks a lot Alexander. The command line is

[0mcd /home/xxx/OpenCV-2.4.3/build_4/3rdparty/libjpeg && /usr/local/arm/4.3.1-eabi-armv6/usr/bin/arm-linux-gcc -DHAVE_CVCONFIG_H -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fPIC -Wno-cast-align -Wno-shadow -Wno-unused -O3 -DNDEBUG -DNDEBUG -I/home/xxx/OpenCV-2.4.3/3rdparty/libjpeg -I/home/xxx/OpenCV-2.4.3/build_4 -o CMakeFiles/libjpeg.dir/jerror.c.o -c /home/xxx/OpenCV-2.4.3/3rdparty/libjpeg/jerror.c

Its getting compiled up to 10% and after that I am getting error. I guess the path is not included.

2013-03-05 12:59:53 -0500 asked a question Problem with #include_next when cross compiling with arm-linux-g++

I am trying to cross-compile OPENCV on ARM-linux based system. For this purpose I created a toolchain cmake file with the following options

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

SET (CMAKE_C_COMPILER "/usr/local/arm/4.3.1-eabi-armv6/usr/bin/arm-linux-gcc")
SET (CMAKE_CXX_COMPILER "/usr/local/arm/4.3.1-eabi-armv6/usr/bin/arm-linux-g++")

SET (CMAKE_FIND_ROOT_PATH "/usr/local/arm/4.3.1-eabi-armv6/")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET (LIBRARY_OUTPUT_PATH "/home/xxx/OpenCV-2.4.3/lib")
SET (OPENCV_CONFIG_FILE_INCLUDE_DIR "/home/xxx/OpenCV-2.4.3")
SET (OPENCV_WARNINGS_ARE_ERRORS OFF)

After running the cmake command and make command I am getting the following error:

In file included from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/bits/postypes.h:47,
             from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/iosfwd:47,
             from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/ios:44,
             from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/ostream:45,
             from /usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/iostream:45,
             from /home/zwang/OpenCV-2.4.3/3rdparty/openexr/Half/half.h:88,
             from /home/zwang/OpenCV-2.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/cwchar:52:24: error: wchar.h: No such file or directory

Summarizing : the compiler is not able to find wchar.h, stdio.h, wctype.h, ctype.h. These headers are present in two locations 1) /usr/local/arm/4.3.1-eabi-armv6/usr/include and 2) /usr/local/arm/4.3.1-eabi-armv6/usr/arm-samsung-linux-gnueabi/include/c++/4.3.1/tr1.

I went deep in to the code and found cwchar includes wchar.h using directive #include_next<wchar.h>. I found all the errors the compiler produces is due to this preprocessor directive. Do I need to make any changes to cmake file?

2013-02-04 15:33:31 -0500 edited question Compiling Opencv2.4.3 on arm-linux-g++

Hi,

I am new to linux environment. I am trying to use opencv libraries for my code on arm-linux-g++. I followed the following steps for CMAKE:

http://processors.wiki.ti.com/index.php/Building_OpenCV_for_ARM_Cortex-A8

When I Run the make command, I get the following error ::

/usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnueabi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/bits/sstream.t cc:272: instantiated from here

/usr/local/arm/4.3.1-eabi-armv6/usr/bin-ccache/../lib/gcc/arm-samsung-linux-gnue abi/4.3.1/../../../../arm-samsung-linux-gnueabi/include/c++/4.3.1/sstream:484:

error: no type named 'int_type' in 'struct std::char_traits<wchar_t>' make[2]: * [modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pc h_dephelp.cxx.o] Error 1

How can I solve this problem?

2013-02-04 10:04:11 -0500 received badge  Editor (source)