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…
The article introduces a way to reduce the size of the gif file. The python script analysis gif file and generate many png files from multiple frames. Then it takes a few png files to combine a new smaller gif file. In addition, You can use OpenCV to convert the 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…
The article is based on How to use the OpenCV parallel_for_ to parallelize your code, the example project uses OpenCV parallel_for_ to speed up the computing process. Now I plan to use the algorithm class vtkSMPTools in VTK to get the same positive effect. The unit computing task is put 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…