Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Image Processing Design Toolbox details
Login with GitLab

Image Processing Design Toolbox

This toolbox implements functions for object detection.
(870 downloads for this version - 289678 downloads for all versions)
Details
Version
4.0
A more recent valid version with binaries for Scilab 5.2 exists: 5.0
Author
Dr. Eng. (J) Harald Galda
Owner Organization
private individual
Maintainer
Harald Galda
Category
License
Creation Date
March 16, 2010
Source created on
Scilab 5.2.x
Binaries available on
The maintainer of this module has not provided binaries.
Description
            IPD - Image Processing Design Toolbox Version 4.0
Copyright (c) by Dr. Eng. (J) Harald Galda, 2009 - 2010.
Conveyed under the conditions of the GNU GPL Version 3 or later.


This toolbox provides functions for designing and parameterizing image
processing algorithms. The following functionality is provided:

1. Histogram calculation
   - gray level histogram
   - cumulated histogram

2. Thresholding
   - segmentation by threshold
   - threshold calculation by Otsu method

3. Morphological filters
   - dilation
   - erosion
   - closing
   - opening
   - top hat
   - bottom hat

4. Median filter

5. Filtering for edge detection
    - Sobel filter
    - Laplace filter
    - Prewitt filter
    - Scharr filter

6. Region based segmentation
   - distance transform
   - watershed transform

7. Blob analysis
   - searching connected regions in binary images
   - removing blobs that have less pixels than a lower bound or more pixels
     than an upper bound
   - calculating specific properties of blobs such as bounding box, centroid
   - drawing bounding boxes around objects found in an image
   - calculating histogram of blob sizes
   - calculating cumulated histogram of blob sizes

8. Displaying images in figure windows
   - display
   - conversion of RGB to indexed images
   - conversion of indexed images to RGB 

9. Conversion between color images and gray level images
   - RGB    to  gray level
   - RGB    to  L*a*b* 
   - L*a*b* to  RGB 

10. Opening image and video files
   - reading image files
   - writing image files
   - reading video files

11. Linear filteration

12. Texture feature calculation
  - Laws texture energy


Changes between version 3.3 and version 4.0
  - EdgeFilter re-implemented as Scilab macro
  - errors in English help corrected
  - German and Japanese help added
      
      
This version uses OpenCV 2.0 which is available for download at

     opencv.willowgarage.com/wiki/

It is recommended to choose Atlas library option when installing Scilab. IPD
can not be loaded if the reference library option was chosen during Scilab 
installation. The author of this toolbox does not use Intel Math Kernel
Library.
            
Files (2)
[3.06 MB]
Source code archive
This ZIP file contains the source code along with the external libraries.
[5.89 MB]
Miscellaneous file
This archive contains all files necessary for Windows.

News (19)
Comments (10)     Leave a comment 
Comment from Chin Luh Tan -- March 17, 2010, 11:38:42 AM    
Hi Again,

Just found out the ShowColotrImage does not work with the Axes in Scilab. 

For e.g., if I've 2 axes, top and bottom, generating by:

clf()
a1=newaxes(); 
a1.axes_bounds=[0,0,1.0,0.5];
t=0:0.1:20;
plot(t,acosh(t),'r')
a2=newaxes();
a2.axes_bounds=[0,0.5,1.0,0.5];
x=0:0.1:4;
plot(x,sinh(x))

sca(a1); //make first axes current
ShowColorImage(I,'')


the image should plot on the top axes, however, it is not the case.

Thanks.

Regards,
Chin Luh
Answer from Harald Galda -- March 17, 2010, 06:28:54 PM    
Hi Chin Luh,

I suggest the following changes in ShowImage (called by ShowColorImage):

comment line 102: delete(gca); -> // delete(gca); 

insert after line 104: delete(Diagram.children);

I am going to change the function ShowImage in a version after 4.0 because version 4.0 is
already published at both atoms.scilab.org and forge.scilab.org. At the latter page only
new files can be added, but uploaded files can not be changed there.

Regards,
Harald Galda
Answer from Samuel Gougeon -- March 18, 2010, 06:31:54 PM    
> comment line 102: delete(gca); -> // delete(gca); 
> 
> insert after line 104: delete(Diagram.children);


if you want to delete the handle, delete(gca()) should be
specified instead of delete(gca) (that attempts to delete
the function gca itself, while gca() stands for the 
_result_ of the function).

SG
Answer from Samuel Gougeon -- March 18, 2010, 06:53:19 PM    
> > comment line 102: delete(gca); -> // delete(gca); 
> > 
> > insert after line 104: delete(Diagram.children);
> 
> if you want to delete the handle, delete(gca()) should be specified 


It is well specified in the script. So there is no issue there.
SG
Answer from Harald Galda -- March 20, 2010, 08:23:20 PM    
I tried to display two images in one window in various ways, but nothing really worked.
Only one image can be displayed in a graphic window, I am afraid.
Answer from Samuel Gougeon -- March 1, 2011, 08:50:11 PM    
> I tried to display two images in one window in various ways, but nothing really worked.
> Only one image can be displayed in a graphic window, I am afraid.


subplot() could be used by replacing delete(gca()) line #110, with the following:

ca = gca(); bounds = ca.axes_bounds;
delete(ca);
xsetech(bounds);
ca = gca(); ca.margins=[0.05 0.05 0.05 0.05 ]; 


// This solves only a part of the problem. The other part is to cleverly share
// the colormap. There is likely a solution, by using a lookup table for the
// indices, but with more work (see the steps in 
// http://bugzilla.scilab.org/show_bug.cgi?id=6686 for a sample).

Regards
Samuel
Answer from Samuel Gougeon -- March 1, 2011, 09:19:47 PM    
> subplot() could be used by replacing delete(gca()) line #110, with the following:
> 
> ca = gca(); bounds = ca.axes_bounds;
> delete(ca);
> xsetech(bounds);
> ca = gca(); ca.margins=[0.05 0.05 0.05 0.05 ]; 


This can be used in ShowImage.sci
Answer from Samuel Gougeon -- March 1, 2011, 10:52:47 PM    
> // .../...The other part is to cleverly share
> // the colormap. There is likely a solution, by using a lookup table for the
> // indices, but with more work (see the steps in 
> // http://bugzilla.scilab.org/show_bug.cgi?id=6686 for a sample).


Finally, it is not so hard: IN PRINCIPLE, still in ShowImage.sci, just replace

FigureHandle.color_map = ColorMap;

with both lines:

LUT = addcolor(ColorMap);
Image = matrix(LUT(Image),size(Image));

And that's OK. We are now able to display several color images in 
different subplot() of a same figure, sharing the same colormap.

HOWEVER, the main drawback is that the addcolor() command is quite slow.
There may be some tens of seconds after the ShowColorImage() command
before the image being actually displayed.
Indeed, for each color to be added, addcolor() scans the current colormap
to see if the color already exists, if yes, the related index is added to
the output, else the color is added and its index is added to the output.

addcolor() could likely be improved in order to accelerate it. I have spent
half an hour to play with unique() and intersect() in that purpose. A kind of
ismember() function would be required. Still some work to do.

This is why, without waiting for an improved addcolor(), in order to avoid 
regression with ShowImage() for the cases dealt with up to now 
(1 figure = 1 image at full format), i propose the following implementation:

==============================

// PATCH - BEGIN
// FigureHandle.color_map = ColorMap;  // Comment this line in the current ShowImage.sci
ca = gca(); bounds = ca.axes_bounds;
delete(ca);
xsetech(bounds);
ca = gca(); ca.margins=[0.05 0.05 0.05 0.05 ];

if and(bounds==[0 0 1 1]) then  // We do as up to now 
    FigureHandle.color_map = ColorMap;  // Quite bad: The same color may be set many times
in the CM
else  // We build a minimal and shared colormap 
    LUT = addcolor(ColorMap);
    Image = matrix(LUT(Image),size(Image)); // We translate the Image for Matplot()
end
// PATCH - END

In addition, comment the following line to cancel it
// delete(gca());

==============================

And that's it! Previous (raw but fast) performances are kept, 
+ we are now able to display as many color images as required in subplots
with a shared colormap.
 
Best regards
Samuel
Answer from Samuel Gougeon -- March 2, 2011, 12:46:35 AM    
An improved addcolor() speeded-up by a factor of ~10 has been posted here: 
http://bugzilla.scilab.org/show_bug.cgi?id=9093

With it, the special case for the full figure is no longer really useful.
The ShowImage() patch may then simply become the following:

============================== 

// PATCH - BEGIN
// FigureHandle.color_map = ColorMap;  // Comment this line in the current ShowImage.sci
ca = gca(); bounds = ca.axes_bounds;
delete(ca);
xsetech(bounds);
ca = gca(); ca.margins=[0.05 0.05 0.05 0.05 ];
LUT = addcolor(ColorMap);
Image = matrix(LUT(Image),size(Image)); // We translate the Image for Matplot()
// PATCH - END 

In addition, comment the following line to cancel it
// delete(gca());

==============================

Samuel
Comment from Samuel Gougeon -- March 18, 2010, 12:24:08 PM    
Hi Harald,

Finally, image processing is back into Scilab/Windows. What a very good new!
After some trials with IPD 3.3 from ATOMS, here is a suggestion: i found that it would be
nice to turn ShowColorImage() and ShowImage() setting gca().isoview="on" _by default_ for
images displayed as Matplot().

Thank you for this great package.
Regards
Samuel
Answer from Harald Galda -- March 18, 2010, 01:02:09 PM    
Hi Samuel,

I am going to take this into consideration when working on the next version. 

IPD 4.0 is in the pipeline. I decided to upload the sources only so that the Windows (and
maybe Linux) package will be created by Atoms Compilation Chain. This might make it
possible to install the toolbox by the Atoms GUI.

Also, I am considering implementing GUI tools when a GUI generator is available in Scilab.

Regards
Harald
Comment from Harald Galda -- March 18, 2010, 01:39:07 PM    
The work around I suggested causes an error message. However, it is necessary to delete
the previous image before a new one is displayed. Everything else causes memory leaks.

This is no problem as long as only one image is displayed in a figure. However, it is
difficult to delete only one image, let the other one(s) unchanged and display the new
image at the place of the deleted one.
Comment from Harald Galda -- March 18, 2010, 02:28:55 PM    
This comment has been deleted.
Comment from Guillaume GILLIOT -- March 19, 2010, 11:43:45 AM    
Hi Harald,

I installed Scilab 5.2.1 (32 bits for XP), and I choose the Atlas library option. After, 
from the console window, with the "Module manager – ATOMS", I installed the IPD toolbox.
      When I restart Scilab I have this message error: 

 IPD - Image Processing Design Toolbox 3.3   
link: The file cxcore200.dll does not exist.
 
Warning: recursion problem..., cleared.

And I can't use Scilab after.
What's wrong?
Thanks

Guillaume
Answer from Harald Galda -- March 20, 2010, 12:39:17 PM    
Hi Guillaume,

the problem seems to be related to the automated loading of the toolbox. The DLLs take a
lot of memory and time for loading. I am searching for a way to suppress automatic loading
and I am going to write later.

Harald
Answer from Harald Galda -- March 20, 2010, 12:43:55 PM    
Hi Guillaume,

I would like to add something: I uploaded a corrected version the day before yesterday.
The most recent version is IPD 4.0 and it works on both Scilab 5.2.0 and 5.2.1. I
corrected some errors in version 3.3. 

Harald
Answer from Harald Galda -- March 20, 2010, 08:21:31 PM    
If you have installed IPD toolbox calling atomsInstall or via the Atoms GUI,
IPD is loaded automatically when Scilab is started. This can cause problems.
If an error message occurs during the start of Scilab, you should prevent IPD
from being loaded automatically. There are two possibilities:

1. You prohibit loading external toolboxes automatically by the command

      atomsSetConfig('autoload', 'False')

2. You prevent only IPD toolbox from being loaded automatically typing

      atomsAutoloadDel('IPD')
 
Comment from Chin Luh Tan -- March 21, 2010, 03:45:14 AM    
Hi,

Yes, indeed I faced problem when trying to show more than 1 image in a gui. I tried to 
modified your ReadImage but no success, and I finally changed the code from very first 
image processing toolbox under scilab and I am able to make it works. (sip toolbox).I 
just take the imshow from sip and change some contents and it works on multiple axis. 

Thanks.

Chin Luh
Comment from Guillaume GILLIOT -- March 22, 2010, 04:19:40 PM    
Dear Harald,
I loaded the last version of IPD toolbox, and now, I have an other problem:

 IPD - Image Processing Design Toolbox 4.0   
link: The file cxcore200.dll does not exist.
atomsLoad: An error occurred while loading 'IPD-4.0'.

I chek in the directory: scilab-5.2.1\contrib\IPD-3.2\sci_gateway\cpp\; and it is there...
I can use scilab (contrary to the last time), but without the IPD function.

What's wrong?
thank you very much.

Guillaume


Answer from Harald Galda -- March 22, 2010, 05:53:57 PM    
Dear Guillaume,

it seems that the error is related to using atomsLoad. You can avoid IPD being loaded
automatically by typing:

      atomsSetConfig('autoload', 'False')

or

      atomsAutoloadDel('IPD')

If you want to load IPD, click the toolboxes menu and then the item 'IPD-4.0'.

Harald
Comment -- March 22, 2010, 09:46:12 PM    
Hi Harald,

With IPD-4.0 and when calling demonstrations:

 demopath = IPD_PATH + 'demos\';
             !--error 4 
Variable non définie: IPD_PATH

at line      17 of exec file called by :    

at line      38 of function demo_gui_update called by :  
if exists("gcbo") then %oldgcbo = gcbo; end;gcbo = getcallbackobject(11);script_path =
demo_gui_update();exec(script_path,-1);;if exists("%oldgcbo") then gcbo = %oldgcbo; else
clear gcbo; end;
while executing a callback

=> It seems that you've not declared IPD_PATH as global so it cannot work with ATOMS.

Pierre
Answer from Harald Galda -- March 23, 2010, 09:12:29 AM    
Hi Pierre,

I understand that some variables defined in IPD.start must be declared global if IPD is to
be loaded by atomsLoad. I am already working on the next version and there these variables
are global.

For the time being I suggest that IPD is not loaded by atomsLoad. Executing

    atomsAutoloadDel('IPD')

should prevent Scilab from loading the toolbox automatically. 

Harald
Comment from Szymon Wójtowicz -- March 23, 2010, 05:45:38 PM    
Help me..

 IPD - Image Processing Design Toolbox 4.0   
link: The file cxcore200.dll does not exist.
 !--error 10000 
atomsLoad: An error occurred while loading 'IPD-4.0'.
at line     323 of function atomsLoad called by :  
atomsLoad(["IPD"]);

I checked all methods of installation and still this same error :(
I tried under win xp sp3, scilab 5.2.1

:(
Answer from Szymon Wójtowicz -- March 23, 2010, 05:56:43 PM    
link('C:\Program Files\scilab-5.2.1\contrib\IPD\4.0\sci_gateway\cpp\cxcore200.dll')
link: The file C:\Program Files\scilab-5.2.1\contrib\IPD\4.0\sci_gateway\cpp\cxcore200.dll
does not exist.
                                                                                   
!--error 236 
link: The shared archive was not loaded: Unknown Error

but this file exist ! :(
Comment from Szymon Wójtowicz -- March 24, 2010, 12:50:12 AM    
Ok, problem's solved..
IPD needs C compiler.. example visual studio C# express
... 
Answer from Harald Galda -- March 24, 2010, 12:29:03 PM    
If you downloaded the source package, you need a C++ compiler such as Visual Studio 2008
Express Edition.

About the error that occurs when linking the DLL: On some computers IPD can not be loaded
by atomsLoad. You can start the toolbox clicking the toolboxes menu and selecting IPD 4.0.
You can prevent Scilab from loading IPD by atomsLoad with the command

atomsAutoloadDel('IPD')
Answer from Administrator ATOMS -- March 24, 2010, 02:11:19 PM    
Hi Harald,

> About the error that occurs when linking the DLL: On some computers IPD can not be
> loaded by atomsLoad. You can start the toolbox clicking the toolboxes menu and
> selecting IPD 4.0.


This is not an atomsLoad() error, I have the same problem if I manually load IPD
→ With the toolbox menu
or
→ exec("loader.sce");

Pierre
Answer from Harald Galda -- March 24, 2010, 04:10:24 PM    
Hi Pierre,

all I can do about this problem is including the link statements in a try and catch block
and displaying an error message more accurate than "link: The file cxcore200.dll does not
exist."

My own PC is more than six years old, has only 512 MB of RAM and is very slow sometimes.
How much RAM has the PC you tried to load IPD 4.0?

Harald
Answer from Administrator ATOMS -- March 24, 2010, 04:13:28 PM    
> My own PC is more than six years old, has only 512 MB of RAM and is very slow
> sometimes.
> How much RAM has the PC you tried to load IPD 4.0?


4Go: I don't think this is the problem. ;-)

Pierre
Answer from Szymon Wójtowicz -- March 26, 2010, 11:58:29 PM    
> If you downloaded the source package, you need a C++ compiler such as Visual Studio
> 2008
> Express Edition.
> 
> About the error that occurs when linking the DLL: On some computers IPD can not be
> loaded
> by atomsLoad. You can start the toolbox clicking the toolboxes menu and selecting IPD
> 4.0.
> You can prevent Scilab from loading IPD by atomsLoad with the command
> 
> atomsAutoloadDel('IPD')


Hi Harald

I downloaded normal version IPD and i don't use atomsload or atomsautoload..
I use toolbox menu to load IPD.. I uninstalled visual studio and.. IPD don't work.. link
error.. I installed visual studio and.. IPD work..  
Answer from Harald Galda -- April 20, 2010, 08:49:07 AM    
> Hi Harald
> 
> I downloaded normal version IPD and i don't use atomsload or atomsautoload..
> I use toolbox menu to load IPD.. I uninstalled visual studio and.. IPD don't work..
> link
> error.. I installed visual studio and.. IPD work..  


The C++ compiler used for building OpenCV 2.0 must be present on the PC IPD is run on. I 
found out about this when installing IPD 5.0 on a computer with a Visual Studio version 
other than the Express Edition.
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.