none
白黒画素の行列表記について RRS feed

  • 質問

  • C言語で秘密分散法で、文字が表示されるプログラムを作成しています
    完成系はウィンドウ画面の中に"HIT"という文字+背景がノイズが表示されるプログラムです
    白画素の分散画像+黒画素の分散画像=黒文字のHITの画像

    なるのは分かりました。ただ、何度、分散画像を構成する行列を書いてもエラーばっかりです。
    行列表記で間違っていると思ったら訂正してもらえませんか?

     黒画素の基本行列です。

    int
    b 0[3][9]={{1,0,0,1,0,0,1,0,0},{0,1,0,0,1,0,0,1,0},{0,0,1,0,0,1,0,0,1}},
    b 1[3][9]={{1,0,0,1,0,0,1,0,0},{0,1,0,0,1,0,0,1,0},{1,0,0,1,0,0,1,0,0}},
    b 2[3][9]={{1,0,0,1,0,0,1,0,0},{0,1,0,0,1,0,0,1,0},{0,1,0,0,1,0,0,1,0}},
    b 3[3][9]={{1,0,0,1,0,0,1,0,0},{0,0,1,0,0,1,0,0,1},{0,0,1,0,0,1,0,0,1}},
    b 4[3][9]={{1,0,0,1,0,0,1,0,0},{0,0,1,0,0,1,0,0,1},{1,0,0,1,0,0,1,0,0}},
    b 5[3][9]={{1,0,0,1,0,0,1,0,0},{0,0,1,0,0,1,0,0,1},{0,1,0,0,1,0,0,1,0}},
    b 6[3][9]={{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,1,0,0},{0,0,1,0,0,1,0,0,1}},
    b 7[3][9]={{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,1,0,0}},
    b 8[3][9]={{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,1,0,0},{0,1,0,0,1,0,0,1,0}},
    b 9[3][9]={{0,1,0,0,1,0,0,1,0},{0,1,0,0,1,0,0,1,0},{0,0,1,0,0,1,0,0,1}},
    b 10[3][9]={{0,1,0,0,1,0,0,1,0},{0,1,0,0,1,0,0,1,0},{1,0,0,1,0,0,1,0,0}},
    b 11[3][9]={{0,1,0,0,1,0,0,1,0},{0,1,0,0,1,0,0,1,0},{0,1,0,0,1,0,0,1,0}},
    b 12[3][9]={{0,1,0,0,1,0,0,1,0},{0,0,1,0,0,1,0,0,1},{0,0,1,0,0,1,0,0,1}},
    b 13[3][9]={{0,1,0,0,1,0,0,1,0},{0,0,1,0,0,1,0,0,1},{1,0,0,1,0,0,1,0,0}},
    b 14[3][9]={{0,1,0,0,1,0,0,1,0},{0,0,1,0,0,1,0,0,1},{0,1,0,0,1,0,0,1,0}},
    b 15[3][9]={{0,1,0,0,1,0,0,1,0},{1,0,0,1,0,0,1,0,0},{0,0,1,0,0,1,0,0,1}},
    b 16[3][9]={{0,1,0,0,1,0,0,1,0},{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,1,0,0}},
    b 17[3][9]={{0,1,0,0,1,0,0,1,0},{1,0,0,1,0,0,1,0,0},{0,1,0,0,1,0,0,1,0}},
    b 18[3][9]={{0,0,1,0,0,1,0,0,1},{0,1,0,0,1,0,0,1,0},{0,0,1,0,0,1,0,0,1}},
    b 19[3][9]={{0,0,1,0,0,1,0,0,1},{0,1,0,0,1,0,0,1,0},{1,0,0,1,0,0,1,0,0}},
    b 20[3][9]={{0,0,1,0,0,1,0,0,1},{0,1,0,0,1,0,0,1,0},{0,1,0,0,1,0,0,1,0}},
    b 21[3][9]={{0,0,1,0,0,1,0,0,1},{0,0,1,0,0,1,0,0,1},{0,0,1,0,0,1,0,0,1}},
    b 22[3][9]={{0,0,1,0,0,1,0,0,1},{0,0,1,0,0,1,0,0,1},{1,0,0,1,0,0,1,0,0}},
    b 23[3][9]={{0,0,1,0,0,1,0,0,1},{0,0,1,0,0,1,0,0,1},{0,1,0,0,1,0,0,1,0}},
    b 24[3][9]={{0,0,1,0,0,1,0,0,1},{1,0,0,1,0,0,1,0,0},{0,0,1,0,0,1,0,0,1}},
    b 25[3][9]={{0,0,1,0,0,1,0,0,1},{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,1,0,0}},
    b 26[3][9]={{0,0,1,0,0,1,0,0,1},{1,0,0,1,0,0,1,0,0},{0,1,0,0,1,0,0,1,0}};

    白画素の基本行列です。

    int a0[3][9]={{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,1,0,0},{1,0,0,1,0,0,1,0,0}},
        a1[3][9]={{1,0,0,1,0,0,0,1,0},{1,0,0,1,0,0,0,1,0},{1,0,0,1,0,0,0,1,0}},
        a2[3][9]={{1,0,0,1,0,0,0,0,1},{1,0,0,1,0,0,0,0,1},{1,0,0,1,0,0,0,0,1}},
        a3[3][9]={{1,0,0,0,1,0,1,0,0},{1,0,0,0,1,0,1,0,0},{1,0,0,0,1,0,1,0,0}},
        a4[3][9]={{1,0,0,0,1,0,0,1,0},{1,0,0,0,1,0,0,1,0},{1,0,0,0,1,0,0,1,0}},
        a5[3][9]={{1,0,0,0,1,0,0,0,1},{1,0,0,0,1,0,0,0,1},{1,0,0,0,1,0,0,0,1}},
        a6[3][9]={{1,0,0,0,0,1,1,0,0},{1,0,0,0,0,1,1,0,0},{1,0,0,0,0,1,1,0,0}},
        a7[3][9]={{1,0,0,0,0,1,0,1,0},{1,0,0,0,0,1,0,1,0},{1,0,0,0,0,1,0,1,0}},
        a8[3][9]={{1,0,0,0,0,1,0,0,1},{1,0,0,0,0,1,0,0,1},{1,0,0,0,0,1,0,0,1}},
        a9[3][9]={{0,1,0,1,0,0,1,0,0},{0,1,0,1,0,0,1,0,0},{0,1,0,1,0,0,1,0,0}},
        a10[3][9]={{0,1,0,1,0,0,0,1,0},{0,1,0,1,0,0,0,1,0},{0,1,0,1,0,0,0,1,0}},
        a11[3][9]={{0,1,0,1,0,0,0,0,1},{0,1,0,1,0,0,0,0,1},{0,1,0,1,0,0,0,0,1}},
        a12[3][9]={{0,1,0,0,1,0,1,0,0},{0,1,0,0,1,0,1,0,0},{0,1,0,0,1,0,1,0,0}},
        a13[3][9]={{0,1,0,0,1,0,0,1,0},{0,1,0,0,1,0,0,1,0},{0,1,0,0,1,0,0,1,0}},
        a14[3][9]={{0,1,0,0,1,0,0,0,1},{0,1,0,0,1,0,0,0,1},{0,1,0,0,1,0,0,0,1}},
        a15[3][9]={{0,1,0,0,0,1,1,0,0},{0,1,0,0,0,1,1,0,0},{0,1,0,0,0,1,1,0,0}},
        a16[3][9]={{0,1,0,0,0,1,0,1,0},{0,1,0,0,0,1,0,1,0},{0,1,0,0,0,1,0,1,0}},
        a17[3][9]={{0,1,0,0,0,1,0,0,1},{0,1,0,0,0,1,0,0,1},{0,1,0,0,0,1,0,0,1}},
        a18[3][9]={{0,0,1,1,0,0,1,0,0},{0,0,1,1,0,0,1,0,0},{0,0,1,1,0,0,1,0,0}},
        a19[3][9]={{0,0,1,1,0,0,0,1,0},{0,0,1,1,0,0,0,1,0},{0,0,1,1,0,0,0,1,0}},
        a20[3][9]={{0,0,1,1,0,0,0,0,1},{0,0,1,1,0,0,0,0,1},{0,0,1,1,0,0,0,0,1}},
        a21[3][9]={{0,0,1,0,1,0,1,0,0},{0,0,1,0,1,0,1,0,0},{0,0,1,0,1,0,1,0,0}},
        a22[3][9]={{0,0,1,0,1,0,0,1,0},{0,0,1,0,1,0,0,1,0},{0,0,1,0,1,0,0,1,0}},
        a23[3][9]={{0,0,1,0,1,0,0,0,1},{0,0,1,0,1,0,0,0,1},{0,0,1,0,1,0,0,0,1}},
        a24[3][9]={{0,0,1,0,0,1,1,0,0},{0,0,1,0,0,1,1,0,0},{0,0,1,0,0,1,1,0,0}},
        a25[3][9]={{0,0,1,0,0,1,0,1,0},{0,0,1,0,0,1,0,1,0},{0,0,1,0,0,1,0,1,0}},
        a26[3][9]={{0,0,1,0,0,1,0,0,1},{0,0,1,0,0,1,0,0,1},{0,0,1,0,0,1,0,0,1}},
       

    秘密画像の基本行列です。

    har c[21][35]=

                 {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0}, 
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
                   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};

     

     

    2013年7月20日 10:24

回答

  • スレッドを分けた理由・狙いを書いていただけないでしょうか。

    今のままですと、一つの課題を分割し直して質問を繰り返しているようにしか見えません。
    そして、複数のスレッドに分散することで、全体が見えなくなる、同じことを繰り返し聞く・言われるというように、質問側も回答側も苦労することになりますよ。


    また、先のスレッドで書かせていただきましたが、一度質問の仕方について見直してください。
    リンク先のドキュメント を読んでもらえていたのなら、このような質問にならないと思いたいからです。。。
    ドキュメントから一部のタイトルを抜粋すると、「エラーメッセージ ―― 必ずコピー&ペーストしましょう」ということも書いてあります。
    2013年7月20日 11:20
    モデレータ