Message Boards Message Boards

0
|
3225 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Built-In parallel execution leaves much to be desired...

Posted 10 years ago

Hi all,

What can i do to speed up my image processing? Rendering an 6k by 4k (24 Mega Pixel) Image with a simple Apply-Function using ImageApplyIndexed takes about 7700 Seconds. On a 6 core, each @3.5 GHz, MacPro with 16GB RAM, this should be somewhat faster. Especially there is only one core taking all the load, five cores are happily idling inside my machine during the process. It should be relatively easy to spread the task of merging the images to the available cores, where each computes a part of the destination image.

Question: Are there any plans to improve Mathematica to make automatic use of available core (CPU) resources? Is there even a vague chance that such computation will be automatically outsourced to CUDA one day? One may want to limit the amount of processors used by allowing to say something like $MaxCPUToBeUsed = Unlimited | Integer...

My code is the following:

Timing[ImageApplyIndexed[
  Function[
   {p1, p2, p3, position},
   Block[
    {
     d1 = ColorDistance[p1, (p2 + p3)/2],
     d2 = ColorDistance[p2, (p1 + p3)/2],
     d3 = ColorDistance[p3, (p1 + p2)/2],
     dmax = Max[d1, d2, d3]
     },
    Which[
     d1 == dmax, p1,
     d2 == dmax, p2,
     d3 == dmax, p3,
     True, (p1 + p2 + p3)/3
     ]
    ]
   ],
  {
   leftPicture,
   middlePicture,
   rightPicture
   }
  ]
 ]
POSTED BY: Thomas Vogler
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract