首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导C++程序设计、program编程讲解、辅导c/c++语言编程 解析Java程序|解析Java程序
项目预算:
开发周期:
发布时间:
要求地区:
Project 1
Matrix operations: Part 1 (100pts)
Submission Procedure:
1. This project is due at 11:59:59pm on Thursday, March 25th, 2020. Every day late will
deduct 20 points.
2. You should work on your project through OnlineGDB and share your code as a Link.
Please make sure your link is valid and contains all of the files. You may also use your own IDE,
such as Visual Studio Code, and upload the files to Sakai and OnlineGDB.
3. Once you’re done, please save your Link in a PDF file named “Project 1.pdf”. Your PDF
should contain your name, RUID, and a single URL to OnlineGDB.
4. Submit your PDF file on Sakai assignment.
For this project, you will be completing an image processing library that can process images
using matrix operations. All images can be represented as a matrix of single-byte values, where
a pixel at matrix location (i, j) is represented by a number between 0 and 255. A color image
consists of three channels: a red channel (R), a green channel (G), and a blue channel (B), and
the corresponding matrix information for an image include three matrixes, each with the same
number of rows (height) and columns (width), one for each of the three channels. Together,
these are passed to an image-writing library for outputting to a file and displaying.
There are multiple functions you will write in the assignment. These will be functions that
bridge the general image library with the RGB matrix view, as well as functions that use the
matrix view to generate new images. We will provide the initial code and necessary files to get
you started. The code designates parts of it with //YOUR CODE HERE, in order to indicate
where you should complete the code.
Code LINK:
https://rutgersconnect-my.sharepoint.com/:f:/g/personal/jo413_soe_rutgers_edu/Eovw3IQc02
pFrRoTa2htYp8Bkj77SSHg2mWXKiGbrZwCOA?e=PcubxD
Part 1: The code (25 points)
The code consists of a number of header files and the main file that you will be updating. The
four files are:
1. project1-main.c
2. stb_image.h
3. stb_image_write.h
4. Stb_image_resize.h
The code you will write will all be in project1-main.c. Notice, at the top of the file, we import all
the necessary files to run the code. These header files consist the necessary function
definitions to open, write, and manipulate a PNG file. For this project, we will be working ONLY
with PNG files.
The main object that you will manipulate is shown below:
// imatrix struct, wraps a byte array of pixel data for an image
typedef struct imatrix{
int width;
int height;
uint8_t** r;
uint8_t** g;
uint8_t** b;
struct imatrix* (*add)(struct imatrix* this, struct imatrix* m2);
struct imatrix* (*subtract)(struct imatrix* this, struct imatrix* m2);
struct imatrix* (*multiply)(struct imatrix* this, struct imatrix* m2);
struct imatrix* (*scale)(struct imatrix* this, int width, int height,
float alpha);
void (*write_image_to_rgb)(struct imatrix* this);
void (*write_rgb_to_image)(struct imatrix* m);
struct imatrix* (*set_rgb_image)(struct imatrix* this, uint8_t*
new_rgb_image, int width, int height, int channels);
//internal image reference
uint8_t* rgb_image;
} imatrix;
This structure consists of a number of fields. Three pointers r, g, b will be used to represent an
image as three separate matrices, one for each channel. The structure also consists of a pointer
rgb_image, which is a pointer to the image data written in a contiguous memory block.
When you read an image as a command-line argument, the code loads the PNG images using
the library. Your job in this first task will be to implement init_rgb(). You should use
malloc() for dynamic memory allocation in order to initialize the r,g,b two-dimensional arrays.
Part 2: Scaling an image
In part 2, you will write the code to scale the pixel values of an image. The associated function
for this part of the project is imatrix* scale(imatrix* this, int width, int
height, float alpha). Please read the documentation for this function and complete
the code. You should test your code by calling it on an image in the main() function.
Part 3: Add, Subtract
Here complete the two add and subtraction functions, imatrix* subtract(imatrix*
m1, imatrix* m2, imatrix* add(imatrix* m1, imatrix* m2. These two
functions take two imatrix and add/subtract them from each other. The result is written to a file
and can be observed. To blend images together, try scaling them before adding or subtracting
them.
Part 4: Multiply
Finally, scaling and rotating an image can be done through matrix multiplication. Complete the
function for matrix multiply imatrix* multiply(imatrix* m1, imatrix* m2),
following the specification in the comments section above the function.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!