I got it to work!  In under  5 minutes it creates R with 300 items that is
then decoded into S and reproduces the original image.  It's chances of
doing that by chance is about 1 in 1.5 trillion.

load 'viewmat'
GRB256=:1 0 2({"1) 256 256 256#:i.256^3
Q=:?(300 300)$ 16777216x

R=:16777216 #. Q
S=:(300$16777216) #: R
Q-:S

GRB256 viewmat Q;'Q'
GRB256 viewmat S;'S'

16777216*90000x

I don't think I'll try it on my phone as it may cause it indigestion.

Linda



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raul Miller
Sent: Friday, September 12, 2014 10:07 PM
To: Programming forum
Subject: Re: [Jprogramming] Using a data arrays to send images

Here's what I notice:

In your first example, the largest possible value in Q was 9, and you
referred to GRB256 even though you had not yet defined it.

In your second example, the largest possible value in Q was greater than
999.

Inspecting samples of the data (try 3 3 {.Q and 3 3 {. S) should make
the significance of the "largest possible value" issue apparent.

Thanks,

-- 
Raul


On Fri, Sep 12, 2014 at 4:09 PM, Linda Alvord <[email protected]>
wrote:
> This is the real problem I'm working on.  Here's what works.
>
>
>
> load 'viewmat'
>
> GRB=:1 0 2{"1 ( #:i.8){0 255
>
> p=: 13 :'?.(y,y)$y'
>
> ]Q=:p 10
>
> ]R=:10 #. Q
>
> ]S=:(10$10)#:R
>
> Q-:S
>
>
>
> GRB256 viewmat Q;'Q'
>
> GRB256 viewmat S;'S'
>
>
>
> Q is a random array of data which has a corresponding color image.The data
> is coded in base 10. That list is then transformed into an array S .  Q
> matches S and image S is like image Q.
>
>
>
> Here's where it doesn't work.
>
>
>
> load 'viewmat'
>
> GRB256=:1 0 2({"1) 256 256 256#:i.256^3
>
> Q=:?(1000 1000)$ 16777216x
>
>
>
> R=:1000 #. Q
>
> S=:(1000$1000) #: R
>
> Q-:S
>
>
>
> GRB256 viewmat Q;'Q'
>
> GRB256 viewmat S;'S'
>
>
>
> Q and R seem to be what I expected, but something is wrong with S.  Any
> ideas?
>
>
>
> Linda
>
>
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to