Partition image into 8 different rows and plot an 3D RGB histogram of each partition

Hi,
I am new to MatLab, I am now currently trying to split the image into 10 different rows based on an available demo. I tried editing it, however, I think due to my lack of understanding in MatLab, I am unable to remove the redundant blocks.
As you can see, I divided my image into 8 successfully, but I am unsure of how to remove the redundant blocks on the right side, and the last one on the left, block #17 out of 18.
Also, is there a way to plot 8 different 3d color histogram based on each partition? Been trying to google, but all I found was for grayscale image.
I hope somebody can help me. Please pardon my lack of expertise in this area. Hope to receive assistance from you guys soon. Thanks.

 Réponse acceptée

Look in the code. Search for all 8's. One of those has to with how many strips to split the image into, something like rows/8. Just change that 8 into a 10 and try to run it. That's about all we can say without having the source code.
See my rgb histogram demo attached below. Feel free to adapt it.

5 commentaires

Thanks for the swift reply. Your RGB demo code will definitely be useful reference for me. In regard to the partition, it doesn't really solve it, when I use 10, there will be an error.
It's a demo I found via the MatLab forum, with another guy having an almost similar problem and I edited it slightly but to no avail. I tried removing the columns, etc, but most editing I do always result in an error.
Thanks once again (:
Hi, I managed to solve the column problem by editing the subplot, changing the numPlotsC to 1, however not all partitions are shown now. Do you have any idea?
I am not very familiar with MatLab syntax and language, trying my best to understand it now as I am only given 5 days to do it by my school supervisor for this task, a jump from the Visual Studio C++ and OpenCV which I always use. I am trying my best to absorb now.
Hope you can help me whith the new error. The original image is shown by windows photo gallery. The figure 1 window is Matlab's.
If you want 10 plots, try something like subplot(2,5,k), subplot(5,2,k), or subplot(3,4,k) there k goes from 1 to 10 and is the location to use. k goes from 1 in the upper left corner to 10 in the lower right corner. For example, to plot in the upper right corner, use subplot(5,2,2).
Yup. Thanks. It finally work. But still don't really get it, cause I divide the image by only 8 rows, so by right, it should be 8 plots, when I used (8,1,k) not all the images came out, but when I times 2, (16,1,k), or (8,2,k) then all the image is displayed. Pretty confusing, but just glad I managed to partition it. Now all that left is the RGB histogram for each partition. Thanks a million!
Also, as I am new to MatLab, I just wish to ask if you have and recommendation for a good website to refer me to so that I can learn more of such image processing and MatLab programming. For image processing in MatLab, I find it difficult to find good resources which can assist me or guide me in my learning. Or do you know of any books? Thanks(:
What you say about subplot doesn't make sense - we'd have to see the code. Perhaps you used different numbers of rows and columns. If you do that you have to make sure none of them would cause an overlap. In that case, the earlier ones vanish.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by