Questions tagged [cimg]

The CImg Library is a small, open source, C++ toolkit for image processing.

The CImg Library is a small, open source, C++ toolkit for image processing.

CImg stands for Cool Image: It is easy to use, efficient and is intended to be a very pleasant toolbox to design image processing algorithms in C++. Due to its generic conception, it can cover a wide range of image processing applications.

297 questions
2
votes
1 answer

CImg how to draw Polygon from given x,y co-ordinates?

I am trying to draw a closed polygon from 5 points , I am trying with the following code : CImg img(800,800,1,3); float red[] = {1.0f,0.0f,0.0f}; CImg points(5,2); int thePoints[] = {40,40,40,200,100,180,120,100,100,40}; int *iterator =…
web2dev
  • 557
  • 10
  • 28
2
votes
0 answers

CImg loading image fails with spaces in path name

I have a C++ application that I am developing to scan an image and return coordinates, the whole application works as expected except for this last problem that I can't seem to figure out. a user uploads images to a folder, and then the images get…
jdseibe
  • 21
  • 3
2
votes
4 answers

CImg: how to test that a file is image

I am writing small C program using Cimg graphics library and need to test that a file is an image. I attempted to load the file/image with CImg srcimg(filename) and catch the exemption but the cimg flattly quits with: convert.im6:…
user2389519
  • 270
  • 2
  • 10
2
votes
5 answers

Save float * images in C++

I wanted to understand how I can save an image of type float: float * image; Allocated in this way: int size = width * height; image = (float *)malloc(size * sizeof(float)); I tried using the CImg library, but does not accept float directly.…
user2485282
  • 21
  • 1
  • 3
2
votes
0 answers

CImg gives error Access violation writing location for reading PNG file

I try to run this very simple code and I get a strange error at the CImg library at line png_read_info(png_ptr,info_ptr); the error is: Unhandled exception at 0x779f8dc9 in test.exe: 0xC0000005: Access violation writing location 0x00000014. the…
Momo
  • 31
  • 3
2
votes
1 answer

Python equivalent of DCT image hash function used in pHash module

I have an existing python program that accepts an image URL and does manipulations on the image loaded. I tried passing the image data to the pHash module in C++ and then get the image hash. I've tried using python extension library to pass the…
Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124
2
votes
3 answers

convert an rgb image into a matrix using C++ and Cimg library

I have this project in blind source seperation where I need to represent a RGB image in a matrix using Cimg. but I can't actually understand how to use Cimg.. I've looked through the documentation in But there are TOO many functions and I wasn't…
zahi daoui
  • 257
  • 1
  • 6
  • 16
2
votes
1 answer

CImg error unhandled exception stack overflow

When I run my code on Visual Studio 2010, I get: Unhandled exception at 0x00b38767 in thesis.exe: 0xC00000FD: Stack overflow. My code is as follows: #include "CImg.h" #define cimg_use_jpg using namespace cimg_library; int main () { CImg
2
votes
2 answers

How to open PNG with CImg library without losing alpha channel?

When I open png file: CImg image("image.png"); ...I expect to get 4 channel (RGBA) image. But I always get 3 channel (RGB) image instead (even if the image is semitransparent): image.spectrum() returns 3 instead of 4. In my…
Lissanro Rayen
  • 582
  • 8
  • 17
2
votes
1 answer

FFT of an image

I have an assignment about fftw and I was trying to write a small program to create an fft of an image. I am using CImg to read and write images. But all I get is a dark image with a single white dot :( I'm most likely doing this the wrong way and I…
jbradaric
  • 816
  • 1
  • 9
  • 13
1
vote
1 answer

How to draw a simple function using the CImg library?

I am looking forward to draw some simple mathematical functions (like y = x^3) using the CImg library. I tried to use it but it is always giving me the following error: undefined reference to `SetDIBitsToDevice@48'. Anyone here can help me in…
CompilingCyborg
  • 4,760
  • 13
  • 44
  • 61
1
vote
0 answers

Crop and deskew an image in R with imager and magick package

How to crop/clip an image with a polygon as the boundary and then deskew the output using imager and magick package in R? library(imager) library(sp) plot(boats) xy <- list(x = c(87.4790282019041, 58.2397610921502, 164.877088198312, …
Crops
  • 5,024
  • 5
  • 38
  • 65
1
vote
1 answer

how to output float to tiff using CImg?

I'm trying to have float values in a .tiff file. The values in display are fine, but once on disk, it is unsigned short. #include #include "CImg.h" #define cimg_use_tif using namespace cimg_library; int main() { CImg
FacundoLM2
  • 43
  • 3
1
vote
1 answer

Converting image/array list for keras input R

I intend to feed neural net with image data. Originally I have them stored as a list of arrays with dims 10,10,3 (height, length, color channel). Does anyone know how to convert the list containing multiple cimg images into one cimg storing…
ramen
  • 691
  • 4
  • 20
1
vote
1 answer

CImg library in Cuda

I am working on a code in CUDA C on VS2008 ,Win 7. I got a matrix of float which is to be displayed as image ..i saved it as .bin file and load it in a separate .cpp file and successfully formed the image using CImg library...however when i try to…
snabbasi
  • 129
  • 3
  • 12