summaryrefslogtreecommitdiff
path: root/test/lua/analyze.lua
diff options
context:
space:
mode:
authorscuri <scuri>2009-08-18 02:21:01 +0000
committerscuri <scuri>2009-08-18 02:21:01 +0000
commit77a4608ee1f828ed70ec58588f0229cd57758148 (patch)
treeb1550da93d53331715c200f1acf8a7c1b2ff7be9 /test/lua/analyze.lua
parente2726d7bef3b0a1684011e558cb68ca99cfecd75 (diff)
*** empty log message ***
Diffstat (limited to 'test/lua/analyze.lua')
-rw-r--r--test/lua/analyze.lua28
1 files changed, 0 insertions, 28 deletions
diff --git a/test/lua/analyze.lua b/test/lua/analyze.lua
deleted file mode 100644
index 7f06496..0000000
--- a/test/lua/analyze.lua
+++ /dev/null
@@ -1,28 +0,0 @@
-require"imlua"
-require"imlua_process"
-
-local filename = "lena.jpg"
-
-local image = im.FileImageLoad(filename)
-local gray = im.ImageCreate(image:Width(), image:Height(), im.GRAY, image:DataType())
-local binary = im.ImageCreate(image:Width(), image:Height(), im.BINARY, image:DataType())
-local region = im.ImageCreate(image:Width(), image:Height(), im.GRAY, im.USHORT)
-
--- make it grayscale
-im.ConvertColorSpace(image, gray)
-gray:Save("lena_gray.jpg", "JPEG")
-
--- make it binary
-im.ProcessSliceThreshold(gray, binary, 0, 128)
-binary:Save("lena_binary.jpg", "JPEG")
-
-local count = im.AnalyzeFindRegions(binary, region, 4, 1)
-print("regions: ", count)
-
-local region2 = im.ImageCreate(image:Width(), image:Height(), im.GRAY, im.BYTE)
-im.ConvertDataType(region, region2, 0, 0, 0, 0)
-
-local region3 = im.ImageCreate(image:Width(), image:Height(), im.MAP, im.BYTE)
-im.ConvertColorSpace(region2, region3)
-region3:SetPalette(im.PaletteHighContrast(), 256)
-region3:Save("lena_region.gif", "GIF")