New feature in limereg

I’m preparing to add a new feature for my Open Source project for image registration ‘Limereg‘, which was inspired by the ImageMagick community who asked me for a solution for the ImageMagick compare -subimage-search command that allows for more than only translation.

For searching such a smaller image inside a big one, that is not only translated, but also rotated (rigid registration) or stretched (affine registration), I will try to perform a series of image registrations on different starting positions.

Algorithm (with regard to the multilevel pyramid scheme, Limereg uses):

  • Create pyramid images of the big reference (R) and the small template (T) image.
  • On the coarsest level register the smaller image to be searched (T) on the bigger image (R)
  • Do this several times from different starting positions. E.g. by putting an equidistant grid of starting positions on R.
  • The best (resulting in the smallest SSD distance measure) n% (e.g. 20%) of positions may survive for the next run on the next finer pyramid level.
  • The next finer level should have a finer grid of starting positions. E.g. for each position that ‘survived’ above, create four new grid-positions (2×2) around the survived one.
  • Repeat this steps recursively until the finest level has been reached.
  • The best (smallest SSD) result points to the found subimage, if the resulting SSD is below a threshold.

I’m very curious how this will work out and how fast it will be.

Intercultural Communication (Germany, China)

Recently I had a training for intercultural competency in China. In the training also the characteristics of my own country (Germany) were explained. Let me share with you a short summary on how communication in Germany differs from communication in China. At first I want to emphasize that both ways are very efficient and I would never say that one of both ways is better than the other one. This blog is just about knowing the differences, without any rating.

The Germans were in a constant state of war and poverty over hundreds of years (until mid of the last century). They were always busy with rebuilding their country and that’s why craftsmanship became so powerful in Germany and a very direct language arose. “Give me the hammer !”, “Don’t put the stones so unorderly !”, “When will you be ready ?”, “No, this is wrong !”. Our trainer tought us that such direct sentences are uncommon in eastern countries, especially in cases where people would loose their face, when there is a chance that a person will be devalued. The concept of loosing ones face is less known to German people on the other hand. Ok, also in Germany people have a reputation, but it works diffently than in eastern countries (as far as I learned from our trainer):

– In Germany every word is filtered by being: The truth, spoken with good reason and efficient.

– In eastern countries it is ok for supporting social relationships or to avoid that someone looses the face to void this rules. It is ok not to tell the truth, for saving others reputation. It is ok to begin with smalltalk (which has a good reason more indirectly, not directly). And – what German people would sometimes regard as inefficient communication – it is advisable to paraphrase problems with much words or even stories that have a message hidden in between.

This was said coming from the different social structures of monochromatic and polychromatic societies. In monochromatic structures each individual deserves total freedom and wants to make it to the top alone. At the end of a work day the amount of identified and solved problems defines the success of the day. In polychromatic structures each person is part of a group, everyone has to serve the group. At the end of a work day the amount of strengthened (or even created) social bounds defines the day’s success.

Let me make an example:

Two German people are sitting in a German lunchroom at lunch, a server administrator and his boss. A lot of people can hear them talking. The server of the administrator is terribly slow each morning when everyone comes to work. Two workers come to both, say short greetings, don’t do any smalltalk and come directly to the point: “Hi Paul, I’m Bernd, did you notice that your server is so slow in the morning, sometimes I have to wait 15 minutes until I can logon”.

You find here the German communication pattern again: Truth, efficient, spoken with a good reason.

Now how would a German react and how could the reaction be if this were Chinese people:

Germany: Paul is very grateful that someone gives him potential for identifying and solving a problem. Paul would ask many questions about the nature of the problem and about how bad the situation is. Paul would not feel personally critisized. Bernd would tell the full truth and would explain every single detail he worries about. The boss of Paul would listen interestedly and would think good of Paul, because Paul is so motivated in asking for every detail. Also Bernd’s behavior would be regarded as being very valuable, he is so motivated that he invests time for giving all details to Paul, this is highly appreciated.

If it would not happen this way, if someone would depict the situation less worse than it is (Paul or Bernd), everyone would think that this is not an honest person (see above: truth) and the reputation of this person would be lowered because he did not stick to the facts.

China: Now imagine the same setting but Paul and his boss are from China. If the German Bernd would then talk so directly about the problem, Paul, his boss and also Bernd would all loose their face (if I understood the training correctly), which might put the Chinese colleagues at high stress. Paul would maybe try to depict the situation less worse to calm down the situation, which the German Bernd would then decode as not telling the full truth. This makes Bernd even more upset because Bernd feels to get tricked and then everything proceeds into total chaos …

So how to avoid this situation:

For western people: According to our trainer the best way is to understand that in China building relationships is more important than solving problems/tasks. And this worked very good for 5000 years now, we should appreciate this as a very effective pattern.

Bernd could begin the communication with smalltalk, and he could express how proud he is being a member of the community and how good the community is interacting which each other, that it is a great pleasure to work together. Everything that refers to the group is perfect. If some German colleagues asked for the Chinese ones before Bernd traveled to there, Bernd can transmit their greetings and he can underline how satisfied the German colleagues are with the relationship in between the whole family of German and Chinese colleagues. Pitfall: Don’t mention anything negative. This is hard for Germans as it is not uncommon in German smalltalk to philosophize about things that went wrong, and to draw lessons-learned from it. Also don’t refer to anything negative that has been solved in the wrong assumption this would be positive smalltalk. Like “I’m so happy that the new CEO is so much better than the old, retired one. He’s so wonderful and has so much youth and power.”. In Chinese ears this might be no positive smalltalk at all, usually the former CEO has to be honored.

As a German, one has to understand that this procedure is no waste of time. That there’s no need of getting nervous when it feels like inefficient communication (see above: efficient, truth, good reason) or when it feels like not being the truth, e.g. when one says that the relationship between the teams is so wonderful when this isn’t fully the case. Being patient and polite here is the key and most recommended.

After Bernd created a good atmosphere he wants to mention that the server is slow each morning. It would be best to tell the Chinese Paul about it under 4 eyes. If this isn’t possible for some reason, the communication has to be as subtle as possible (well, under 4 eyes one would still be more suble than in Germany). I’m no expert here, but if I’d be Bernd, I’d maybe mention that the server is such a valuable contribution to the team and that its speed is so good at noon and in the evening when people work longer for their customers. A Chinese Bernd would understand this, if he’s aware of the slowdown in the mornings. Maybe I would tell a story (a lied one maybe – which is very difficult for Germans who’s reputation is tightly bound to telling the truth, as explained before) where the speed of a server saved the team from trouble and helped an important customer who was calling in the morning. It is important here to emphasize the impact to other people (the team, the customer) and not to emphasize only on factual problems.

For the German the success of this communication is measured in the first place in whether the server will become faster later on. The communication’s success for the Chinese might be measured in the first place in whether the relationships could be tightened and all people are satisfied. A Chinese Paul will help Bernd for strengthening the relashionship to him and because Bernd needs Pauls help. A German Paul on the other hand would help Bernd for strengthening the companies processes and would care less about the relationships. Ok, this is a bit overdrawn, also a Chinese Paul would care for the companies processes and also a German Paul would try to have a good relationship to Bernd. But according to my training the focus is either more on facts or more on relations, this is importand to be understood.

If I had to give the same kind of advice to Chinese people (how to communicate to the other party), it would be to talk about facts and to talk very clearly. Germans like when negative facts are directly mentioned with their full impact. They care less abour who is responsible for the fact, they concentrate more on the situation itself and on how to overcome it. You can call a German and come right to the point (however as Chinese people are so good in smalltak, and also in Germany smalltalk is part of business communication, it is not an error to start with it, if kept reasonably short. (see above: efficient)).

After the (optional) small talk the following would be ok: “Hi Franz, in the specification you gave us unfortunately the whole power train is missing. We need this, is it allready available ? And if not, when can we expect it ? Thanks a lot.”. The latter question would in most cases (not allways) not be understood as making pressure, but as asking for an information, which should be as realistic as possible. Another example: “Hi Franz, there’s a little error in the software requirements you wrote. Req 234 seems to be contratictrary to Req 259, would you agree or haven’t we understood it ? Please explain, thanks.”.

Furthermore, if something is not possible, tell it a German like you would tell a small child or a golden retreiver. “It is not possible”. Be prepared for giving the true reason, like “sorry, doing this in Hong Kong is not very wise, Chinese authorities want this to happen on the mainland”. Give the reason without caring wether the German would look stupid, he will apreciate hearing the truth and as the concept of loosing ones face is less known to him, he probably will not notice at all that your answer doesn’t let him look good.

The same topic  for Germans, because it is so important: If a colleague from China tells you “this would be a challenge” or “I’m not sure, that …” what he really means is: This isn’t possible at all, in no way this will ever work out, find another way. I heard of several situation where tasks didn’t succeed and the Chinese people said from the very beginning that this is impossible (in the encoded words above) and the German people just didn’t understood the meaning and answered: “A challenge ? Great, we love challanging tasks, go and try your best ! When can we expect this to be ready ?” When a German hears “challenge” he hears that it is tough but probably possible …

So far for today. It’s a tremendously complex and wide topic. If you need further details, I can recommend the seminar from Susanne Kilian called ‘The Cina Code’ and she would probably also travel to other countries and give you a ‘The German Code’ lesson (see http://www.english-code.de).

Also nice: https://www.google.de/search?q=east+meets+west+yang+liu&tbm=isch