MATLAB Projects

How to integrate an element in an image according to the intensity?

I have a squared image img that I cut in two parts vertically, I calculate the mean of intensity in each part and then I compare these means with minimal function. I create a square of one with a size 200 by 200.

My question is : How can I say that I want place the square in the part of the image where there is the minimal mean of intensity (so once it can be in the right part and an other once it can be in the left part and the place in the part is not significant at first)? I wold like to do this automatically because I have several images.
[code]img=imread('image.tif') dim=size(img,1); meam1=mean(mean(:,1:dim/2)); mean2=mean(mean(:,dim+1/2:end)); Min=min(mean1,mean2); Square= ones(200,200);[/code]


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir