Question

To be implemented in MATLAB

Question 1: Consider the following images: a) office_1.jpg d) saturn.png b) pears.png e) rice.png c) peppers.png f) onion.png

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Q1)****since the images are not provided the procedure to find the same and the commands are provided below**** Green channel of a image(example-pears.png) can be extracted as follows(in MATLAB):-

rgbimage=imread('pears.png');

greenchannel= rgbimage( : ; : ; 2 );

Similarly the green channel of any image can be extracted. All you have to do is change the file name.

A scalar value is a matrix or an array with just a single value. So it can be considered as a 1×1 matrix. So addition of a scalar to a matrix can be done in the following way:-

scalarvalue1=14

scalarvalue2=64

scalarvalue3=8

addedvalue1= rgbimage+scalarvalue1;

addedvalue2=rgbimage+scalarvalue2;

addedvalue3=rgbimage+scalarvalue3;

For subtraction:-

subtractedvalue1=rgbimage-scalarvalue1;

And so on

For multiplication:-

multipliedvalue1=scalarvalue1.*rgbimage;

Dot(.) is used for element vise operation. Since it's a scalar multiplication dot can be omitted. Dot is useful in matrix multiplication.

For division:-

dividedvalue1=rgbimage/scalarvalue1;

Q2) The function bwconncomp can be used to find the connected components of an image. But this function can only work on binary image so we have to first convert it to gray image:-

gimage=rgb2gray('coins.png');

connectedcomponents=bwconncomp (gimage)

b) The words from a image can be done using the ocr function of MATLAB:-

text=ocr(gimage);

It can be saved as a png file using imwrite function as:-

imwrite(text , 'text.png');

Add a comment
Know the answer?
Add Answer to:
Question 1: Consider the following images: a) office_1.jpg d) saturn.png b) pears.png e) rice.png...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT