not entirely unix orientated but....
anyway i've got an old 486dx? 100 that i'll looking to turn into a unix running machine. But everytime i turn it on it comes up with and invalid CMOS checksum, after i've been into the set up and reset that it works fine, tried a new batter and that didn't sort... (1 Reply)
Let me explain my problem, I have a file in the following format
9602622 - User ID
01 -2 - Question number & Grade
02 - 3
03 - 7
04 - 12
05 - 9
06 - 0
9601664 - User ID
01 -2
02 - 3
03 - 7
04 - 12
05 - 9
06 - 0
I need to change the file so it looks like this
9601664 54 -... (1 Reply)
Hi
$ a=10 ; b=2
$ expr $a + $b
12
$ expr $a - $b
8
$ expr $a / $b
5
$ expr $a * $b
expr: syntax error
Any idean why I am getting this error only when multiplying two numbers. Whats the exact syntax?
Thanks a lot to all in advance
CSaha (5 Replies)
Is there a way that i can get something like this to work:
Number=`expr 80 \* 10.69`
i.e. To multiply an integer by a decimal or a decimal by a decimal etc...?
thanks (10 Replies)
Hi,
I am stuck with a problem, will be thankful for your guidance and help.
I have two files. Each line is a group of words with first word as group Id. eg. 'gp1' in File1 and 'grp1' in File2.
<File1>
gp1 : xyz xys3 syt2 ssx itt kty
gp2 : syt2 kgk iti op2
gp3 : ppy yt5 itt sky... (11 Replies)
Please help me with commands for the following file operations
File description
5 columns in total , sorted by column 1 value
First formatting,
1) Records with duplicate column 1 values are to be ignored. Just consider the first occurrence of such a record.
2) Records with (column 2 -... (3 Replies)
Hi, this is my code.It's simple : there are 2 2D arrays and the multiplied to C.
#include<stdio.h>
#include<sys/shm.h>
#include<sys/stat.h>
#include<stdlib.h>
main()
{
int *A; //A
int *B; //B
int *C; //C
int i,j,x,k,d;
int id;
... (17 Replies)
HI,
i am trying to multiply 2 2D arrays (a,b) using fork.
The answer will be at c.
Each child have to calculate 1 row of c.
The code is right, as i think of it, with no errors but i dont get the correct c array...
I think there is maybe a mistake in i dimension ...
Anyway, here is the code:
... (16 Replies)
I'm looking for a script that sums the contents of a folder,
When you give a parameter to the script , i want to know the size of the directory, the number of files, number of folders,
These are commands that I have already found
du -s
find . -type f | wc -l
find . -type d | wc -ly
... (19 Replies)
Hi Guys,
I am trying to format my csv file. When I spool the file using sqlplus the single row output is wrapped on three lines.
Somehow I managed to format that file and finally i am trying to make the multiple line on single line.
The below command is working fine but I need to pass the... (3 Replies)
Discussion started by: RJSKR28
3 Replies
LEARN ABOUT OPENSOLARIS
mlib_imagenormcrosscorrel
mlib_ImageNormCrossCorrel(3MLIB) mediaLib Library Functions mlib_ImageNormCrossCorrel(3MLIB)NAME
mlib_ImageNormCrossCorrel - normalized cross correlation
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>
mlib_status mlib_ImageNormCrossCorrel(mlib_d64 *correl,
const mlib_image *img1, const mlib_image *img2, const mlib_d64 *mean2,
const mlib_d64 *sdev2);
DESCRIPTION
The mlib_ImageNormCrossCorrel() function computes the normalized cross-correlation coefficients between a pair of images, on a per-channel
basis.
It uses the following equations:
w-1 h-1
SUM SUM (d1[x][y][i] * d2[x][y][i])
x=0 y=0
correl[i] = -------------------------------------
s1[i] * s2[i]
d1[x][y][i] = img1[x][y][i] - m1[i]
d2[x][y][i] = img2[x][y][i] - m2[i]
1 w-1 h-1
m1[i] = ----- * SUM SUM img1[x][y][i]
w*h x=0 y=0
1 w-1 h-1
m2[i] = ----- * SUM SUM img2[x][y][i]
w*h x=0 y=0
w-1 h-1
s1[i] = sqrt{ SUM SUM (img1[x][y][i] - m1[i])**2 }
x=0 y=0
w-1 h-1
s2[i] = sqrt{ SUM SUM (img2[x][y][i] - m2[i])**2 }
x=0 y=0
where w and h are the width and height of the images, respectively; m1 and m2 are the mean arrays of the first and second images, respec-
tively; s1 and s2 are the un-normalized standard deviation arrays of the first and second images, respectively.
In usual cases, the normalized cross-correlation coefficient is in the range of [-1.0, 1.0]. In the case of (s1[i] == 0) or (s2[i] == 0),
where a constant image channel is involved, the normalized cross-correlation coefficient is defined as follows:
#define signof(x) ((x > 0) ? 1 : ((x < 0) ? -1 : 0))
if ((s1[i] == 0.) || (s2[i] == 0.)) {
if ((s1[i] == 0.) && (s2[i] == 0.)) {
if (signof(m1[i]) == signof(m2[i]) {
correl[i] = 1.0;
} else {
correl[i] = -1.0;
}
} else {
correl[i] = -1.0;
}
}
The two images must have the same type, the same size, and the same number of channels. They can have 1, 2, 3 or 4 channels. They can be of
type MLIB_BYTE, MLIB_SHORT, MLIB_USHORT or MLIB_INT.
If (mean2 == NULL) or (sdev2 == NULL), then m2 and s2 are calculated in this function according to the formulas shown above. Otherwise,
they are calculated as follows:
m2[i] = mean2[i];
s2[i] = sdev2[i] * sqrt(w*h);
where mean2 and sdev2 can be the output of mlib_ImageMean() and mlib_ImageStdDev(), respectively.
PARAMETERS
The function takes the following arguments:
correl Pointer to normalized cross correlation array on a channel basis. The array must be the size of channels in the images. correl[i]
contains the cross-correlation of channel i.
img1 Pointer to first image.
img2 Pointer to second image.
mean2 Pointer to the mean array of the second image.
sdev2 Pointer to the standard deviation array of the second image.
RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO mlib_ImageAutoCorrel(3MLIB), mlib_ImageAutoCorrel_Fp(3MLIB), mlib_ImageCrossCorrel(3MLIB), mlib_ImageCrossCorrel_Fp(3MLIB), mlib_ImageNorm-
CrossCorrel_Fp(3MLIB), attributes(5)SunOS 5.11 2 Mar 2007 mlib_ImageNormCrossCorrel(3MLIB)