NO

Author Topic: Editor for convolutions filters  (Read 10786 times)

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Editor for convolutions filters
« Reply #15 on: April 03, 2021, 11:30:28 AM »
Très bien.
J'espère que plus que moi en profiterons.

Merci beaucoup mon ami.

John Z

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #16 on: April 04, 2021, 09:35:44 AM »
Here is the las version.
Improved speed and corrected bugs.

Nom: myGimp.7z
Taille: 720138 octets (703 KiB)
CRC32: 751FF826
CRC64: EA209118B8E05293
SHA256: 1D08CC8ECD05742366A45614712096D7F84D72A9D9BA37BA9FD2FB09773429E5
SHA1: C6B628A0E4D8D949725D8C35C1C3A00D309AAD0E
BLAKE2sp: 54A86B585E39463362A24EAD4FB9587997D161C5F9AE5653E1BA547BDF1CBEC6
« Last Edit: April 04, 2021, 09:38:30 AM by Grincheux »

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #17 on: April 04, 2021, 09:39:28 AM »
And the missing Sqlite3

Nom: sqlite3.7z
Taille: 678152 octets (662 KiB)
CRC32: 9D4966E7
CRC64: E5C887B0205A29F5
SHA256: 633FD9732A44662C804B1E81F717C4309E945526DC44D0EEC3FE27AD0FF16A66
SHA1: DB5C34039C6DC14080A4DE1454269CED7F907682
BLAKE2sp: 6B73618D93B6898388A3CB1D23B66C21EF0254FD160DFB30961FD8DF8EF517FD

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #18 on: April 04, 2021, 06:44:13 PM »
Original



Once the filter is applied:


Last Version



Quote
Datas :
Name : Flt 0017
Record Number 17
Size : 3x3
Divisor : -50
Bias : 0
Grey : 0
Datas :
   745,  -646,  -279
   371,  -378,   652
   140,  -624,   -32
« Last Edit: April 04, 2021, 06:54:32 PM by Grincheux »

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: Editor for convolutions filters
« Reply #19 on: April 06, 2021, 03:17:33 PM »
The resulting image is really scary ;-)
---
Stefan

Proud member of the UltraDefrag Development Team

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #20 on: April 06, 2021, 03:22:42 PM »
I am testing Median filter, Min and Max filters, Distance and Variance too.
After I have no idea.
I re-read my code to try to improve it.
In a few days I will create a page on google blogger for downloading the program and try to understand how it works.


Thank you for your comment. ;D

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #21 on: April 09, 2021, 05:41:23 PM »
Final update ?




I have added pdf files in French and in english.
Thank You Google Translate

https://www.mediafire.com/file/h7ydmq0u2bbhn0v/Cfe-en.pdf/file
« Last Edit: April 20, 2021, 05:57:45 PM by Grincheux »

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Editor for convolutions filters
« Reply #22 on: April 11, 2021, 04:20:46 PM »
 :)
I note the name change....

Thanks, the pdf is helpful.  Should it mention the need for SQLite? 

John Z

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #23 on: April 11, 2021, 04:22:35 PM »
SQLite is joint into the package.

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Editor for convolutions filters
« Reply #24 on: April 11, 2021, 04:40:01 PM »
 :) Was just going to say I see the DLL  :)

John Z

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #25 on: April 11, 2021, 07:25:51 PM »
I have added a file name Cfe.ini
It contains:
Quote
[Cfe]
Database=0
Inf File=0

When "Database" is equal to 0, that means that no filter record will be added into to file User Filters.db3
When "Inf File" is equal to 0, no image description file will be created.
« Last Edit: April 20, 2021, 05:57:18 PM by Grincheux »

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #26 on: April 15, 2021, 09:57:42 AM »
I do not publish any changes from now within two months.
I made a lot of changes and corrected a mountain of bugs:
Everyday I work with the program during many hours to find what is wrong.
For now it seems clean.

Source code = Binaries

Play with it you will be very surprised if you think you where pretty... I test on me and did not recognized myself.

There is an other domain that I would like to include, it is the CNN seems not too complicated...

Telle me what is wrong or what could be improved, that would help me.
« Last Edit: April 20, 2021, 05:57:03 PM by Grincheux »

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Editor for convolutions filters
« Reply #27 on: April 17, 2021, 02:49:34 AM »
Ran across this and remembered reading you were interested in optimization as well as assembly code.

Software optimization resources
https://www.agner.org/optimize/

John Z

Grincheux

  • Guest
Re: Editor for convolutions filters
« Reply #28 on: April 17, 2021, 05:57:44 PM »
I know this and read it it many times.

Agner has a good code but don't forget you can't always use it for all the programs.
For example, his function StrCpy is good for large strings, but for small strings, we don't need it.
There are very good ideas because he does not speak about asm only, he introduces optimizations for many languages.
I apply his rules for unrolling loops, when I have a loop like this:

for(i = 0 i < 256 ; i=i+4)
{
    DoSomething(i) ;
    DoSomething(i + 1) ;
    DoSomething(i + 2) ;
    DoSomething(i + 3) ;
}

In my program I need to transform the image from RGB to Grey.
I make the transformation using the average of Red, Green and Blue.

Rather than making Average = (Red + Green = Blue) / 3;
I have a table fo 256 entries nto which I already have computed the average.
I get it doing _r = _g = _b = TabDiv3[_r + _g + _b] ;
If I would repect the standard, it is not for today, I would have three tables, one for Red, one for Green and an other for Blue.
_r = TabStdRed[_r] ;
_g = TabStdGreen[_g] ;
_b = TabStdBlue[_b] ;
Grey = _r + _g + _b ;

I think it is quicker. An other idea is to replace the division by 3 using magic numbers, difficult in C.

I would finish repeating what Mr Pelles told me, having a good algorithm is the best thing.
I think he is TRUE.

But for finishing, Mr Pelle or Frankie must have good ideas on the subject that would be very interesting if they would...

« Last Edit: April 20, 2021, 05:56:40 PM by Grincheux »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Editor for convolutions filters
« Reply #29 on: April 18, 2021, 02:46:46 PM »
To avoid writing a whole book, I just have a few random comments:

1) The compiler will use magic numbers for division and multiplication when it can, but sometimes C language promotion rules can confuse things.

2) Running the profiler on an interactive program like this is only partially helpful, since most of the time is recorded in some Windows function waiting for the next message (so application times are often seen as 0.nn% and easy to miss). What it reveals is pretty obvious: a function like Convolve() takes some time (but still pretty fast on my machine, even for a large image). Doing the traditional "start clock" + "stop clock" in a function like this may be more helpful.

3) I just looked briefly at Convolve(), and not sure how much it matters in practice (without changing code and measuring time), but more variables could be "unsigned" and some conditions inside the loops seems to apply to the whole image, so perhaps use the condition to choose between two different (tighter) loops. This will complicate the code, but if you really want those last percent of performance, it may be worth investigating... (or not).

4) Not sure it applies, but have you considered using SIMD instructions/intrinsics (SSE/AVX/...)? Processing many pixels quickly is one thing they should be good at (in theory). In practice it may be too complicated and not worth it...
/Pelle