Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

image processing-CCS 3.1/c6713 dsk

Status
Not open for further replies.

chinnydas

Junior Member level 1
Joined
Jun 4, 2012
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,394
hi all, With the help of matlab we are storing the pixel values of an particular image. by the same way, how one can generate pixel value using c language. i have tried, but iam unable to get the corresponding values, my code for your reference,


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
FILE *fp, *f1;
       float x[1024][1024];
       fp=fopen('image.bmp','r+');
       f1=fopen('data.dat','w+');
       for(i=0;i<=64;i++)
           {
               for(i=0;i<=64;i++)
               {
                fprintf(f1,"%f",x[i][j]);
}
}



but, i am unable to see my image. im working on CCS 3.1. could somebody please help me. suggestions will be greatful.

regards, chinny
 
Last edited by a moderator:


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
> xyloObj = mmreader('paris_cif.avi');
> 
> nFrames = xyloObj.NumberOfFrames;
> vidHeight = xyloObj.Height;
> vidWidth = xyloObj.Width;
> 
> % Preallocate movie structure.
> mov(1:nFrames) = ...
>     struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),...
>            'colormap', []);
>        
> hf = figure(1);
> set(hf, 'position', [150 150 vidWidth vidHeight])
> 
> % Read one frame at a time.
> for k = 1 :nFrames
>     t1 = tic;
>     mov(k).cdata = read(xyloObj, k);
>     imshow(mov(k).cdata);
>     hold off;
>     pause(0.10);
>     toc(t1) 
> end
> 
> clc;
> clear all;
> 
> I_rgb =  imread('paris.png');
> C = makecform('srgb2xyz');    % creates the color transformation structure
> I_xyz = applycform(I_rgb,C);
>   ImX = I_xyz(:,:,1); figure(1),imshow(ImX), title('Paris');
>   text(size(ImX,2),size(ImX,1)+15,...
>        'X Image', ...
>        'FontSize',7,'HorizontalAlignment','right');
>   ImY = I_xyz(:,:,2); figure(2),imshow(ImY), title('Paris');   
>   text(size(ImY,2),size(ImY,1)+15,...
>        'Y Image', ...
>        'FontSize',7,'HorizontalAlignment','right');
>   ImZ = I_xyz(:,:,3); figure(3),imshow(ImZ), title('Paris')
>   text(size(ImZ,2),size(ImZ,1)+15,...
>        'Z Image', ...
>        'FontSize',7,'HorizontalAlignment','right');
>   figure(4),imshow(I_rgb), title('Paris');
>   text(size(I_rgb,2),size(I_rgb,1)+15,...
>        'Luminance Image', ...
>        'FontSize',7,'HorizontalAlignment','right');

 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top