Re: [SIP-devel] new interf_demo + pbs
Advanced image processing toolbox for Scilab on Unix/Linux/Mac OS
Status: Beta
Brought to you by:
ricardofabbri
From: Ricardo F. <rf...@if...> - 2003-06-30 22:46:22
|
On Sat, 21 Jun 2003, DRUEL Jocelyn wrote: > 2) 2 functions to take pictures from a video camera using xawtv. We use a > cheap miroPCTV for this (about 50$). This works on linux only of course. Cool. I suggest that you check if the xawtv command is available before calling it. But this is not very important. > 3) modifications to use gray_imread: > I replaced many gray_imread by gray_imread/2555 because I had problems with > displaying or tracing profiles. I don't exactly know why. This is due to the fact that you read your .jpg images, which are pseudo-color (indexed). What you probably did before imread was to use the index of the image, which points to 256 different colors in the colormap. The colors in the colormap goes from 0 to 65535, so you must divide by __257__ to get the 0-255 range (65535 / 257 == 255). > > The gray_imread function is much much slower than imread when I read > grayscale pictures. A test on my box gave: 2.4 and 0.26 (estimated by > timer()). That's a pb for me (specially as I read several images to make some > calculations). > gray_imread (because of im2gray) is really very slow, I haven't noticed that before. I optimized im2gray to eliminate a for loop (see attachment). gray_imread is much faster now. In scilab any loop over an image is prohibitive :-((. It is ok just for "thumbnail-sized" images, when we need to prototype an algorithm. I could implement im2gray in C, but the trick I done in gray_imread saved me some development time. But if it is still slow, please tell me. > Why not modify the gray_imread so that with a grayscale image, it does simply > an imread ? Does it cause pbs ? Yes, it causes problems, because there is no fast way (in scilab) to know if a pseudo-color (indexed) image is grayscale or color. It depends on the colormap. Even if it is grayscale, the intensity distribution in the colormap may be different from the numbers in the index image. Although this is not common, may happen. What you've been doing is using directly the index image and assume that the colormap has a linear intensity distribution, so it can be discarded. This will work only with your particular images, but may fail with other images. best regards, Ricardo. -- Ricardo Fabbri, Cybernetic Vision Research Group, USP, Brazil. http://cyvision.if.sc.usp.br/~rfabbri |