Need help applying Roberts Cross operator to 2D Array

Hey guys Im using a txt file to store values onto array intImage[][], and I want to take that array and run it through the Roberts Cross operator:

(rc[i][j] = (| intImage[i][j] - intImage[i + 1][j + 1] | , | intImage[i + 1][j] - intImage[i][j + 1] | ))

but I keep getting an "Expected an expression" error in front of the first | keys.

any idea what I am doing wrong?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 #include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cmath>

using namespace std;

const int rows = 4,
cols = 4;

int main()
{
	
	int intImage[rows][cols],
		charImage[rows][cols],
		rc[rows][cols],
		i,
		j,
		maximum;

	ifstream infile;

	infile.open("TextFile1.txt");	//Importing TExtFile1.txt

	if (!infile)	//Checks whether or not the program can locate the file or not
	{
		cerr << "file could not be found\n";	//Displays an error message
		
		exit(1);	//Ends the program
	}

	cout << "The image before the Roberts Cross operator has been applied to it";

	for (i = 0; i < rows; i++)
	{
		for (j = 0; j < cols; j++)
		{
			infile >> intImage[i][j];
		}
	}

	for (i = 0; i < rows; i++)
	{
		for (j = 0; j < cols; j++)
		{
			cout << intImage[i][j] << " ";
		}
		cout << endl;
	}
	
	cout << "The image after the Roberts Cross operator has been applied to it";

	

		for (i = 0; i < rows; i++)
		{
			for (j = 0; j < cols; j++)
			{
				rc[i][j] = (| intImage[i][j] - intImage[i + 1][j + 1] | , | intImage[i + 1][j] - intImage[i][j + 1] | );
			}
		}

	return 0;
}
You mean line 60? What is that you're trying to do?
Oh I just solved it but thank you anyway.

Topic archived. No new replies allowed.