encountered some problems when i try write a demo by myself
Taoja opened this issue · comments
my demo is : https://github.com/Taoja/web-wasm-faceDetector
there have two problems:
- the func rgbaToGrayscale is useless, the picture still colorful when i output imageData and use canvas render it
- unable detect face, maybe it is because func rgbaToGrayscale is useless
Did you have a chance to look into https://github.com/esimov/pigo/tree/master/wasm or https://github.com/esimov/pigo-wasm-demos. There are a lot of examples how you can use Pigo on Webassembly. Regarding the aforementioned project of yours, I've tried to run the demo, but I have encountered a few errors.
Now about your question of using the rgbaToGrayscale method, there is no need to define a custom grayscale method, since Pigo automatically converts the image to grayscale mode prior detection.
Did you have a chance to look into https://github.com/esimov/pigo/tree/master/wasm or https://github.com/esimov/pigo-wasm-demos. There are a lot of examples how you can use Pigo on Webassembly. Regarding the aforementioned project of yours, I've tried to run the demo, but I have encountered a few errors.
Now about your question of using the rgbaToGrayscale method, there is no need to define a custom grayscale method, since Pigo automatically converts the image to grayscale mode prior detection.
thx for your reply, i saw the demo what your suggest before i write my demo.
but your demo is hardly to learn the pigo(plase forgive me for talking your demo)because js methods and pigo api are mixed together.
so it is why i try to use html script to do js methods and use wasm to achieve pigo api。
i m a noob about makefile, so sry about u cannot run the demo。
Sorry, but this is working for you? Because for me is not working. I'm receiving too much errors. Could you give me a working copy and I can look into it.
Sorry, but this is working for you? Because for me is not working. I'm receiving too much errors. Could you give me a working copy and I can look into it.
now my demo is easy to use
GOOS=js GOARCH=wasm go build -o ./pkg/lib.wasm main.go
and open the html in pkg dir
Closing this issue since it's not related to the Pigo API.