Thanks to Qtxie's superb work, Red now runs in 64-bit mode on Apple's ARM processors. I'm enjoying programming with Red again!
Image Processing with Red and Rebol Languages
lundi 10 août 2026
mercredi 22 avril 2026
Rebol R3 skeleton
Using erode and dilate is similar to OpenCV morphologyEx (not supported by Rebol 3)
Rebol [
]
;--all images are binary with 1 channel
;--using erode and dilate is similar to OpenCV morphologyEx (not supported by Rebol 3)
cv: import opencv
with cv [
img: imread/with "../images/char.png" IMREAD_GRAYSCALE ;--source image as GS
threshold :img :img 127 255 THRESH_BINARY ;--binary thresholding
namedWindow win1: "Source"
moveWindow win1 0x0
imshow/name img "Source"
skel: Matrix [:img/size CV_8UC1] ;--1 channel matrix (8-bit)
element: getStructuringElement MORPH_CROSS 3x3 -1x-1 ;--structuring element for the kernel
until [
eroded: erode :img none element -1x-1 1 ;--erode
temp: dilate :eroded none element -1x-1 1 ;--then dilate
subtract :img :temp :temp ;--img source - eroded image
bitwise-or :skel :temp :skel ;--just OR operator
img: :eroded ;--update source image
maxi: second minMaxLoc img ;--get maxi value
maxi = 0 ;--repeat until maxi = 0
]
namedWindow win2: "Skeleton"
moveWindow win2 250x0
imshow/name skel win2
waitKey 0
destroyAllWindows
]
jeudi 16 avril 2026
Heat diffusion
From https://en.wikipedia.org/wiki/Heat_equation
"In mathematics and physics (more specifically thermodynamics), the heat equation is a parabolic partial differential equation. The theory of the heat equation was first developed by Joseph Fourier in 1822 for the purpose of modeling how a quantity such as heat diffuses through a given region. Since then, the heat equation and its variants have been found to be fundamental in many parts of both pure and applied mathematics".
vendredi 3 avril 2026
Using Filter2D with Rebol-OpenCV
Rebol-OpenCV (https://github.com/Oldes/Rebol-OpenCV) Filter2D is really fantastic for creating various filters on image.
"Convolves an image with the kernel."
src [handle!] "cvMat"
dst [handle! none!] "cvMat"
ddepth [integer!] "desired depth of the destination image"
kernel [handle!] "convolution kernel (or rather a correlation kernel), a single-channel floating point matrix"
anchor [pair! integer!] "position of the anchor within the element"
delta [number!] "value added to the filtered pixels before storing them in dst"
/border "border mode used to extrapolate pixels outside of the image"
type [integer!] "one of: [0 1 2 4 5 16]"
]
This is an example of creating a Kuwahara_filter
Rebol [
]
;--https://en.wikipedia.org/wiki/Kuwahara_filter
cv: import opencv
with cv [
src: imread/with "../images/mandrill.jpg" -1 ;--(IMREAD_UNCHANGED)
dst: Matrix :src ;--create a matrix
;--using Rebol vector type for a 3x3 kernel
vec: #(f32! [-0.5 1.5 -0.5 1.5 -3.0 1.5 -0.5 1.5 -0.5]) ;--sum = 1
filter: Matrix [CV_32FC1 3x3 :vec] ;--a 3x3 kernel
filter2D :src :dst -1 :filter -1x1 0 ;-1 same image depth
;--show result
imshow/name src "Source"
imshow/name dst "Kuwahara"
moveWindow "Source" 0x0
moveWindow "Kuwahara" 260x0
waitKey 0
destroyAllWindows
]
You can find here https://github.com/ldci/R3_OpenCV_Samples/tree/main/image_filtering a lot of examples for generating filters on image.
vendredi 19 décembre 2025
A simple GUI for Rebol3
- MOUSEMOVE
- LBUTTONDOWN
- RBUTTONDOWN
- MBUTTONDOWN
- LBUTTONUP
- RBUTTONUP
- MBUTTONUP
- LBUTTONDBLCLK
- RBUTTONDBLCLK
- MBUTTONDBLCLK
- MOUSEWHEEL
- MOUSEHWHEEL
vendredi 12 décembre 2025
Virginia Project: A first paper from R2P2 Lab
https://www.frontiersin.org/journals/pediatrics/articles/10.3389/fped.2025.1636667/full
First, the Virginia software, written with Red language, isolated neonatal anatomy through PyTorch-based PointRend segmentation combined with morphological filtering.
Second, radiometric decoding via ExifTool and ImageMagick extracted pixel-level temperature values mapped to anatomical regions of interest (chest, extremities). Finally, quantitative thermal metrics were derived, including median body surface, temperature and spatial thermal variability (interquartile range).
A key advantage of this automated pipeline is its low operator dependence; once the image is acquired, the entire segmentation and feature extraction process is software-driven, minimizing human interpretation bias.
jeudi 23 octobre 2025
BlurHash with r3
What is BlurHash? (from https://uploadcare.com/blog/blurhash-images/ and https://github.com/woltapp/blurhash )
BlurHash is a lightweight way to represent a blurred version of an image that was invented by the Wolt team. It is represented by a short piece of text that when decoded can produce a low quality version of an image which can be shown to the user while the actual image is being loaded.
The idea behind BlurHash is to design a placeholder that is close to the original image but has a smaller size. This makes it possible to send the placeholder to the client side of your application, which reduces the time that the user spends waiting for the page to load.
Oldes wrote an extension for Rebol 3 that makes it very easy to use BlurHash.
See https://github.com/Siskin-framework/Rebol-BlurHash
Rebol [
title: "Rebol/BlurHash test"
]
blurhash: import 'blurhash
cv: import 'opencv
image: load %../pictures/test1.tiff ;--use your own image
print ["Encoding image of size" as-yellow image/size]
hash: blurhash/encode image
print ["String: " hash]
print ["Decoding hash into image"]
blured: resize blurhash/decode hash 32x32 image/size
with cv [
print "Source Image"
imshow/name image "Source"
waitkey 0
print "Blured Image"
imshow/name blured "Blured"
waitkey 0
print "Any key to close"
]












