C++ :: Image / Video Compression Project - Error In Reading File
Apr 3, 2012
I have this image/video compression project that is to be done in C. I've been given this source code by my supervisor which is supposed to be a working one.
Assuming I have a sequence of 5 images in .pgm format (image41.pgm, image42.pgm .... image45.pgm). Some of the code involved is
Code:
#define START_FRAME 41
#define END_FRAME 45
#define SKIP_FRAME 1
#define INPUT_STRING "/home/folder/image%03d"
int main(){
int frameNo = START_FRAME
nx=1920, ny=1080;
char fileName[128];
[Code] ....
When I tried to compile the code using make file (shell script), I got this error message "In function 'readPgm' format '%d' expects argument of type 'int *', but argument 3 has type 'unsigned char *' "
Can identify what the problem is and how to rectify it?
View 10 Replies
ADVERTISEMENT
Sep 7, 2014
I'm looking to convert audio, images, video to base64 in c++, and through many searches on the web I've only seem to come up with string > base64.
When I view a .mp3 file for example, there are many characters there that are not available to be used in my string to encode.
[URL] ....
I have this code set up in my project, and all I want is to be able to give the location of any file and have it encode (could just encode to a string, I can handle writing it to a file), and then give a location to put the decoded file as well.
I'm not sure exactly where to even start.
View 6 Replies
View Related
Oct 28, 2013
I have been working with video files and my task is open a video file, get it copied into another file and then changing into binary format. after getting few bits inverted, changing back it into ascii formats. Original video contains normal and extended ascii codes. Unfortunately, i got stuck at first step, whole video file is not being copied. i have written a piece of code that copies the whole word/ any text file but the video file is not fully copied as just 5KB out of 119,659 KB are copied.
Code: #include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[]) {
FILE *fp1,*fp2;
char c;
fp1 = fopen( "sample.mpg", "r") ;
fp2 = fopen("result.txt","w");
[Code] ....
View 9 Replies
View Related
Nov 30, 2012
I am trying to overlay an image on a live video.I have used alpha blending method to overlay image on the video. On overlaying the image, it gets overlayed five times rather than one as expected.
Both frame data and the image data is taken as BYTE* for overlaying and displaying it.
The image used is a bitmap image.
The data (BYTE*) of both the video and the image is overlayed and the resultant is stored back in the variable of the video and den drawn on the picture control of vc++.
The video resolution is 640x480.
The image I m overlaying is 128x128.
The IDE used is visual studio professional.The code is developed using c++.
How do I overlay the bitmap image as a single image on the live video at a specific position.
View 2 Replies
View Related
Sep 30, 2013
How to read an image in C++ ...
All what i know that i may use a Cimage library but it doesn't really work or to read the image from a file ....
View 4 Replies
View Related
Dec 7, 2014
I am attempting to read a ppm file. When i do it i try to write it back in another file just to see how's done and i get a terrible result. I assume the problem is something with the casting i do to the variables.
This is my image class
Image:: Image(unsigned int width, unsigned int height, bool interleaved) {
buffer = new Component [3*width*height];
this->height=height;
this->width=width;
this->buffer=Component();
[Code] .....
View 4 Replies
View Related
Apr 26, 2013
I have a jpg file. I have extracted the width and the length of the image. I have done that with some codes and markers. Now I need the image data starts as from that place i would like read the data and print the pixel value. I would like to display the pixels later.
View 2 Replies
View Related
Nov 25, 2012
Used some online code example to put a little project to display raw image. The display does not seem to work.For some purposes, I like this to work with a dialog based MFC project.XDVView is derived from CScrollView.
See OnInitDialog() and OnDraw(CDC* pDC).8bit 768x756
View 14 Replies
View Related
Feb 6, 2013
I am working in Eclipse, and it keeps giving me this error that I do not understand. In the fillTable function, "is >> kP[i]" Eclipse says: no match for 'operator>>' in 'is >> *(((TranslationTable<int, std::string>*)this)->TranslationTable<int, std::string>::kP + (+(((unsigned int)i) * 8u)))'.
#ifndef TRANSLATIONTABLE_H_
#define TRANSLATIONTABLE_H_
#include "KeyValuePair.h"
#include <iostream>
#include <cstdlib>
[Code]....
View 3 Replies
View Related
Dec 3, 2013
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int encrypt_data(FILE *);
[Code] ....
I am trying encrypt the file "encrypt" when I enter it I get "Error in reading file"
I think its a problem with the fgets() and scanf()...I tried both fgets out and then scanf but I get the same error.
I look in the directory and see that when I enter a file to be encrypted a blank file with a "?" at the end is created in the directory. so I try to encrypt "encrypt" it shows error then creates "encrypt?"
I then tested it by entering a random file name that does not exist
EXAMPLE
Please enter file to be encrypted: fakefilename
Error in reading file.
I look in the directory the non existent file now is listed "fakefilename"
View 1 Replies
View Related
Mar 21, 2013
I am using OpenCASCADE environment to read STL file! I face a problem, with forward declaration error with the following
void StlReadIn::STL_Import() {
std::string FileName;
std::cout<<"
Enter the file name
";
std::cin>>FileName;
[Code] .....
Error message:
stlreadin.cpp:26:47: error: invalid use of incomplete type ‘struct StlMesh_Mesh’
/usr/local/oce-0.9.1/include/oce/Handle_StlMesh_Mesh.hxx:23:7: error: forward declaration of ‘struct StlMesh_Mesh’
View 2 Replies
View Related
May 20, 2013
Below is the code for reading a struct that was stored in a binary file. Problem is while reading from file I get the name without first character and age is always equal to zero which it should not be.
#include <iostream>
#include <conio.h>
#include <fstream>
struct abc {
char name[100];
int age;
[Code] .....
View 3 Replies
View Related
Apr 23, 2014
I am writing to write a program and performs the following tasks
- Reading a file (txt file contains some temperature values)
- Display the temperature values (contents of the file)
- Calculating the average of the temperature values in the file.
- finds the maximum and minim value of temperature in the file.
The program is user interactive and waits for the user input and process according to his input (choice)
I have managed to complete the program and covered all the expect except the error handling for file opening and reading, although I have managed to do it for the part one part (i.e for the choice == 1)
I can repeat it for the other choices (i.e for 2, 3 ) but I do not want to repeat the code and do it in a different function or do it once for all. While making an attempt I can not handle the rest of the program and all the program turns into a mess.
#include <iostream>
#include <fstream>
#include <iomanip>
int menu();
int myChoice(char);
char inputValidating();
[Code] .....
Need Error handling for file opening and Reading that is used once, So far I have managed to do it for choice 1
Text file can be found in the attachment
View 3 Replies
View Related
Feb 27, 2014
I am looking for a compression algorithm which compress sequence of random numbers (will be in sorted order but some of the numbers may be missing). The compressed data will be sent to other component where decompression will take place.
View 5 Replies
View Related
Mar 6, 2015
im trying to read employee information from a file using structures but im having problems with getting the file to open and read in the information
Code:
Write a programt that inputs (at most 50) records from a sequential file
#include <stdio.h>
#include <stdlib.h>
struct employee // employee structure definition
}
[code]....
View 13 Replies
View Related
May 10, 2014
I am working on a small project which contains three files
1. MainTest.cpp
2. CashRegister.h
3. CashRegister.cpp
I have done everything that suppose to be done but still I am getting an error and can not execute the program....
Code:
// MainTest.cpp
#include <iomanip>
using std::setw;
using std::left;
#include <iostream>
using std::cout;
[Code] ....
View 14 Replies
View Related
Jul 18, 2014
Recently I tried a project template from infragistics
Infragistics Windows Forms -ProjectManager
every time I open the design form it desply this message.
What should I do to resolve it.
View 3 Replies
View Related
Mar 31, 2015
I have a VC solution . This solution contain 1 execute project and 10 library projects. The libraries added to the execute project by
#pragma comment(lib,"../outputbin64/lib/mylib").
When i comment these lines to not be added these libraries to the execute project , i will have link error like this :
LINK : fatal error LNK1104: cannot open file '../outputbin64/lib/mylib.lib'
My library projects not added to execute project with another way.
My question is why the execute project will link the libraries that not added to project programmatically?
View 7 Replies
View Related
Nov 2, 2012
I'm trying to convert dicom .dcm file to .jpeg using Imebra in C++ app using QT Creator as dev environment.
I've downloaded Imebra and was able to run QT project example for Dicom2Jpeg conversion successfully. But when I tried to copy same code to my C++ app it failed to run with following error msg:
malloc: * error for object xxxxxx: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug
I have followed steps on adding Imebra files to my project as it was shown on Imebra site. Also used their qt project as example. My main.cpp open dicom file, then loads it to dataset, then calls my dialog window. It crashes on loading dataset.
#include "QApplication.h"
#include "QHBoxLayout.h"
#include "mydialog.h"
#include "iostream.h"
include "library/imebra/include/imebra.h"
int main( int argc, char ** argv ){
[Code] ....
Deeper debugging showed that source of error is in JpegCodec.cpp file readStream() function when checking JpegSignature to see if it's in wrong format with resulting internal PUNTOEXE error "detected a wrong format".
Interesting thing is that while running same test dcm file using given dicom2jpeg example (which has exact same code of opening file and loading it) gives no errors and converts to jpeg successfully. So I know it's not the file issue, but the way imebra code is integrated into my C++ app.
My dev environment: macbook pro with Lion OS, QT Creator, QT project, C++ code, ITK library added, Imebra files are completely integrated as part of the Qt project.
So, my question is how do I work/link/reference/call Imebra functionality in QT project? Am I forgetting to link something, or some object is not instantiated/deleted on time?
View 2 Replies
View Related
Dec 11, 2012
I am creating small application using c#.net.I removed all image tag using regular expression no I want to remove all video file and flash file also in source code of webpage.
so far I have tried this ...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
[Code] .....
View 1 Replies
View Related
Apr 4, 2013
I have an assignment where I need to take an assigned image, rotate it 90 degrees to the right, flip it upside down, and turn it to grayscale; each with different outputs.
I was thinking if I can read in the image into a 2d array //array[height][width] or even just an array with the values of each pixel (r, g, b), I can just modify the array and spit it out when done.
if i can just get it into the array, I think I'll be fine. We've done similar assignments with modifying arrays for grayscale images and the other two I can probably figure out. But how am I going to read in each pixel into an array with three different values in each slot? This is my code so far:
Code:
#include<stdio.h>
View 1 Replies
View Related
Nov 29, 2014
I'm trying to read a PPM image into an array. The header will have already been read in and I'm trying to put in a 2-d array to make manipulations easier. This is the code I have so far with LOTS of errors and warnings and I honestly don't know what almost any of them mean.
Code:
int imageArray( FILE *input, struct pixel *theArray ){
int i, j;
int col, row;
int *imageArray = (int**)malloc(row * sizeof(int*));
for(i=0; i<row; i++){
[Code]...
View 3 Replies
View Related
Jan 23, 2014
I making a application which convert video to audio in MFC. i want make it without using FFMPEG . How can it possible.
View 1 Replies
View Related
Apr 10, 2013
I need to know about image processing whether it can be done using C /c++ as I am not familiar with MATLAB. I have attached one image. The arrow in the image show the indented circular portion. I need to crop out only the portion inside the indented portion. I think there should be a sharp difference in gradient intensity in pixel at the indented portion. Is it possible to extract that portion out by reading the binary image?
View 2 Replies
View Related
Jul 2, 2014
Basically i'm willing to create an application which could share Video,Mp3 Over the internet to my friends.
For suppose I'm hosting file on my PC, and i want to share "D" Drive to my friends but they aren't connected to my network locally. i want to share movies over the internet using a host and client application in c#.net.
the purpose of this application is very clear that that i want to share movies over the internet and they have to be able to watch movies on their PCs Except running my PC remotely.
View 8 Replies
View Related
Oct 9, 2013
I am working on H.264 encoder. How to open a binary file using c, i have tried and have got zero errors but end result its not opening....
View 3 Replies
View Related