@@ -15,6 +15,10 @@ Therefore the [OpenCV documentation](https://docs.opencv.org/4.x/index.html) sho
1515 - [ Prerequisites to source rock install] ( #prerequisites-to-source-rock-install )
1616 - [ Windows] ( #windows )
1717 - [ Linux] ( #linux )
18+ - [ Debian, Ubuntu] ( #debian-ubuntu )
19+ - [ Fedora] ( #fedora )
20+ - [ Almalinux 8] ( #almalinux-8 )
21+ - [ Almalinux 9] ( #almalinux-9 )
1822 - [ How to install] ( #how-to-install )
1923- [ Examples] ( #examples )
2024 - [ Show an image] ( #show-an-image )
@@ -65,8 +69,55 @@ Prebuilt binaries are available for [LuaJIT 2.1](https://luajit.org/) and [Lua 5
6569 - Install [ LuaRocks] ( https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Unix )
6670 - Install [ Ninja] ( https://ninja-build.org/ )
6771 - Install [ NodeJS] ( https://nodejs.org/en/download/current )
68- - Install needed packages ` sudo apt -y install build-essential git python3-pip python3-venv python-is-python3 unzip zip qtbase5-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbbmalloc2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-dev libreadline-dev `
69- - For faster build time, you can use [ Ninja] ( https://ninja-build.org/ ) ` luarocks config --scope project cmake_generator Ninja `
72+ - Install needed packages (see below for you corresponding distruction).
73+ - Tell luarocks to use [ Ninja] ( https://ninja-build.org/ ) as cmake generator ` luarocks config --scope project cmake_generator Ninja `
74+
75+ ##### Debian, Ubuntu
76+
77+ ``` sh
78+ sudo apt install -y build-essential curl git libavcodec-dev libavformat-dev libdc1394-dev \
79+ libjpeg-dev libpng-dev libreadline-dev libswscale-dev libtbb-dev \
80+ pkg-config python3-pip python3-venv qtbase5-dev unzip wget zip
81+ sudo apt install -y libtbbmalloc2 || apt install -y libtbb2
82+ ```
83+
84+ ##### Fedora
85+
86+ ``` sh
87+ sudo dnf install -y curl gcc gcc-c++ git \
88+ libjpeg-devel libpng-devel readline-devel make patch tbb-devel \
89+ libavcodec-free-devel libavformat-free-devel libdc1394-devel libswscale-free-devel \
90+ pkg-config python3-pip qt5-qtbase-devel unzip wget zip
91+ ```
92+
93+ ##### Almalinux 8
94+
95+ ``` sh
96+ sudo dnf install -y curl gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ git \
97+ libjpeg-devel libpng-devel readline-devel make patch tbb-devel \
98+ pkg-config python3.12-pip qt5-qtbase-devel unzip wget zip && \
99+ sudo config-manager --set-enabled powertools && \
100+ sudo dnf install -y epel-release && \
101+ sudo dnf install -y https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
102+ sudo dnf install -y https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm && \
103+ sudo dnf update -y && \
104+ sudo dnf install -y ffmpeg-devel && \
105+ source /opt/rh/gcc-toolset-12/enable
106+ ```
107+
108+ ##### Almalinux 9
109+
110+ ``` sh
111+ sudo dnf install -y curl gcc gcc-c++ git \
112+ libjpeg-devel libpng-devel readline-devel make patch tbb-devel \
113+ pkg-config python3-pip qt5-qtbase-devel unzip wget zip && \
114+ sudo config-manager --set-enabled crb && \
115+ sudo dnf install -y epel-release && \
116+ sudo dnf install -y https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm
117+ sudo dnf install -y https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-9.noarch.rpm && \
118+ sudo dnf update -y && \
119+ sudo dnf install -y libavcodec-free-devel libavformat-free-devel libdc1394-devel libswscale-free-devel
120+ ```
70121
71122### How to install
72123
@@ -76,7 +127,7 @@ I recommend you to try installing the prebuilt binary with
76127luarocks install --server=https://github.com/smbape/lua-opencv/releases/download/v0.0.4 opencv_lua
77128```
78129
79- Or to specify the target lua version
130+ Or to specify the target lua version with one of the following commands
80131
81132``` sh
82133luarocks install --server=https://github.com/smbape/lua-opencv/releases/download/v0.0.4 opencv_lua 4.10.0luajit2.1
@@ -86,7 +137,21 @@ luarocks install --server=https://github.com/smbape/lua-opencv/releases/download
86137luarocks install --server=https://github.com/smbape/lua-opencv/releases/download/v0.0.4 opencv_lua 4.10.0lua5.1
87138```
88139
89- If none of the above works for you, then install the source rock
140+ Those prebuilt binaries should work on Windows and many linux distributions and have been tested on:
141+ - Windows 11
142+ - Ubuntu 20.04
143+ - Ubuntu 22.04
144+ - Ubuntu 24.04
145+ - Debian 10
146+ - Debian 11
147+ - Debian 12
148+ - Fedora 38
149+ - Fedora 39
150+ - Fedora 40
151+ - Almalinux 8
152+ - Almalinux 9
153+
154+ If none of the above works for you, then install the source rock with
90155
91156``` sh
92157luarocks install --server=https://github.com/smbape/lua-opencv/releases/download/v0.0.4 opencv_lua 4.10.0
@@ -96,13 +161,13 @@ luarocks install --server=https://github.com/smbape/lua-opencv/releases/download
96161
97162On Windows, the lua_modules modules should be added to PATH as show with ` luarocks path `
98163
99- ``` sh
164+ ``` cmd
100165set "PATH=%LUA_MODULES%\bin;%APPDATA%\luarocks\bin;%PATH%"
101166```
102167
103- ` LUA_MODULES ` pointing to your lua_modules folder if any .
168+ ` LUA_MODULES ` is a variable pointing to your lua_modules folder.
104169
105- For example, in your lua project, initialized with ` luarocks init ` , modify the file ` lua.bat ` and after the line ` set "LUAROCKS_SYSCONFDIR= ` add
170+ For example, in your lua project, initialized with ` luarocks init ` , modify the file ` lua.bat ` and after the line with ` set "LUAROCKS_SYSCONFDIR= ` , add
106171
107172``` cmd
108173set LUA_MODULES=%~dp0lua_modules
@@ -244,8 +309,12 @@ cv.waitKey()
244309cv .destroyAllWindows ()
245310```
246311
312+ More expamples can be found in the samples directory.
313+
247314## Running examples
248315
316+ All the examples in the samples directory can be run by folling theses instructions.
317+
249318### Prerequisites to run examples
250319
251320#### Windows
@@ -262,7 +331,8 @@ cv.destroyAllWindows()
262331 - Install [ Ninja] ( https://ninja-build.org/ )
263332 - Install needed packages:
264333 - Debian, Ubuntu: ` sudo apt install -y curl g++ gcc git libgl1 libglib2.0-0 libreadline-dev libsm6 libxext6 make python3-pip python3-venv unzip wget `
265- - Fedora, Almalinux: ` sudo dnf install -y curl gcc gcc-c++ git glib2 readline-devel libglvnd-glx libSM libXext make patch python3-devel python3-pip unzip wget `
334+ - Fedora, Almalinux 9: ` sudo dnf install -y curl gcc gcc-c++ git glib2 readline-devel libglvnd-glx libSM libXext make patch python3-pip unzip wget `
335+ - Almalinux 8: ` sudo dnf install -y curl gcc gcc-c++ git glib2 readline-devel libglvnd-glx libSM libXext make patch python3.12-pip unzip wget `
266336
267337### Initialize the project
268338
@@ -303,7 +373,7 @@ node scripts/test.js --Release
303373## Hosting you own binary rocks
304374
305375If the provided binray rocks are not suitable for your environnment, you can install the source rock.
306- Installing the source rock takes a long time (01h25mn on my old computer, 30mn on the new one).
376+ However, installing the source rock takes a long time (01h25mn on my old computer, 30mn on the new one).
307377Therefore, it is not practical to repeat that process again.
308378To avoid that long install time, you can host your own prebuilt binary rocks on a private server.
309379
0 commit comments