OpenCV
Video – build And Test OpenCV 4.6.0 On Ubuntu 20.04
Here is a video about building OpenCV 4.6.0 on Ubuntu 20.04. It records all process about building OpenCV library and running a simple test program. Youtube: Bilibili:
Here is a video about building OpenCV 4.6.0 on Ubuntu 20.04. It records all process about building OpenCV library and running a simple test program. Youtube: Bilibili:
The post shows a simple example about how to display a selected image by opencv.js in web page. <div> <div class=”inputoutput”> <img id=”imageSrc” alt=”No Image” style=”display: none;”> <div class=”caption”><input type=”file” id=”fileInput” name=”file”></div> </div> <div class=”inputoutput”> <canvas id=”canvasOutput”></canvas> </div> </div> <script async=”” src=”/functions/opencv/opencv.js” type=”text/javascript”></script> <script type=”text/javascript”> let imgElement = document.getElementById(‘imageSrc’); let Read more…
The article shows how to make the original image has a retro style. Two steps need to be done. Change the red color channel of the original image. Change the brightness by a filled circle. The mathematical function used in step1 makes the brighter pixel brighter, darker pixel darker. Read more…
The article introduces how to display an image by OpenCV in CPlusPlus and Python language. The user can exit the whole program when he presses the ESC key. CPP CMakeLists.txt macro(use_cxx11) if (CMAKE_VERSION VERSION_LESS “3.1”) if (CMAKE_CXX_COMPILER_ID STREQUAL “GNU”) set (CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=gnu++11”) endif () else () set (CMAKE_CXX_STANDARD 11) Read more…
We can use XML to store the OpenCV matrix and read it to recover the whole image. A simple example is in the following code snippet. We write an original image data to Untitled1.xml, then read it to generate another Mat object and show it. #include <stdio.h> #include <opencv2/opencv.hpp> #include Read more…
I want to fill the image to become a square one. The interface copyMakeBorder can help us to expand the original image to a bigger size. /* @param top @param bottom @param left @param right Parameter specifying how many pixels in each direction from the source image rectangle to extrapolate. Read more…
Gamma correction is a very useful method to make the original image brighter. It is a non-linear transform for every input value, the relevant math equation is in the following section. O:output value I:input value #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { Mat Read more…
The linear blend operator for two images: dst = α⋅src1+β⋅src2+γ we can use the following interface to support combine two pictures. CV_EXPORTS_W void addWeighted(InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst, int dtype = -1); Notice: we need to use the images which have the same Read more…
The original image and project are in the following part. CMakeLists.txt macro(use_cxx11) if (CMAKE_VERSION VERSION_LESS “3.1”) if (CMAKE_CXX_COMPILER_ID STREQUAL “GNU”) set (CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=gnu++11”) endif () else () set (CMAKE_CXX_STANDARD 11) endif () endmacro(use_cxx11) cmake_minimum_required(VERSION 2.8) project( cvMat ) use_cxx11() find_package( OpenCV REQUIRED ) add_executable( ${PROJECT_NAME} “main.cpp” ) target_link_libraries( ${PROJECT_NAME} Read more…