NO

Author Topic: Convolution Filters Editor  (Read 25520 times)

Grincheux

  • Guest
Convolution Filters Editor
« on: July 25, 2021, 12:58:37 PM »
I have simplified the program. No Histogram and Preview Windows.
Added a "Save All" button to create all the effects.
Recompiled with Pelles 11.2
Editor random numbers are in the range -9999 to +9996
Now when the program save all the filters it runs with reduced ressources (BACKGROUND_BEGIN / END)
Added 2987 models.
Corrected some bugs.

Deleted some warnings when compiling. Level 2.
Removed unused code in the convolve functions.
Reduced allocated memory.
Tried to use MM_MALLOC but the function crashes.

I wanted to replace VirtualAlloc. For using GetDIBits, the memory must be aligned, this is OK with VirtualAlloc and MM_MALLOC would have to do the same thing, but it crashes...
I have set a new icon but this one is not good for me.
Removed some fields in the main structure.

Program can be downloaded at
https://www.mediafire.com/file/ggmgie9ktk2m82y/Cfe.7z/file
« Last Edit: August 19, 2021, 11:58:08 AM by Grincheux »

Grincheux

  • Guest
Re: Convolution Filters Editor
« Reply #1 on: August 27, 2021, 01:30:53 PM »

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Convolution Filters Editor
« Reply #2 on: August 27, 2021, 03:24:05 PM »
You've been keeping busy  :)

Thanks - downloaded it too.

John Z

Grincheux

  • Guest
Re: Convolution Filters Editor
« Reply #3 on: August 27, 2021, 04:43:18 PM »
Yes, I did not happen to do what I wanted.
Giving the result always is a hard thing.
I have defined a structure for the color and they are intialized in the source code, perhaps it will be useful.
Thank John.

Grincheux

  • Guest
Re: Convolution Filters Editor
« Reply #4 on: September 21, 2021, 08:12:40 PM »
Now CFE uses a database into which user filters are saved too.
I added "favorite" to keep time.
Added 6 fusion options.
Added the possibility to remove or to update a filter.
Corrected some bugs and modified the toolbox dialog to be used on a single screen.
The program has 3262 predifined filters and 184 favorites (Good).

Don't edit the faile Datas.c with Pelle's IDE, you will get an error when compiling between the lines 3282 and 3291.
The lines are too long for Pelle. You can use NotePad++.
If you do this you the compile operation will be OK.

The new version is available at https://www.mediafire.com/file/4w94rgrr7sr0qiq/Cfe.7z/file

The result of what CFE can do is available on FLICKR at https://www.flickr.com/photos/188274347@N07/

An example

« Last Edit: September 21, 2021, 08:14:23 PM by Grincheux »

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Convolution Filters Editor
« Reply #5 on: September 22, 2021, 12:44:16 PM »
Don't edit the file Datas.c with Pelle's IDE, you will get an error when compiling between the lines 3282 and 3291.
The lines are too long for Pelle. You can use NotePad++.

An example

Wow - I'm wondering did you try using continuation character to break up the long line(s)? I'll try using TextPad from Helios, and see how it goes.  I'm sure I have no business editing such a long lines though  :)
 - oh yeah I see filter 3258 has 4601 characters on a line..... (TextPad - no problem)

The linked example photo is quite interesting I like the effect on the tug boat and harbor.  Never been on "Flicker" but maybe I'll jump over for a look-see as long as not needing to join something or another...

John Z
« Last Edit: September 22, 2021, 01:02:09 PM by John Z »

Grincheux

  • Guest
Re: Convolution Filters Editor
« Reply #6 on: September 25, 2021, 10:06:22 PM »

Offline MrBcx

  • Global Moderator
  • Member
  • *****
  • Posts: 189
    • Bcx Basic to C/C++ Translator
Re: Convolution Filters Editor
« Reply #7 on: September 26, 2021, 12:18:31 AM »
Last version. Il will not be updated.
Links :
Installation : https://www.mediafire.com/file/f26xdnnuuydrnuw/Cfe-Setup.exe/file
All the project : https://www.mediafire.com/file/4nmm3tyq1jlzq0m/Cfe.7z/file

If you change your mind, File | Open is desperately needed. 
Drag and Drop is a horrible user interface, IMO.

You did a great job on your convolution engine.
I wrote a 3x3 and 5x5 convolution filter about 20 years ago.  Really interesting subject!
Bcx Basic to C/C++ Translator
https://www.BcxBasicCoders.com

Grincheux

  • Guest
Re: Convolution Filters Editor
« Reply #8 on: September 26, 2021, 07:08:17 PM »


Quote
If you change your mind, File Open is desperately needed. Drag and Drop is a horrible user interface, IMO.

I was thinking about. You are right I will do it. I will post the new version when it is done. Thank You for the remark.

Quote
I wrote a 3x3 and 5x5 convolution filter about 20 years ago.  Really interesting subject!

With Cfe you can do 29x29 filter.

Here is an other update Complete Project : https://www.mediafire.com/file/cnm0k2c2u3u64ok/Cfe.7z/file

Binaries : https://www.mediafire.com/file/45dvxdr32775ym6/Cfe-Setup.exe/file

You can rename the filters and the Goods
You have 10 undo levels
------------------------------------------------------------------
1994 Filters
120 Goods
« Last Edit: September 26, 2021, 07:21:41 PM by Grincheux »

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Convolution Filters Editor
« Reply #9 on: September 27, 2021, 01:34:35 PM »
Last version. Il will not be updated.

When you achieve your vision then you are done. ;)

However the file open is a good add. Especially since starting the program it occupies the entire screen so to do a drag-and-drop requires resizing the main window before doing anything.  Another thing which confused me initially is when I dropped the file (actually tried many times) nothing would happen so it was unclear that anything was ever dropped.  Then I figured out you need to drop the file then change some settings to get it to appear.   Would be nice for the file to appear when dropped.

That being said the amount of work you have put into this is incredible.  Your last update reduced the exe by about 4megs I think and removed less than useful filters.

John Z

Grincheux

  • Guest
Re: Convolution Filters Editor
« Reply #10 on: October 18, 2021, 04:35:54 AM »
Thank You JohnZ

The Open File is not for today, I have thought that a man that chooses is photos takes them and put them under the light one by one. It is this image I have in my head.

I have an other update after many hundred of tests. Some bugs corrected, above all a bug that will no frees memory.
It is possible to export the database into a C source file. That permits you to create other filters and if they are good you
take the file "$Export Filters$.c" and copies the data to replace the in the Datas.c. You recompile and your new ilters are there.

Models cannot be deleted except if you are in admin mode.
This made by changing the "Cfe.ini" file. By default you are admin and the database is exported.

I know that the toolbox occupies the whole screen, it is a problem that I would like to improve. Perhaps by adding a preview window?
You can minimize the toolbox.

I have made comparisons between Cfe and other programs, it is more than correct.
Now I am looking at Neurons filters, it is hard and I did not stay at school for a long time...

When starting the program lists all the filters but in choosing a size and the click on select you have all the filters for the selected size.
If you click on "Save All" it will save all the filters in the combobox form the one that is selected (Default the first filter).

There are 2600 filters that I created and verified. No blck background.. Removed Sobel and Laplace filters, but you can add them.
It is possible to rename a filter but the name will be lost while exporting.
It is possible to add a comment, that will be kept while exporting.

It is possible to get a previous filter between one and ten but I don't understant how it works!
It is something I must change.

The left part of the toolbox is for creating filter.
Personnaly I don't use the background and the fusion/merge button.

The right part of the toolbox is for merging two filters together.
Some results are funny.

The files to download are at :
https://www.mediafire.com/file/cnm0k2c2u3u64ok/Cfe.7z/file for the bunaries
and
https://www.mediafire.com/file/cnm0k2c2u3u64ok/Cfe.7z/file for the whole project

Have fun and don't hesitate to make comments, they will help me.

Thank You
« Last Edit: October 18, 2021, 05:09:33 AM by Grincheux »

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Convolution Filters Editor
« Reply #11 on: October 18, 2021, 12:05:18 PM »
Thank You JohnZ

The Open File is not for today, I have thought that a man that chooses is photos takes them and put them under the light one by one. It is this image I have in my head.

I always have agreed with staying true to your vision, as I do with my programs. 

Have fun and don't hesitate to make comments, they will help me.

I'll give it a go and see how some of my photos turn out :)  Some of which are at this site
https://sourceforge.net/projects/sixelviewer/

HaGD,
John Z

Grincheux

  • Guest
Re: Convolution Filters Editor
« Reply #12 on: October 19, 2021, 12:08:47 AM »
I have dowloaded SixEl. The six format is not very common.
I was suprise when eeing Leonardo, I did not think to him!
Runs well on my pc and is very fast.


Thank You


If you test my pgm the filter 1724 is
-1 -1 -1 -1 -1
-1 -1 0 1 -1
-1 0 20 0 -1
1 1 0 -1 -1
-1 -1 -1 -1 -1


It 's a good filter for adding luminosity to an image.


Good filters are 1724 a 1725


Good night

Grincheux

  • Guest
Re: Convolution Filters Editor
« Reply #13 on: October 19, 2021, 05:17:30 PM »
Just an other update because I found two filters which give wonderful results.
I have reduced the dialogbox size and added a copy to clipboard possibility.

The whole project is at https://www.mediafire.com/file/0os3175cbxxc92y/Cfe-Setup.exe/file
« Last Edit: October 19, 2021, 05:22:41 PM by Grincheux »

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Convolution Filters Editor
« Reply #14 on: October 19, 2021, 05:36:36 PM »
I have dowloaded SixEl. The six format is not very common.
I was suprise when seeing Leonardo, I did not think to him!
Runs well on my pc and is very fast.
Thanks! I think my sixelviewer is the only standalone windows sixel viewer. None of the big guys support the format.

Got your new CFE version!  Tried several things and posting one output here.  Sorry to say I could not figure out how to save the 'filtered' image result.  Ended up using iview to capture the screen.  A lot of built in capability I'll need to play with it longer.. I do like that the arrow keys can be used to cycle through the filters faster than using the mouse and dropdown list - good design.

John Z