What Could Be Causing a Fortran Compilation Error During Image Processing?

In summary, it seems that the 20th or 21st frame does not have the expected number of data, and that you need the rest of the video to run the algorithm.
  • #1
6a Climber
1
0
Hi
I try to run an image processing algorithm (Cross-Correlation based) on fortran to analyze a 500 frames video, but after the 20th frame I get this error message:The program 'D:\Omri\19.12.11\Debug\Cross_Corr_Omri.exe' has exited with code -1073741800 (0xC0000018).

anf in the debug window I have this message:

forrtl: severe <24>: end-of file during read, unit 1, file: (the name of the file)I checked whether the video is only 20 frames long but it was 500 as it supposed to be...and the program ceases. I do have the results for the first 20 frames but I need the rest as well.

Thanks
 
Last edited:
Technology news on Phys.org
  • #2
Likely the 20th or 21st frame doesn't have the expected number of data. Locate places in the code where a read occurs for unit 1 and insert an END=# parameter in the READ statement(s). That should result in a graceful halt where you can output diagnostics such as the number of records or data read and the number expected. (You may have to put a FLUSH(0) statement after your PRINTS to get the output.)
 
  • #3
Another possible error is whether you've opened the file as binary or ascii. in ascii mode the file read routines will look for an EOF marker. In addition to looking for EOF markers they also might be looking for a CR or CRLF character sequence to denote an end of text line.

A binary data file will most likely have one of these characters somewhere and thus reading a binary file will result in reading lines short or premature EOF error.

This is also a common problem in C code.

The fortran binary might also be called raw mode as in don't look for any special character give me the data raw and unrefined.

Not knowing what OS or what FORTRAN here's a possible reference:

http://idlastro.gsfc.nasa.gov/idl_html_help/Reading_and_Writing_FORTRAN_Data.html
 
Last edited by a moderator:
  • #4
jedishrfu said:
Another possible error is whether you've opened the file as binary or ascii. in ascii mode the file read routines will look for an EOF marker. In addition to looking for EOF markers they also might be looking for a CR or CRLF character sequence to denote an end of text line.

A binary data file will most likely have one of these characters somewhere and thus reading a binary file will result in reading lines short or premature EOF error.

This is also a common problem in C code.

The fortran binary might also be called raw mode as in don't look for any special character give me the data raw and unrefined.

Not knowing what OS or what FORTRAN here's a possible reference:

http://idlastro.gsfc.nasa.gov/idl_html_help/Reading_and_Writing_FORTRAN_Data.html

forgot to mention there are actually 3 ways to read a file in fortran
- as variable length text records
- as variable length binary records
- as raw binary where you seek to an address and read n bytes of data (random file)

It seems any image file would have a format that demands the 3rd option as it will have some structured tables for the imahe header, color palette and image data where each pixel is represented by 1, 2 or 4 bytes depending on the type of image with the 1 byte or 2 byte referencing a color in the palette table or as 4 bytes where each byte represents red, green, blue, intensity or some similar variation of values. The header would have provided meta info about the image such as size and type of color coding used.
 
Last edited by a moderator:
  • #5
6a Climber said:
Hi
I try to run an image processing algorithm (Cross-Correlation based) on fortran to analyze a 500 frames video, but after the 20th frame I get this error message:


The program 'D:\Omri\19.12.11\Debug\Cross_Corr_Omri.exe' has exited with code -1073741800 (0xC0000018).

anf in the debug window I have this message:

forrtl: severe <24>: end-of file during read, unit 1, file: (the name of the file)


I checked whether the video is only 20 frames long but it was 500 as it supposed to be...


and the program ceases. I do have the results for the first 20 frames but I need the rest as well.

Thanks

This information us quite useless without the code. You need to post it.
 

1. What is a Fortran Compilation Error?

A Fortran Compilation Error is an error that occurs during the process of compiling a program written in the Fortran programming language. Compilation is the process of translating human-readable code into machine-readable code that the computer can understand and execute. Errors can occur during this process if there are mistakes or inconsistencies in the code.

2. What causes Fortran Compilation Errors?

Fortran Compilation Errors can be caused by a variety of factors, including syntax errors (such as missing or incorrect punctuation), logical errors (such as using variables before they are declared), and runtime errors (such as trying to divide by zero). These errors can prevent the program from being compiled successfully and may require debugging to fix.

3. How can I debug a Fortran Compilation Error?

The first step in debugging a Fortran Compilation Error is to carefully review the error message that is displayed. This message will often provide information about where the error is located in the code and what type of error it is. Once you have identified the error, you can go back to your code to fix it. It may also be helpful to use a debugger tool or consult documentation for the Fortran language.

4. Can Fortran Compilation Errors be prevented?

While some Fortran Compilation Errors may be unavoidable, many can be prevented by following good coding practices. This includes writing clear and concise code, using appropriate variable and function names, and testing your code frequently. It is also important to keep your code well-organized and to use comments to explain the purpose of each section.

5. What should I do if I continue to encounter Fortran Compilation Errors?

If you are consistently encountering Fortran Compilation Errors, it may be helpful to seek assistance from a more experienced programmer or a Fortran support community. It may also be beneficial to review your code and look for patterns in the errors that can help identify underlying issues. With practice and attention to detail, you can reduce the frequency of Fortran Compilation Errors in your programming projects.

Similar threads

  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
17
Views
6K
  • Programming and Computer Science
Replies
4
Views
7K
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
2
Views
8K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
4
Views
8K
  • Programming and Computer Science
Replies
1
Views
2K
Back
Top