The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Maximum value in a matrix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

b.robertson

1 Posts

Posted - 06/27/2011 :  04:51:54 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am a new user of OriginPro 8.5 and I need a quick and easy way to find the maximum value in a matrix which represents an image. Any ideas? Thanks.

greg

USA
1378 Posts

Posted - 06/27/2011 :  5:10:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Suppose I have two images in MBook1 in Matrixsheets "Capture1" and "Flowers". This script gets those values:

range rm1 = [MBook1]Capture1!1;
range rm2 = [MBook1]Flowers!1;
stats rm1;
stats.max=;
stats rm2;
stats.max=;

Note that if the image is RGB, you will get back an RGB value, otherwise you get an N-bit gray scale value.

Not using a script, you would have to use Analysis : Histogram,
then:
For gray scale images, you would have to find the last row for which Histogram Master is non-zero.
For RGB you can do the same per channel.

Edited by - greg on 06/27/2011 5:19:41 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000