ShapiX - v1.5.0a - Tools for pattern/face recognition and image processing (under Windows®, FreeDos, Linux and FreeBSD)  

Welcome to the website of ShapiX, an (french) freeware (terminal mode) working under Windows® 32 or 64 bits, FreeDos (16 bits), Linux (Ubuntu) and FreeBSD (Unix). The objective of the software is to increase quality of pictures and prepare original pictures to a specific pattern recognition project (working in progress). The first US version of Shapix was created in March 2018. ShapiX is very easy to install, no dependance, no DLL, just the run file....

Technology

Shapix is written in C (portable) and compiled under TDM - GCC version 4.9.2 64Bits release for the windows® version, gcc under FreeDos, g++ for Linux version (Ubuntu v12.4+) and gcc49 under FreeBSD (v11+). Shapix is a very light size program (240ko) and run with no additional ressource (run/exe file is just needed). All original developments have been made on the excellent platform DEV - C++ Copyright (C) 1989, 1991 Free Software Foundation, Inc. (Open Source). Shapix is written from scratch using standard algorithms and qdbmp library modified (Author Chai Braudo) for BMP structure (modified by me) and simple savejpg library.

Current version to download

You can download Shapix files at this address: http://www.shapix.org or here: https://www.freewarefiles.com

Platform Date Version / build Package CheckSum SHA1
Windows® 64 bits Sept 2018 1.5.0.346 shapix_64bWin.zip AA6401FA1F6B6102CDE77E307E830C35F21133B2
Windows® 32 bits Sept 2018 1.5.0.347 shapix_32bWin.zip 1CE5A790A364AA2F6946EA445C74260251DACB82
Linux (Ubuntu v12.4+) 32 bits Sept 2018 1.5.0 shapix_32bLx.tar.gz AA41CA1E95EA799C92E38F952A194CB1B3AE2D3C
FreeBSD (v11+) 64 bits Sept 2018 1.5.0 shapix_64bbsd.tar.gz 56B2972B1B1E9BC0E66200369E6211AF9E22FDC4
FreeDos (v1.2) 16 bits Sept 2018 1.5.0 shapix.zip A3C99BE642EDA4D63DECEDEB314081776C26BA16

Content of packages

Features

Version

Pattern & face recognition

This part is working in progress (version 2.0 in the future). The objective is to implement pattern recognition specifically for simple pattern like circle, line, etc. But the current motivation is to scan picture (BMP format) concerning hieroglyphs and realize directly the transliteration (so with big basic picture database)... great job... I'am also working first on an algorithm for face recognition (via Viola & Jones algoruthm).

Installation

Please follow these instructions to download and execute Shapix (you can rename the executable file):
Under Windows
® (32 or 64 bits):
  1. Open a terminal Window (press Start button and entry "cmd")
  2. go to a existing folder or create it  (i.e. c:\shapix)
  3. Copy the zip package to your local folder
  4. uncompress the package
  5. launch shapix_64b (or shapix_32b) with options at the prompt in Terminal mode, enter only shapix_64b for options list and help
  6. you can test by launching this command: shapix_64b -idemo\riad.bmp -tgs -h -z0.2 -b -etest.jpg
  7. Enjoy!
Under Linux (Ubuntu v12.4+ 32 bits) 
  1. Open a terminal window (press <CTRL><Alt><T>)
  2. go to a existing folder or create it  (i.e. /home/shapix)
  3. Copy the tar package to your local folder
  4. uncompress the package
  5. launch ./shapix_32blx with options at the prompt in Terminal mode, enter only ./shapix_32blx for options list and help
  6. you can test by launching this command: ./shapix_32blx -idemo/riad.bmp -tgs -h -z0.2 -b -etest.jpg
  7. Enjoy!
Under FreeBSD (FreeBSD v11+ 64 bits) 
  1. Open a terminal window
  2. go to a existing folder or create it  (i.e. /home/shapix)
  3. mount your USB key
  4. Copy the tar package to your local folder
  5. uncompress the package
  6. launch ./shapix_64b with options at the prompt in Terminal mode, enter only ./shapix_64b for options list and help
  7. you can test by launching this command: ./shapix_64b -idemo/riad.bmp -tgs -h -z0.2 -b -etest.jpg
  8. Enjoy!
Under FreeDos (v1.2 - 16 bits):
  1. go to a existing folder on the root or create it  (i.e. c:\shapix)
  2. Copy the zip package to your local folder
  3. uncompress the package
  4. launch shapix with options, enter only shapix for option list and help
  5. you can test by launching this command: shapix -idemo\riad.bmp -tgs -h -z0.2 -b -etest.jpg
  6. Enjoy!

Options

Many options are proposed for using shapix, generally, an option in lowercase (e.g.: -tgs) means that the option run a specific process. An option in uppercase SET a value to a parameter (e.g.: -PCC or -C141).

The main options of shapix are listed below:
Options Comments
 -M set mute mode, no display on the current screen (must be the first option), ex: -M
-L  write comments in log file (default log filename is 'log.txt'), for example, -M -L options, means writing all output messages in the log file and without message on the current screen. Log filename should be specified in the INI file
-i<input File> name of input file (with path) in BMP format only
-Y set replace file to YES (no confirmation message before replacing)
-o<output File>  name of output file (with path) in BMP format (if no, default is ''temp.bmp' or the filename specified in the INI file)
-e<export File> name of export file (with path) in JPG format
-T<trans> set the transparency value [0,1] for merge process, ex: -T0.2 (merge with 20% of transparency), you can use -P option to precise merging position
-m<merge File> name of merge file (with path) in BMP format only
-x<explode RGB>  explode channel(s), ex: -xRG (explode R and G channel from the image) ; ex: to display only R channel, enter -xGB
-h<parameter> histogram raising with R,G,B parameter, ex: -hR (raising Red channel), -hG, -hB, -h (grayscale only)
-H<parameter> create a BMP image (and save it) of histogram for R,G,B or gray color, ex: -HR (for Red channel), -H (grayscale only), result in histoXXX.bmp file
-N set normalize filtered image (+128) must be set before filtre option, ex: -N
-f<filter> filter: convert whith a specific filter (3x3 convolution matrix), ex: -f-2,-2,-2,-2,-2,-2,-2,-2,16. Warning, reading cells is in spiral mode (not by line), finished by the central cell. The order in the f structure is like this:
1 2 3
8 9 4
7 6 5
corresponding to f1,2,3,4,5,6,7,8,9
-I  display information of current file in process (BMP picture)
-? display help and command list
-C<parameter> set cutoff parameter [0,255] for Black&White convert, ex: -C141 (CutOff value to 141). If no setting, average methode used to convert to B&W
-P<position> set position for sizing, wording, merging..., ex: -PCC (center), -PTL (Top Left), -PTR (Top Right), -PBL (Bottom Left), -PBR (Bottom Right), PTC (Top Center), PBC (Bottom Center)
-F<format> set the output rating with -s option, ex: -F16:9 (default is 3:2, ex: -F)
-s<size> canvas resize of file with size parameter Width x Height, ex: -s512x512 (no 'px' specified and no space) or -s512 (with format -F setting and -P option), you can use only -s option to adjust the original picture to the format specified, ex: -F16:9 -s means that you want just adjust the picture to the 16:9 format without other size
-w<text>  insert a text in the image at specific position (use -P options for position), ex: -w"COPYRIGHT(c) 2018", character must be between ASCII(32-122) at this time...
-z<size> resize file with size parameter [0,n], ex: -z0.5 (reduce 50%) or -z800px (width value and original scale)
-r<degrees> rotate file with degrees parameter [0,360], ex: -r30 (rotate 30 degrees left - anticlockwise direction )
-c<contrast> increase/decrease contrast with contrast parameter [-255,+255], ex: -c20 (increase contrast of +20). Warning, it's not a percent!
-g<parameter> gamma correction with parameter (float) [0.0,8.0], ex: -g0.87. A good value is 0.80 generally
-v<parameters> set specific Value (execute) to pixels with 3 parameters, ex: -v120,245,255 (set 255 to the range [120,245] values pixels)
-a<parameters> adjust RGB colors with Hue Saturation Value parameters, ex -a1,1.3,1.1 values H, S, V between [0,10], 1 = no change, 1.3 at S position => Saturation x 1.3 ... H=0 for Red, ... etc.
-d<param.> distortion/warping image with 5 parameters, ex: -d1,30,2,3,4 (category [0-5],degree[0-360],factor[0-5],divide[0-20],rounds[0-10]). you can play with parameters to discover all possibilities of fered
-k<parameters> capping RGB color with 3 parameters S1,S2 & S3, ex: -k0,255,128 (fix interval color for channels & decrease number of colors e.g. 256/128=2 colors by channel). S1=bottom limit, S2=top limit, S3=interval between color. If S2 is decreased, lightness will decrease.. This option is used for pop art effect (for example)
-l<lightness> increase/decrease lightness with parameter [0,n], ex: -b0.5 (reduce lightness 50%)
-b<border> add a border to the image, ex: -b0.03 (border 3% of the width), you can use -b option only, so the default border parameter will be set
-K<key>  set an encryption key, value between [0-9999] to hide a text (watermarking) into an image, ex: -K8956, used with -$ option (see below)
-u<text> insert and encrypte a hidden text (watermarking) into the image (use -K option ou parameter in the ini file to specify an encryption key), ex: -K7656 -u"Access code is 56#@67", max lenght of message is 128 characters. See below to decrypt the message. The -K option is not necessary if you have specified the DEFAULT_ENCRYPTED_KEY parameter in the INI file (see below INI file paragraph). Encyption and hidden text is better in an color image. This option is in beta test mode.
-u decrypte an encryption and hidden text into the image (use -K option ou parameter in the ini file to specify an encryption key), ex: -K7656 -u (the decrypted text will not be in the log file)
-t<action>  gs: convert to grayscale, ex: -tgs
bw: convert to black and white, ex: -tbw
negative: convert to negative mode, ex: -tnegative
sepia: convert to sepia, ex: -tsepia
contour: contour process, ex: -tcontour
emboss: embossment process, ex: -temboss
flip: convert to flip, ex: -tflip
mirror: convert to mirror, ex: -tmirror
sharpen: sharpe the image, ex: -tsharpen
blur: blur the image, ex: -tblur
median : apply median filter in order to reduce noise
raster: rasterization of the image with RASTER_CUTOFF parameter (ini file), ex: -traster (grayscale target)
tdoc: apply filter to fix old document (Niblack algorithme), ex: -tdoc. Please setup with RDOC & KDOC parameters in INI file
painting: oil painting effect to the image, ex: -tpainting, see ini file for oil painting effect parameters
magic: fix or/and increase quality of image automatically (Beta test)

Some examples
shapix -Y -iimages\riad.bmp -oimages\test1.bmp -N -f1,2,1,2,1,2,1,2,4 -b applying a sharpen filter to the image riad.bmp with values normalization and adding a border to the image, result is in test1.bmp
shapix -iimages\neige.bmp -oimages\test1.bmp -N -f1,-3,1,-3,1,-3,1,-3,9 -f1,2,1,2,1,2,1,2,4 -c20 applying two filters to the neige.bmp image with a strong contrast (+20), result is in test1.bmp. Warning, contrast value is not a percent!!
shapix -Y -iimages\villa.bmp -tgs -h -tbw -tcontour -tnegative -I converting the image villa.bmp to grayscale, applying histogram correction, converting to black and white, checking contour of the image, converting to negative mode and showing image information... This is specific for archeology image. The result is in temp.bmp (default temp filename in the INI file)
shapix -iimages\hotel.bmp -oimages\test.bmp -tgs -z0.3 -N -temboss -tnegative Eembossing an image with resizing to 30% of original and negative to finish. The result is in temp.bmp (default temp filename in the INI file)
shapix -iimages\hotel.bmp -xGB explode Green and Blue channel (value=0) and keep only Red channel
shapix -Y -iimages\assouan.bmp -F16:9 -s -hR -hG -l1.2 change the format image to 16:9, fix histogram value for Red and Green channel and increase ligthness to 20%
shapix -Y -iimages\maryline.bmp -xB -k0,255,128  make an pop art effect (2 colors by channel without the Blue channel
shapix -Y -iimages\assouan.bmp -HR create the RED histogram file (histoRED.bmp) of the image; you can change the size of histogram (BMP) in the INI file
shapix -Y -iimages\brouillard.bmp -g0.5 -c5 -hG -hB -l1.1 remove fog from a picture with gamma correction and histogram egalization
shapix -Y -iimages\groupe.bmp -otest\out.bmp -tgs -c90 -l1.2 -v0,55,0 -v80,255,255 -tcontour -tnegative set value to ranges of image and increase contour quality
shapix -Y -iimages\riad.bmp -tmedian reduce the noice of the picture (color or grayscale), result in temp.bmp
shapix -Y -itest\IMG_0369.bmp -g0.8 -hR -hG -hB -l1.3 fixing overexposed
shapix -Y -itest\IMG_0369.bmp -a1.2,1.3,0.8 adjust hot colors
shapix -Y -iimages\ane.bmp -K5654 -u"Access code is: 456654#%@56" -oane2.bmp encrypte and hidde the message with the ane.bmp image using encryption key 5654. The result will be added in ane2.bmp file. Both files will be the same size. Currently the option is in beta test mode.
shapix -Y -iimages\ane2.bmp -K5654 -u decrypting the hidden message from the ane2.bmp file

Author

I am born in 1960 and I am working in data processing field since 1985. I have a good command of several computer languages (mainly C and PHP) and have already developed many dynamics websites. I trained within the University of Orsay (91-France) the C/C++ language and algorithm. I am working now on Artificial Intelligence (AI) and ECM solutions for business (IT expert). You can contact me directly on my website; the link is available at the bottom of this page.

Legal stuff

Please read the following terms and conditions before using this software. Use of this software indicates you accept the terms of this license agreement and warranty.

1. Disclaimer of warranty
ShapiX is provided "as-is" and without warranty of any kind, express, implied or otherwise, including without limitation, any warranty of merchantability or fitness for a particular purpose.
In no event shall the author of this software be held liable for data loss, damages, loss of profits or any other kind of loss while using or misusing this software.
The software must not be modified, you may not decompile and/or disassemble.
2. License
ShapiX is provided as freeware for private (non commercial), or educational use, including non-profit organization (i.e. schools, universities, public authorities, police, fire brigade, and hospitals).
In this case, you are granted the right to use and to make an unlimited number of copies of this software.
Company must purchase licenses to be able to use ShapiX. For specific developpment, please contact me.

Copyright © 2018 Olivier de Lannoy. All rights reserved.

Shapix
is guaranteed with no malware and no virus (see checksum after download).

INI file

The INI file is used to set up some default parameters but it is optional.
# Shapix - configuration INI file
# This file is an optional file (but recommended)
# See readme file for more
#
MUTE_MODE=0
LOG=log.txt
ISLOG=0
DISPLAY_INI=0
REPLACE_FILE=0
TEMP=temp.bmp
DEFAULT_POSITION=CC
#
DEFAULT_BORDER=0.020
DEFAULT_FORMAT=1.5
DEFAULT_CONTRAST=0.0
DEFAULT_LIGHTNESS=0.0
HISTO_LEVEL=0.9
#
SPACE_BETWEEN_SYMBOL=2
SPACE_FROM_BORDER=2
#
NBITS=24
#
DEFAULT_RGB_COLOR_TEXT=808080
DEFAULT_RGB_COLOR_BORDER=FFFFFF
#
RASTER_CUTOFF=128
#
PAINTING_LIGHTNESS=20
PAINTING_RADIUS=2
#
HISTO_WIDTH=512
HISTO_HEIGHT=256
#
SEUIL_LOWER=0.10
SEUIL_OVER=0.90
#
BW_CUTOFF=128
#
# parameter for old document process -tdoc
# Sauvola from Niblack method
KDOC=0.2
RDOC=128
#
# Key for encrypted text in image
# could be changed
DEFAULT_ENCRYPTED_KEY=2761
#

# = comments

set mute mode (1=no message)
name of the log file
set log to YES or NO
Display all parameters reading from ini file, 0=no, 1=yes
set replace file without confirmation message, 0=NO, 1=YES
name of the temp file (when no filename is specified in command line
default position CC=center

default percent of the border (% of the width), if using -b option only
default format 3:2 (do not entry format 3:2 but 1.5)
default contrast
default lightness
parameter to fix histogram (arround 1)

space between the symbol of the text inside the picture
space from the border of the picture and the text

number of bits for default picture BMP structure

color for the text inserted (hexa format without #)
color for the border (hexa format without #

Value for rasterization, level to cut off black and white pixel

intensity for calculate oil painting
radius value for oil painting effect (1, 2 or 3 max...)

width of the histogram in BMP file
height of the histogram in BMP file

for calculating exposure, level for underexposure, 10% of black
for calculating exposure, level for overexposure, 10% of white (over)

Cutoff value to convert image to Black & White


parameters for Niblack algorithme





default encyption key if -K option is omitted

BATCH processing

You can use a batch file (.bat file under Windows and FreeDos) to run shapix with many pictures and process. See below a simple example of a batch file. You can create your own batch file also under LINUX & FreeBSD (Unix).
You can also copy/paste the text below to run a test in test.bat file (please, change the input, output and option parameter and the folders must be created before runing batch file). You need also, for the test, to put some pictures in BMP format into the input  folder...

Example:
REM BATCH FILE FOR GENERATE JPG IMAGE
@echo off
SET input=C:\demo\images\*.bmp
SET output=C:\photos-test\
SET option=-Y -F16:9 -s -tgs -h -l1.2 -b -z0.6

for %%f in (%input%) do call :process %%f
goto :eof

:process
SET name=%~n1
SET fichier=%1
shapix -i%fichier% %option% -e%output%%name%.jpg 

Benchmark - May 2018

Start at: 2018.05.09, 10:59:16
Computer: LAPTOP-GHN2VE83, France
Equipment: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz with 7,9 GB Memory
System: Windows
® 10 Home Edition (Build 9200) 64 bit

Command Original picture Final picture
shapix -Y -iimages\riad.bmp -eimages\riad4.jpg -N -f1,2,1,2,1,2,1,2,4

ou

shapix -Y -iimages\riad.bmp -tmedian
shapix -iimages\assouan.bmp -N -h -tsepia -z0.3 -PBR -w"COPYRIGHT (c) 2018 - ODL" -ebella.jpg
shapix -Y -L -iimages\chambre.bmp -I -g1.2 -h -c10 -l1.4
shapix -Y -iimages\couloir.bmp -z0.2 -tmedian -g0.8 -tsharpen

Links about image process
https://docs.gimp.org/en/plug-in-convmatrix.html
https://homepages.inf.ed.ac.uk/rbf/HIPR2/unsharp.htm
https://rosettacode.org/wiki/Image_convolution#C
https://www.sites.univ-rennes2.fr/arts-spectacle/cian/image_numFlash/pdf/chap5_tout52.pdf
http://xmcvs.free.fr/astroart/Chapitre4.pdf
http://www.unit.eu/cours/videocommunication/filtrage_lin%C3%A9aire.pdf
https://www.developpez.net/forums/d495285/general-developpement/algorithme-mathematiques/contribuez/image-detecteur-ligne-hough/
https://fr.wikipedia.org/wiki/D%C3%A9tection_de_contours


All pictures, images and texts on the website are "all rights reserved" - Copyright © 2018 – Olivier de Lannoy
 website of the author | Contact | shapix | FreewareFiles
updating the 2018-09-19