Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

problem about bmp, jpeg, png format in c++

 
webmaster forum
ghreza  Offline
Activity
0%
 
New Poster
Posts: 1
Topics: 1
December 09, 2009, 01:55:13 PM

I should write a program to combine the huge number of images side-by-side. The source images are jpeg and png formats images. I think no any direct way to combine png or jpeg images to gather, unless first convert them to bmp, or any raw format, and perform combination and finally convert the new image to jpeg or png format. Because of huge count of images (about 100000 images), I cant use standard available tools, that uses main memory. I should make all of operations on hard disk. Then I should write entire needing code. I need any information about these formats and similar codes if exists. The programming languages not important, because, I worked with C#, java, c, c++, vb6, vb.net.
here I give you my code (that perform such task) as sample in matlab:

Code:
function [bOperationSuccessfullyCompleted] = JpegImagesMerge(mapsPath,baseX,baseY,baseZ,wLen,hLen,TargetFile)
    bOperationSuccessfullyCompleted = true;
    finalMap = uint8(zeros(hLen*256,wLen*256,3));
    for i=1:hLen
        Y=baseY+i-1; % minus one exist because of i=1 in first step.
        for j=1:wLen
            X=baseX+j-1; % minus one exist because of j=1 in first step.
            mapFileName = strcat(mapsPath,'\','v=46&x=',int2str(X),'&y=',int2str(Y),'&z=',int2str(baseZ),'.jpg');
            if exist(mapFileName,'file')
                mapFile = imread(mapFileName,'jpg');
                [szx,szy,szz] = size(mapFile);
                if szx~=256 || szy~=256
                    bOperationSuccessfullyCompleted = false;
                    break;
                end             
                bx = ((j-1)*256+1);
                by = ((i-1)*256+1);
                finalMap(by:(by+255),bx:(bx+255),:) = mapFile;
            else
                bOperationSuccessfullyCompleted = false;
                break;
            end
        end
        if bOperationSuccessfullyCompleted==false
            break;
        else           
            imwrite(finalMap,TargetFile,'jpg');
        end
    end
end

JpegImagesMerge('D:\gmaps\sat-tabriz-z14\maps',10295,6312,14,9,7,'D:\gmaps\sat-tabriz-z14\tabriz-z14.jpg')

This program is right but using matlab and running program based on RAM I cant merge more than 1000 images to gather.
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
December 14, 2009, 07:30:50 AM

I need any information about these formats and similar codes if exists.

Try this site, it will have links to all the information you will need - www.google.com

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 05, 2012, 10:26:01 AM