Ask Your Question

houmanr's profile - activity

2019-02-11 04:01:22 -0500 received badge  Popular Question (source)
2018-09-06 15:01:00 -0500 received badge  Necromancer (source)
2018-09-06 15:01:00 -0500 received badge  Self-Learner (source)
2016-02-29 16:47:50 -0500 answered a question static link fails with "multiple definitions" error

two years later and still having the same problem! the new solution for me was to remove ipp build options from cmake and also add the following : SET(CMAKE_EXE_LINKER_FLAGS "-static")

or just change the "CMAKE_EXE_LINKER_FLAGS" in the cmake options

2015-03-27 18:45:24 -0500 commented question peculiar matrix reference behaviour

oh i see what i did there lol. Thank you for your comment. Yes, what you wrote is exactly what I intended to do.

J

2015-03-26 23:39:13 -0500 asked a question peculiar matrix reference behaviour

Hi there, So this could very well be due to my lack of understanding of the matrix data type in opencv, so please let me know if that is the case. I have two vectors of Mat types and I am looping through all elements of all these matrices to find their respective norms as such:

    for (k = 0; k < inp.size(); k++)
{
    for (i = 0; i < inp[k].rows; i++)
    {

        for (j = 0; j < inp[k].cols; j++)
        {
            Vec2f& elem = inp[k].at<Vec2f>(i, j);

            a = elem[0];
            b = elem[1];
            c = elem[0];
            d = -elem[1]; 
            xx+= (a*c - b*d);


             elem = modelp[k].at<Vec2f>(i, j);

            a = elem[0];
            b = elem[1];
            c = elem[0];
            d = -elem[1];
            yy += (a*c - b*d);
        }

    }
}

So this should be a fairly simple operations. However, after this loop the two matrices become equal! I think I am messing up the references somehow and make each pixel in one matrix to point to that of the other matrix. But I dont see how this is happening! please help me out because I am very confused. Of course the problem is fixed if I make a new reference for the calculation of the norm of the second matrix, but I still need to know why this is happening.

Thank you J

2014-12-02 13:43:51 -0500 commented question pixel values different when read from C#

hi, and thank you for your reply. Those two are both great hints and I actually started from there. That is why i tested it on non-compressed images as well, such as bmp and the same results occurred. As for RGB vs BGR, i made sure i did not make any errors either. If you look at my table you see the corresponding values are nearly identical, so the channels have been correctly preserved. Thanks J

2014-12-01 18:16:23 -0500 asked a question pixel values different when read from C#

hi there, I am having some strange problems with opencv. I have a program written in C# which I converted to C and then I linked it with opencv. The C# version uses the native C# image loading libraries to read images and my C version uses imread from opencv 3 beta. However the output of the two programs are slightly different. After days of debugging I found out the source of the problem is the fact that the pixel values are different as read by imread in OPENCV and as read by C#. I printed a sample of these pixel values: (the pixels are RGBA and each row represents a single byte, so four rows would be one pixel):


byte    C#  opencv  diff
0   116 116 0
1   120 120 0
2   114 114 0
3   255 255 0
4   114 114 0
5   118 118 0
6   112 112 0
7   255 255 0
8   115 116 -1
9   119 120 -1
10  113 114 -1
11  255 255 0
12  119 120 -1
13  123 124 -1
14  117 118 -1
15  255 255 0
16  121 122 -1
17  125 126 -1
18  119 120 -1
19  255 255 0
20  119 119 0
21  123 123 0
22  117 117 0
23  255 255 0
24  119 120 -1
25  123 124 -1
26  117 118 -1
27  255 255 0
28  122 123 -1
29  126 127 -1
30  120 121 -1
31  255 255 0
32  125 125 0
33  129 129 0
34  123 123 0
35  255 255 0
36  120 119 1
37  124 123 1
38  118 117 1
39  255 255 0
40  119 120 -1
41  123 124 -1
42  117 118 -1
43  255 255 0
44  122 122 0
45  126 126 0
46  120 120 0
47  255 255 0

Please let me know if you have any idea why this is happening.

Thank you for your time, J

2014-10-08 16:40:09 -0500 commented question static link fails with "multiple definitions" error

i seem to have fixed it by going through a lot of the "link.txt" files and manually changing all instances of "-lstdc++" with "-static-libstdc++" and it seems to be working. Im sure there is a way to do this from cmake but i did not figure it out.

2014-10-08 15:19:35 -0500 commented question static link fails with "multiple definitions" error

i tried using -static-libgcc -static-libstdc++ for CMAKE_CXX_FLAGS to no avail

2014-10-08 14:54:22 -0500 commented question static link fails with "multiple definitions" error

it seems someone has filed a bug report as well: http://code.opencv.org/issues/3759

2014-10-08 14:51:27 -0500 asked a question static link fails with "multiple definitions" error

hi there

I am trying to compile opencv 3 statically on windows 7 64 bit using MinGW TDM 64 bit version. I use cmake and i check off the "shared" option before I begin the compilation. During compilation, around 43% progress point, I get the following errors:

Linking CXX executable ..\..\bin\opencv_perf_core.exe
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev[_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev]+0x0): multiple definition of `std::basic_ostringstream<char, std::char_traits<char="">, std::allocator<char> >::~basic_ostringstream()'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/libstdc++.dll.a(d002421.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNSt19basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev[_ZNSt19basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev]+0x0): multiple definition of `std::basic_istringstream<char, std::char_traits<char="">, std::allocator<char> >::~basic_istringstream()'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/libstdc++.dll.a(d002405.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev[_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev]+0x0): multiple definition of `std::basic_stringstream<char, std::char_traits<char="">, std::allocator<char> >::~basic_stringstream()'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/libstdc++.dll.a(d002382.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv[_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv]+0x0): multiple definition of `std::basic_stringbuf<char, std::char_traits<char="">, std::allocator<char> >::str() const'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/libstdc++.dll.a(d000415.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7_M_syncEPcyy[_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7_M_syncEPcyy]+0x0): multiple definition of `std::basic_stringbuf<char, std::char_traits<char="">, std::allocator<char> >::_M_sync(char*, unsigned long long, unsigned long long)'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/libstdc++.dll.a(d002216.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode[_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode]+0x0): multiple definition of `std::basic_ostringstream<char, std::char_traits<char="">, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/libstdc++.dll.a(d002417.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode[_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode]+0x0): multiple definition of `std::basic_stringstream<char, std::char_traits<char="">, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/libstdc++.dll.a(d002378.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(ios-inst.o):ios-inst.cc:(.text$_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate[_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate]+0x0): multiple definition of `std::basic_ios<char, std::char_traits<char=""> >::clear(std::_Ios_Iostate)'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/libstdc++.dll.a(d002756.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1\libstdc++.a(ios-inst.o):ios-inst.cc:(.text$_ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E[_ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E]+0x0): multiple definition of `std::basic_ios<char, std::char_traits<char ...
(more)