sav
sav

Reputation: 2150

How are images stored in EMGU?

How are images stored in emgu?

enter image description here

Those pixel values seem to be very large magnitude. ~ 9*10^9

Shouldn't pixels be [0 .. 255] ?

When I draw the image it seems to look ok. TemplateMatch is a grayscale float, ie:

Image<Gray, Single> TemplateMatch;

also when I scale TemplateMatch, it seems to have no effect on its appearance. ie:

TemplateMatch._Mul(somevalue);

Upvotes: 0

Views: 114

Answers (1)

rold2007
rold2007

Reputation: 1327

Yes, pixels are usually between 0 and 255 but when they're not, like in your case, there are a couple of things that can be done to draw your image correctly anyways.

The image can be remapped using the lowest and highest values in your image. Since you see no change when applying _Mul(somvalue) it is probably the algorithm that is applied.

Another way to deal with image of depth higher than 8-bit is to apply a modulo operation. It is faster to apply because you don't need to scan all pixels in the image upfront but it usually gives less interesting results.

When you say that you "draw" the image, I suppose you're using the ImageBox class in EmguCV. Note that if you draw it with another library you may not see the same result as it might be using a different algorithm.

Upvotes: 1

Related Questions