Transplantation of opencv open-source image processing function library in S3C2440

Source: Internet
Author: User

I. Introduction
  • Opencv is an open-source image processing function library based on C/C ++.
  • Its code has been optimized and can be used to process images in real time.
  • Good portability
  • Allows you to load, save, and collect images or videos.
  • Low-level and advanced application interfaces (APIS)

Ii. Function Description

  • Image Data Operations (memory allocation and release, image copying, setting, and conversion)
Image Data manipulation (allocation, release, copying, setting, conversion ).
  • Image/video input/output (support for file or camera input, image/video file output)
Image and video I/O (file and camera based input, image/video file output ).
  • Matrix/vector data operations and linear algebra operations (matrix product, matrix equation solving, feature value, Singular Value Decomposition)
Matrix and vector manipulation and linear algebra routines (products, solvers, eigenvalues, SVD ).
  • Supports multiple dynamic data structures (linked list, queue, dataset, tree, and graph)
Various Dynamic Data Structures (lists, queues, sets, trees, graphs ).
  • Basic Image Processing (noise reduction, edge detection, corner point detection, sampling and interpolation, color transformation, Morphological Processing, histogram, and image pyramid structure)
Basic Image Processing (filtering, edge detection, corner detection, sampling and interpolation, color conversion, morphological operations, histograms, image pyramids ).
  • Structural Analysis (Connected Domain/branch, contour processing, distance conversion, image moment, template matching, Hof transformation, polynomial approximation, curve fitting, elliptic fitting, Dirani triangle)
Structural Analysis (connected components, contour processing, Distance Transform, various moments, template matching, Hough transform, polygonal approximation, line fitting, Ellipse Fitting
Triangulation ).
  • Camera Calibration (search and tracking CALIBRATION mode, parameter calibration, basic Matrix Estimation, single-response matrix estimation, and stereo visual matching)
Camera Calibration (finding and tracking calibration patterns, calibration, fundamental matrix estimation, homography estimation, stereo corresponsible ).
  • Motion Analysis (optical flow, Action segmentation, and target tracking)
Motion Analysis (optical flow, motion segmentation, tracking ).
  • Target Recognition (feature method and HMM Model)
Object Recognition (eigen-methods, hmm ).
  • Basic gui (display images/videos, keyboard/mouse operations, slide bars)
Basic gui (display image/video, keyboard and mouse handling, scroll-bars ).

  • Image annotation (line, curve, polygon, text annotation)
Image labeling (line, conic, polygon, text drawing)

3. Port on S3C2440 Environment: RedHat As5
1. involved files
Libjpeg: http://www.rayfile.com/zh-cn/files/2a4d4dfa-c267-11e0-b204-0015c55db73d/
Libpng: http://www.rayfile.com/zh-cn/files/4d7b34b8-c267-11e0-909e-0015c55db73d/
Libz: http://www.rayfile.com/zh-cn/files/69cb96bd-c267-11e0-8619-0015c55db73d/
Opencv2.0 http://www.rayfile.com/zh-cn/files/a1df3f68-c267-11e0-989c-0015c55db73d/

2. complete preparation of opencv:
Step 0: Prepare Environment Variables
# Export opencv_build_dir =/home/opencv/install

Step 1: Compile zlib
# Tar xzf zlib-1.2.4.tar.gz
# Cd zlib-1.2.4
./Configure -- prefix = $ opencv_build_dir/install
# Vi makefile
Replace GCC with arm-Linux-gcc
Replace AR with arm-Linux-ar
Replace ranlib with arm-Linux-ranlib.
# Make
# Make install

Step 2: Compile the JPEG Library
# Tar xzf jpegsrc.v8a.tar.gz
# Cd jpeg-8a
./Configure -- Host = arm-Linux -- prefix = $ opencv_build_dir/install
# Make
# Make install

Step 3: Compile the libpng library
# Tar xzf libpng-1.2.43.tar.gz
# Cd libpng-1.2.43
./Configure -- Host = arm-Linux -- prefix = $ opencv_build_dir/install
# Make
# Make install

Step 4: Compile opencv
# Tar xjf OpenCV-2.0.0.tar.bz2
# Cd OpenCV-2.0.0
#. /Configure -- Host = arm-Linux -- without-GTK -- without-carbon -- without-QuickTime -- without-1394libs -- without-FFMPEG -- without-Python -- without-swig -- disable-static -- enable -Shared -- disable-apps cxx = arm-Linux-G ++ -- prefix = $ opencv_build_dir/install
-- Libdir = $ opencv_build_dir/install/lib-includedir = $ opencv_build_dir/install/include
# Make
# Make install

Finally, the database generated by Strip:
# Find | xargs file | grep "Not stripped" | cut-D:-F1 | xargs arm-Linux-strip


3. Compile the program
The following makefile is generally used to compile an application based on the opencv Library:
Note that the value of the libopencv variable is the same as that of the preceding variable.
TARGET = cvRectSRC = cvRect.cppLIBOPENCV := /home/openCV/installCFLAGS = -I$(LIBOPENCV)/include/opencvLDFLAGS = -L$(LIBOPENCV)/lib -lm -lcv -lcvaux -lcxcore -lhighgui -lml -lpthread -ljpeg -lpng -lrt -lcxcore -lz$(TARGET): $(SRC)arm-linux-g++ $(CFLAGS) $(SRC) -o $(TARGET) $(LDFLAGS)arm-linux-strip $(TARGET)clean:rm -rf $(TARGET)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.