how to work with symmetric image

2 ビュー (過去 30 日間)
Fawaz Hjouj
Fawaz Hjouj 2019 年 6 月 5 日
回答済み: John D'Errico 2019 年 6 月 5 日
The problem: [ can be underdetermined]:
Let A1 be an image with center of mass at the origin as in Fig A1, for example.
So the x-y coordinates are involved here.
Let A2 be the image obtained by reflecting A1 about the y-axis.
And, let C =A1+ A2, as in figure C. Clearly C is symmetric in the y axis.
The question is to obtain A1 if we know C only.
I am not sure if certain commands would help in some approximation.
Any suggestion is appreciated, thank you.
Hjouj
A1 C
  2 件のコメント
John D'Errico
John D'Errico 2019 年 6 月 5 日
編集済み: John D'Errico 2019 年 6 月 5 日
Please don't post your license information online. I deleted it.
Note that we are NOT a MATLAB team. In fact, Answers is composed of purely voluntary individuals, who are not in general employees of The MathWorks. There is no need to post your address, your license, etc., online.
Fawaz Hjouj
Fawaz Hjouj 2019 年 6 月 5 日
Thanks John

サインインしてコメントする。

回答 (2 件)

Walter Roberson
Walter Roberson 2019 年 6 月 5 日
This is not generally possible.
Assume for the moment that A1 is a binary image of 0 and 1, so the reflected A1, namely A2, is also a binary image. C = A1 + A2 will then have 3 possible values for any given location:
  • 0 -- indicates that neither the left side nor the right side were set. Left and right side can be unambiguously set to 0 in extracted image
  • 2 -- indicates that both the left side and the right side were set. Left and right side can be unambiguously set to 1 in extracted image
  • 1 -- indicates that either the left side or the right side but not both were set. Unfortunately you cannot tell which from C.
For example these two both create the same C:
---- ----
| |
---- ----
| |
---- ----
In typical fonts, b and d and p and q are reflections of each other, so this is a problem even just with words.

John D'Errico
John D'Errico 2019 年 6 月 5 日
Sorry, but this is completely underdetermined. You can never recover A1, from the composite C.
Consider any arbitrary array A1. We can create C by the simple line:
C = A1 + fliplr(A1);
But then, can we go back? So, given only C, how can we recover A1?
Suppose C is an nxn array, as is the unknown array A1. Assume that n is even, so we don't worry about the column of elements in the very middle. (Not a real problem, it just makes it more complex for no good reason.)
We could write out equations for each element of C. That is,
C(1,1) = A1(1,1) + A1(1,n)
C(1,2) = A1(1,2) + A1(1,n - 1)
C(1,3) = A1(1,2) + A1(1,n - 3)
...
C(2,1) = A1(2,1) + A1(2,n)
...
C(n,1) = A1(n,1) + A1(n,n)
etc.
In fact, we could write a set of n/2 equations, but there would be n unknowns. Since we know the matrix C is symmetric, there is no purpose in trying to write an equation for the elements of C on the right hand side of the divide.
Anyway, there simply is not enough information to recover the original matrix A1.
But suppose you claimed to have more information? That is, suppose you claim to know that A1 is a binary matrix, thus, composed only of 0 and 1 elements?
A simple counter-example is sufficient here. Suppose that C is the 2x2 matrix composed of ones?
C = [1 1; 1 1];
Which version of A1 is correct?
A1 = [1 0;1 0]
A1 = [0 1;0 1]
A1 = [1 0;0 1]
A1 = [0 1;1 0]
See that all four possible versions of A1 yield the matrix C, and you can never know which one it was.

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by