Image processing and Computer Vision
Asked Answered
S

2

9

I would like to use Smalltalk (Pharo) to better refactor my image processing and computer vision code/algorithms, written in other languages. I have not found a lot of examples online where Smalltalk is used for processing images (or video frames). I would like to know whether

i) there is an opencv/image/computer vision library available for Smalltalk that is easily installed or

ii) someone could give an example of how to access the pixel data in an image and threshold it using Smalltalk.

Sheerlegs answered 23/4, 2016 at 0:6 Comment(2)
SmallTalk seems an odd choice of language for image processing, however, if that is what you know, then go for it. What sort of algorithms do you have - I am intrigued. Maybe consider installing ImageMagick (heavyweight and very capable) or NetPBM (light-weight and simple installation) to convert any image you have into NetPBM format (PGM for greyscale or PPM for colour) then you can easily open the files and read them and process them in SmallTalk... https://mcmap.net/q/1039316/-c-create-png-bitmap-from-array-of-numbersArchivolt
Using Smalltalk for this is actually a good idea. You should take a look at Cuis.Leatherneck
R
1

For the first question, you can maybe write your own interface using FFI to the OpenCV C-API. For the second question, I think it's easy to use ImageReadWriter formFromFileNamed: and then can use pixelValueAt: to read the value, threshold, and then write back by pixelValueAt:put:.

Romaic answered 10/1, 2018 at 7:1 Comment(0)
S
1

There is a recent binding to OpenCV (for Pharo 7 a.t.m.) at https://github.com/feenkcom/gt4opencv

Stockbreeder answered 23/9, 2019 at 19:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.