Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I need to ask about the possibility that Mathcad will allow me to process images through the image processing function, taken with a digital camera, to give me % failure of adhesion of a film on the material in attached image. Can I use Mathcad for basic matrix operations? Or how can I achieve this ?
I guess you are talking about Prime (sometimes called Mathcad Prime) and not the discontinued software Mathcad (latest version is V.15, but the software is not available anymore).
A couple of image processing functions are available and of course they basically consist of matrix operations. You may look them up in the help
About Image Processing Functions
The big drawback is that prime (on contrary to real Mathcad) does not offer an image operator and so changes and modifications done to images cannot be reviewed immediately in Prime, but you must save the changed images and then view them.
We can only hope that in a later version PTC will also implement a way in Prime to view the images, which are available as a data matrix in Prime, directly in Prime as an image.
I found this online can I apply this? Is this the best way to move forward if not please let me know
1. Load the image:
2. img := Image("C:\path\to\your\image.jpg")
3. Convert to grayscale (if necessary):
4. grayImg := Grayscale(img)
5. Apply a threshold to identify failure:
6. threshold := 0.5 // Set an appropriate value
7. binaryImg := If(grayImg > threshold, 1, 0)
8. Calculate the failure percentage:
9. totalPixels := size(binaryImg)
10. failurePixels := sum(binaryImg)
11. failurePercentage := (failurePixels / totalPixels) * 100
I can't say much about the percentage failure of adhesion you are looking for and how to get hat value.
The functions for image processing available in Prime can be found in the help. You have to decide if they can do what you are looking for. Generally I think that Prime is not much useful for image processing because of its missing image component which makes is very hard to check the effect of an applied filter, etc.
Concerning the instruction sequence you say yo found somewhere on the net - it sure does not apply to Prime (looks like AI generated).
But i guess you could try to duplicate the actions with primes methods.
Prime does not provide an "image(...)" function, but you can read in an image to a Prime matrix using the "READRGB(...)" function.
Prime does not provide a "Grayscale(...)" function, but you can convert your image to grayscale using the "rgb_to_gray(...)" function.
etc.
The procedure outlined in that sequence may look like this in Prime
Not sure if the result is in any way meaningful to you.
BTW, the multiplication of the threshold value by 255 was done because the greyscale image in Prime is represented by a matrix with numbers running from 0 to 255 (8 bit). Because of the threshold value 0.5 I assumed that the method you had outlined was based on values in the range from 0 to 1.
Prime 10 sheet attached
Hi @IS_10705139,
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution or please feel free to detail in a reply what has helped you and mark it as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.
Thanks,