I asked a question a few hours ago , as the following but The intended question is changed.
http://answers.opencv.org/question/120726/how-to-convert-mat-data-to-byte-data-in-andorid-by-using-opencv/
So I newly ask a question in here.
[Question]
I would like to equal the value of "ds" to the value of "a" in the following code.
>・・・
>> Mat img2 = new Mat(new Size(85, 85),> CvType.CV_8UC3); String a = img2.dump(); > byte[] ds = a.getBytes();> System.out.println(a); -----(A)> System.out.println(ds);------(B)>・・・
Actually, (A) and (B) is different from each other
(A)'s output:
I/System.out: 244, 255, 249, 255, 243, 255, 248, 255, 247, 255, 245, ・・・
(B)'s output:
I/System.out: [B@4627b6a0 ・・・
The purpose of equaling the value of "ds" to the value of "a" is to send the ds's data via socket communication as the following:
>・・・ socket = new Socket(IP_ADDR,
> PORT); out = new> BufferedOutputStream(socket.getOutputStream());> out.write(ds); ・・・
then, I want not to send same value of (B) output but to send same value of (A) in byte data.
If you know the solution of the problem ,Please let me know.
↧