2

I use the lib Magick.NET for access to the image file. I need to process each pixel on image:

MagickImage img = new MagickImage(@"d:\TEST\110706M01000509.jpg");
PixelCollection pc = img.GetReadOnlyPixels(0, 0, img.Width, img.Height);

for (int x = 0; x < pc.Width; x++)
    for (int y = 0; y < pc.Height; y++)
    {
        byte[] color = pc.GetValue(x,y);

        // SOME ACTIONS
    }

But, access to the color of pixels of the image (12000 X 16000) takes more than 5 minutes… How more quickly process all pixels of the image use lib Magick.NET?

Vadim Ovchinnikov
  • 13,327
  • 5
  • 62
  • 90
Ivan
  • 81
  • 1
  • 3
  • 1
    It may help to put the x loop inside the y loop, because ImageMagick internally organizes the pixels in scanlines. In fact most if not all image formats are organized that way, too. – Glenn Randers-Pehrson Jun 13 '15 at 13:38
  • If the first loop by x, the second loop by y, I received next result: start load -> 14:51:34 start loop -> 14:51:46 end loop -> 14:58:53 If the first loop by y, the second loop by x, I received next result: start load -> 15:05:56 start loop -> 15:06:08 end loop -> 15:12:56 Improve absent. Anymore ideas? – Ivan Jun 16 '15 at 12:32
  • 1
    use emgucv for that.. – Dr.Haimovitz Jun 14 '16 at 00:15

0 Answers0