Author Topic: Reduce List of Lists  (Read 1365 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 493
Reduce List of Lists
« on: September 29, 2018, 11:26:22 AM »
Hi,

I have an Image in which each pixel is stored in a list of lists (of size m x n) as follows :-

(setq imagelist (list
                            (list 34 4 4 32 5 34 54 345 .....)
                            (list 34 4 4 32 5 34 54 345 .....)
                            (list 34 4 4 32 5 34 54 345 .....)
                            (list 34 4 4 32 5 34 54 345 .....)
                      )
)

I am displaying this image on a DCL box. Problem is that my DCL box size is sometimes lesser than the size of list (m or n or both).
Is there any way by which I can eliminate every alternate 1, or 2, or 3, or more (dynamic) pixels as per the image size and as per DCL box size.

In a nutshell, I want to reduce the list of lists of size m x n to a x b where,
(i) a < m
(ii) b < n
(iii) m, n, a and b are known
(iv) Depending upon the ratio of a and m, the alternate 1, 2, or 3, or more pixels must be removed.
(v) Depending upon the ratio of b and n, the alternate 1, 2, or 3, or more lists must be removed.

I am ready to reduce the resolution or little bit distort the image wherever the pixels are removed.










Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Reduce List of Lists
« Reply #1 on: September 29, 2018, 03:40:02 PM »
I perform the calculation you have described as part of the image scaling for this function (lines 124-156); though, in this case, I am scaling the vectors prior to calculating the pixel coordinates.

Perhaps you can glean something useful from the example.

Lee