Ask Your Question

DrCrime's profile - activity

2019-03-08 10:54:24 -0600 received badge  Notable Question (source)
2018-12-30 08:41:02 -0600 received badge  Popular Question (source)
2016-01-14 03:33:37 -0600 commented question looking for an image viewer with pixel preview

Interesting. I did not know about the many features of imshow. I use it only to get a quick look at my data during debugging. How complicated is is to add additional buttons like previous and next image in series? Or to add a statusbar with additional information (like image 5 /100, filename, ...)?

Also I am not interested in zooming in. I like a second windows with a magnification of what lies under the cursor and some text with RGB (or HSV) values next to it.

Thanks a lot.

2016-01-14 03:29:32 -0600 received badge  Enthusiast
2016-01-13 03:08:19 -0600 asked a question looking for an image viewer with pixel preview

Hi,

this question is only indirectly connected to opencv. However, I hope its ok asking it. In my workflow I usually have a time series of images and I examine them using the image viewer Eye Of Gnome. However, recently I saw a usefull feature on a image viewer on the MacBook (I am sorry I forget to ask how the program was named). There was a little window with a large magnification of the section under the mouse cursor. Next to it the RGB values where listed.

Does anyone know a image viewer for Linux (Ubuntu 14.04) that allows me to examine image series similar to Eye of Gnome (easy and quick changing the image with one click) and adds a magnification tool with RGB values?

Thanks a lot.

2015-12-21 05:59:58 -0600 commented question Install Opencv ON eclipse in ubuntu

The linker program ld cannot find the libraries. As I said in my previous comment: I assume that you need a -l in front of all library names. This is so if you use ld directly. However, I don't use eclipse and therefore don't know which influence it has and if it changes the syntax of ld.

2015-12-21 04:54:21 -0600 commented question Install Opencv ON eclipse in ubuntu

It seems that you are missing a -l in front of most of your libraries

g++ -L/usr/local/lib -o "Test" ./src/Test.o  -lopencv_core -lopencv_nonfree -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

However, I don't know how to change that in eclipse.

2015-12-21 04:35:28 -0600 commented question Install Opencv ON eclipse in ubuntu

I don't understand your question. Your library should not be installed in the linker. Do you know what a linker is?

2015-12-21 03:40:37 -0600 commented question Install Opencv ON eclipse in ubuntu

ld is your linker. Did you check if it is installed in /usr/bin ?

$ which ld
2015-12-21 03:16:22 -0600 commented question Install Opencv ON eclipse in ubuntu

Did you check if the library files are present in /usr/local/lib? There should be files like libopencv_core.so. And make sure that you have read access to the files and read+execute flags for all folders.

2015-12-21 03:07:21 -0600 received badge  Scholar (source)
2015-12-21 03:05:27 -0600 received badge  Self-Learner (source)
2015-12-21 03:04:36 -0600 answered a question How to install xphoto from opencv_contrib

Thanks to berak, I was able to install the current opencv library with the additional opencv_contrib repository on my Ubuntu 14.04 machine.

To build and install the library I performed the following steps:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip qt5-default libvtk6-dev zlib1g-dev libwebp-dev libpng-dev libtiff5-dev libopenexr-dev libgdal-dev libx264-dev yasm libxine2-dev libeigen3-dev python-tk python3-dev python3-tk python3-numpy ant default-jdk doxygen

mkdir -pv opencv
cd opencv

git clone https://github.com/Itseez/opencv.git
cd opencv/
git pull
cd ..

# opencv contrib
git clone https://github.com/Itseez/opencv_contrib.git
cd opencv_contrib/
git pull
cd ..

cd opencv/
mkdir -pv build
cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D WITH_TBB=ON \
      -D WITH_V4L=ON \
      -D WITH_QT=ON \
      -D WITH_OPENGL=ON \
      -D BUILD_opencv_ximgproc=ON \
      -D BUILD_opencv_python2=ON \
      -D BUILD_opencv_python3=OFF \
      ..

make
sudo make install
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig

These steps are from the install script by Rodrigo Berriel. I adapted them following the very helpful comments by berak.

After the installation I was able to build some C++ code calling the white balance function from xphoto:

cv::Mat whiteBalanced;
cv::xphoto::balanceWhite(ImageOriginal, whiteBalanced, cv::xphoto::WHITE_BALANCE_SIMPLE);

The code could be compiled:

g++ -g -O2 -W -Wall -Wextra -Werror -pedantic -std=c++11 -I/usr/local/include/ -c main.cpp

and linked:

g++ -W -Wall -Wextra -Werror -pedantic -std=c++11 -o Main.bin main.o -L/usr/local/lib/ -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lopencv_imgcodecs -lopencv_xphoto

Thanks a lot for your help!

2015-12-21 02:49:47 -0600 commented question How to install xphoto from opencv_contrib

Thanks a lot. That worked.

2015-12-18 09:07:38 -0600 commented question How to install xphoto from opencv_contrib

Thanks, that was really quite easy. However, that changes the problem to

main.o: In function `main':
main.cpp:294: undefined reference to `cv::xphoto::balanceWhite(cv::Mat const&, cv::Mat&, int, float, float, float, float)'
collect2: error: ld returned 1 exit status
make: *** [all] Error 1

But the compilation does work fine. Why does it not find the balanceWhite() function?

2015-12-18 09:04:33 -0600 commented question How to install xphoto from opencv_contrib

I have one further question: What is the common style in this forum for making edits to my posts? Should I keep adding supplements to my original question or should I rewrite the entire questions if I get new information from your answers? Thanks.

2015-12-18 09:00:58 -0600 commented question How to install xphoto from opencv_contrib

Thanks a lot for your "blunt guess". I am using the opencv git repository now (instead of the stable relase zip file). I can compile opencv + modules now. However, when I try to link my own code I run into trouble. I documented everything in my original post as Supplement 2. Do you see the mistake in the linking process? Thanks in advance!

2015-12-17 13:57:28 -0600 commented question How to install xphoto from opencv_contrib

I added the error message I get when I compile with ximgproc to the original post.

2015-12-17 13:55:09 -0600 received badge  Editor (source)
2015-12-17 08:04:35 -0600 asked a question How to install xphoto from opencv_contrib

Hi,

I want to use the cv::xphoto::balanceWhite() function in my code. However, I have some problems installing the library. So far I understood that I need opencv 3.0.0 combined with the opencv_contrib repository. To install these I followed mostly the instructions by Rodrigo Berriel and the README.md in the opencv_contrib repository.

The steps I performed where (my operating system is Ubuntu 14.04):

sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip qt5-default libvtk6-dev zlib1g-dev libwebp-dev libpng-dev libtiff5-dev libopenexr-dev libgdal-dev libx264-dev yasm libxine2-dev libeigen3-dev python-tk python3-dev python3-tk python3-numpy ant default-jdk doxygen

These dependencies are probably more than I need. I combined the recommendations from several pages.

wget https://github.com/Itseez/opencv/archive/3.0.0.zip -O opencv-3.0.0.zip
git clone https://github.com/Itseez/opencv_contrib.git
unzip opencv-3.0.0.zip
cd opencv-3.0.0
mkdir -pv build
cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D WITH_TBB=ON \
      -D WITH_V4L=ON \
      -D WITH_QT=ON \
      -D WITH_OPENGL=ON \
      -D BUILD_opencv_ximgproc=OFF \
      -D BUILD_opencv_python2=OFF \
      -D BUILD_opencv_python3=OFF \
      ..

I removed ximgproc and python because these modules gave me some errors during configuration. However, I am only interested in xphoto anyway.

make -j 8
sudo make install
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig

This process goes through without any errors. Further, I can compile my opencv code that does not contain any contrib modules so far. But, as soon as I add a call to the following code, compilation fails.

#include "opencv2/xphoto.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/imgproc/types_c.h"
...
cv::Mat whiteBalanced;
cv::xphoto::balanceWhite(ImageOriginal, whiteBalanced, cv::xphoto::WHITE_BALANCE_SIMPLE);

I identified the problem so far, that the compiler (clang) does not find the include files. I searched my machine and only found them scattered in the opencv_contrib repository, but not installed in a common place like /usr/include.

So my assumption is that opencv got compiled and installed correctly, however the modules from the opencv_contrib repository where only compiled but not installed.

Is there a step missing or did I something wrong during the installation? How do you compile opencv together with the xphoto module?

Thank you very much.

supplement: If I compile with the options:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D WITH_TBB=ON \
      -D WITH_V4L=ON \
      -D WITH_QT=ON \
      -D WITH_OPENGL=ON \
      -D BUILD_opencv_ximgproc=ON \
      -D BUILD_opencv_python2=OFF \
      -D BUILD_opencv_python3=OFF \
      ..

I get the error:

[ 94%] Building CXX object modules/ximgproc/CMakeFiles/opencv_ximgproc.dir/src/sparse_match_interpolators.cpp.o
In file included from /home/mkreim/bin/opencv/opencv/opencv-3.0.0/modules/core/include/opencv2/core.hpp:54:0,
                 from /home/mkreim/bin/opencv ...
(more)