Ask Your Question

Dezintegrator's profile - activity

2020-10-23 08:09:06 -0600 received badge  Popular Question (source)
2017-08-23 13:51:15 -0600 received badge  Famous Question (source)
2016-09-03 06:05:19 -0600 received badge  Notable Question (source)
2016-06-06 09:28:02 -0600 received badge  Popular Question (source)
2015-09-17 10:07:17 -0600 asked a question Get camera pos matrix from depth image

Hello, I have got depth image And I need to get Camera pos matrix, I suppose my 2D and 3D points are wrong

    void getWorldAndImageCoordinates(cv::Mat& image, vector<cv::Point3d>& world_coords, 
     vector<cv::Point2d>& pixel_coords, cv::Mat& IntrinsicMatrix)
{
    float FocalInvertedX = 1/IntrinsicMatrix.at<float>(0,0);    // 1/fx
    float FocalInvertedY = 1/IntrinsicMatrix.at<float>(1,1);    // 1/fy

    cv::Point3d newPoint3D;
    cv::Point2d newPoint2D;
    for (int i=0;i<image.rows;i++)
    {
        for (int j=0;j<image.cols;j++)
        {
            float depthValue = image.at<float>(i,j);

            // if depthValue is not NaN
            if ((depthValue == depthValue) && (depthValue!=0) && (depthValue!=1))                
            {
                // Find 3D position:
                newPoint3D.z = depthValue;
                newPoint3D.x = (j - IntrinsicMatrix.at<float>(0,2)) * newPoint3D.z * FocalInvertedX;
                newPoint3D.y = (i - IntrinsicMatrix.at<float>(1,2)) * newPoint3D.z * FocalInvertedY;
                world_coords.push_back(newPoint3D);

                newPoint2D.x =  j - IntrinsicMatrix.at<float>(0,2);
                newPoint2D.y =  i - IntrinsicMatrix.at<float>(1,2);
                pixel_coords.push_back(newPoint2D);
            }

        }
    }
}


    cv::Mat depthImage = cv::imread(name, CV_LOAD_IMAGE_ANYDEPTH | CV_LOAD_IMAGE_ANYCOLOR);

        vector<cv::Point3d>     world_coords;
    vector<cv::Point2d>     pixel_coords;
    getWorldAndImageCoordinates(depthImage, world_coords, pixel_coords, IntrinsicMatrix);
    cv::Mat distCoeffs = (cv::Mat_<double>(1,5) << 0, 0, 0, 0, 0);

    cv::Mat rotation_vector, translation_vector;
    solvePnP(world_coords, pixel_coords, IntrinsicMatrix, distCoeffs, rotation_vector, translation_vector, false, 0 );
    cv::Mat Rt;
    cv::Rodrigues(rotation_vector,  Rt);
    cv::Mat R;
    cv::transpose(Rt, R);

    cv::Mat coords = -R * translation_vector;
2015-09-17 07:06:13 -0600 asked a question transform 2 point clouds (2 cameras) to same origin

Hello, I get camera pos matrix K(4x4) = [R|t]; last row = [0,0,0,1] I don't understand how convert point cloud from camera coor. system to world coor. system?

I just apply my camera pos matrix to cloud. But I think it is wrong.
pcl::transformPointCloud (*cloud, *transformed_cloud2, K);

2015-09-11 08:15:57 -0600 commented question imread() imshow OpenEXR example

I have build opencv WITH_OPENEXR=ON.

cerr << cv::getBuildInformation():

Media I/O: ZLib: build (ver 1.2.7) JPEG: build (ver 62) PNG: build (ver 1.5.12) TIFF: build (ver 42 - 4.0. JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1)

But then I run , I get only black image

`main(){Mat image; const string name ("C:\rgb-d\img.exr"); image = imread(name); // Read the file namedWindow( "window", WINDOW_AUTOSIZE ); // Create a window for display.

if(!image.empty()){
    imshow("window", image);
}

waitKey(0);} // Wait for a keystroke in the window`
2015-09-11 07:31:36 -0600 asked a question imread() imshow OpenEXR example

Please share the link or give example how to load and show openEXR images in c++

2015-09-11 06:09:54 -0600 asked a question imread() msvcr100d.dll error

Hello! I install OpenCV and try open image with imread(). imread return -1 or throw extension "0x5b3437ef (msvcr100d.dll)" in my.exe : 0xC0000005:Access violation when reading "0x00000020". I don't know the reason. Please help me.

OpenCV 2.4.11 Windows 7 x32 visual studio 2010.

2015-03-21 11:49:17 -0600 commented question Qt Error : main.o: undefined reference to symbol '_ZN2cv6String10deallocateEv'

The problem has gone I add this into *.pro file

LIBS += -L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_highgui

2015-03-21 10:59:55 -0600 commented question Qt Error : main.o: undefined reference to symbol '_ZN2cv6String10deallocateEv'

I moved libopencv_core.so.2.4 to anover folder, but have this error

2015-03-21 10:18:38 -0600 asked a question Qt Error : main.o: undefined reference to symbol '_ZN2cv6String10deallocateEv'

I have just installed opencv. (ubuntu 14.04) . I am trying run the example, but i have got error:

warning: libopencv_core.so.3.0, needed by //usr/local/lib/libopencv_imgcodecs.so, may conflict with libopencv_core.so.2.4 error: main.o: undefined reference to symbol '_ZN2cv6String10deallocateEv' /usr/local/lib/libopencv_core.so.3.0:-1: : error adding symbols: DSO missing from command line :-1: ошибка: collect2: error: ld returned 1 exit status

Please, help me to solve this proplem

there are *pro and cpp files:

//------------------------------------------------------------------------------------------------------------------------------------------------------ QT += core gui \ multimedia \ multimediawidgets

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = opencv_examples

TEMPLATE = app

INCLUDEPATH += /usr/local/include/highgui \ /usr/local/include/imgcodecs \ LIBS += -lopencv_imgcodecs \ -lopencv_highgui \ -lopencv_core SOURCES += main.cpp

//---------------------------------------------------------------------------------------

{

include "opencv2/opencv.hpp"

include "opencv2/core/core.hpp"

include "opencv2/highgui/highgui.hpp"

include "iostream"

using namespace cv; using namespace std;

int main( int argc, char** argv ) {

Mat image;
image = imread("/home/imgs/lena.png");   // Read the file

if(! image.data )                              // Check for invalid input
{
    cout <<  "Could not open or find the image" << std::endl ;
    return -1;
}

namedWindow( "Display window", WINDOW_AUTOSIZE );// Create a window for display.
imshow( "Display window", image );                   // Show our image inside it.

waitKey(0);                                          // Wait for a keystroke in the window

return 0;

}

}

2015-03-01 09:36:10 -0600 commented question installation 'make' error Ubuntu 14.04

I reinstalled Ubuntu 14.04 and used this script http://rodrigoberriel.com/2014/10/ins... , and it work!!!

2015-03-01 05:10:01 -0600 commented question installation 'make' error Ubuntu 14.04

I did
sudo apt-get remove libjpeg-dev
sudo apt-get install -y libjpeg-dev

it changed: JPEG: /usr/lib/i386-linux-gnu/libjpeg.so (ver )

but I have the same error

2015-02-28 15:56:10 -0600 received badge  Editor (source)
2015-02-28 15:53:47 -0600 commented question installation 'make' error Ubuntu 14.04

i've done git clone https://github.com/Itseez/opencv.git After git checkout 2.4 : Branch 2.4 set up to track remote branch 2.4 from origin.

I added cmake output to my first

2015-02-28 15:09:08 -0600 commented question installation 'make' error Ubuntu 14.04

Did you mean latest 2.4 stable branch ?

2015-02-28 14:51:57 -0600 commented question installation 'make' error Ubuntu 14.04

Ubuntu 14.04; gcc; g++; opencv 2.4.10;

2015-02-28 14:07:24 -0600 asked a question installation 'make' error Ubuntu 14.04

I have a lot of same errors:

[ 11%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_jpeg.cpp.o
/home/olga/libs/openCV/opencv-2.4.10/modules/highgui/src/grfmt_jpeg.cpp: In function ‘void cv::jpeg_buffer_src(j_decompress_ptr, cv::JpegSource*)’:
/home/libs/openCV/opencv-2.4.10/modules/highgui/src/grfmt_jpeg.cpp:150:29: error: invalid conversion from ‘void (*)(j_decompress_ptr) {aka void (*)(jpeg_decompress_struct*)}’ to ‘void (*)()’ [-fpermissive]
     source->pub.init_source = stub;
                         ^

cmake config output:

~/libs/openCV/opencv/release$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
-- The CXX compiler identification is GNU 4.8.2
-- The C compiler identification is GNU 4.8.2
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detected version of GNU GCC: 48 (408)
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Performing Test HAVE_CXX_W
-- Performing Test HAVE_CXX_W - Success
-- Performing Test HAVE_C_W
-- Performing Test HAVE_C_W - Success
-- Performing Test HAVE_CXX_WALL
-- Performing Test HAVE_CXX_WALL - Success
-- Performing Test HAVE_C_WALL
-- Performing Test HAVE_C_WALL - Success
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_C_WERROR_RETURN_TYPE
-- Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_CXX_WERROR_ADDRESS
-- Performing Test HAVE_CXX_WERROR_ADDRESS - Success
-- Performing Test HAVE_C_WERROR_ADDRESS
-- Performing Test HAVE_C_WERROR_ADDRESS - Success
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_CXX_WFORMAT
-- Performing Test HAVE_CXX_WFORMAT - Success
-- Performing Test HAVE_C_WFORMAT
-- Performing Test HAVE_C_WFORMAT - Success
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WMISSING_DECLARATIONS
-- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
-- Performing Test HAVE_C_WMISSING_PROTOTYPES
-- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WUNDEF
-- Performing Test HAVE_CXX_WUNDEF - Success
-- Performing Test HAVE_C_WUNDEF
-- Performing Test HAVE_C_WUNDEF - Success
-- Performing Test HAVE_CXX_WINIT_SELF
-- Performing Test HAVE_CXX_WINIT_SELF - Success
-- Performing Test HAVE_C_WINIT_SELF
-- Performing Test HAVE_C_WINIT_SELF - Success
-- Performing Test HAVE_CXX_WPOINTER_ARITH
-- Performing Test HAVE_CXX_WPOINTER_ARITH - Success
-- Performing Test HAVE_C_WPOINTER_ARITH
-- Performing Test HAVE_C_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_WSHADOW
-- Performing Test HAVE_CXX_WSHADOW - Success
-- Performing Test HAVE_C_WSHADOW
-- Performing Test HAVE_C_WSHADOW - Success
-- Performing Test HAVE_CXX_WSIGN_PROMO
-- Performing Test HAVE_CXX_WSIGN_PROMO - Success
-- Performing Test HAVE_C_WSIGN_PROMO
-- Performing Test HAVE_C_WSIGN_PROMO - Failed
-- Performing Test HAVE_CXX_WNO_NARROWING
-- Performing Test HAVE_CXX_WNO_NARROWING - Success
-- Performing Test HAVE_C_WNO_NARROWING
-- Performing Test HAVE_C_WNO_NARROWING - Success
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_CXX_PTHREAD
-- Performing Test HAVE_CXX_PTHREAD - Success
-- Performing Test HAVE_C_PTHREAD
-- Performing Test HAVE_C_PTHREAD - Success
-- Performing Test HAVE_CXX_MARCH_I686
-- Performing Test HAVE_CXX_MARCH_I686 - Success
-- Performing Test HAVE_C_MARCH_I686
-- Performing Test HAVE_C_MARCH_I686 - Success
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_CXX_MSSE
-- Performing Test HAVE_CXX_MSSE - Success
-- Performing Test HAVE_C_MSSE
-- Performing Test HAVE_C_MSSE ...
(more)
2013-12-09 06:43:31 -0600 asked a question can't install on Win 32x by Using the Pre-built Libraries

I unpacked archive to C:/DevTools/opencv. I trying to make this comand in command line: setx -m OPENCV_DIR C:\DevTools\opencv\Build\x86\vc10

But, I took messege: Error. Denial of access to the specified registry path

Please, help me

2013-12-05 04:13:43 -0600 asked a question Can't unpack opencv-2.4.7. exe | Win 7 32 x

Hi! I can't unpack opencv - 2.4.7.exe Messege:"Can not open ...\opencv-2.4.7.exe as archive" I have admin right. Win 7 professional 32x. Help me, please.