Identify the difference between two images and highlight the difference

29 views
Skip to first unread message

shira Jacobs

unread,
Oct 27, 2022, 2:21:50 AM10/27/22
to javacv
Hey there,
I had implemented the code to get SSIM for 2 images,
 Now I want to present a masc image with the highlight of the diffs,
()I see that in python Opencv there is a function - structural_similarity
that return the diff.
Can you help me find out how to do it in Javacv
?

Thanks a lot!!
Shira.

Samuel Audet

unread,
Oct 27, 2022, 5:02:34 AM10/27/22
to jav...@googlegroups.com, shira Jacobs
structural_similarity() seems to be a function from Scikit-learn, but it
looks like OpenCV provides a similar algorithm in QualitySSIM:
http://bytedeco.org/javacpp-presets/opencv/apidocs/org/bytedeco/opencv/opencv_quality/QualitySSIM.html

shira Jacobs

unread,
Oct 27, 2022, 7:38:36 AM10/27/22
to javacv
what a  quick answer!! 
thank you!

did you mean to the function compute?
but how can I get the image with the diffs?
it retunes only Scalar

Thanks!

ב-יום חמישי, 27 באוקטובר 2022 בשעה 12:02:34 UTC+3, Samuel Audet כתב/ה:

shira Jacobs

unread,
Oct 30, 2022, 12:22:04 AM10/30/22
to javacv
Hey all , 
I found a method in qualityBase class name - getQualityMap
but for creating an instance for this class a Pointer must be sent  - 
/** Pointer cast constructor. Invokes {link Pointer#Pointer(Pointer)}. */
public QualityBase(Pointer p) { super(p); }


?how do I create this pointer
need to have all the data like: 
* param p the other Pointer to reference
*/
public Pointer(final Pointer p) {
if (p != null) {
address = p.address;
position = p.position;
limit = p.limit;
capacity = p.capacity;
if (p.deallocator != null) {
deallocator = new ProxyDeallocator(this, p);
}
}
}

Can someone help me please???

Thanks!!!
ב-יום חמישי, 27 באוקטובר 2022 בשעה 09:21:50 UTC+3, ‪shira Jacobs‬‏ כתב/ה:

Samuel Audet

unread,
Oct 30, 2022, 5:55:43 AM10/30/22
to jav...@googlegroups.com, shira Jacobs
We can't create an instance of QualityBase, we need to choose from one
of its subclasses: QualityGMSD, QualityMSE, QualityPSNR, QualityBRISQUE,
or QualitySSIM

On 10/30/22 13:22, shira Jacobs wrote:
> Hey all ,
> I found a method in *qualityBase *class name *- getQualityMap*

shira Jacobs

unread,
Oct 30, 2022, 6:54:25 AM10/30/22
to javacv
So how can I use  getQualityMap method?

ב-יום ראשון, 30 באוקטובר 2022 בשעה 11:55:43 UTC+2, Samuel Audet כתב/ה:

Keith Hall

unread,
Oct 30, 2022, 11:23:25 AM10/30/22
to javacv
Looks like the QualitySSIM class has a static create method  to create a QualitySSIM object from a Mat. QualitySSIM inherits getQualityMap from QualityBase

shira Jacobs

unread,
Oct 31, 2022, 1:03:09 AM10/31/22
to javacv
!!Thank you

ב-יום ראשון, 30 באוקטובר 2022 בשעה 17:23:25 UTC+2, the.kei...@gmail.com כתב/ה:
Reply all
Reply to author
Forward
0 new messages