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
1 answer

Exception thrown: write access violation. Variable was nullptr

I have to read a .pgm file for an assignment and decode the least significant bit in every byte to get some hidden text. I have the reading and writing code from the professor but when I try to read the file color has an issue being written to. I…
FunkyMunky
  • 21
  • 5
0
votes
3 answers

Displaying histogram pixel values from PGM image (p5) using Pure C without any image processing library

This question is challenging to get more understanding on Image Processing using pure C. I have done a simple program reading non-binary PGM file using C compiled with GCC. Now, it is becoming a problem when I try to read binary PGM file. This…
rhzs
  • 516
  • 7
  • 24
0
votes
0 answers

"Undefined reference to WinMain"

I'm currently working on a coding project and having some difficulties with this error message ygwin/11/../../../../lib/libcygwin.a(libcmain.o): in function `main': /usr/src/debug/cygwin-3.3.5-1/winsup/cygwin/lib/libcmain.c:37: undefined reference…
0
votes
1 answer

How do I use overlay_add command in mplayer?

I managed to create a .pgm image file with GIMP, and noticed the potentially problematic #-comment it embeds into the file, but I still cannot get this command to display any noticeable result. I launch the mplayer with -slave mode, and input the…
ivan866
  • 554
  • 4
  • 10
0
votes
1 answer

Read PGM files in python

I want to read pgm files for glasses detection in Machine Learning Right now I Import pgm_reader from pgm_reader import Reader then I Import os and defiend a Series for save Images into and I tried to read files like this import os reader =…
0
votes
1 answer

.pgm images don't fit seem to fit in array

Working on some basic image processing and I need to manipulate a P2 .prg image. If there are no comments then in line two there should be a width and height value. If we take the FEEP example from this…
Wumbo
  • 90
  • 5
0
votes
1 answer

Error generating cropped images using python

I'm doing some machine learning and need some images to be resized to fit the rest of the dataset. I'm doing some sloppy cropping of the images and I'm getting result which confuse me. The code is very basic and is provided below. The problem I'm…
0
votes
1 answer

Convert pgm to Matrix

I need to convert a pgm file to a csv file with 25 rows by 25 columns. df <- read.delim("1_1.pgm", skip =3, row.names = NULL, sep = "," ,col.names = NULL, header = FALSE, fill = TRUE) write.csv(df, "test.csv") I've done this but I think I have to…
Cbrady
  • 93
  • 1
  • 2
  • 7
0
votes
1 answer

Modulization Gone Awry

So I had one large function that worked. Then I decided to modify it and now I am just printing out a black square. I am attaching my code to see if any one would understand what is happening. These three function where once large function: Function…
Joe Tyman
  • 1,417
  • 5
  • 28
  • 57
0
votes
1 answer

Cropping a PGM in C

I am trying to teach myself digital image process. I have read my pgm into a struct. In this struct I have pixel array. I can print it just fine. Now I want to crop this photo based on a user input. I take these inputs and just get a black rectangle…
Joe Tyman
  • 1,417
  • 5
  • 28
  • 57
0
votes
0 answers

Problem in the change of line when reading files in C

I'm reading a .pgm file (like the lines below) with "fgetc(file)". When getting only the numbers with a loop in which I avoid the spaces in between (it seems it treats each space, no matter how big it is, as a single character), it joints the last…
DoZmeR
  • 11
  • 1
0
votes
1 answer

Make sense of PGM data and load PGM data into vector/array

Let me preface this by saying this is my first time working with the PGM file format in C++, so I have multiple questions. I'm currently using P2 PGM files, but I read that P5 is much simpler to work with. How can I convert a P2 to a P5? With the…
esljkfgh
  • 25
  • 1
  • 5
0
votes
1 answer

Resizing a the dimensions of a pixel pgm image in C

What i am trying to do i resize the a regular pgm image,by a factor of 3--100X100 becomes 33X33,i am using pointer array to store the original image and the resized image, the original image will be 10000 long and the resized image will be 1089…
0
votes
1 answer

Convert pgm image to bmp

how do I load pgm image in C# and how Im convert it to pgm file?
jerry
  • 1
  • 1
  • 1
0
votes
1 answer

How can I display a PGM picture in a JavaFX?

So I tried to open a PGM file to display it in an ImageView widget in my JavaFX scene, but it's not working. Any idea how can I display the PGM file? Is there any way to convert it to a JPG/PNG file and then display it? thanks! if (file != null) { …