Data stored in OpenCV cv::Mats are not always continuous in memory, which can be verified via API Mat::isContinuous(). Instead, it follows the following rules:

  1. Matrices created by imread(), clone(), or a constructor will always be continuous.
  2. The only time a matrix will not be continuous is when it borrows data from an existing matrix (i.e. created out of an ROI of a big mat), with the exception that the data borrowed is continuous in the big matrix, including
    • borrow a single row;
    • borrow multiple rows but with full original width.
Read more »

I recently moved my blog here using Hexo instead of previous Jekyll, though the old version is still available. Hexo is a fast, simple & powerful blog framework. Compared with Jekyll, Hexo is more flexible in terms of setup, post writing via Markdown, tags, themes, content searching, 3rd-part plugin support, etc.

This post summarizes the setup steps of Hexo in Windows 10, which I hope will somehow help those who want to blog using Hexo as well.

Read more »

Setup

Install Windows Subsystem for Linux (WSL)

  1. Settings -> Turn Windows features on or off -> check on Windows Subsystem for Linux -> Reboot.
  2. If has error Windows Subsystem for Linux has no installed distributions, run in cmd

    1
    lxrun /install

    Note: in Windows 10 1803 and later, lxrun is deprecated, will need to install it via Windows App Store following the link showing on the screen.

Read more »

In VS, memory leaks can be detected by using C Run-Time (CRT) libraries [1]. A typical example of enabling this feature can be like:

Read more »

CMakeLists.txt for Lib project:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# add path of headers to include_directories
include_directories(include)

# STATIC for static lib, and SHARED for dynamic
FILE(GLOB SOURCES
src/*.h
src/*.cpp
)
add_library(mylib STATIC ${SOURCES})

# link libs, list all of them
target_link_libraries(mylib
-lib-name-.lib
)
Read more »

Install

  1. Install Anaconda. (e.g. by default in C:\Users\tommyhu\anaconda3)
  2. Add the following paths to Path:
    • C:\Users\tommyhu\anaconda3
    • C:\Users\tommyhu\anaconda3\Scripts
Read more »