If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Manipulate Bitmap in DSP Code
27 posts
• Page 1 of 3 • 1, 2, 3
Manipulate Bitmap in DSP Code
Hi,
I need to manipulate a small Bitmap (128 x 128 pixels max) fast, and was wondering if a Bitmap (image array) can be "loaded" into the DSP Code Module and accessed that way.
For example to extract color information from a particular pixel location... think of it like "GetPix" (Get Pixel) but way faster than green modules ?
I want to use a Bitmap Image for audio waveform manipulation, and vise versa
Thanks,
Aron
I need to manipulate a small Bitmap (128 x 128 pixels max) fast, and was wondering if a Bitmap (image array) can be "loaded" into the DSP Code Module and accessed that way.
For example to extract color information from a particular pixel location... think of it like "GetPix" (Get Pixel) but way faster than green modules ?
I want to use a Bitmap Image for audio waveform manipulation, and vise versa
Thanks,
Aron
-
aronb - Posts: 154
- Joined: Sun Apr 17, 2011 3:08 am
- Location: Florida, USA
Re: Manipulate Bitmap in DSP Code
You could load the Bitmap into mem and then manipulate it using wave read, code and analyzer. However, to display the result you'd have to convert back to bitmap, which is slow.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Manipulate Bitmap in DSP Code
Martin,
Can you explain a bit more please, step by step
Would I still use the GetPix primitive and write it to an array then to mem then to DSP ?
Thank you very much for the help,
Aron
Can you explain a bit more please, step by step
Would I still use the GetPix primitive and write it to an array then to mem then to DSP ?
Thank you very much for the help,
Aron
-
aronb - Posts: 154
- Joined: Sun Apr 17, 2011 3:08 am
- Location: Florida, USA
Re: Manipulate Bitmap in DSP Code
Here is a demo. It is fairly complicated, dunno if there is an easier way.
Edit: fixed initialization issue (thanks tulamide for pointing it out!)
Edit: fixed initialization issue (thanks tulamide for pointing it out!)
- Attachments
-
- ImageProcessing_fixed.fsm
- (41.83 KiB) Downloaded 1069 times
Last edited by martinvicanek on Tue May 24, 2016 6:54 pm, edited 1 time in total.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Manipulate Bitmap in DSP Code
martinvicanek wrote:Here is a demo. It is fairly complicated, dunno if there is an easier way.
Is it supposed to change something when turning the brightness knob? Or does it need additional modules/prims to work? I added and activated an asio out, but nothing happened.
My two cents:
The main idea is good. Convert the bitmap to an array once, store changes to the array and only convert the array back to a bitmap when a redraw is needed. Might be doable with Ruby as well, but the main downside is that we can't make use of the graphics card's power, especially the 2d shaders.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Manipulate Bitmap in DSP Code
For the brightness knob to work you might have to press some of the triggers inside the module in some order.
Yes, I suppose you could do most of the first part, the bitmap to mem conversion, in Ruby. I might upload a more interesting demo later on.
Yes, I suppose you could do most of the first part, the bitmap to mem conversion, in Ruby. I might upload a more interesting demo later on.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Manipulate Bitmap in DSP Code
The above demo features a very simple brightness adjustment. It has clipping artifacts which result in hue distortion. Do not use for serious image processing!
Perhaps a more useful application is attached below. It demoes a control for hue rotation, which might be handy if you want to dynamically sweep the color of a LED from green to red, say, with all nuances of yellow and orange (Spogg, are you reading this? ) in between.
@aronb, what kind of image manipulation did you have in mind?
Perhaps a more useful application is attached below. It demoes a control for hue rotation, which might be handy if you want to dynamically sweep the color of a LED from green to red, say, with all nuances of yellow and orange (Spogg, are you reading this? ) in between.
@aronb, what kind of image manipulation did you have in mind?
- Attachments
-
- ImageProcessingHue.fsm
- Fixed initialization after duplicate
- (108.24 KiB) Downloaded 1054 times
Last edited by martinvicanek on Wed May 25, 2016 8:13 pm, edited 1 time in total.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Manipulate Bitmap in DSP Code
martinvicanek wrote:... orange (Spogg, are you reading this? ).
If the poster is you Martin, I always read it! Especially if orange is involved.
I love this demo but I had a strange issue. I put the whole thing into a module with graphics enabled (so I could put it into my toolbox whole) and it stopped working. I added an ASIO prim. Still not. So I took it out of the module and it still failed to work. Restarted FS and reloaded the module and it worked. Then repeated the above with the same result. I did try the trigger switch but I couldn't revive the function. Never seen this behaviour before.
What am I doing wrong? I bet I'm going to feel foolish quite soon...
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: Manipulate Bitmap in DSP Code
@spogg
+1
Seems like the order of the triggers that being sent to the bitmap prim's should be carefully determined, or you loose the functionality for some reason.
@martin, thanks for this. very interesting schematic.
+1
Seems like the order of the triggers that being sent to the bitmap prim's should be carefully determined, or you loose the functionality for some reason.
@martin, thanks for this. very interesting schematic.
-
kortezzzz - Posts: 763
- Joined: Tue Mar 19, 2013 4:21 pm
Re: Manipulate Bitmap in DSP Code
The problem was that the output bitmap memory allocation was not retriggered after duplicate. Fixed now.
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
27 posts
• Page 1 of 3 • 1, 2, 3
Who is online
Users browsing this forum: Google [Bot] and 75 guests