Rapid Object Mapping
Rapid Object Mapping
Hi All,
Some time ago, AAT and I collaborated on an OpenCV example for my project, PureBasic Interface to OpenCV. Years later, another forum member developed a RAD SVG tool, which reminded me of the example AAT and I had worked on. With only a few minor modifications, literally just a dozen new lines of code, a promising new SVG tool began to take shape.
When I initially shared my results as an animated GIF, the response appeared limited, so I decided to set the example aside.
I don’t necessarily expect significant interest this time either, but revisiting OpenCV was enjoyable. It was great to see that, even though the version is somewhat dated, the algorithms remain highly relevant today.
Back when I first posted this in 2020, my thought was that it could serve as an add-on to any future SVG tools, essentially adding the Rapid to RAD.
• Useful for mapping complex shapes, animating sprite-sheet images, and more.
See the following video: Vector Drawing
.. MP4 video was created using my Video Snipping Tool.
1. Two JPG images are displayed for the demonstration.
2. The original 2020 example is copied into the main OpenCV folder.
3. The code executes, deriving x/y points from the image contours.
4. These points are drawn onto a copy of the selected image.
5. The SVG library uses the x/y points to render the results onto a CanvasGadget.
6. Various other SVG rendering options are also demonstrated.
Some time ago, AAT and I collaborated on an OpenCV example for my project, PureBasic Interface to OpenCV. Years later, another forum member developed a RAD SVG tool, which reminded me of the example AAT and I had worked on. With only a few minor modifications, literally just a dozen new lines of code, a promising new SVG tool began to take shape.
When I initially shared my results as an animated GIF, the response appeared limited, so I decided to set the example aside.
I don’t necessarily expect significant interest this time either, but revisiting OpenCV was enjoyable. It was great to see that, even though the version is somewhat dated, the algorithms remain highly relevant today.
Back when I first posted this in 2020, my thought was that it could serve as an add-on to any future SVG tools, essentially adding the Rapid to RAD.
• Useful for mapping complex shapes, animating sprite-sheet images, and more.
See the following video: Vector Drawing
.. MP4 video was created using my Video Snipping Tool.
1. Two JPG images are displayed for the demonstration.
2. The original 2020 example is copied into the main OpenCV folder.
3. The code executes, deriving x/y points from the image contours.
4. These points are drawn onto a copy of the selected image.
5. The SVG library uses the x/y points to render the results onto a CanvasGadget.
6. Various other SVG rendering options are also demonstrated.
Last edited by JHPJHP on Tue Oct 21, 2025 4:45 pm, edited 5 times in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Rapid SVG
Excellent work as always! 
Re: Rapid SVG
That's cool, good job.
Re: Rapid SVG
Did I understand correctly? :
Does this code define the points around a shape?
In OpenGL, the instruction that creates polygons only creates convex polygons. Is there a way to "slice" any shape into convex polygons? (If so, that would be great for me.)
Thanks
Does this code define the points around a shape?
In OpenGL, the instruction that creates polygons only creates convex polygons. Is there a way to "slice" any shape into convex polygons? (If so, that would be great for me.)
Thanks
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
Re: Rapid Object Mapping
Hi Caronte3D, miso,
Thank you for your positive comments.
------------
Hi SPH,
• The two examples shown in the videos were quick modifications of an existing example.
------------
As I mentioned in my previous post, animations are a no-brainer...
See the following video: Vector Animation
.. MP4 video was created using my Video Snipping Tool.
.. Used my GIF Toolkit to convert a GIF animation to a sprite sheet.
1. The generated sprite sheet is displayed for the demonstration.
2. In a loop the sprite sheet is broken-down into regions of interest.
3. X/Y points are derived from the image contours.
4. These points are drawn onto a copy of the selected image.
5. The x/y points are used to render the results onto a CanvasGadget at 2x the scale.
Thank you for your positive comments.
------------
Hi SPH,
Yes, it has been part of the PureBasic Interface to OpenCV for over ten years, and it’s just one of many examples that can map points to objects.SPH wrote:Does this code define the points around a shape?
• The two examples shown in the videos were quick modifications of an existing example.
------------
As I mentioned in my previous post, animations are a no-brainer...
See the following video: Vector Animation
.. MP4 video was created using my Video Snipping Tool.
.. Used my GIF Toolkit to convert a GIF animation to a sprite sheet.
1. The generated sprite sheet is displayed for the demonstration.
2. In a loop the sprite sheet is broken-down into regions of interest.
3. X/Y points are derived from the image contours.
4. These points are drawn onto a copy of the selected image.
5. The x/y points are used to render the results onto a CanvasGadget at 2x the scale.
Last edited by JHPJHP on Tue Oct 21, 2025 4:45 pm, edited 2 times in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Rapid SVG
I read almost every post on this forum but don't always respond to them. Like this topic: I have no idea what SVG is and have no need for it, but I read it anyway without any plan to respond to it. But your quote made me write this reply to remind you that your work is actually seen and appreciated, even if I don't use it personally. Thumbs up!
Re: Rapid Object Mapping
Hi BarryG,
• For reference, SVG stands for Scalable Vector Graphics; see PureBasic - VectorDrawing.
There are countless uses; one example is my Old-Skool Fire Effect.
That’s a bit of a paradox: How can you be sure you don’t need it if you don’t know what it isBarryG wrote:I have no idea what SVG is and have no need for it
• For reference, SVG stands for Scalable Vector Graphics; see PureBasic - VectorDrawing.
That was kind of you but really not necessary. I was just having a bit of fun. The code has been available for over ten years, so anyone who works with SVG and still finds themselves manually mapping coordinates around objects, my point should be fairly obviousBarryG wrote:your quote made me write this reply to remind you that your work is actually seen and appreciated
There are countless uses; one example is my Old-Skool Fire Effect.
Last edited by JHPJHP on Tue Oct 21, 2025 4:45 pm, edited 1 time in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Rapid SVG Mapping
Hi JHP²
I'd like to get the gist of what I'm looking for. All I need for what I need is minimal.
I'd like to use your code to create an algorithm that allows me to find the points surrounding a shape.
Could you provide me with a simple code that does this?
I know my request is rather... bold, but if you have it up your sleeve, I'm all ears...
Thanks
I'd like to get the gist of what I'm looking for. All I need for what I need is minimal.
I'd like to use your code to create an algorithm that allows me to find the points surrounding a shape.
Could you provide me with a simple code that does this?
I know my request is rather... bold, but if you have it up your sleeve, I'm all ears...
Thanks
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
Re: Rapid Object Mapping
Hi SPH,
Your curiosity and interest are appreciated, but before I invest time in developing a standalone package, let’s first confirm whether the current implementation aligns with your requirements.
The script operates using Contours and Polygon Approximations as follows:
• It first identifies the contours of an object for the purpose of shape analysis.
• It then approximates those contours, returning a sequence of X/Y coordinate points.
If a standalone package is created, it would include a minimum of three DLLs along with their corresponding LIB files.
• PureBasic Interface to OpenCV is a much larger framework that already includes over 250 examples.
While the framework supports Windows (32-bit / 64-bit), Linux (64-bit), and macOS (64-bit), this particular package would include only the script and binaries for Windows 64-bit.
The algorithm can identify points for multiple objects. Object filtering by area size and point granularity are both user-configurable.
• If you remain interested, provide a link to a test image so I can verify that the script will perform as intended.
Your curiosity and interest are appreciated, but before I invest time in developing a standalone package, let’s first confirm whether the current implementation aligns with your requirements.
The script operates using Contours and Polygon Approximations as follows:
• It first identifies the contours of an object for the purpose of shape analysis.
• It then approximates those contours, returning a sequence of X/Y coordinate points.
If a standalone package is created, it would include a minimum of three DLLs along with their corresponding LIB files.
• PureBasic Interface to OpenCV is a much larger framework that already includes over 250 examples.
While the framework supports Windows (32-bit / 64-bit), Linux (64-bit), and macOS (64-bit), this particular package would include only the script and binaries for Windows 64-bit.
The algorithm can identify points for multiple objects. Object filtering by area size and point granularity are both user-configurable.
• If you remain interested, provide a link to a test image so I can verify that the script will perform as intended.
Last edited by JHPJHP on Wed Oct 22, 2025 4:43 pm, edited 1 time in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Rapid Object Mapping
There are advantages and disadvantages.
There are a lot of files (>1) for the little I've been looking for. Additionally, we should see if your algorithm can create polygons that trace an entire area.
I'm skeptical.
There are a lot of files (>1) for the little I've been looking for. Additionally, we should see if your algorithm can create polygons that trace an entire area.
I'm skeptical.
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
Re: Rapid Object Mapping
Hi SPH,
You mentioned that there are advantages and disadvantages, which ultimately depend on user requirements rather than the framework itself. OpenCV is used by millions, and for good reason: About OpenCV
As for the number of files, I don’t see why that should be an issue, especially if this is intended as a personal tool. Even in cases of broader distribution, dependencies are commonplace. In fact, I can’t recall downloading any useful software in recent years that didn’t include some form of dependency or supporting files.
Regarding your point about creating polygons that trace an entire area, the skepticism is misplaced. It’s not my algorithm, and in this case, skepticism isn’t relevant. The script performs exactly as designed.
If it doesn’t meet your expectations, it’s likely due to a misunderstanding of its intended function. Alternatively, if it works but not to the desired level of precision, it can certainly be adjusted. Moreover, given the vast range of algorithms available, one or more of the many alternatives could achieve better results for your specific objective.
Anyway, this wasn’t intended as a sales pitch. As I get older, I’ve come to appreciate the value of my time. Good luck.
You mentioned that there are advantages and disadvantages, which ultimately depend on user requirements rather than the framework itself. OpenCV is used by millions, and for good reason: About OpenCV
As for the number of files, I don’t see why that should be an issue, especially if this is intended as a personal tool. Even in cases of broader distribution, dependencies are commonplace. In fact, I can’t recall downloading any useful software in recent years that didn’t include some form of dependency or supporting files.
Regarding your point about creating polygons that trace an entire area, the skepticism is misplaced. It’s not my algorithm, and in this case, skepticism isn’t relevant. The script performs exactly as designed.
If it doesn’t meet your expectations, it’s likely due to a misunderstanding of its intended function. Alternatively, if it works but not to the desired level of precision, it can certainly be adjusted. Moreover, given the vast range of algorithms available, one or more of the many alternatives could achieve better results for your specific objective.
Anyway, this wasn’t intended as a sales pitch. As I get older, I’ve come to appreciate the value of my time. Good luck.
Last edited by JHPJHP on Thu Oct 23, 2025 2:30 pm, edited 1 time in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Rapid Object Mapping
An example image will be great to see what you mean. Thanks.SPH wrote: Tue Oct 21, 2025 7:31 pm Additionally, we should see if your algorithm can create polygons that trace an entire area.
Belive! C++ version of Puzzle of Mystralia
Bug Planet
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Bug Planet
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Re: Rapid Object Mapping
Well, for example: a drawing of the letter "P"
The trick would be to avoid creating a polygon that would cover the "hole" of the letter.
Furthermore, the OpenGL instruction I'm using only creates convex polygons.
All this taken into account, we end up with a rather demanding algorithm...
The trick would be to avoid creating a polygon that would cover the "hole" of the letter.
Furthermore, the OpenGL instruction I'm using only creates convex polygons.
All this taken into account, we end up with a rather demanding algorithm...
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
Re: Rapid Object Mapping
Ignorance is bliss.JHPJHP wrote: Sun Oct 19, 2025 11:43 pmHow can you be sure you don’t need it if you don’t know what it is![]()

