Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Expression
Posted 6 lug 2012, 17:11 GMT-4 Version 4.2a 2 Replies
Please login with a confirmed email address before reporting spam
Hi,
I’m modeling a component from the importation of an image. As you know when you import an image, you obtained a function im1(x,y)=(R+G+B)/3 , so is easy to separate only two material. Using the following expression:
Material1*(im1(x,y)<=0.5)+Material2*( im1(x,y)>0.5)
But when i try to do an analytic function in order to distinguish 4 different materials in the image I’m not able to realize a good expression, because there are element that are between at range, but when I applied the following expression:
Material1*(im1(x,y)>=0.9)+Material2*( 0.7<=im1(x,y)<0.9)+Material3*(0.5<=im1(x,y)<0.7)+Material4(im1<0.5)
That doesn’t work and I can only supposed that the expression (0.5<=im1(x,y)<0.7) is incorrect or not supported by Comsol…So if somebody can help me or teach me at little more about the expression that you can input in Comsol I would be very grateful
I’m modeling a component from the importation of an image. As you know when you import an image, you obtained a function im1(x,y)=(R+G+B)/3 , so is easy to separate only two material. Using the following expression:
Material1*(im1(x,y)<=0.5)+Material2*( im1(x,y)>0.5)
But when i try to do an analytic function in order to distinguish 4 different materials in the image I’m not able to realize a good expression, because there are element that are between at range, but when I applied the following expression:
Material1*(im1(x,y)>=0.9)+Material2*( 0.7<=im1(x,y)<0.9)+Material3*(0.5<=im1(x,y)<0.7)+Material4(im1<0.5)
That doesn’t work and I can only supposed that the expression (0.5<=im1(x,y)<0.7) is incorrect or not supported by Comsol…So if somebody can help me or teach me at little more about the expression that you can input in Comsol I would be very grateful
2 Replies Last Post 7 lug 2012, 15:46 GMT-4