The best approximation I got compared to yours is this.
( Of course click to amplify)
The last exact same picture you posted is from the tutorial I linked.
You have to invert it.
BTW .“I meant setting the multiplier to 1 not zero”
Of course, I played with all the parameters.
With sobel filter I doubt it. The lines are vertical because I’ve choose the derivative parameters that way to give some contrast at least. See here just some lines and pictures. You can change the derivative parameter from 0 to 2. I’ve tried also the ScharrEdges and the CannyEdges but none of them gives an outcome as nice as yours. I’m afraid you have to accept the credit.
these correspond to the 3 outputs of the car image not sure they are in order, but one gives clean lines, the next clean lines with some shading and the last combines the derived lines with the brightness of the original image for a pencil colored look.
Feel free to use the repo, hopefully I’ll make it into a library later.
I still didn’t give up. Bryan Chung has made a CVImage class that makes it possible to use the latest OpenCV library.So now you can use full range of parameters in the sobel function. With this I could give the house picture some more details now, but still not as your outcome.
If I remember well you wrote somewhere that you are writing a neural network to do character recognition. The newer openCV makes YOLO (You only look once) detection possible in Processing.
See here a video of Real-Time Object Detection with openCV
For those whom interested:
To use the latest openCV library (4.4.0 at the time of this post) you need to paste the jar’s and dll in a folder “code” within your sketch folder.
I’ve prepared a zip of this folder with all the jar’s build and dll. You can download it here.
I also made a new repository here, where I plan to post various codes that can’t be done with the older openCV-processing version. An example is for example the warpAffine function.
This I also solved and posted it on my repo here. It uses the same image and thus the same result as on the openCV tutorial about hierarchy. This is handy when you convert contours into shapes and you want holes in them.
Just adding thresholding at the moment this produces an image which is binary based on the output of the sobel, with the aim of using histeresis to thin the lines too and produce canny edge detection, still have to read some more into the process, but the thresholding currently works this combined with my previous work should provide good contours which you can trim dependent on size. I can also speed it up by only scanning for walls which will allow processing of images greater than the current resolution.
The program has now been updated with shaders, so everything now works using gpu at 60fps.
Only issue I’m trying to overcome is the speed is fine so long as the canvas is manipulated without posting to a PImage or creating an image using get afterwards. If I do then the speed is reduced by a factor of 2. is there an alternative method to convert canvas data to PImage.
I’m currently pretty happy with the cpu version of canny.
blur
sobel
surpress max
finish
there’s always a few bits here and there, I guess the next steps would be dilation and erosion.
This version currently doesn’t have the contour tracing, however that step is complete it just has to be added to the code, and then edges can be extracted from the picture.
Working on a shader version to speed things up a bit but currently running into some problems extracting the sobel gradient required for the max surpression, will update when fixed.