Questions tagged [pgm]

PGM is a grayscale image format used by the Netpbm library and other graphics software.

Portable Gray Map (PGM) is a simple image format for grayscale images.

The format allows data to be stored in either ASCII or binary format. PGM is the native format of the Netpbm graphics library and the format is described on the Netpbm web site. It is part of a family of formats including , , and , collectively tagged (the original name for what is now the Netpbm library).

175 questions
0
votes
0 answers

Copying header of a .pgm file

I have been getting an error when trying to copy the header of a pgm to another. could someone please tell me where i'm wrong? FILE *infile; infile = fopen(fin, "rb"); fscanf(infile, "%s %d %d %d\n",&type,&u,&v,&depth); FILE *outfile; outfile =…
0
votes
2 answers

Inverting a PGM's Color Values Distorts the Image

My goal is to read in a PGM image and produce an image with inverted color values. But when I put in this image, I get back this image. I'm programming in C, using Eclipse and MinGW GCC on Windows 7 (64-bit). Why is the image getting so…
James
  • 1
  • 1
0
votes
2 answers

Reading PGM Image in C (Not Reading File Correctly)

I'm using files, pgm.c and pgm.h to read in a PGM image file, and then my program will manipulate the file (grayscale, rotation, etc). However, I can't get the file to read properly. When I use: PGMImage* img =…
James
  • 1
  • 1
0
votes
1 answer

C++: reading large pgm file with ifstream

I want to load a 16-bit binary PGM image with a size of 4096x4096 pixels using std::ifstream. The problem is that I can only load smaller files, eg. 512x512. If I try to load the "large" one the data I get is always 0 for every pixel. Example…
Tim
  • 135
  • 1
  • 12
0
votes
1 answer

Do I need to normalize my probability distribution after observing evidence in a decision making issue?

Currently I'm working on a decision making system and I have the following elements: Complex bayesian network Decision CPD (Conditional probability distribution) Utility factor (Which maps weights to certain probability assignments) (Only the…
Marcel
  • 23
  • 1
  • 4
0
votes
1 answer

Read binary .pgm files with python and numpy

I need to read 64x64 pgm plain format image files and put the resulting values in a numpy matrix. I can do it only if I use Opencv and PIL functions to open the image, but the final numpy matrix yielded has 3-channel and the values returned are 0…
mad
  • 2,677
  • 8
  • 35
  • 78
0
votes
1 answer

Generate image .pgm from array

There's a lot of posts about reading .pgm images but none or almost about generating one from an array.
Ben
  • 469
  • 2
  • 4
  • 20
0
votes
3 answers

error: storage size of ‘Img’ isn't known

I'm trying to write a simple code to read in a .PGM file. The code I wrote is #include "./netpbm/lib/pgm.h" #include typedef unsigned int gray; int main(int argc, char* argv[]){ gray Maxval; gray* Img[]; int row, col; …
0
votes
1 answer

Summarizing all points around a center point?

for the purpose of smoothing an image, I need to summarize all pixels around a given center pixel and then build the average, what's basically my new pixel then. There are like two problems now: 1) What's a good way to summarize them? and 2) How…
Steffen
  • 3,999
  • 1
  • 23
  • 30
0
votes
2 answers

Ifstream fails for unknown reason

I have a problem with the function used to read the pgm file format to the memory . I used the sources in the following link http://www.cse.unr.edu/~bebis/CS308/Code/ReadImage.cpp . You can find others in the same directory ; and some instructions…
Tiana987642
  • 696
  • 2
  • 10
  • 28
0
votes
1 answer

Can anyone suggest me site for PGM images for stereo vision?

I need some sample images for my project in stereo vision, please suggest some links where i can find .pgm gray scale images of good quality of both left and right vision (above 500KB size). Actually i googled it for many times but couldn't find…
Meluha
  • 1,460
  • 3
  • 14
  • 19
0
votes
2 answers

java pgm 2 jpeg/png

I have an int array containing gray scale values from 0-254, i also have the x and y size of the image. It is an easy thing to create an pgm image, but i want to display it in a jsp, so i need somehow to convert it to a jpeg or png image. If you…
Red33mer
  • 810
  • 3
  • 15
  • 22
0
votes
2 answers

includes many php-files in one pgm and catch errors

i call an php pgm per cronjob at different times. the pgm includes many php-files. each file sends or gets data from partners. How can i handle errors in one includes pgm. at the time, one ftp-connection in an included pgm fails so the complete…
user1121575
  • 390
  • 1
  • 4
  • 19
0
votes
2 answers

Reading a pgm file in Java

I need to read a pgm file and store the array of values contained in it in a 2D array. In PGM format, each pixel is specified by a gray value between 0 and MaxVal. The first three lines give information related to the image: magic number, height,…
Ranjith
  • 1,623
  • 3
  • 21
  • 34
0
votes
2 answers

How do I display a PGM file within a QGraphicsView?

I am trying to display a PGM file using the following test application. The code works with a PNG file, but not PGM: import sys from PyQt4.QtGui import * from PyQt4.QtCore import * import Image import ImageQt class MyView(QGraphicsView): def…
1 2 3
11
12