Regarding "Why?", I was training a neural net to recognize 13x13
images and I wanted to create slightly imprecise images to improve the
net, so I generated randomized compressions. Does that explain it?

Now my neural net is trained and I want to just compress 52x52 images
to 13x13 and am waffling on whether the filtering process now should
be similarly random or should be based on something like the "median
filter" value of the 4x4 subregion like Cliff Reiter does. Having
looked at the matrix and vector C routines supplied by Apple, which do
not offer a median filter-like option, I am leaning toward the type of
compression I mentioned in a previous message in this thread named
"vDSP_vcmprs". I am still trying to figure out its use, though, and
hoping that it use of "stride" will enable me to compress in
checkboard sub regions of 2x2 or 4x4. As to the choice of which item
to select in each region, I am still waffling on whether or not to
choose randomly in the spirit of statistical random sampling (not as
before to generate different samples).

Thank you,

On Wed, Jan 2, 2013 at 10:13 AM, Raul Miller <[email protected]> wrote:
> In english: you are breaking your image into 2 by 2 pixel regions and
> assigning each pixel in a region a value 0 1 2 3 (upper left, upper
> right, lower left, lower right) and then extracting that pixel from
> each of the regions, for your result.
>
> In your current implementation, you pick a random value for the pixel
> choice, and then you use it on the entire region.  But that value is
> not a parameter for the verb 'sample'.  Instead you give a value which
> the choice must be less than, and you have sample pick an arbitrary
> value from the resulting range.  Why?
>
> --
> Raul
>
> On Mon, Dec 31, 2012 at 6:07 PM, Brian Schott <[email protected]> wrote:
>>         I developed a small image compression script which is applied to a
>> "thresholded" image from the G component only of the RGB triplet. (Although
>> my example below is of an 8x8 thresholded image, in practice it is 52x52.)
>>
>>    wind=: 2 2$2
>>    sample=: 4 : 'wind (?x)&{@,;._3"2 y'
>>    ]specimen=: 8 8?.@$2  NB. the test thresholded image
>> 0 1 0 1 1 1 0 0
>> 0 1 0 1 0 0 1 0
>> 0 0 0 0 1 1 1 0
>> 0 0 0 0 1 1 0 1
>> 1 0 0 1 0 0 1 0
>> 1 0 0 0 0 1 0 1
>> 0 0 1 0 0 1 0 0
>> 1 0 0 1 0 1 0 0
>>    2 (4&sample) specimen NB. a random resulting compression
>>
>>         Eventually I will have to do this compression in C and I am very
>> weak in C, so I am looking for an alternative calculation that gives
>> approximately the same result but using something like matrix
>> multiplication. I am just beginning to learn the terminology of image
>> transformation, but this may be an example of a "convolution" in that
>> discipline.
>>
>>         So, my question is (I think) can a random convolution matrix be
>> constructed to accomplish a similar result using matrix multiplication, for
>> which I have found a c code example at rosettacode.org?
>>
>> http://rosettacode.org/wiki/Matrix_multiplication#C
>>
>> Thanks,
>>
>> (B=)



-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to