i.mx6q opencv version

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx6q opencv version

4,894 Views
jongsuyoo
Contributor I

Hi all,

I would like to know what version of opencv does work in i.mx6q.

I built opencv-2.4.6.1 successfully.

but, 2.4.7 and 2.4.8 version doesn't work...

What about you guys??

ps. BSP : L3.0.35_4.1.0_130816_source.tar

Tags (2)
16 Replies

2,114 Views
andre_silva
NXP Employee
NXP Employee

what issues are you getting ?

regards,

Andre

0 Kudos

2,114 Views
makislivadas
Contributor IV

I am too finding problems building opencv 2.4.8.for imx6.

Using the build scripts that I used for 2.4.6.1 I am getting the following errors when I try to build 2.4.8

========================================

[ 26%] Built target opencv_perf_core_pch_dephelp
[ 26%] Built target pch_Generate_opencv_perf_core
Linking CXX executable ../../bin/opencv_perf_core
/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libz.so.1, needed by ../../lib/libopencv_core.so.2.4.8, not found (try using -rpath or -rpath-link)
/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libjpeg.so.62, needed by ../../lib/libopencv_highgui.so.2.4.8, not found (try using -rpath or -rpath-link)
/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libpng.so.3, needed by ../../lib/libopencv_highgui.so.2.4.8, not found (try using -rpath or -rpath-link)
/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libtiff.so.3, needed by ../../lib/libopencv_highgui.so.2.4.8, not found (try using -rpath or -rpath-link)
/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libgtk-x11-2.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.8, not found (try using -rpath or -rpath-link)

==========================

and here when the linker error stopped the build.

==========================

opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libswscale.so.2, needed by ../../lib/libopencv_highgui.so.2.4.8, not found (try using -rpath or -rpath-link)
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `g_time_val_add'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `gtk_widget_queue_draw'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_create_info_struct'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `jpeg_resync_to_restart'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_read_info'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `g_return_if_fail_warning'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_write_info'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_set_strip_16'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `avio_close@LIBAVFORMAT_55'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `compress'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `g_timeout_add'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `TIFFReadRGBATile'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `TIFFSetWarningHandler'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `gtk_type_new'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `jpeg_std_error'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `jpeg_CreateDecompress'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `sws_getCachedContext@LIBSWSCALE_2'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `jpeg_start_compress'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_get_io_ptr'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `TIFFSetField'
../../lib/libopencv_core.so.2.4.8: undefined reference to `gzeof'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_set_expand_gray_1_2_4_to_8'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `gtk_style_attach'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `gtk_widget_get_type'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `gtk_window_resize'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_set_swap'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `g_cond_broadcast'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `jpeg_set_quality'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_set_read_fn'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `uncompress'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `jpeg_read_header'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_write_image'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `g_type_check_instance_cast'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `avformat_open_input@LIBAVFORMAT_55'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `g_usleep'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `png_destroy_read_struct'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `TIFFClose'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `TIFFReadRGBAStrip'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `av_rescale_q@LIBAVUTIL_52'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `av_codec_get_id@LIBAVFORMAT_55'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `av_log_set_level@LIBAVUTIL_52'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `TIFFGetField'
../../lib/libopencv_highgui.so.2.4.8: undefined reference to `g_get_current_time'

============

0 Kudos

2,114 Views
andre_silva
NXP Employee
NXP Employee

I got some issues too when building 2.4.8, but 2.4.2 goes well, you can check it here: www.imxcv.blogspot.com

I will try 2.4.8 again and let you know.

regards,

Andre

0 Kudos

2,114 Views
olias
Contributor II

Hello Andre,

Any luck?  I followed your instructions for the yocto build of opencv for imx successfully.  I find yocto too difficult to use for building specific packages and setting parameters for the system.  LTIB is more clear and flexible.  However, I cannot build the more recent opencv versions.  I did build 2.4.2, but that seems out of date now.  Can you give me some pointers on what the opencv.spec file should contain?

Thank you,

Roger

0 Kudos

2,114 Views
andre_silva
NXP Employee
NXP Employee

Hi Roger,

unfortunatley I wasn´t able to build 2.4.8 yet, I got a lot of issues related to glib and gtk, maybe I it requires to be upgraded too. Soon as I have any information I let you know.

regards,

andre

0 Kudos

2,114 Views
olias
Contributor II

Hello Andre,

I have moved back to the opencv-2.4.6 that was successfully built via yocto, but when I try it in an LTIB environment of the same kernel vintage 3.0.35, different toolchain of course, I can build all but 3 libraries.

They are:

Linking CXX shared library ../../lib/libopencv_highgui.so
CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: In function `icvWindowThreadLoop()':
window_gtk.cpp:(.text._ZL19icvWindowThreadLoopv+0x18): undefined reference to `g_mutex_lock'
window_gtk.cpp:(.text._ZL19icvWindowThreadLoopv+0x28): undefined reference to `g_mutex_unlock'
window_gtk.cpp:(.text._ZL19icvWindowThreadLoopv+0x34): undefined reference to `g_thread_yield'
CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: In function `icvDeleteWindow(CvWindow*)':
window_gtk.cpp:(.text._ZL15icvDeleteWindowP8CvWindow+0xa8): undefined reference to `g_cond_broadcast'
CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: In function `icvOnKeyPress(_GtkWidget*, _GdkEventKey*, void*)':
window_gtk.cpp:(.text._ZL13icvOnKeyPressP10_GtkWidgetP12_GdkEventKeyPv+0xd0): undefined reference to `g_mutex_lock'
window_gtk.cpp:(.text._ZL13icvOnKeyPressP10_GtkWidgetP12_GdkEventKeyPv+0xf8): undefined reference to `g_cond_broadcast'
window_gtk.cpp:(.text._ZL13icvOnKeyPressP10_GtkWidgetP12_GdkEventKeyPv+0x100): undefined reference to `g_mutex_unlock'
etc.

and

Scanning dependencies of target pch_Generate_opencv_superres
[ 96%] Generating precomp.hpp
[ 97%] Generating precomp.hpp.gch/opencv_superres_Release.gch
[ 97%] Built target pch_Generate_opencv_superres
Scanning dependencies of target opencv_superres
[ 97%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
[ 97%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/btv_l1.cpp.o
[ 98%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/input_array_utility.cpp.o
[ 98%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/btv_l1_gpu.cpp.o
[ 98%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o
/home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/superres/src/frame_source.cpp: In function 'cv::Ptr<cv::superres::FrameSource> cv::superres::createFrameSource_Video_GPU(const string&)':
/home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/superres/src/frame_source.cpp:263:16: error: expected type-specifier before 'VideoFrameSource'
/home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/superres/src/frame_source.cpp:263:16: error: could not convert '(int*)operator new(4u)' from 'int*' to 'cv::Ptr<cv::superres::FrameSource>'
/home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/superres/src/frame_source.cpp:263:16: error: expected ';' before 'VideoFrameSource'
/home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/superres/src/frame_source.cpp:263:41: error: 'VideoFrameSource' was not declared in this scope
/home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/superres/src/frame_source.cpp:264:1: error: control reaches end of non-void function [-Werror=return-type]
cc1plus: some warnings being treated as errors

make[2]: *** [modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o] Error 1
make[1]: *** [modules/superres/CMakeFiles/opencv_superres.dir/all] Error 2
make: **

and this appears to be a consequence of highgui failing:

Scanning dependencies of target opencv_ts_pch_dephelp
[ 98%] Building CXX object modules/ts/CMakeFiles/opencv_ts_pch_dephelp.dir/opencv_ts_pch_dephelp.cxx.o
Linking CXX static library ../../lib/libopencv_ts_pch_dephelp.a
[ 99%] Built target opencv_ts_pch_dephelp
Scanning dependencies of target pch_Generate_opencv_ts
[ 99%] Generating precomp.hpp.gch/opencv_ts_Release.gch
In file included from /home/csc/csc_projects/imx6_project4/opencv-2.4.6/platforms/linux/build/modules/ts/precomp.hpp:3:0:
/home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/ts/include/opencv2/ts/ts.hpp:312:18: note: the mangling of 'va_list' has changed in GCC 4.4
[ 99%] Built target pch_Generate_opencv_ts
Scanning dependencies of target opencv_ts
[ 99%] Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/gpu_test.cpp.o
In file included from /home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/ts/src/gpu_test.cpp:43:0:
/home/csc/csc_projects/imx6_project4/opencv-2.4.6/modules/ts/include/opencv2/ts/gpu_test.hpp:48:39: fatal error: opencv2/highgui/highgui.hpp: No such file or directory
compilation terminated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/gpu_test.cpp.o] Error 1
make[1]: *** [modules/ts/CMakeFiles/opencv_ts.dir/all] Error 2
make: *** [all] Error 2

I think you are seeing similar things with 2.4.8

Have you seen this with 2.4.6?

Regards,

Roger

0 Kudos

2,114 Views
makislivadas
Contributor IV

Yes, opencv 2.4.6.1 works fine. I think the errors you getting may be related to the fact that LTIB still uses version 2.22 of glib whereas opencv 2.4.6.1 requires 2.35.

0 Kudos

2,114 Views
olias
Contributor II

Hello Makis,

I have built the libraries now several times, always slightly different configurations and none of them are usable on the imx6 platform, nor can eclipse link them with a test app when pointing at the xtool chain.

I believe the "ccmake ." step to configure the build is not working with the xtool chain, so even though the toolchain.cmake file is good the build isn't.

Are you sure your libraries are working on your arm platform?

If so,  will you describe the configuration steps you take before a  "cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake" command?

Thanks,

Roger

0 Kudos

2,114 Views
makislivadas
Contributor IV

Hi,

If OpenCV build ok this is a good step. This is because opencv relies on many xtool chain libraries that are resident in the rootfs of the target. If one of these libraries are missing opencv fails to be build.

The problem you have is most likely configuring eclipse. In particular the libraries configuration.

0 Kudos

2,114 Views
olias
Contributor II

Thanks for the info, yes glib-2.35 does clean up the compile problems.

now I have a link problem:

[ 32%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_precomp.cpp.o
Linking CXX executable ../../bin/opencv_perf_core
warning: libgtk-x11-2.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)

warning: libatk-1.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
warning: libgio-2.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
warning: libpangoft2-1.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
warning: libpangocairo-1.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libgdk_pixbuf-2.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libcairo.so.2, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libpango-1.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libfreetype.so.6, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libfontconfig.so.1, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libgobject-2.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libglib-2.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libgthread-2.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libgstbase-0.10.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libgstreamer-0.10.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libgmodule-2.0.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libxml2.so.2, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libgstapp-0.10.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
: warning: libgstvideo-0.10.so.0, needed by ../../lib/libopencv_highgui.so.2.4.2, not found (try using -rpath or -rpath-link)
../../lib/libopencv_highgui.so.2.4.2: undefined reference to `gst_app_src_set_caps'
../../lib/libopencv_highgui.so.2.4.2: undefined reference to `g_time_val_add'
../../lib/libopencv_highgui.so.2.4.2: undefined reference to `gst_element_link_many'
../../lib/libopencv_highgui.so.2.4.2: undefined reference to `gtk_widget_queue_draw'
../../lib/libopencv_highgui.so.2.4.2: undefined reference to `g_return_if_fail_warning'
../../lib/libopencv_highgui.so.2.4.2: undefined reference to `gst_element_link'
../../lib/libopencv_highgui.so.2.4.2: undefined reference to `gst_app_sink_set_max_buffers'

They are all in the rootfs/usr/lib

What have I messed up here?

Thanks,

Roger

0 Kudos

2,114 Views
andre_silva
NXP Employee
NXP Employee

Hi Roger, I stopped on 2.4.2 and then I tried 2.4.8. =(. I will finish some high priority work I am doing and then I will move back to opencv and we can work on this together.

regards,

Andre

0 Kudos

2,114 Views
makislivadas
Contributor IV

I did managed to get opencv 2.4.8 build on my imx6 environment.

However, I went to the minimal setup of LTIB.

1. Build minimal BSP kernel.

2. Ticked zlib and libffi packages.

3. Build glib2.35.

4. Build ffmpeg.

5. Now to build opencv2.4.8 the toolchain.cmake file that works with opencv2.4.6.1 needs to be modified to add link path for all the libraries generated by LTIB as in the example below:

...

set( CMAKE_EXE_LINKER_FLAGS "-Wl,-rpath,/home/makis/imx6/ltib/rootfs/usr/lib -Wl,-rpath,/home/makis/imx6/ltib/rootfs/lib" )

...

This will tell opencv I believe were to look for libraries.

However, the minimal BSP does not build GTK and GSTREAMER, which means opencv 2.4.8 will have to be configured without GTK and GSTREAMER support.

So if you do not need these, opencv2.4.8 can be build this way.

I have the feeling though that if you need GTK support, the version build with  LTIB (GNOME Profile) may be not compatible with the one needed by opencv2.4.8

2,114 Views
andre_silva
NXP Employee
NXP Employee

Hi Makis,

thank you for your response. It helps a lot.

regards,

Andre

0 Kudos

2,114 Views
Wlodek_D_
Senior Contributor II

Dear jongsu yoo,

Thank you for your post, however please consider moving it to the right community place for better visibility.

For details please see general advice https://community.freescale.com/docs/DOC-99909

Thank you for using Freescale Community.

Regards,

Wlodek_D.

0 Kudos

2,114 Views
jongsuyoo
Contributor I

Oh I'm sorry.

it has moved.

Regards,

Yoo.

0 Kudos

2,115 Views
olias
Contributor II

Yes I am using the same BSP and opencv-2.4.8 without success.  I am asking the same question.

0 Kudos