Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
clc;clear all;
Imatrix = []
for i=1:3
images{i} = imread(sprintf('frame-1065.png',i));
Imatrix = cat(3, Imatrix, images{i});
D = Imatrix;
end;
imshow(D)
This is the code I'm trying to run but the problem is I have 2000 pictures and I am only able to get one to be displayed.
I think what you really want is to store the images as image stacks.
This will allow you to view the image stack in e.g. ImageJ and scroll through it etc.
I would store them as one single tiff file and do something like this (please note that all your images must be of the same size):
numOfImages = 2000;
output_filename = 'imgstack.tif';
for k=1:numOfImages
loaded_image = imread(sprintf('frame-%d.png',k));
imwrite(loaded_image, output_filename, 'WriteMode',append','Compression','none');
end
The issue is visualization. You can view either an MxNxP stack or a cell array where each cell represents an image using the montage function.
https://www.mathworks.com/help/images/ref/montage.html
figure, montage(images)
In your code above.
If you want to visualize your data as a volume, which you've indicated in the most recent comment, then volshow or volumeViewer in IPT will do that.
volumeViewer(Imatrix)
figure, volshow(Imatrix)
Where Imatrix is an MxNxP array that you want to perform volume visualization on.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have an image of Lego bricks which I have segmented in order to get only the blue and red colored bricks.
I also have two templates of bricks that I want to find.
I want to count the number of each of the template bricks in the image. I thought of counting the number of circles on top of the bricks, but some of the bricks are flipped. How could I do this?
Counting the number of circles on top of the bricks could be a very difficult task. A better solution is to look after better properties such like the relation between the hight and the width of the brick.
A possible start for segmentation is as follows:
E = regionprops(L,'all'); % E contains all properties
area = cat(1, E.Area) % saves the area in a variable
cp = cat(1,E.Centroid) % saves the center of the object
figure,imshow(label2rgb(L));
hold on; plot(cp(:,1), cp(:,2), 'b*'); % displays the center of the objects
It will show you your segmentation and will display some information about the properties of the obejects. From there on you will be able to look for what properties you are watching for and can select them in if statements. Depending on your image and your selected properties this could take up to 10 properties but most likely will be around 5.
For further information look here: MATLAB segmentation overview
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to determine area of circular object in image below using MATLAB. Can someone explain codes for doing that? I got thresholded image but I did not proceed more.
If the binary image is img, and it contains only values 0 (background) and 1 (object), or it is a logical array containing true and false, and all the object pixels are considered part of the object, then sum(img(:)) is the area of the object in pixels.
If the segmented image contains multiple objects, or noise, it will have to be filtered first to leave only the pixels that belong to the one object.
To convert the area in pixels to an area in physical units you need to know the size of a pixel. This is often obtained by adding a ruler to the image.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have to store a 1MByte word file into a 512x512 pixels image using Matlab and extract it again. The only thing that I know is that we have to remove the invaluable bits of the image (the ones that are all noise) and store our fie there.
Unfortunately I know nothing about both Matlab and Image Processing.
Thanks All.
Given the numbers provided, you can't. 512x512 give 6.2MBit given 24 bits per pixel. So your doc is larger than the image you are hiding it in.
If we ignore the above, then this is what you have to do:
Load the image and convert to uints.
Mask out a number of LSB bits in each pixel.
Load the doc as binary and fill those bits in where you
masked the others out.
Now, from the above to actual code is a bit of work. If you have no experience with matlab it won't be easy. Try reading up on imread() and bit operations in matlab. When you have some code up and running, then post it here for help.
Regards
In matlab you can read images with imread()
(details on: http://de.mathworks.com/help/matlab/ref/imread.html?s_tid=gn_loc_drop )
Image = imread("Filename.jpg")
figure()
imshow(Image)
This code would show you the Image in a Window.
I think what you're looking for is steganography instead of watermarking.
Steganography:
https://en.wikipedia.org/wiki/Steganography
Here is an example of an image with a file inside it:
http://marvinproject.sourceforge.net/en/plugins/steganography.html
Related topic:
Image Steganography
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a ply image. I want to color it according to my requirement.
1. (.ply) image from kinect
2. Change the rgb value of all point in cloud
e.g
.ply image where all points in the cloud are to be in yellow or blue color.
I have been able to display it using Matlab command "scatter3" but also want to save the colored point cloud as a new point cloud by "pcwrite" function of Matlab.
To answer properly to this question I should know which version of Matlab are you using. If you are using Matlab 2015a you should have these three function
pcread to read a 3D point cloud (.ply file);
pcshow to show a 3D point cloud;
pcwrite to write a .ply file.
Let's say your image is called "airplane.ply".
To properly use that you first read the image using:
ptCloud = pcread('airplane.ply')
then you will notice that ptCloud has different field. One of that regard the color, and is the one you have to change. To do so you have to specify a colour for each point in the cloud. So:
pointscolor=uint8(zeros(ptCloud.Count,3));
pointscolor(:,1)=255;
pointscolor(:,2)=255;
pointscolor(:,3)=51;
since [255 255 51] is the yellow color.
Then assign this matrix to the ptCloud.Color.
ptCloud.Color=pointscolor;
See the result:
pcshow(ptCloud)
and save the file:
pcwrite(ptCloud,'ptCloud.ply')
where 'ptCloud.ply' is the name you want to assign to the file.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am doing an image processing project. In my project there is an GUI file that reads an image and processing it for segmentation. while reading an image file, initially it is checking the size of that image... However, I don't understand what the function I=[m x n x 4] really means. Could someone explain this to me?
Your image I is of size m pixels high by n pixels wide and has 4 channels: Red, Green, Blue and an alpha channel.
Matlab stores I as a 3D array, you can access the x-y-th pixel by I(y,x,:) returning the four-vector representing the RGBA value of the x-y-th pixel.