rahmatnazali / pimage Goto Github PK
View Code? Open in Web Editor NEWPython package for detecting copy-move attack on a digital image
Home Page: https://pypi.org/project/pimage/
License: Apache License 2.0
Python package for detecting copy-move attack on a digital image
Home Page: https://pypi.org/project/pimage/
License: Apache License 2.0
hi im getting error all
ERROR SHOWN-
C:\Users\alman\anaconda3\python.exe E:/image-copy-move-detection-python2-master/main_GUI.py
E:/image-copy-move-detection-python2-master/screenshot/horse_blur.png
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\alman\anaconda3\lib\tkinter_init_.py", line 1892, in call
return self.func(*args)
File "E:\image-copy-move-detection-python2-master\main_GUI.py", line 91, in onFilePicker
imageRight = Image.open("../testcase_result/")
File "C:\Users\alman\anaconda3\lib\site-packages\PIL\Image.py", line 2975, in open
fp = builtins.open(filename, "rb")
PermissionError: [Errno 13] Permission denied: '../testcase_result/'
horse_blur.png
Step 1 of 4: Object and variable initialization
Exception in Tkinter callback
<ImageObject.ImageObject object at 0x000001A22EC54B80>
Traceback (most recent call last):
File "C:\Users\alman\anaconda3\lib\tkinter_init_.py", line 1892, in call
return self.func(*args)
File "E:\image-copy-move-detection-python2-master\main_GUI.py", line 109, in onDetect
imageResultPath = CopyMoveDetection.detect(self.imagePath, self.imageName, '../testcase_result/', blockSize=32)
File "E:\image-copy-move-detection-python2-master\CopyMoveDetection.py", line 56, in detect
singleImage = ImageObject.ImageObject(sourceDirectory, fileName, blockSize, outputDirectory)
File "E:\image-copy-move-detection-python2-master\ImageObject.py", line 71, in init
print (self).Nb, self.isThisRGBImage
AttributeError: 'NoneType' object has no attribute 'Nb'
Do you have any code to find the accuracy ?. It would be helpful if you provide any code.
I am pretty new to the python world & I have been able to successfully create virtual environment & installing packages from requirement.txt. But I can't figure out what to do next to run your code. Please help me out with the situation. I couldn't understand from the "Example".
The current example code in the readme (directories, filename, ...) does not match detect.py input. Would be nice to have a command line "python3 detect image.jpg" example.
The project should have unit testing. Currently the testing is only held by manually running the example script.
hi,I used your example diagram for testing, but I copied and pasted it myself, again with blank results.
The way I do it is just regular copy and paste.
I wonder why?
Thank you very much!
So the loop in ImageObject.analyze
for i in tqdm(range(featureContainerLength)):
for j in range(i + 1, featureContainerLength):
can be changed to
for i in tqdm(range(featureContainerLength-1)):
j = i+1
giving a speedup of a factor >1000 on the analyze step (depending on image dimensions).
That step on the test image goes from 384 to 0.11 seconds on my PC.
This can be done because the feature list is already sorted, so you don't have to compare each block to every other block. You only need to compare it to the next block.
The original paper clearly states this:
identical blocks correspond to adjacent pairs in the sorted list
When I run main_GUI.py I get an error:
Traceback (most recent call last):
File "main_GUI.py", line 123, in <module>
app = aFrame(root)
File "main_GUI.py", line 23, in __init__
self.initUI()
File "main_GUI.py", line 44, in initUI
imageLeft = Image.open("resource/empty.png")
File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 2634, in open
fp = builtins.open(filename, "rb")
IOError: [Errno 2] **No such file or directory: 'resource/empty.png'**
Hi - I am trying to run the code over the horse_fake.png example, but I have reduced the blocksize to decrease the runtime, with the following problem on macOS:
Traceback (most recent call last):
File "main.py", line 10, in
forgery_detect.detect('../test_images/', image_file, '../output_images/', blockSize=8) # was 32
File "/Users/j/src/Image-Forgery-Detection/forgery_detect/forgery_detect.py", line 22, in detect
imageResultPath = singleImage.run()
File "/Users/j/src/Image-Forgery-Detection/forgery_detect/image_object.py", line 82, in run
self.compute()
File "/Users/j/src/Image-Forgery-Detection/forgery_detect/image_object.py", line 127, in compute
self.featuresContainer.addBlock(imageBlock.computeBlock())
File "/Users/j/src/Image-Forgery-Detection/forgery_detect/Blocks.py", line 38, in computeBlock
blockDataList.append(self.computeCharaFeatures(4))
File "/Users/j/src/Image-Forgery-Detection/forgery_detect/Blocks.py", line 118, in computeCharaFeatures
c4_part1 += self.imageGrayscalePixels[xCoordinate, yCoordinate]
TypeError: unsupported operand type(s) for +=: 'int' and 'tuple'
Any ideas?
Thanks!
Im trying to implement the GUI for the new repo with the help of your old repo, but im getting an error. Below is the error what im getting now. can you please help me fix it. And ill attach the GUI code and the detect.py code to this.
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\shuch\AppData\Local\Programs\Python\Python38\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "D:/image-copy-move-detection-master/copy_move_detection/Main1.py", line 96, in onDetect
imageResultPath = detect.detect(self.imagePath, self.imageName, '../output/', block_size=32)
TypeError: detect() got multiple values for argument 'block_size'
for help:where is the "resource/empty.png"
This would be the last help i would ask from you. Thank you so much for all the help you have done. I tried different codes for confusion matrix and none of them worked for me. I just need the code for confusion matrix .So could you please help me with this. And i would be really greatfull for all your help.
Time taken is too large about 6 minutes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.