Weekly Post #4 - The Membership degree of an image

It's hard to believe that we're ending Week 4 of Major Project already. Next thing I know mid-project demos will be here! (due Mid-March)

This week really has been about getting the membership function fully ready for implementation in two of the Fuzzy Entropy algorithms. To break this week down a little more:

Completed the function to find the membership degree of a specific pixel

Created my 'de-luca' branch

Started implemented the De-Luca & Termini algorithm

Started creating my CRC Cards

Create diagram in draw.io depicting which function links with which

Define how to identify my comments from Learned-Miller's

Wrote posts on Membership function & TDD

Adapted Membership function closer to the final needs


Membership function

The initial Membership function work, where the membership of a specified pixel can be found here. This was written in a TDD approach, and a snippet of this can be found in this post.

The latter part of the week was spent adapting this initial attempt so the membership function would take the image matrix as a whole, apply the membership algorithm to each pixel, and output a matrix of membership values.

This has almost definitely broken my test written above, so I will hopefully be fixing that this afternoon. It's likely the majority of the test will have to be rewritten as it was originally created to take in x,y values for a pixel (which now the function does not).

To get an idea of the sheer extent of an image matrix, and it's corresponding membership matrix see below.

Image matrix This excerpt from a greylevel image matrix, is outputs the following membership matrix:

Membership matrix Where you can see a significant number of pixels actually fall between the shoulders of a group (value =1).

Note, some values are listed as '0' which given that the membership groups overlap should not happen. Will have to look into this.


De Luca Algorithm

With the membership function now ready and working, I could begin to implement the De Luca & Termini Fuzzy Entropy algorithm:

De Luce algorithm

My plan is to have this working by the end of next week, so I can have a strong mid-project demonstration with at least:

  • Standard Entropy image alignment
  • One Fuzzy Entropy image alignment
  • A basic GUI to allow the User easy control

CRC Cards

CRC Cards traditionally outline design for Object Oriented Design 1 however due to the structure of MATLAB, being very much a 'function per file', I have taken a slightly more unconventional approach by creating 1 per major function in the system.

Due to the combination of existing and new functions in my project, each card also notes which category that functions falls into (Existing, Modified, New). The idea with the CRC Cards will be to create a simple, easy to read design that even people who do not use MATLAB will be able to follow. That, and if any edits are made to the functions (or any are removed etc) it''s quick and simple to 'chuck' the card away (although for the sake of Major Project documentation, they will be 'archived' rather than thrown away).

CRC Function Cards

They are laid out in such a fashion to mimic the hierarchy of functions, which neatly leads onto...


Modeling function interactions

I was struggling to understand the flow of the existing Congealing functions, so I spent some time on Wednesday mapping out which function calls to which.

These diagrams are still basic, and very much a work in progress as I get to grips with the application. They were drawn in draw.io.

Original flow

I further went on to incorporate the membership function and how the 'De Luca' implementation would work:

De Luca flow


What's next?

Next week will be a busy one working towards implementing the first Fuzzy Entropy algorithm:

  • Finish implementing De Luca & Termini's fuzzy algorithm
  • Further understand existing code
  • Start report write-up for De Luca & Termini's implementation
  • Add more information to my CS38220 poster on Major Project progress
  • If time: start research into Fuzzy Shannon Entropy (which should be easier to implement)